commit 00f842d9bf0c816340e1ce7025ec0fb327628281 Author: Lai Power Date: Tue Apr 7 13:03:04 2020 +0000 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b059e35 --- /dev/null +++ b/.gitignore @@ -0,0 +1,68 @@ +*.log +*.swp +*.back +*.bak +*.sql +*.sql.gz +~* + +.htaccess +.maintenance + +wp-config.php +sitemap.xml +sitemap.xml.gz +wp-content/uploads/ +wp-content/blogs.dir/ +wp-content/upgrade/ +wp-content/backup-db/ +wp-content/cache/ +wp-content/backups/ + +wp-content/advanced-cache.php +wp-content/object-cache.php +wp-content/wp-cache-config.php +wp-content/db.php + +wp-admin/ +wp-includes/ +/index.php +/license.txt +/readme.html + +# de_DE +/liesmich.html + +# it_IT +/LEGGIMI.txt +/licenza.html + +# da_DK +/licens.html + +# es_ES, es_PE +/licencia.txt + +# hu_HU +/licenc.txt +/olvasdel.html + +# sk_SK +/licencia-sk_SK.txt + +# sv_SE +/licens-sv_SE.txt + +/wp-activate.php +/wp-blog-header.php +/wp-comments-post.php +/wp-config-sample.php +/wp-cron.php +/wp-links-opml.php +/wp-load.php +/wp-login.php +/wp-mail.php +/wp-settings.php +/wp-signup.php +/wp-trackback.php +/xmlrpc.php \ No newline at end of file diff --git a/wp-content/index.php b/wp-content/index.php new file mode 100644 index 0000000..6220032 --- /dev/null +++ b/wp-content/index.php @@ -0,0 +1,2 @@ + + +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. \ No newline at end of file diff --git a/wp-content/mu-plugins/README.md b/wp-content/mu-plugins/README.md new file mode 100644 index 0000000..325544e --- /dev/null +++ b/wp-content/mu-plugins/README.md @@ -0,0 +1,95 @@ +# authLDAP + +[![Join the chat at https://gitter.im/heiglandreas/authLdap](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/heiglandreas/authLdap?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +Use your existing LDAP as authentication-backend for your wordpress! + +[![Build Status](https://travis-ci.org/heiglandreas/authLdap.svg?branch=master)](https://travis-ci.org/heiglandreas/authLdap) +[![WordPress Stats](https://img.shields.io/wordpress/plugin/dt/authldap.svg)](https://wordpress.org/plugins/authldap/stats/) +[![WordPress Version](https://img.shields.io/wordpress/plugin/v/authldap.svg)](https://wordpress.org/plugins/authldap/) +[![WordPress testet](https://img.shields.io/wordpress/v/authldap.svg)](https://wordpress.org/plugins/authldap/) +[![Code Climate](https://codeclimate.com/github/heiglandreas/authLdap/badges/gpa.svg)](https://codeclimate.com/github/heiglandreas/authLdap) +[![Test Coverage](https://codeclimate.com/github/heiglandreas/authLdap/badges/coverage.svg)](https://codeclimate.com/github/heiglandreas/authLdap) + +So what are the differences to other Wordpress-LDAP-Authentication-Plugins? + +* **Flexible**: You are totaly free in which LDAP-backend to use. Due to the extensive configuration you can +freely decide how to do the authentication of your users. It simply depends on your +filters +* **Independent**: As soon as a user logs in, it is added/updated to the Wordpress' user-database +to allow wordpress to always use the correct data. You only have to administer your users once. +* **Failsafe**: Due to the users being created in Wordpress' User-database they can +also log in when the LDAP-backend currently is gone. +* **Role-Aware**: You can map Wordpress' roles to values of an existing LDAP-attribute. + +## How does the plugin work? + +Well, as a matter of fact it is rather simple. The plugin verifies, that the user +seeking authentification can bind to the LDAP using the provided password. + +If that is so, the user is either created or updated in the wordpress-user-database. +This update includes the provided password (so the wordpress can authenticate users +even without the LDAP), the users name according to the authLDAP-preferences and +the status of the user depending on the groups-settings of the authLDAP-preferences + +Writing this plugin would not have been as easy as it has been, without the +wonderfull plugin of Alistair Young from http://www.weblogs.uhi.ac.uk/sm00ay/?p=45 + +## Configuration + +### Usage Settings + +* **Enable Authentication via LDAP** Whether you want to enable authLdap for login or not +* **debug authLdap** When you have problems with authentication via LDAP you can enable a debugging mode here. +* **Save entered Password** Decide whether passwords will be cached in your wordpress-installation. **Attention:** Without the cache your users will not be able to log into your site when your LDAP is down! + +### Server Settings + +* **LDAP Uri** This is the URI where your ldap-backend can be reached. More information are actually on the Configuration page +* **Filter** This is the real McCoy! The filter you define here specifies how a user will be found. Before applying the filter a %s will be replaced with the given username. This means, when a user logs in using ‘foobar’ as username the following happens: + + * **uid=%1$s** check for any LDAP-Entry that has an attribute ‘uid’ with value ‘foobar’ + * **(&(objectclass=posixAccount)(|(uid=%1$s)(mail=%1$s)))** check for any LDAP-Entry that has an attribute ‘objectclass’ with value ‘posixAccout’ and either a UID- or a mail-attribute with value ‘foobar’ + + This filter is rather powerfull if used wisely. + +### Creating Users + +* **Name-Attribute** Which Attribute from the LDAP contains the Full or the First name of the user trying to log in. This defaults to name +* **Second Name Attribute** If the above Name-Attribute only contains the First Name of the user you can here specify an Attribute that contains the second name. This field is empty by default +* **User-ID Attribute** This field will be used as login-name for wordpress. Please give the Attribute, that is used to identify the user. This should be the same as you used in the above Filter-Option. This field defaults to uid +* **Mail Attribute** Which Attribute holds the eMail-Address of the user? If more than one eMail-Address are stored in the LDAP, only the first given is used. This field defaults to mail +* **Web-Attribute** If your users have a personal page (URI) stored in the LDAP, it can be provided here. This field is empty by default + +### User-Groups for Roles + +* **Group-Attribute** This is the attribute that defines the Group-ID that can be matched against the Groups defined further down This field defaults to gidNumber. +* **Group-Filter** Here you can add the filter for selecting groups for the currentlly logged in user The Filter should contain the string %s which will be replaced by the login-name of the currently logged in + + +## FAQ + +
+
Can I change a users password with this plugin?
+
Short Answer: No!
Long Answer: As the users credentials are not + only used for a wordpress-site when you authenticate against an LDAP but for + many other services also chances are great that there is a centralized place + where password-changes shall be made. We'll later allow inclusion of a link + to such a place but currently it's not available. And as password-hashing and + where to store it requires deeper insight into the LDAP-Server then most users + have and admins are willing to give, password changes are out of scope of this + plugin. If you know exactyl what you do, you might want to have a look at + + issue 54 + wherer a way of adding it is described! +
+
Can I add a user to the LDAP when she creates a user-account on wordpress?
+
Short Answer: No!
Long Answer: Even though that is technically possible + it's not in the scope of this plugin. As creating a user in an LDAP often involves + an administrative process that has already been implemented in your departments + administration it doesn't make sense to rebuild that - in most cases highly + individual - process in this plugin. If you know exactly what you do, have a look at + issue 65 + where wtfiwtz shows how to implement that feature. +
+
diff --git a/wp-content/mu-plugins/VERSION b/wp-content/mu-plugins/VERSION new file mode 100644 index 0000000..a625450 --- /dev/null +++ b/wp-content/mu-plugins/VERSION @@ -0,0 +1 @@ +2.3.1 \ No newline at end of file diff --git a/wp-content/mu-plugins/Vagrantfile b/wp-content/mu-plugins/Vagrantfile new file mode 100644 index 0000000..33f8311 --- /dev/null +++ b/wp-content/mu-plugins/Vagrantfile @@ -0,0 +1,28 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +$install_ldap = < diff --git a/wp-content/plugins/activitypub/LICENSE b/wp-content/plugins/activitypub/LICENSE new file mode 100644 index 0000000..e59f0cc --- /dev/null +++ b/wp-content/plugins/activitypub/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Matthias Pfefferle + +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. diff --git a/wp-content/plugins/activitypub/activitypub.php b/wp-content/plugins/activitypub/activitypub.php new file mode 100644 index 0000000..7edbad1 --- /dev/null +++ b/wp-content/plugins/activitypub/activitypub.php @@ -0,0 +1,100 @@ +post_author; + + $activitypub_post = new \Activitypub\Model\Post( $post ); + $activitypub_activity = new \Activitypub\Model\Activity( 'Create', \Activitypub\Model\Activity::TYPE_FULL ); + $activitypub_activity->from_post( $activitypub_post->to_array() ); + + foreach ( \Activitypub\get_follower_inboxes( $user_id ) as $inbox => $to ) { + $activitypub_activity->set_to( $to ); + $activity = $activitypub_activity->to_json(); // phpcs:ignore + + \Activitypub\safe_remote_post( $inbox, $activity, $user_id ); + } + } + + /** + * Send "update" activities + * + * @param int $post_id + */ + public static function send_update_activity( $post_id ) { + $post = \get_post( $post_id ); + $user_id = $post->post_author; + + $activitypub_post = new \Activitypub\Model\Post( $post ); + $activitypub_activity = new \Activitypub\Model\Activity( 'Update', \Activitypub\Model\Activity::TYPE_FULL ); + $activitypub_activity->from_post( $activitypub_post->to_array() ); + + foreach ( \Activitypub\get_follower_inboxes( $user_id ) as $inbox => $to ) { + $activitypub_activity->set_to( $to ); + $activity = $activitypub_activity->to_json(); // phpcs:ignore + + \Activitypub\safe_remote_post( $inbox, $activity, $user_id ); + } + } + + /** + * Send "delete" activities + * + * @param int $post_id + */ + public static function send_delete_activity( $post_id ) { + $post = \get_post( $post_id ); + $user_id = $post->post_author; + + $activitypub_post = new \Activitypub\Model\Post( $post ); + $activitypub_activity = new \Activitypub\Model\Activity( 'Delete', \Activitypub\Model\Activity::TYPE_FULL ); + $activitypub_activity->from_post( $activitypub_post->to_array() ); + + foreach ( \Activitypub\get_follower_inboxes( $user_id ) as $inbox => $to ) { + $activitypub_activity->set_to( $to ); + $activity = $activitypub_activity->to_json(); // phpcs:ignore + + \Activitypub\safe_remote_post( $inbox, $activity, $user_id ); + } + } +} diff --git a/wp-content/plugins/activitypub/includes/class-activitypub.php b/wp-content/plugins/activitypub/includes/class-activitypub.php new file mode 100644 index 0000000..49e022a --- /dev/null +++ b/wp-content/plugins/activitypub/includes/class-activitypub.php @@ -0,0 +1,179 @@ +query_vars['activitypub'] ) ) { + return $json_template; + } + + if ( ! isset( $_SERVER['HTTP_ACCEPT'] ) ) { + return $template; + } + + $accept_header = $_SERVER['HTTP_ACCEPT']; + + if ( + \stristr( $accept_header, 'application/activity+json' ) || + \stristr( $accept_header, 'application/ld+json' ) + ) { + return $json_template; + } + + // accept header as an array + $accept = \explode( ',', \trim( $accept_header ) ); + + if ( + \in_array( 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', $accept, true ) || + \in_array( 'application/activity+json', $accept, true ) || + \in_array( 'application/ld+json', $accept, true ) || + \in_array( 'application/json', $accept, true ) + ) { + return $json_template; + } + + return $template; + } + + /** + * Add the 'photos' query variable so WordPress + * won't mangle it. + */ + public static function add_query_vars( $vars ) { + $vars[] = 'activitypub'; + + return $vars; + } + + /** + * Add our rewrite endpoint to permalinks and pages. + */ + public static function add_rewrite_endpoint() { + \add_rewrite_endpoint( 'activitypub', EP_AUTHORS | EP_PERMALINK | EP_PAGES ); + } + + /** + * Schedule Activities + * + * @param int $post_id + */ + public static function schedule_post_activity( $new_status, $old_status, $post ) { + // do not send activities if post is password protected + if ( \post_password_required( $post ) ) { + return; + } + + // check if post-type supports ActivityPub + $post_types = \get_post_types_by_support( 'activitypub' ); + if ( ! \in_array( $post->post_type, $post_types, true ) ) { + return; + } + + if ( 'publish' === $new_status && 'publish' !== $old_status ) { + \wp_schedule_single_event( \time(), 'activitypub_send_post_activity', array( $post->ID ) ); + } elseif ( 'publish' === $new_status ) { + \wp_schedule_single_event( \time(), 'activitypub_send_update_activity', array( $post->ID ) ); + } elseif ( 'trash' === $new_status ) { + \wp_schedule_single_event( \time(), 'activitypub_send_delete_activity', array( get_permalink( $post ) ) ); + } + } + + /** + * Replaces the default avatar + * + * @param array $args Arguments passed to get_avatar_data(), after processing. + * @param int|string|object $id_or_email A user ID, email address, or comment object + * + * @return array $args + */ + public static function pre_get_avatar_data( $args, $id_or_email ) { + if ( + ! $id_or_email instanceof \WP_Comment || + ! isset( $id_or_email->comment_type ) || + $id_or_email->user_id + ) { + return $args; + } + + $allowed_comment_types = \apply_filters( 'get_avatar_comment_types', array( 'comment' ) ); + if ( ! empty( $id_or_email->comment_type ) && ! \in_array( $id_or_email->comment_type, (array) $allowed_comment_types, true ) ) { + $args['url'] = false; + /** This filter is documented in wp-includes/link-template.php */ + return \apply_filters( 'get_avatar_data', $args, $id_or_email ); + } + + // check if comment has an avatar + $avatar = self::get_avatar_url( $id_or_email->comment_ID ); + + if ( $avatar ) { + if ( ! isset( $args['class'] ) || ! \is_array( $args['class'] ) ) { + $args['class'] = array( 'u-photo' ); + } else { + $args['class'][] = 'u-photo'; + $args['class'] = \array_unique( $args['class'] ); + } + $args['url'] = $avatar; + $args['class'][] = 'avatar-activitypub'; + } + + return $args; + } + + /** + * Function to retrieve Avatar URL if stored in meta + * + * + * @param int|WP_Comment $comment + * + * @return string $url + */ + public static function get_avatar_url( $comment ) { + if ( \is_numeric( $comment ) ) { + $comment = \get_comment( $comment ); + } + return \get_comment_meta( $comment->comment_ID, 'avatar_url', true ); + } +} diff --git a/wp-content/plugins/activitypub/includes/class-admin.php b/wp-content/plugins/activitypub/includes/class-admin.php new file mode 100644 index 0000000..0dca896 --- /dev/null +++ b/wp-content/plugins/activitypub/includes/class-admin.php @@ -0,0 +1,149 @@ + 'string', + 'description' => \__( 'Use title and link, summary or full content', 'activitypub' ), + 'show_in_rest' => array( + 'schema' => array( + 'enum' => array( 'title', 'excerpt', 'content' ), + ), + ), + 'default' => 'content', + ) + ); + \register_setting( + 'activitypub', 'activitypub_object_type', array( + 'type' => 'string', + 'description' => \__( 'The Activity-Object-Type', 'activitypub' ), + 'show_in_rest' => array( + 'schema' => array( + 'enum' => array( 'note', 'article', 'wordpress-post-format' ), + ), + ), + 'default' => 'note', + ) + ); + \register_setting( + 'activitypub', 'activitypub_use_shortlink', array( + 'type' => 'boolean', + 'description' => \__( 'Use the Shortlink instead of the permalink', 'activitypub' ), + 'default' => 0, + ) + ); + \register_setting( + 'activitypub', 'activitypub_use_hashtags', array( + 'type' => 'boolean', + 'description' => \__( 'Add hashtags in the content as native tags and replace the #tag with the tag-link', 'activitypub' ), + 'default' => 0, + ) + ); + \register_setting( + 'activitypub', 'activitypub_add_tags_as_hashtags', array( + 'type' => 'boolean', + 'description' => \__( 'Add all tags as hashtags at the end of each activity', 'activitypub' ), + 'default' => 0, + ) + ); + \register_setting( + 'activitypub', 'activitypub_support_post_types', array( + 'type' => 'string', + 'description' => \esc_html__( 'Enable ActivityPub support for post types', 'activitypub' ), + 'show_in_rest' => true, + 'default' => array( 'post', 'pages' ), + ) + ); + \register_setting( + 'activitypub', 'activitypub_blacklist', array( + 'type' => 'string', + 'description' => \esc_html__( 'Block fediverse instances', 'activitypub' ), + 'show_in_rest' => true, + 'default' => 'gab.com', + ) + ); + } + + public static function add_settings_help_tab() { + \get_current_screen()->add_help_tab( + array( + 'id' => 'overview', + 'title' => \__( 'Overview', 'activitypub' ), + 'content' => + '

' . \__( 'ActivityPub is a decentralized social networking protocol based on the ActivityStreams 2.0 data format. ActivityPub is an official W3C recommended standard published by the W3C Social Web Working Group. It provides a client to server API for creating, updating and deleting content, as well as a federated server to server API for delivering notifications and subscribing to content.', 'activitypub' ) . '

', + ) + ); + + \get_current_screen()->set_help_sidebar( + '

' . \__( 'For more information:', 'activitypub' ) . '

' . + '

' . \__( 'Test Suite', 'activitypub' ) . '

' . + '

' . \__( 'W3C Spec', 'activitypub' ) . '

' . + '

' . \__( 'Give us feedback', 'activitypub' ) . '

' . + '
' . + '

' . \__( 'Donate', 'activitypub' ) . '

' + ); + } + + public static function add_followers_list_help_tab() { + // todo + } + + public static function add_fediverse_profile( $user ) { + ?> +

+ ID ); + } +} diff --git a/wp-content/plugins/activitypub/includes/class-debug.php b/wp-content/plugins/activitypub/includes/class-debug.php new file mode 100644 index 0000000..ac8b8bf --- /dev/null +++ b/wp-content/plugins/activitypub/includes/class-debug.php @@ -0,0 +1,30 @@ +post_content, $match ) ) { + $tags = \implode( ', ', $match[1] ); + + \wp_add_post_tags( $data->post_parent, $tags ); + } + + return $id; + } + + /** + * Filter to replace the #tags in the content with links + * + * @param string $the_content the post-content + * + * @return string the filtered post-content + */ + public static function the_content( $the_content ) { + $the_content = \preg_replace_callback( '/' . ACTIVITYPUB_HASHTAGS_REGEXP . '/i', array( '\Activitypub\Hashtag', 'replace_with_links' ), $the_content ); + + return $the_content; + } + + /** + * A callback for preg_replace to build the term links + * + * @param array $result the preg_match results + * @return string the final string + */ + public static function replace_with_links( $result ) { + $tag = $result[1]; + $tag_object = \get_term_by( 'name', $tag, 'post_tag' ); + + if ( $tag_object ) { + $link = \get_term_link( $tag_object, 'post_tag' ); + return \sprintf( '', $link, $tag ); + } + + return '#' . $tag; + } + + /** + * Adds all tags as hashtags to the post/summary content + * + * @param string $content + * @param WP_Post $post + * + * @return string + */ + public static function add_hashtags_to_content( $content, $post ) { + $tags = \get_the_tags( $post->ID ); + + if ( ! $tags ) { + return $content; + } + + $hash_tags = array(); + + foreach ( $tags as $tag ) { + $hash_tags[] = \sprintf( '', \get_tag_link( $tag ), $tag->slug ); + } + + return $content . '

' . \implode( ' ', $hash_tags ) . '

'; + } +} diff --git a/wp-content/plugins/activitypub/includes/class-health-check.php b/wp-content/plugins/activitypub/includes/class-health-check.php new file mode 100644 index 0000000..0a04308 --- /dev/null +++ b/wp-content/plugins/activitypub/includes/class-health-check.php @@ -0,0 +1,12 @@ + 'sha512', + 'private_key_bits' => 2048, + 'private_key_type' => OPENSSL_KEYTYPE_RSA, + ); + + $key = \openssl_pkey_new( $config ); + $priv_key = null; + + \openssl_pkey_export( $key, $priv_key ); + + // private key + \update_user_meta( $user_id, 'magic_sig_private_key', $priv_key ); + + $detail = \openssl_pkey_get_details( $key ); + + // public key + \update_user_meta( $user_id, 'magic_sig_public_key', $detail['key'] ); + } + + public static function generate_signature( $user_id, $url, $date ) { + $key = self::get_private_key( $user_id ); + + $url_parts = \wp_parse_url( $url ); + + $host = $url_parts['host']; + $path = '/'; + + // add path + if ( ! empty( $url_parts['path'] ) ) { + $path = $url_parts['path']; + } + + // add query + if ( ! empty( $url_parts['query'] ) ) { + $path .= '?' . $url_parts['query']; + } + + $signed_string = "(request-target): post $path\nhost: $host\ndate: $date"; + + $signature = null; + \openssl_sign( $signed_string, $signature, $key, OPENSSL_ALGO_SHA256 ); + $signature = \base64_encode( $signature ); // phpcs:ignore + + $key_id = \get_author_posts_url( $user_id ) . '#main-key'; + + return \sprintf( 'keyId="%s",algorithm="rsa-sha256",headers="(request-target) host date",signature="%s"', $key_id, $signature ); + } + + public static function verify_signature( $headers, $signature ) { + + } +} diff --git a/wp-content/plugins/activitypub/includes/functions.php b/wp-content/plugins/activitypub/includes/functions.php new file mode 100644 index 0000000..31d29cf --- /dev/null +++ b/wp-content/plugins/activitypub/includes/functions.php @@ -0,0 +1,336 @@ + 'as:manuallyApprovesFollowers', + 'PropertyValue' => 'schema:PropertyValue', + 'schema' => 'http://schema.org#', + 'value' => 'schema:value', + ), + ); + + return \apply_filters( 'activitypub_json_context', $context ); +} + +function safe_remote_post( $url, $body, $user_id ) { + $date = \gmdate( 'D, d M Y H:i:s T' ); + $signature = \Activitypub\Signature::generate_signature( $user_id, $url, $date ); + + $wp_version = \get_bloginfo( 'version' ); + $user_agent = \apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . \get_bloginfo( 'url' ) ); + $args = array( + 'timeout' => 100, + 'limit_response_size' => 1048576, + 'redirection' => 3, + 'user-agent' => "$user_agent; ActivityPub", + 'headers' => array( + 'Accept' => 'application/activity+json', + 'Content-Type' => 'application/activity+json', + 'Signature' => $signature, + 'Date' => $date, + ), + 'body' => $body, + ); + + $response = \wp_safe_remote_post( $url, $args ); + + \do_action( 'activitypub_safe_remote_post_response', $response, $url, $body, $user_id ); + + return $response; +} + +function safe_remote_get( $url, $user_id ) { + $date = \gmdate( 'D, d M Y H:i:s T' ); + $signature = \Activitypub\Signature::generate_signature( $user_id, $url, $date ); + + $wp_version = \get_bloginfo( 'version' ); + $user_agent = \apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . \get_bloginfo( 'url' ) ); + $args = array( + 'timeout' => 100, + 'limit_response_size' => 1048576, + 'redirection' => 3, + 'user-agent' => "$user_agent; ActivityPub", + 'headers' => array( + 'Accept' => 'application/activity+json', + 'Content-Type' => 'application/activity+json', + 'Signature' => $signature, + 'Date' => $date, + ), + ); + + $response = \wp_safe_remote_get( $url, $args ); + + \do_action( 'activitypub_safe_remote_get_response', $response, $url, $user_id ); + + return $response; +} + +/** + * Returns a users WebFinger "resource" + * + * @param int $user_id + * + * @return string The user-resource + */ +function get_webfinger_resource( $user_id ) { + // use WebFinger plugin if installed + if ( \function_exists( '\get_webfinger_resource' ) ) { + return \get_webfinger_resource( $user_id, false ); + } + + $user = \get_user_by( 'id', $user_id ); + + return $user->user_login . '@' . \wp_parse_url( \home_url(), PHP_URL_HOST ); +} + +/** + * [get_metadata_by_actor description] + * + * @param sting $actor + * + * @return array + */ +function get_remote_metadata_by_actor( $actor ) { + $metadata = \get_transient( 'activitypub_' . $actor ); + + if ( $metadata ) { + return $metadata; + } + + if ( ! \wp_http_validate_url( $actor ) ) { + return new \WP_Error( 'activitypub_no_valid_actor_url', \__( 'The "actor" is no valid URL', 'activitypub' ), $actor ); + } + + $user = \get_users( array ( + 'number' => 1, + 'who' => 'authors', + 'fields' => 'ID', + ) ); + + // we just need any user to generate a request signature + $user_id = \reset( $user ); + + $response = \Activitypub\safe_remote_get( $actor, $user_id ); + + if ( \is_wp_error( $response ) ) { + return $response; + } + + $metadata = \wp_remote_retrieve_body( $response ); + $metadata = \json_decode( $metadata, true ); + + if ( ! $metadata ) { + return new \WP_Error( 'activitypub_invalid_json', \__( 'No valid JSON data', 'activitypub' ), $actor ); + } + + \set_transient( 'activitypub_' . $actor, $metadata, WEEK_IN_SECONDS ); + + return $metadata; +} + +/** + * [get_inbox_by_actor description] + * @param [type] $actor [description] + * @return [type] [description] + */ +function get_inbox_by_actor( $actor ) { + $metadata = \Activitypub\get_remote_metadata_by_actor( $actor ); + + if ( \is_wp_error( $metadata ) ) { + return $metadata; + } + + if ( isset( $metadata['endpoints'] ) && isset( $metadata['endpoints']['sharedInbox'] ) ) { + return $metadata['endpoints']['sharedInbox']; + } + + if ( \array_key_exists( 'inbox', $metadata ) ) { + return $metadata['inbox']; + } + + return new \WP_Error( 'activitypub_no_inbox', __( 'No "Inbox" found', 'activitypub' ), $metadata ); +} + +/** + * [get_inbox_by_actor description] + * @param [type] $actor [description] + * @return [type] [description] + */ +function get_publickey_by_actor( $actor, $key_id ) { + $metadata = \Activitypub\get_remote_metadata_by_actor( $actor ); + + if ( \is_wp_error( $metadata ) ) { + return $metadata; + } + + if ( + isset( $metadata['publicKey'] ) && + isset( $metadata['publicKey']['id'] ) && + isset( $metadata['publicKey']['owner'] ) && + isset( $metadata['publicKey']['publicKeyPem'] ) && + $key_id === $metadata['publicKey']['id'] && + $actor === $metadata['publicKey']['owner'] + ) { + return $metadata['publicKey']['publicKeyPem']; + } + + return new \WP_Error( 'activitypub_no_public_key', \__( 'No "Public-Key" found', 'activitypub' ), $metadata ); +} + +function get_follower_inboxes( $user_id ) { + $followers = \Activitypub\Peer\Followers::get_followers( $user_id ); + $inboxes = array(); + + foreach ( $followers as $follower ) { + $inbox = \Activitypub\get_inbox_by_actor( $follower ); + if ( ! $inbox || \is_wp_error( $inbox ) ) { + continue; + } + // init array if empty + if ( ! isset( $inboxes[ $inbox ] ) ) { + $inboxes[ $inbox ] = array(); + } + $inboxes[ $inbox ][] = $follower; + } + + return $inboxes; +} + +function get_identifier_settings( $user_id ) { + ?> + + + + + + + +
+ + +

or

+ +

+
+ wp_rewrite_rules(); + + // not using rewrite rules, and 'author=N' method failed, so we're out of options + if ( empty( $rewrite ) ) { + return 0; + } + + // generate rewrite rule for the author url + $author_rewrite = $wp_rewrite->get_author_permastruct(); + $author_regexp = \str_replace( '%author%', '', $author_rewrite ); + + // match the rewrite rule with the passed url + if ( \preg_match( '/https?:\/\/(.+)' . \preg_quote( $author_regexp, '/' ) . '([^\/]+)/i', $url, $match ) ) { + $user = get_user_by( 'slug', $match[2] ); + if ( $user ) { + return $user->ID; + } + } + + return 0; +} + +/** + * Get the blacklist from the WordPress options table + * + * @return array the list of blacklisted hosts + * + * @uses apply_filters() Calls 'activitypub_blacklist' filter + */ +function get_blacklist() { + $blacklist = \get_option( 'activitypub_blacklist' ); + $blacklist_hosts = \explode( PHP_EOL, $blacklist ); + + // if no values have been set, revert to the defaults + if ( ! $blacklist || ! $blacklist_hosts || ! \is_array( $blacklist_hosts ) ) { + $blacklist_hosts = array( + 'gab.com', + ); + } + + // clean out any blank values + foreach ( $blacklist_hosts as $key => $value ) { + if ( empty( $value ) ) { + unset( $blacklist_hosts[ $key ] ); + } else { + $blacklist_hosts[ $key ] = \trim( $blacklist_hosts[ $key ] ); + } + } + + return \apply_filters( 'activitypub_blacklist', $blacklist_hosts ); +} + +/** + * Check if an URL is blacklisted + * + * @param string $url an URL to check + * + * @return boolean + */ +function is_blacklisted( $url ) { + foreach ( \ActivityPub\get_blacklist() as $blacklisted_host ) { + if ( \strpos( $url, $blacklisted_host ) !== false ) { + return true; + } + } + + return false; +} diff --git a/wp-content/plugins/activitypub/includes/model/class-activity.php b/wp-content/plugins/activitypub/includes/model/class-activity.php new file mode 100644 index 0000000..470b192 --- /dev/null +++ b/wp-content/plugins/activitypub/includes/model/class-activity.php @@ -0,0 +1,95 @@ +context = null; + } elseif ( 'full' === $context ) { + $this->context = \Activitypub\get_context(); + } + + $this->type = \ucfirst( $type ); + $this->published = \date( 'Y-m-d\TH:i:s\Z', \strtotime( 'now' ) ); + } + + public function __call( $method, $params ) { + $var = \strtolower( \substr( $method, 4 ) ); + + if ( \strncasecmp( $method, 'get', 3 ) === 0 ) { + return $this->$var; + } + + if ( \strncasecmp( $method, 'set', 3 ) === 0 ) { + $this->$var = $params[0]; + } + } + + public function from_post( $object ) { + $this->object = $object; + $this->published = $object['published']; + $this->actor = $object['attributedTo']; + $this->id = $object['id']; + } + + public function from_comment( $object ) { + + } + + public function to_array() { + $array = \get_object_vars( $this ); + + if ( $this->context ) { + $array = array( '@context' => $this->context ) + $array; + } + + unset( $array['context'] ); + + return $array; + } + + public function to_json() { + return \wp_json_encode( $this->to_array(), JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_QUOT ); + } + + public function to_simple_array() { + $activity = array( + '@context' => $this->context, + 'type' => $this->type, + 'actor' => $this->actor, + 'object' => $this->object, + 'to' => $this->to, + 'cc' => $this->cc, + ); + + if ( $this->id ) { + $activity['id'] = $this->id; + } + + return $activity; + } + + public function to_simple_json() { + return \wp_json_encode( $this->to_simple_array(), JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_QUOT ); + } +} diff --git a/wp-content/plugins/activitypub/includes/model/class-post.php b/wp-content/plugins/activitypub/includes/model/class-post.php new file mode 100644 index 0000000..a452274 --- /dev/null +++ b/wp-content/plugins/activitypub/includes/model/class-post.php @@ -0,0 +1,320 @@ +post = \get_post( $post ); + } + + public function get_post() { + return $this->post; + } + + public function get_post_author() { + return $this->post->post_author; + } + + public function to_array() { + $post = $this->post; + + $array = array( + 'id' => \get_permalink( $post ), + 'type' => $this->get_object_type(), + 'published' => \date( 'Y-m-d\TH:i:s\Z', \strtotime( $post->post_date ) ), + 'attributedTo' => \get_author_posts_url( $post->post_author ), + 'summary' => $this->get_the_title(), + 'inReplyTo' => null, + 'content' => $this->get_the_content(), + 'contentMap' => array( + \strstr( \get_locale(), '_', true ) => $this->get_the_content(), + ), + 'to' => array( 'https://www.w3.org/ns/activitystreams#Public' ), + 'cc' => array( 'https://www.w3.org/ns/activitystreams#Public' ), + 'attachment' => $this->get_attachments(), + 'tag' => $this->get_tags(), + ); + + return \apply_filters( 'activitypub_post', $array ); + } + + public function to_json() { + return \wp_json_encode( $this->to_array(), JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_QUOT ); + } + + public function get_attachments() { + $max_images = \apply_filters( 'activitypub_max_images', 3 ); + + $images = array(); + + // max images can't be negative or zero + if ( $max_images <= 0 ) { + $max_images = 1; + } + + $id = $this->post->ID; + + $image_ids = array(); + // list post thumbnail first if this post has one + if ( \function_exists( 'has_post_thumbnail' ) && \has_post_thumbnail( $id ) ) { + $image_ids[] = \get_post_thumbnail_id( $id ); + $max_images--; + } + // then list any image attachments + $query = new \WP_Query( + array( + 'post_parent' => $id, + 'post_status' => 'inherit', + 'post_type' => 'attachment', + 'post_mime_type' => 'image', + 'order' => 'ASC', + 'orderby' => 'menu_order ID', + 'posts_per_page' => $max_images, + ) + ); + foreach ( $query->get_posts() as $attachment ) { + if ( ! \in_array( $attachment->ID, $image_ids, true ) ) { + $image_ids[] = $attachment->ID; + } + } + + $image_ids = \array_unique( $image_ids ); + + // get URLs for each image + foreach ( $image_ids as $id ) { + $alt = \get_post_meta( $id, '_wp_attachment_image_alt', true ); + $thumbnail = \wp_get_attachment_image_src( $id, 'full' ); + $mimetype = \get_post_mime_type( $id ); + + if ( $thumbnail ) { + $image = array( + 'type' => 'Image', + 'url' => $thumbnail[0], + 'mediaType' => $mimetype + ); + if ( $alt ) { + $image['name'] = $alt; + } + $images[] = $image; + } + } + + return $images; + } + + public function get_tags() { + $tags = array(); + + $post_tags = \get_the_tags( $this->post->ID ); + if ( $post_tags ) { + foreach ( $post_tags as $post_tag ) { + $tag = array( + 'type' => 'Hashtag', + 'href' => \get_tag_link( $post_tag->term_id ), + 'name' => '#' . $post_tag->slug, + ); + $tags[] = $tag; + } + } + + return $tags; + } + + /** + * Returns the as2 object-type for a given post + * + * @param string $type the object-type + * @param Object $post the post-object + * + * @return string the object-type + */ + public function get_object_type() { + if ( 'wordpress-post-format' !== \get_option( 'activitypub_object_type', 'note' ) ) { + return \ucfirst( \get_option( 'activitypub_object_type', 'note' ) ); + } + + $post_type = \get_post_type( $this->post ); + switch ( $post_type ) { + case 'post': + $post_format = \get_post_format( $this->post ); + switch ( $post_format ) { + case 'aside': + case 'status': + case 'quote': + case 'note': + $object_type = 'Note'; + break; + case 'gallery': + case 'image': + $object_type = 'Image'; + break; + case 'video': + $object_type = 'Video'; + break; + case 'audio': + $object_type = 'Audio'; + break; + default: + $object_type = 'Article'; + break; + } + break; + case 'page': + $object_type = 'Page'; + break; + case 'attachment': + $mime_type = \get_post_mime_type(); + $media_type = \preg_replace( '/(\/[a-zA-Z]+)/i', '', $mime_type ); + switch ( $media_type ) { + case 'audio': + $object_type = 'Audio'; + break; + case 'video': + $object_type = 'Video'; + break; + case 'image': + $object_type = 'Image'; + break; + } + break; + default: + $object_type = 'Article'; + break; + } + + return $object_type; + } + + public function get_the_content() { + if ( 'excerpt' === \get_option( 'activitypub_post_content_type', 'content' ) ) { + return $this->get_the_post_summary(); + } + + if ( 'title' === \get_option( 'activitypub_post_content_type', 'content' ) ) { + return $this->get_the_title(); + } + + return $this->get_the_post_content(); + } + + public function get_the_title() { + if ( 'Article' === $this->get_object_type() ) { + $title = \get_the_title( $this->post ); + + return \html_entity_decode( $title, ENT_QUOTES, 'UTF-8' ); + } + + return null; + } + + /** + * Get the excerpt for a post for use outside of the loop. + * + * @param int Optional excerpt length. + * + * @return string The excerpt. + */ + public function get_the_post_excerpt( $excerpt_length = 400 ) { + $post = $this->post; + + $excerpt = \get_post_field( 'post_excerpt', $post ); + + if ( '' === $excerpt ) { + + $content = \get_post_field( 'post_content', $post ); + + // An empty string will make wp_trim_excerpt do stuff we do not want. + if ( '' !== $content ) { + + $excerpt = \strip_shortcodes( $content ); + + /** This filter is documented in wp-includes/post-template.php */ + $excerpt = \apply_filters( 'the_content', $excerpt ); + $excerpt = \str_replace( ']]>', ']]>', $excerpt ); + + $excerpt_length = \apply_filters( 'excerpt_length', $excerpt_length ); + + /** This filter is documented in wp-includes/formatting.php */ + $excerpt_more = \apply_filters( 'excerpt_more', ' [...]' ); + + $excerpt = \wp_trim_words( $excerpt, $excerpt_length, $excerpt_more ); + } + } + + return $excerpt; + } + + /** + * Get the content for a post for use outside of the loop. + * + * @return string The content. + */ + public function get_the_post_content() { + $post = $this->post; + + $content = \get_post_field( 'post_content', $post ); + + $filtered_content = \apply_filters( 'the_content', $content ); + $filtered_content = \apply_filters( 'activitypub_the_content', $filtered_content, $this->post ); + + $decoded_content = \html_entity_decode( $filtered_content, ENT_QUOTES, 'UTF-8' ); + + $allowed_html = \apply_filters( 'activitypub_allowed_html', '

",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html(''),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('
  • ')},d.prototype.update=function(a){var b=this;if(this.clear(),0!==a.length){for(var d=[],e=0;e1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('×');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
  • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen())if(c===d.ESC||c===d.TAB||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault()),c===d.DOWN||c===d.UP)b.focusOnActiveElement();else{var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3)}else b.hasFocus()&&(c===d.ENTER||c===d.SPACE||c===d.DOWN&&a.altKey)&&(b.open(),a.preventDefault())})},e.prototype.focusOnActiveElement=function(){c.isTouchscreen()||this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c}); \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/library/customizer/controls/js/slider-customizer.js b/wp-content/plugins/gp-premium/library/customizer/controls/js/slider-customizer.js new file mode 100644 index 0000000..549b225 --- /dev/null +++ b/wp-content/plugins/gp-premium/library/customizer/controls/js/slider-customizer.js @@ -0,0 +1,134 @@ +wp.customize.controlConstructor['generatepress-pro-range-slider'] = wp.customize.Control.extend({ + + ready: function() { + + 'use strict'; + + var control = this, + value, + thisInput, + inputDefault, + changeAction, + controlClass = '.customize-control-generatepress-pro-range-slider', + footerActions = jQuery( '#customize-footer-actions' ); + + // Set up the sliders + jQuery( '.generatepress-slider' ).each( function() { + var _this = jQuery( this ); + var _input = _this.closest( 'label' ).find( 'input[type="number"]' ); + var _text = _input.next( '.value' ); + _this.slider({ + value: _input.val(), + min: _this.data( 'min' ), + max: _this.data( 'max' ), + step: _this.data( 'step' ), + slide: function( event, ui ) { + _input.val( ui.value ).change(); + _text.text( ui.value ); + } + }); + }); + + // Update the range value based on the input value + jQuery( controlClass + ' .gp_range_value input[type=number]' ).on( 'input', function() { + value = jQuery( this ).attr( 'value' ); + if ( '' == value ) { + value = -1; + } + jQuery( this ).closest( 'label' ).find( '.generatepress-slider' ).slider( 'value', parseFloat(value)).change(); + }); + + // Handle the reset button + jQuery( controlClass + ' .generatepress-reset' ).on( 'click', function() { + var icon = jQuery( this ), + visible_area = icon.closest( '.gp-range-title-area' ).next( '.gp-range-slider-areas' ).children( 'label:visible' ), + input = visible_area.find( 'input[type=number]' ), + slider_value = visible_area.find( '.generatepress-slider' ), + visual_value = visible_area.find( '.gp_range_value' ), + reset_value = input.attr( 'data-reset_value' ); + + input.val( reset_value ).change(); + visual_value.find( 'input' ).val( reset_value ); + visual_value.find( '.value' ).text( reset_value ); + + if ( '' == reset_value ) { + reset_value = -1; + } + + slider_value.slider( 'value', parseFloat( reset_value ) ); + }); + + // Figure out which device icon to make active on load + jQuery( controlClass + ' .generatepress-range-slider-control' ).each( function() { + var _this = jQuery( this ); + _this.find( '.gp-device-controls' ).children( 'span:first-child' ).addClass( 'selected' ); + _this.find( '.range-option-area:first-child' ).show(); + }); + + // Do stuff when device icons are clicked + jQuery( controlClass + ' .gp-device-controls > span' ).on( 'click', function( event ) { + var device = jQuery( this ).data( 'option' ); + + jQuery( controlClass + ' .gp-device-controls span' ).each( function() { + var _this = jQuery( this ); + if ( device == _this.attr( 'data-option' ) ) { + _this.addClass( 'selected' ); + _this.siblings().removeClass( 'selected' ); + } + }); + + jQuery( controlClass + ' .gp-range-slider-areas label' ).each( function() { + var _this = jQuery( this ); + if ( device == _this.attr( 'data-option' ) ) { + _this.show(); + _this.siblings().hide(); + } + }); + + // Set the device we're currently viewing + wp.customize.previewedDevice.set( jQuery( event.currentTarget ).data( 'option' ) ); + } ); + + // Set the selected devices in our control when the Customizer devices are clicked + footerActions.find( '.devices button' ).on( 'click', function() { + var device = jQuery( this ).data( 'device' ); + jQuery( controlClass + ' .gp-device-controls span' ).each( function() { + var _this = jQuery( this ); + if ( device == _this.attr( 'data-option' ) ) { + _this.addClass( 'selected' ); + _this.siblings().removeClass( 'selected' ); + } + }); + + jQuery( controlClass + ' .gp-range-slider-areas label' ).each( function() { + var _this = jQuery( this ); + if ( device == _this.attr( 'data-option' ) ) { + _this.show(); + _this.siblings().hide(); + } + }); + }); + + // Apply changes when desktop slider is changed + control.container.on( 'input change', '.desktop-range', + function() { + control.settings['desktop'].set( jQuery( this ).val() ); + } + ); + + // Apply changes when tablet slider is changed + control.container.on( 'input change', '.tablet-range', + function() { + control.settings['tablet'].set( jQuery( this ).val() ); + } + ); + + // Apply changes when mobile slider is changed + control.container.on( 'input change', '.mobile-range', + function() { + control.settings['mobile'].set( jQuery( this ).val() ); + } + ); + } + +}); \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/library/customizer/controls/js/spacing-customizer.js b/wp-content/plugins/gp-premium/library/customizer/controls/js/spacing-customizer.js new file mode 100644 index 0000000..ad2eeee --- /dev/null +++ b/wp-content/plugins/gp-premium/library/customizer/controls/js/spacing-customizer.js @@ -0,0 +1,200 @@ +( function( $, api ) { + // No longer needed as of 1.2.95 + // Keeping it here just in case + api.controlConstructor['spacing'] = api.Control.extend( { + ready: function() { + var control = this; + $( '.generate-number-control', control.container ).on( 'change keyup', + function() { + control.setting.set( $( this ).val() ); + } + ); + } + } ); + + api.controlConstructor['gp-spacing-slider'] = api.Control.extend( { + ready: function() { + var control = this; + $( '.slider-input', control.container ).on( 'change keyup', + function() { + control.setting.set( $( this ).val() ); + } + ); + } + } ); + + api.controlConstructor['generatepress-spacing'] = api.Control.extend( { + ready: function() { + var control = this, + controlClass = '.customize-control-generatepress-spacing', + footerActions = jQuery( '#customize-footer-actions' ); + + // Figure out which device icon to make active on load + jQuery( controlClass + ' .gp-spacing-control-section' ).each( function() { + var _this = jQuery( this ); + _this.find( '.gp-device-controls' ).children( 'span:first-child' ).addClass( 'selected' ); + _this.find( '.spacing-values-area:first-child' ).show(); + }); + + // Do stuff when device icons are clicked + jQuery( controlClass + ' .gp-device-controls > span' ).on( 'click', function( event ) { + var device = jQuery( this ).data( 'option' ); + + jQuery( controlClass + ' .gp-device-controls span' ).each( function() { + var _this = jQuery( this ); + if ( device == _this.attr( 'data-option' ) ) { + _this.addClass( 'selected' ); + _this.siblings().removeClass( 'selected' ); + } + }); + + jQuery( controlClass + ' .spacing-values-container .spacing-values-area' ).each( function() { + var _this = jQuery( this ); + if ( device == _this.attr( 'data-option' ) ) { + _this.show(); + _this.siblings().hide(); + } + }); + + // Set the device we're currently viewing + wp.customize.previewedDevice.set( jQuery( event.currentTarget ).data( 'option' ) ); + } ); + + // Set the selected devices in our control when the Customizer devices are clicked + footerActions.find( '.devices button' ).on( 'click', function() { + var device = jQuery( this ).data( 'device' ); + jQuery( controlClass + ' .gp-device-controls span' ).each( function() { + var _this = jQuery( this ); + if ( device == _this.attr( 'data-option' ) ) { + _this.addClass( 'selected' ); + _this.siblings().removeClass( 'selected' ); + } + }); + + jQuery( controlClass + ' .spacing-values-container .spacing-values-area' ).each( function() { + var _this = jQuery( this ); + if ( device == _this.attr( 'data-option' ) ) { + _this.show(); + _this.siblings().hide(); + } + }); + }); + + control.container.on( 'change keyup', '.spacing-top', + function() { + control.settings['desktop_top'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.spacing-right', + function() { + control.settings['desktop_right'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.spacing-bottom', + function() { + control.settings['desktop_bottom'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.spacing-left', + function() { + control.settings['desktop_left'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.tablet-spacing-top', + function() { + control.settings['tablet_top'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.tablet-spacing-right', + function() { + control.settings['tablet_right'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.tablet-spacing-bottom', + function() { + control.settings['tablet_bottom'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.tablet-spacing-left', + function() { + control.settings['tablet_left'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.mobile-spacing-top', + function() { + control.settings['mobile_top'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.mobile-spacing-right', + function() { + control.settings['mobile_right'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.mobile-spacing-bottom', + function() { + control.settings['mobile_bottom'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change keyup', '.mobile-spacing-left', + function() { + control.settings['mobile_left'].set( jQuery( this ).val() ); + } + ); + } + } ); +} )( jQuery, wp.customize ); + +jQuery( document ).ready( function($) { + $( '.gp-link-spacing' ).on( 'click', function(e) { + e.preventDefault(); + + // Set up variables + var _this = $( this ), + element = _this.data( 'element' ); + + // Add our linked-values class to the next 4 elements + _this.parent( '.gp-spacing-section' ).prevAll().slice(0,4).find( 'input' ).addClass( 'linked-values' ).attr( 'data-element', element ); + + // Change our link icon class + _this.hide(); + _this.next( 'span' ).show(); + }); + + $( '.gp-unlink-spacing' ).on( 'click', function(e) { + e.preventDefault(); + + // Set up variables + var _this = $( this ); + + // Remove our linked-values class to the next 4 elements + _this.parent( '.gp-spacing-section' ).prevAll().slice(0,4).find( 'input' ).removeClass( 'linked-values' ).attr( 'data-element', '' ); + + // Change our link icon class + _this.hide(); + _this.prev( 'span' ).show(); + }); + + $( '.gp-spacing-section' ).on( 'input', '.linked-values', function() { + var _this = $( this ), + data = _this.attr( 'data-element' ), + val = _this.val(), + targetElements = _this.closest( '.spacing-values-area' ).find( '.linked-values[ data-element="' + data + '" ]' ); + + + targetElements.each( function( key, value ) { + var element = $( this ); + element.val( val ).change(); + }); + }); +}); diff --git a/wp-content/plugins/gp-premium/library/customizer/controls/js/typography-customizer.js b/wp-content/plugins/gp-premium/library/customizer/controls/js/typography-customizer.js new file mode 100644 index 0000000..002dec0 --- /dev/null +++ b/wp-content/plugins/gp-premium/library/customizer/controls/js/typography-customizer.js @@ -0,0 +1,151 @@ +( function( api ) { + + api.controlConstructor['gp-pro-customizer-typography'] = api.Control.extend( { + ready: function() { + var control = this; + + control.container.on( 'change', '.generatepress-font-family select', + function() { + var _this = jQuery( this ), + _value = _this.val(), + _categoryID = _this.attr( 'data-category' ), + _variantsID = _this.attr( 'data-variants' ); + + // Set our font family + control.settings['family'].set( _this.val() ); + + // Bail if our controls don't exist + if ( 'undefined' == typeof control.settings['category'] || 'undefined' == typeof control.settings['variant'] ) { + return; + } + + setTimeout( function() { + // Send our request to the generate_get_all_google_fonts_ajax function + var response = jQuery.getJSON({ + type: 'POST', + url: ajaxurl, + data: { + action: 'generate_get_all_google_fonts_ajax', + gp_customize_nonce: gp_customize.nonce + }, + async: false, + dataType: 'json', + }); + + // Get our response + var fonts = response.responseJSON; + + // Create an ID from our selected font + var id = _value.split(' ').join('_').toLowerCase(); + + // Set our values if we have them + if ( id in fonts ) { + + // Get existing variants if this font is already selected + var got_variants = false; + jQuery( '.generatepress-font-family select' ).not( _this ).each( function( key, select ) { + var parent = jQuery( this ).closest( '.generatepress-font-family' ); + + if ( _value == jQuery( select ).val() && _this.data( 'category' ) !== jQuery( select ).data( 'category' ) ) { + if ( ! got_variants ) { + updated_variants = jQuery( parent.next( '.generatepress-font-variant' ).find( 'select' ) ).val(); + got_variants = true; + } + } + } ); + + // We're using a Google font, so show the variants field + _this.closest( '.generatepress-font-family' ).next( 'div' ).show(); + + // Remove existing variants + jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove(); + + // Populate our select input with available variants + jQuery.each( fonts[ id ].variants, function( key, value ) { + jQuery( 'select[name="' + _variantsID + '"]' ).append( jQuery( '' ).attr( 'value', value ).text( value ) ); + } ); + + // Set our variants + if ( ! got_variants ) { + control.settings[ 'variant' ].set( fonts[ id ].variants ); + } else { + control.settings[ 'variant' ].set( updated_variants ); + } + + // Set our font category + control.settings[ 'category' ].set( fonts[ id ].category ); + jQuery( 'input[name="' + _categoryID + '"' ).val( fonts[ id ].category ); + } else { + _this.closest( '.generatepress-font-family' ).next( 'div' ).hide(); + control.settings[ 'category' ].set( '' ) + control.settings[ 'variant' ].set( '' ) + jQuery( 'input[name="' + _categoryID + '"' ).val( '' ); + jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove(); + } + }, 25 ); + } + ); + + control.container.on( 'change', '.generatepress-font-variant select', + function() { + var _this = jQuery( this ); + var variants = _this.val(); + + control.settings['variant'].set( variants ); + + jQuery( '.generatepress-font-variant select' ).each( function( key, value ) { + var this_control = jQuery( this ).closest( 'li' ).attr( 'id' ).replace( 'customize-control-', '' ); + var parent = jQuery( this ).closest( '.generatepress-font-variant' ); + var font_val = api.control( this_control ).settings['family'].get(); + + if ( font_val == control.settings['family'].get() && _this.attr( 'name' ) !== jQuery( value ).attr( 'name' ) ) { + jQuery( parent.find( 'select' ) ).not( _this ).val( variants ).triggerHandler( 'change' ); + api.control( this_control ).settings['variant'].set( variants ); + } + } ); + } + ); + + control.container.on( 'change', '.generatepress-font-category input', + function() { + control.settings['category'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change', '.generatepress-font-weight select', + function() { + control.settings['weight'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change', '.generatepress-font-transform select', + function() { + control.settings['transform'].set( jQuery( this ).val() ); + } + ); + + } + } ); + +} )( wp.customize ); + +jQuery( document ).ready( function($) { + + jQuery( '.generatepress-font-family select' ).selectWoo(); + jQuery( '.generatepress-font-variant' ).each( function( key, value ) { + var _this = $( this ); + var value = _this.data( 'saved-value' ); + if ( value ) { + value = value.toString().split( ',' ); + } + _this.find( 'select' ).selectWoo().val( value ).trigger( 'change.select2' ); + } ); + + $( ".generatepress-font-family" ).each( function( key, value ) { + var _this = $( this ); + if ( $.inArray( _this.find( 'select' ).val(), typography_defaults ) !== -1 ) { + _this.next( '.generatepress-font-variant' ).hide(); + } + }); + +} ); diff --git a/wp-content/plugins/gp-premium/library/customizer/deprecated.php b/wp-content/plugins/gp-premium/library/customizer/deprecated.php new file mode 100644 index 0000000..00dd2f9 --- /dev/null +++ b/wp-content/plugins/gp-premium/library/customizer/deprecated.php @@ -0,0 +1,324 @@ +manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} +endif; + +if ( ! function_exists( 'generate_backgrounds_is_top_bar_active' ) ) : +/** + * Check to see if the top bar is active + * + * @since 1.3.45 + */ +function generate_backgrounds_is_top_bar_active() +{ + $top_bar = is_active_sidebar( 'top-bar' ) ? true : false; + return apply_filters( 'generate_is_top_bar_active', $top_bar ); +} +endif; + +if ( ! function_exists( 'generate_blog_sanitize_choices' ) ) : +/** + * Sanitize choices + */ +function generate_blog_sanitize_choices( $input, $setting ) { + + // Ensure input is a slug + $input = sanitize_key( $input ); + + // Get list of choices from the control + // associated with the setting + $choices = $setting->manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} +endif; + +if ( ! function_exists( 'generate_blog_is_posts_page' ) ) : +/** + * Check to see if we're on a posts page + */ +function generate_blog_is_posts_page() +{ + $blog = ( is_home() || is_archive() || is_attachment() || is_tax() ) ? true : false; + + return $blog; +} +endif; + +if ( ! function_exists( 'generate_blog_is_posts_page_single' ) ) : +/** + * Check to see if we're on a posts page or a single post + */ +function generate_blog_is_posts_page_single() +{ + $blog = ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) ? true : false; + + return $blog; +} +endif; + +if ( ! function_exists( 'generate_blog_is_excerpt' ) ) : +/** + * Check to see if we're displaying excerpts + */ +function generate_blog_is_excerpt() +{ + if ( ! function_exists( 'generate_get_defaults' ) ) + return; + + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_defaults() + ); + + return ( 'excerpt' == $generate_settings['post_content'] ) ? true : false; +} +endif; + +if ( ! function_exists( 'generate_colors_sanitize_hex_color' ) ) : +/** + * Sanitize hex colors + * We don't use the core function as we want to allow empty values + * @since 0.1 + */ +function generate_colors_sanitize_hex_color( $color ) { + if ( '' === $color ) + return ''; + + // 3 or 6 hex digits, or the empty string. + if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) + return $color; + + return ''; +} +endif; + +if ( ! function_exists( 'generate_colors_sanitize_rgba' ) ) : +/** + * Sanitize RGBA colors + * @since 1.3.42 + */ +function generate_colors_sanitize_rgba( $color ) { + if ( '' === $color ) + return ''; + + // If string does not start with 'rgba', then treat as hex + // sanitize the hex color and finally convert hex to rgba + if ( false === strpos( $color, 'rgba' ) ) { + return generate_colors_sanitize_hex_color( $color ); + } + + // By now we know the string is formatted as an rgba color so we need to further sanitize it. + $color = str_replace( ' ', '', $color ); + sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha ); + return 'rgba('.$red.','.$green.','.$blue.','.$alpha.')'; + + return ''; +} +endif; + +if ( ! function_exists( 'generate_menu_plus_sanitize_choices' ) ) : +/** + * Sanitize choices + */ +function generate_menu_plus_sanitize_choices( $input, $setting ) { + + // Ensure input is a slug + $input = sanitize_key( $input ); + + // Get list of choices from the control + // associated with the setting + $choices = $setting->manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} +endif; + +if ( ! function_exists( 'generate_page_header_is_posts_page' ) ) : +/** + * This is an active_callback + * Check if we're on a posts page + */ +function generate_page_header_is_posts_page() +{ + $blog = ( is_home() || is_archive() || is_attachment() || is_tax() ) ? true : false; + + return $blog; +} +endif; + +if ( ! function_exists( 'generate_page_header_is_posts_page_single' ) ) : +/** + * Check to see if we're on a posts page or a single post + */ +function generate_page_header_is_posts_page_single() +{ + $blog = ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) ? true : false; + + return $blog; +} +endif; + +if ( ! function_exists( 'generate_secondary_nav_sanitize_choices' ) ) : +/** + * Sanitize choices + */ +function generate_secondary_nav_sanitize_choices( $input, $setting ) { + + // Ensure input is a slug + $input = sanitize_key( $input ); + + // Get list of choices from the control + // associated with the setting + $choices = $setting->manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} +endif; + +if ( ! function_exists( 'generate_spacing_sanitize_choices' ) ) : +/** + * Sanitize choices + */ +function generate_spacing_sanitize_choices( $input, $setting ) { + + // Ensure input is a slug + $input = sanitize_key( $input ); + + // Get list of choices from the control + // associated with the setting + $choices = $setting->manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} +endif; + +if ( ! function_exists( 'generate_premium_sanitize_typography' ) ) : +/** + * Sanitize typography dropdown + * @since 1.1.10 + * @deprecated 1.2.95 + */ +function generate_premium_sanitize_typography( $input ) +{ + if ( ! function_exists( 'generate_get_all_google_fonts' ) || ! function_exists( 'generate_typography_default_fonts' ) ) { + return 'Open Sans'; + } + + // Grab all of our fonts + $fonts = generate_get_all_google_fonts(); + + // Loop through all of them and grab their names + $font_names = array(); + foreach ( $fonts as $k => $fam ) { + $font_names[] = $fam['name']; + } + + // Get all non-Google font names + $not_google = generate_typography_default_fonts(); + + // Merge them both into one array + $valid = array_merge( $font_names, $not_google ); + + // Sanitize + if ( in_array( $input, $valid ) ) { + return $input; + } else { + return 'Open Sans'; + } +} +endif; + +if ( ! function_exists( 'generate_typography_sanitize_choices' ) ) : +/** + * Sanitize choices + * @since 1.3.24 + */ +function generate_typography_sanitize_choices( $input, $setting ) { + + // Ensure input is a slug + $input = sanitize_key( $input ); + + // Get list of choices from the control + // associated with the setting + $choices = $setting->manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} +endif; + +if ( ! function_exists( 'generate_page_header_sanitize_choices' ) ) : +/** + * Sanitize our select inputs + */ +function generate_page_header_sanitize_choices( $input, $setting ) { + + // Ensure input is a slug + $input = sanitize_key( $input ); + + // Get list of choices from the control + // associated with the setting + $choices = $setting->manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); +} +endif; + +if ( ! function_exists( 'generate_page_header_sanitize_hex_color' ) ) : +/** + * Sanitize colors + * We don't use the core function as we want to allow empty values + */ +function generate_page_header_sanitize_hex_color( $color ) { + if ( '' === $color ) + return ''; + + // 3 or 6 hex digits, or the empty string. + if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) + return $color; + + return ''; +} +endif; + +if ( ! function_exists( 'generate_page_header_sanitize_html' ) ) : +/** + * Sanitize our fields that accept HTML + */ +function generate_page_header_sanitize_html( $input ) +{ + return wp_kses_post( $input ); +} +endif; \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/library/customizer/sanitize.php b/wp-content/plugins/gp-premium/library/customizer/sanitize.php new file mode 100644 index 0000000..a0cb7ef --- /dev/null +++ b/wp-content/plugins/gp-premium/library/customizer/sanitize.php @@ -0,0 +1,131 @@ +manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); + } +} + +if ( ! function_exists( 'generate_premium_sanitize_checkbox' ) ) { + /** + * Sanitize checkbox + */ + function generate_premium_sanitize_checkbox( $checked ) { + // Boolean check. + return ( ( isset( $checked ) && true == $checked ) ? true : false ); + } +} + +if ( ! function_exists( 'generate_premium_sanitize_hex_color' ) ) { + /** + * Sanitize hex colors + * We don't use the core function as we want to allow empty values + * + * @since 0.1 + */ + function generate_premium_sanitize_hex_color( $color ) { + if ( '' === $color ) { + return ''; + } + + // 3 or 6 hex digits, or the empty string. + if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) { + return $color; + } + + return ''; + } +} + +if ( ! function_exists( 'generate_premium_sanitize_rgba' ) ) { + /** + * Sanitize RGBA colors + * + * @since 1.3.42 + */ + function generate_premium_sanitize_rgba( $color ) { + if ( '' === $color ) { + return ''; + } + + // If string does not start with 'rgba', then treat as hex + // sanitize the hex color and finally convert hex to rgba + if ( false === strpos( $color, 'rgba' ) ) { + return generate_premium_sanitize_hex_color( $color ); + } + + // By now we know the string is formatted as an rgba color so we need to further sanitize it. + $color = str_replace( ' ', '', $color ); + sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha ); + return 'rgba('.$red.','.$green.','.$blue.','.$alpha.')'; + + return ''; + } +} + +if ( ! function_exists( 'generate_premium_sanitize_decimal_integer' ) ) { + /** + * Sanitize integers that can use decimals + * + * @since 1.3.41 + */ + function generate_premium_sanitize_decimal_integer( $input ) { + return abs( floatval( $input ) ); + } +} + +/** + * Sanitize integers that can use decimals + * @since 1.4 + */ +function generate_premium_sanitize_decimal_integer_empty( $input ) { + if ( '' == $input ) { + return ''; + } + + return abs( floatval( $input ) ); +} + +if ( ! function_exists( 'generate_premium_sanitize_html' ) ) { + /** + * Sanitize our fields that accept HTML + */ + function generate_premium_sanitize_html( $input ) { + return wp_kses_post( $input ); + } +} + +function generate_premium_sanitize_variants( $input ) { + if ( is_array( $input ) ) { + $input = implode( ',', $input ); + } + + return sanitize_text_field( $input ); +} diff --git a/wp-content/plugins/gp-premium/library/image-processing-queue/image-processing-queue.php b/wp-content/plugins/gp-premium/library/image-processing-queue/image-processing-queue.php new file mode 100644 index 0000000..0ae72af --- /dev/null +++ b/wp-content/plugins/gp-premium/library/image-processing-queue/image-processing-queue.php @@ -0,0 +1,17 @@ +process = new IPQ_Process(); + add_filter( 'update_post_metadata', array( $this, 'filter_update_post_metadata' ), 10, 5 ); + } + + /** + * Filter the post meta data for backup sizes + * + * Unfortunately WordPress core is lacking hooks in its image resizing functions so we are reduced + * to this hackery to detect when images are resized and previous versions are relegated to backup sizes. + * + * @param bool $check + * @param int $object_id + * @param string $meta_key + * @param mixed $meta_value + * @param mixed $prev_value + * @return bool + */ + public function filter_update_post_metadata( $check, $object_id, $meta_key, $meta_value, $prev_value ) { + if ( '_wp_attachment_backup_sizes' !== $meta_key ) { + return $check; + } + + $current_value = get_post_meta( $object_id, $meta_key, true ); + + if ( ! $current_value ) { + $current_value = array(); + } + + $diff = array_diff_key( $meta_value, $current_value ); + + if ( ! $diff ) { + return $check; + } + + $key = key( $diff ); + $suffix = substr( $key, strrpos( $key, '-' ) + 1 ); + + $image_meta = self::get_image_meta( $object_id ); + + foreach ( $image_meta['sizes'] as $size_name => $size ) { + if ( 0 !== strpos( $size_name, 'ipq-' ) ) { + continue; + } + + $meta_value[ $size_name . '-' . $suffix ] = $size; + unset( $image_meta['sizes'][ $size_name ] ); + } + + if ( ! $this->is_updating_backup_sizes ) { + $this->is_updating_backup_sizes = true; + update_post_meta( $object_id, '_wp_attachment_backup_sizes', $meta_value ); + wp_update_attachment_metadata( $object_id, $image_meta ); + return true; + } + + $this->is_updating_backup_sizes = false; + + return $check; + } + + /** + * Check if the image sizes exist and push them to the queue if not. + * + * @param int $post_id + * @param array $sizes + */ + protected function process_image( $post_id, $sizes ) { + $new_item = false; + + foreach ( $sizes as $size ) { + if ( self::does_size_already_exist_for_image( $post_id, $size ) ) { + continue; + } + + if ( self::is_size_larger_than_original( $post_id, $size ) ) { + continue; + } + + $item = array( + 'post_id' => $post_id, + 'width' => $size[0], + 'height' => $size[1], + 'crop' => $size[2], + ); + $this->process->push_to_queue( $item ); + $new_item = true; + } + + if ( $new_item ) { + $this->process->save()->dispatch(); + } + } + + /** + * Get image HTML for a specific context in a theme, specifying the exact sizes + * for the image. The first image size is always used as the `src` and the other + * sizes are used in the `srcset` if they're the same aspect ratio as the original + * image. If any of the image sizes don't currently exist, they are queued for + * creation by a background process. Example: + * + * echo ipq_get_theme_image( 1353, array( + * array( 600, 400, false ), + * array( 1280, 720, false ), + * array( 1600, 1067, false ), + * ), + * array( + * 'class' => 'header-banner' + * ) + * ); + * + * @param int $post_id Image attachment ID. + * @param array $sizes Array of arrays of sizes in the format array(width,height,crop). + * @param string $attr Optional. Attributes for the image markup. Default empty. + * @return string HTML img element or empty string on failure. + */ + public function get_image( $post_id, $sizes, $attr = '' ) { + $this->process_image( $post_id, $sizes ); + + return wp_get_attachment_image( $post_id, array( $sizes[0][0], $sizes[0][1] ), false, $attr ); + } + + /** + * Get image URL for a specific context in a theme, specifying the exact size + * for the image. If the image size does not currently exist, it is queued for + * creation by a background process. Example: + * + * echo ipq_get_theme_image_url( 1353, array( 600, 400, false ) ); + * + * @param int $post_id + * @param array $size + * + * @return string + */ + public function get_image_url( $post_id, $size ) { + $this->process_image( $post_id, array( $size ) ); + + $size = self::get_size_name( $size ); + $src = wp_get_attachment_image_src( $post_id, $size ); + + if ( isset( $src[0] ) ) { + return $src[0]; + } + + return ''; + } + + /** + * Get array index name for image size. + * + * @param array $size array in format array(width,height,crop). + * @return string Image size name. + */ + public static function get_size_name( $size ) { + $crop = $size[2] ? 'true' : 'false'; + return 'ipq-' . $size[0] . 'x' . $size[1] . '-' . $crop; + } + + /** + * Get an image's file path. + * + * @param int $post_id ID of the image post. + * @return false|string + */ + public static function get_image_path( $post_id ) { + return get_attached_file( $post_id ); + } + + /** + * Get an image's post meta data. + * + * @param int $post_id ID of the image post. + * @return mixed Post meta field. False on failure. + */ + public static function get_image_meta( $post_id ) { + return wp_get_attachment_metadata( $post_id ); + } + + /** + * Update meta data for an image + * + * @param int $post_id Image ID. + * @param array $data Image data. + * @return bool|int False if $post is invalid. + */ + public static function update_image_meta( $post_id, $data ) { + return wp_update_attachment_metadata( $post_id, $data ); + } + + /** + * Checks if an image size already exists for an image + * + * @param int $post_id Image ID. + * @param array $size array in format array(width,height,crop). + * @return bool + */ + public static function does_size_already_exist_for_image( $post_id, $size ) { + $image_meta = self::get_image_meta( $post_id ); + $size_name = self::get_size_name( $size ); + + return isset( $image_meta['sizes'][ $size_name ] ); + } + + /** + * Check if an image size is larger than the original. + * + * @param int $post_id Image ID. + * @param array $size array in format array(width,height,crop). + * + * @return bool + */ + public static function is_size_larger_than_original( $post_id, $size ) { + $image_meta = self::get_image_meta( $post_id ); + + if ( ! isset( $image_meta['width'] ) || ! isset( $image_meta['height'] ) ) { + return true; + } + + if ( $size[0] > $image_meta['width'] || $size[1] > $image_meta['height'] ) { + return true; + } + + return false; + } + } + +} diff --git a/wp-content/plugins/gp-premium/library/image-processing-queue/includes/class-ipq-process.php b/wp-content/plugins/gp-premium/library/image-processing-queue/includes/class-ipq-process.php new file mode 100644 index 0000000..88da843 --- /dev/null +++ b/wp-content/plugins/gp-premium/library/image-processing-queue/includes/class-ipq-process.php @@ -0,0 +1,97 @@ + 0, + 'width' => 0, + 'height' => 0, + 'crop' => false, + ); + $item = wp_parse_args( $item, $defaults ); + + $post_id = $item['post_id']; + $width = $item['width']; + $height = $item['height']; + $crop = $item['crop']; + + if ( ! $width && ! $height ) { + throw new IPQ_Process_Exception( "Invalid dimensions '{$width}x{$height}'" ); + } + + if ( Image_Processing_Queue::does_size_already_exist_for_image( $post_id, array( $width, $height, $crop ) ) ) { + return false; + } + + $image_meta = Image_Processing_Queue::get_image_meta( $post_id ); + + if ( ! $image_meta ) { + return false; + } + + add_filter( 'as3cf_get_attached_file_copy_back_to_local', '__return_true' ); + $img_path = Image_Processing_Queue::get_image_path( $post_id ); + + if ( ! $img_path ) { + return false; + } + + $editor = wp_get_image_editor( $img_path ); + + if ( is_wp_error( $editor ) ) { + throw new IPQ_Process_Exception( 'Unable to get WP_Image_Editor for file "' . $img_path . '": ' . $editor->get_error_message() . ' (is GD or ImageMagick installed?)' ); + } + + if ( is_wp_error( $editor->resize( $width, $height, $crop ) ) ) { + throw new IPQ_Process_Exception( 'Error resizing image: ' . $editor->get_error_message() ); + } + + $resized_file = $editor->save(); + + if ( is_wp_error( $resized_file ) ) { + throw new IPQ_Process_Exception( 'Unable to save resized image file: ' . $editor->get_error_message() ); + } + + $size_name = Image_Processing_Queue::get_size_name( array( $width, $height, $crop ) ); + $image_meta['sizes'][ $size_name ] = array( + 'file' => $resized_file['file'], + 'width' => $resized_file['width'], + 'height' => $resized_file['height'], + 'mime-type' => $resized_file['mime-type'], + ); + wp_update_attachment_metadata( $post_id, $image_meta ); + + return false; + } + } +} + diff --git a/wp-content/plugins/gp-premium/library/image-processing-queue/includes/ipq-template-functions.php b/wp-content/plugins/gp-premium/library/image-processing-queue/includes/ipq-template-functions.php new file mode 100644 index 0000000..13c6fc3 --- /dev/null +++ b/wp-content/plugins/gp-premium/library/image-processing-queue/includes/ipq-template-functions.php @@ -0,0 +1,47 @@ + 'header-banner' + * ) + * ); + * + * @param int $post_id Image attachment ID. + * @param array $sizes Array of arrays of sizes in the format array(width,height,crop). + * @param string $attr Optional. Attributes for the image markup. Default empty. + * + * @return string HTML img element or empty string on failure. + */ + function ipq_get_theme_image( $post_id, $sizes, $attr = '' ) { + return Image_Processing_Queue::instance()->get_image( $post_id, $sizes, $attr ); + } +} + +if ( ! function_exists( 'ipq_get_theme_image_url' ) ) { + /** + * Get image URL for a specific context in a theme, specifying the exact size + * for the image. If the image size does not currently exist, it is queued for + * creation by a background process. Example: + * + * echo ipq_get_theme_image_url( 1353, array( 600, 400, false ) ); + * + * @param int $post_id + * @param array $size + * + * @return string Img URL + */ + function ipq_get_theme_image_url( $post_id, $size ) { + return Image_Processing_Queue::instance()->get_image_url( $post_id, $size ); + } +} diff --git a/wp-content/plugins/gp-premium/library/select2/select2.full.min.js b/wp-content/plugins/gp-premium/library/select2/select2.full.min.js new file mode 100644 index 0000000..567c81a --- /dev/null +++ b/wp-content/plugins/gp-premium/library/select2/select2.full.min.js @@ -0,0 +1 @@ +/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
      ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a(''),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[data-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("data-selected","true"):b.attr("data-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&(b.data("element").select2("close"),setTimeout(function(){b.find("*:focus").blur(),c.focus()},1))})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('
        '),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}}),this.$selection.on("keydown",function(a){!b.isOpen()&&a.which>=48&&a.which<=90&&b.open()}),b.on("focus",function(){e.focusOnSearch()})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('
      • ')},d.prototype.focusOnSearch=function(){var a=this;void 0!==a.$search&&setTimeout(function(){a._keyUpPrevented=!0,a.$search.focus()},1)},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('×');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}else a.which===c.ENTER&&(b.open(),a.preventDefault())});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
      • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen()){c===d.ESC||c===d.TAB||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault());var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),c===d.DOWN||c===d.UP?b.focusOnActiveElement():(e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3))}else b.hasFocus()&&(c!==d.ENTER&&c!==d.SPACE&&c!==d.DOWN||(b.open(),a.preventDefault()))})},e.prototype.focusOnActiveElement=function(){this.isOpen()&&!c.isTouchscreen()&&this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(f=d(this))&&g.push(f)})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;if(this._isInitialized)return void b.call(this,c);this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a ` + + -1, + 'orderby' => 'title', + 'post_type' => 'generate_page_header', + 'suppress_filters' => false, + )); + + $options[ $type ] = ! isset( $options[ $type ] ) ? '' : $options[ $type ]; + + foreach( $page_headers as $header ) { + printf( '', + $header->ID, + selected( $options[ $type ], $header->ID ), + $header->post_title + ); + } + ?> + + ( window_height - offset ) ) { + jQuery( '.fullscreen-enabled' ).attr( 'style', 'height: initial !important' ); + } +} + +jQuery(document).ready(function($) { + + // Run the header height function + generateHeaderHeight(); + + // Set up the resize timer + var generateResizeTimer; + + if ( jQuery('.generate-page-header.fullscreen-enabled')[0] ) { + // Initiate full window height on resize + var width = $(window).width(); + $(window).resize(function() { + if($(window).width() != width){ + clearTimeout(generateResizeTimer); + generateResizeTimer = setTimeout(generateHeaderHeight, 200); + width = $(window).width(); + } + }); + + $( window ).on( "orientationchange", function( event ) { + if($(window).width() != width){ + clearTimeout(generateResizeTimer); + generateResizeTimer = setTimeout(generateHeaderHeight, 200); + width = $(window).width(); + } + }); + } + +}); \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/page-header/functions/js/full-height.min.js b/wp-content/plugins/gp-premium/page-header/functions/js/full-height.min.js new file mode 100644 index 0000000..dd988e1 --- /dev/null +++ b/wp-content/plugins/gp-premium/page-header/functions/js/full-height.min.js @@ -0,0 +1 @@ +function generateHeaderHeight(){if(jQuery(".fullscreen-enabled").length){var a,b=jQuery(window).height();a=jQuery(".inside-page-header").length?jQuery(".inside-page-header"):jQuery(".generate-inside-combined-content").length?jQuery(".generate-inside-combined-content"):jQuery(".generate-inside-page-header-content");var c=jQuery(".fullscreen-enabled").offset().top;jQuery(".fullscreen-enabled").css("height",b-c+"px"),a.outerHeight()>b-c&&jQuery(".fullscreen-enabled").attr("style","height: initial !important")}}function generateHeaderParallax(){var a=jQuery(".menu-toggle");if(!a.is(":visible")&&jQuery(".generate-page-header.parallax-enabled")[0]){if(jQuery(".page-header-contained")[0])var b=jQuery(".generate-page-header.parallax-enabled .inside-content-header");else var b=jQuery(".generate-page-header.parallax-enabled");var c=jQuery(this).scrollTop(),d=jQuery(".generate-page-header.parallax-enabled").data("parallax-speed");return b.css("background-position","center "+parseInt(-c/d)+"px")}}jQuery(document).ready(function(a){generateHeaderHeight();var b;if(jQuery(".generate-page-header.parallax-enabled")[0]&&a(document).scroll(function(){generateHeaderParallax()}),jQuery(".generate-page-header.fullscreen-enabled")[0]){var c=a(window).width();a(window).resize(function(){a(window).width()!=c&&(clearTimeout(b),b=setTimeout(generateHeaderHeight,200),c=a(window).width())}),a(window).on("orientationchange",function(d){a(window).width()!=c&&(clearTimeout(b),b=setTimeout(generateHeaderHeight,200),c=a(window).width())})}}); \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/page-header/functions/js/jquery.vide.min.js b/wp-content/plugins/gp-premium/page-header/functions/js/jquery.vide.min.js new file mode 100644 index 0000000..d78004e --- /dev/null +++ b/wp-content/plugins/gp-premium/page-header/functions/js/jquery.vide.min.js @@ -0,0 +1,9 @@ +/* + * Vide - v0.5.0 + * Easy as hell jQuery plugin for video backgrounds. + * http://vodkabears.github.io/vide/ + * + * Made by Ilya Makarov + * Under MIT License + */ +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):b("object"==typeof exports?require("jquery"):a.jQuery)}(this,function(a){"use strict";function b(a){var b,c,d,e,f,g,h,i={};for(f=a.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,",").split(","),h=0,g=f.length;g>h&&(c=f[h],-1===c.search(/^(http|https|ftp):\/\//)&&-1!==c.search(":"));h++)b=c.indexOf(":"),d=c.substring(0,b),e=c.substring(b+1),e||(e=void 0),"string"==typeof e&&(e="true"===e||("false"===e?!1:e)),"string"==typeof e&&(e=isNaN(e)?e:+e),i[d]=e;return null==d&&null==e?a:i}function c(a){a=""+a;var b,c,d,e=a.split(/\s+/),f="50%",g="50%";for(d=0,b=e.length;b>d;d++)c=e[d],"left"===c?f="0%":"right"===c?f="100%":"top"===c?g="0%":"bottom"===c?g="100%":"center"===c?0===d?f="50%":g="50%":0===d?f=c:g=c;return{x:f,y:g}}function d(b,c){var d=function(){c(this.src)};a('').load(d),a('').load(d),a('').load(d),a('').load(d)}function e(c,d,e){if(this.$element=a(c),"string"==typeof d&&(d=b(d)),e?"string"==typeof e&&(e=b(e)):e={},"string"==typeof d)d=d.replace(/\.\w*$/,"");else if("object"==typeof d)for(var f in d)d.hasOwnProperty(f)&&(d[f]=d[f].replace(/\.\w*$/,""));this.settings=a.extend({},g,e),this.path=d;try{this.init()}catch(i){if(i.message!==h)throw i}}var f="vide",g={volume:1,playbackRate:1,muted:!0,loop:!0,autoplay:!0,position:"50% 50%",posterType:"detect",resizing:!0,bgColor:"transparent",className:""},h="Not implemented";e.prototype.init=function(){var b,e,g=this,i=g.path,j=i,k="",l=g.$element,m=g.settings,n=c(m.position),o=m.posterType;e=g.$wrapper=a("
        ").addClass(m.className).css({position:"absolute","z-index":-1,top:0,left:0,bottom:0,right:0,overflow:"hidden","-webkit-background-size":"cover","-moz-background-size":"cover","-o-background-size":"cover","background-size":"cover","background-color":m.bgColor,"background-repeat":"no-repeat","background-position":n.x+" "+n.y}),"object"==typeof i&&(i.poster?j=i.poster:i.mp4?j=i.mp4:i.webm?j=i.webm:i.ogv&&(j=i.ogv)),"detect"===o?d(j,function(a){e.css("background-image","url("+a+")")}):"none"!==o&&e.css("background-image","url("+j+"."+o+")"),"static"===l.css("position")&&l.css("position","relative"),l.prepend(e),"object"==typeof i?(i.mp4&&(k+=''),i.webm&&(k+=''),i.ogv&&(k+=''),b=g.$video=a("")):b=g.$video=a('');try{b.prop({autoplay:m.autoplay,loop:m.loop,volume:m.volume,muted:m.muted,defaultMuted:m.muted,playbackRate:m.playbackRate,defaultPlaybackRate:m.playbackRate})}catch(p){throw new Error(h)}b.css({margin:"auto",position:"absolute","z-index":-1,top:n.y,left:n.x,"-webkit-transform":"translate(-"+n.x+", -"+n.y+")","-ms-transform":"translate(-"+n.x+", -"+n.y+")","-moz-transform":"translate(-"+n.x+", -"+n.y+")",transform:"translate(-"+n.x+", -"+n.y+")",visibility:"hidden",opacity:0}).one("canplaythrough."+f,function(){g.resize()}).one("playing."+f,function(){b.css({visibility:"visible",opacity:1}),e.css("background-image","none")}),l.on("resize."+f,function(){m.resizing&&g.resize()}),e.append(b)},e.prototype.getVideoObject=function(){return this.$video[0]},e.prototype.resize=function(){if(this.$video){var a=this.$wrapper,b=this.$video,c=b[0],d=c.videoHeight,e=c.videoWidth,f=a.height(),g=a.width();g/e>f/d?b.css({width:g+2,height:"auto"}):b.css({width:"auto",height:f+2})}},e.prototype.destroy=function(){delete a[f].lookup[this.index],this.$video&&this.$video.off(f),this.$element.off(f).removeData(f),this.$wrapper.remove()},a[f]={lookup:[]},a.fn[f]=function(b,c){var d;return this.each(function(){d=a.data(this,f),d&&d.destroy(),d=new e(this,b,c),d.index=a[f].lookup.push(d)-1,a.data(this,f,d)}),this},a(document).ready(function(){var b=a(window);b.on("resize."+f,function(){for(var b,c=a[f].lookup.length,d=0;c>d;d++)b=a[f].lookup[d],b&&b.settings.resizing&&b.resize()}),b.on("unload."+f,function(){return!1}),a(document).find("[data-"+f+"-bg]").each(function(b,c){var d=a(c),e=d.data(f+"-options"),g=d.data(f+"-bg");d[f](g,e)})})});jQuery(document).ready(function($) {var page_header_content = $( '.page-header-content' );if ( page_header_content.length ) {if ( page_header_content.hasClass( 'grid-container' ) ) {$( '.inside-page-header-container' ).data('vide').getVideoObject().play();} else {page_header_content.data('vide').getVideoObject().play();}}}); diff --git a/wp-content/plugins/gp-premium/page-header/functions/js/lc_switch.js b/wp-content/plugins/gp-premium/page-header/functions/js/lc_switch.js new file mode 100644 index 0000000..89eae36 --- /dev/null +++ b/wp-content/plugins/gp-premium/page-header/functions/js/lc_switch.js @@ -0,0 +1,149 @@ +/** + * lc_switch.js + * Version: 1.0 + * Author: LCweb - Luca Montanari + * Website: http://www.lcweb.it + * Licensed under the MIT license + */ + +(function($){ + if(typeof($.fn.lc_switch) != 'undefined') {return false;} // prevent dmultiple scripts inits + + $.fn.lc_switch = function(on_text, off_text) { + + // destruct + $.fn.lcs_destroy = function() { + + $(this).each(function() { + var $wrap = $(this).parents('.lcs_wrap'); + + $wrap.children().not('input').remove(); + $(this).unwrap(); + }); + + return true; + }; + + + // set to ON + $.fn.lcs_on = function() { + + $(this).each(function() { + var $wrap = $(this).parents('.lcs_wrap'); + var $input = $wrap.find('input'); + + if(typeof($.fn.prop) == 'function') { + $wrap.find('input').prop('checked', true); + } else { + $wrap.find('input').attr('checked', true); + } + + $wrap.find('input').trigger('lcs-on'); + $wrap.find('input').trigger('lcs-statuschange'); + $wrap.find('.lcs_switch').removeClass('lcs_off').addClass('lcs_on'); + + // if radio - disable other ones + if( $wrap.find('.lcs_switch').hasClass('lcs_radio_switch') ) { + var f_name = $input.attr('name'); + $wrap.parents('form').find('input[name='+f_name+']').not($input).lcs_off(); + } + }); + + return true; + }; + + + // set to OFF + $.fn.lcs_off = function() { + + $(this).each(function() { + var $wrap = $(this).parents('.lcs_wrap'); + + if(typeof($.fn.prop) == 'function') { + $wrap.find('input').prop('checked', false); + } else { + $wrap.find('input').attr('checked', false); + } + + $wrap.find('input').trigger('lcs-off'); + $wrap.find('input').trigger('lcs-statuschange'); + $wrap.find('.lcs_switch').removeClass('lcs_on').addClass('lcs_off'); + }); + + return true; + }; + + + // construct + return this.each(function(){ + + // check against double init + if( !$(this).parent().hasClass('lcs_wrap') ) { + + // default texts + var ckd_on_txt = (typeof(on_text) == 'undefined') ? 'ON' : on_text; + var ckd_off_txt = (typeof(off_text) == 'undefined') ? 'OFF' : off_text; + + // labels structure + var on_label = (ckd_on_txt) ? '
        '+ ckd_on_txt +'
        ' : ''; + var off_label = (ckd_off_txt) ? '
        '+ ckd_off_txt +'
        ' : ''; + + + // default states + var disabled = ($(this).is(':disabled')) ? true: false; + var active = ($(this).is(':checked')) ? true : false; + + var status_classes = ''; + status_classes += (active) ? ' lcs_on' : ' lcs_off'; + if(disabled) {status_classes += ' lcs_disabled';} + + + // wrap and append + var structure = + '
        ' + + '
        ' + + on_label + off_label + + '
        '; + + if( $(this).is(':input') && ($(this).attr('type') == 'checkbox' || $(this).attr('type') == 'radio') ) { + + $(this).wrap('
        '); + $(this).parent().append(structure); + + $(this).parent().find('.lcs_switch').addClass('lcs_'+ $(this).attr('type') +'_switch'); + } + } + }); + }; + + + + // handlers + $(document).ready(function() { + + // on click + $(document).delegate('.lcs_switch:not(.lcs_disabled)', 'click tap', function(e) { + + if( $(this).hasClass('lcs_on') ) { + if( !$(this).hasClass('lcs_radio_switch') ) { // not for radio + $(this).lcs_off(); + } + } else { + $(this).lcs_on(); + } + }); + + + // on checkbox status change + $(document).delegate('.lcs_wrap input', 'change', function() { + + if( $(this).is(':checked') ) { + $(this).lcs_on(); + } else { + $(this).lcs_off(); + } + }); + + }); + +})(jQuery); diff --git a/wp-content/plugins/gp-premium/page-header/functions/js/metabox.js b/wp-content/plugins/gp-premium/page-header/functions/js/metabox.js new file mode 100644 index 0000000..b4739c7 --- /dev/null +++ b/wp-content/plugins/gp-premium/page-header/functions/js/metabox.js @@ -0,0 +1,220 @@ +jQuery(document).ready(function($) { + $( '#generate-tabs-container input[type="checkbox"]' ).lc_switch( '', '' ); + + $( '.generate-tabs-menu a' ).on( 'click', function( event ) { + event.preventDefault(); + $( this ).parent().addClass( 'generate-current' ); + $( this ).parent().siblings().removeClass( 'generate-current' ); + var tab = $( this ).attr( 'href' ); + $( '.generate-tab-content' ).not(tab).css( 'display', 'none' ); + $( tab ).fadeIn( 100 ); + + if ( '#generate-image-tab' == tab || '#generate-content-tab' == tab ) { + $( '.show-in-excerpt' ).show(); + } else { + $( '.show-in-excerpt' ).hide(); + } + } ); + + $( '#_meta-generate-page-header-content' ).bind( 'input change', function() { + if ( this.value.length ) { + $( '.page-header-content-required' ).hide(); + } else { + $( '.page-header-content-required' ).show(); + } + }); +}); + +jQuery(window).load(function($) { + if ( jQuery( '#_meta-generate-page-header-enable-image-crop' ).val() == 'enable' ) { + jQuery( '#crop-enabled' ).show(); + } + + jQuery( '#_meta-generate-page-header-enable-image-crop' ).change(function () { + if ( jQuery( this ).val() === 'enable' ) { + jQuery( '#crop-enabled' ).show(); + } else { + jQuery( '#crop-enabled' ).hide(); + } + }); + + if ( jQuery( '#_meta-generate-page-header-image-background' ).is( ':checked' ) ) { + jQuery( '.parallax' ).show(); + } else { + jQuery( '.parallax' ).hide(); + } + + jQuery('body').delegate('.image-background', 'lcs-statuschange', function() { + if (jQuery(this).is(":checked")) { + jQuery('.parallax').show(); + } else { + jQuery('.parallax').hide(); + jQuery('#_meta-generate-page-header-image-background-fixed').lcs_off(); + } + }); + + if ( jQuery('#_meta-generate-page-header-full-screen').is(':checked')) { + jQuery('.vertical-center').show(); + } else { + jQuery('.vertical-center').hide(); + } + + jQuery('body').delegate('#_meta-generate-page-header-full-screen', 'lcs-statuschange', function() { + if (jQuery(this).is(":checked")) { + jQuery('.vertical-center').show(); + } else { + jQuery('.vertical-center').hide(); + jQuery('#_meta-generate-page-header-vertical-center').lcs_off(); + } + }); + + if ( jQuery('#_meta-generate-page-header-transparent-navigation').is(':checked')) { + jQuery('.navigation-colors').show(); + } else { + jQuery('.navigation-colors').hide(); + } + + jQuery('body').delegate('#_meta-generate-page-header-transparent-navigation', 'lcs-statuschange', function() { + if (jQuery(this).is(":checked")) { + jQuery('.navigation-colors').show(); + } else { + jQuery('.navigation-colors').hide(); + } + }); + + if ( jQuery('#_meta-generate-page-header-combine').is(':checked')) { + jQuery('.combination-options').show(); + } else { + jQuery('.combination-options').hide(); + } + + jQuery('body').delegate('#_meta-generate-page-header-combine', 'lcs-statuschange', function() { + if (jQuery(this).is(":checked")) { + jQuery('.combination-options').show(); + } else { + jQuery('.combination-options').hide(); + } + }); + + if ( jQuery('#_meta-generate-page-header-image-background-type').val() == '' ) { + jQuery('.vertical-center').hide(); + jQuery('.fullscreen').hide(); + } + jQuery('#_meta-generate-page-header-image-background-type').change(function () { + if (jQuery(this).val() === '') { + jQuery('.vertical-center').hide(); + jQuery('#_meta-generate-page-header-vertical-center').lcs_off(); + jQuery('.fullscreen').hide(); + jQuery('#_meta-generate-page-header-full-screen').lcs_off(); + } else { + //jQuery('.vertical-center').show(); + jQuery('.fullscreen').show(); + } + }); + + var $set_button = jQuery('.generate-upload-file'); + /** + * open the media manager + */ + $set_button.click(function (e) { + e.preventDefault(); + + var $thisbutton = jQuery(this); + var frame = wp.media({ + title : $thisbutton.data('title'), + multiple : false, + library : { type : $thisbutton.data('type') }, + button : { text : $thisbutton.data('insert') } + }); + // close event media manager + frame.on('select', function () { + var attachment = frame.state().get('selection').first().toJSON(); + // set the file + //set_dfi(attachment.url); + $thisbutton.prev('input').val(attachment.url); + $thisbutton.nextAll('input.image-id').val(attachment.id); + if ( $thisbutton.data('prev') === true ) { + $thisbutton.prev('input').prevAll('#preview-image').children('.saved-image').remove(); + $thisbutton.prev('input').prevAll('#preview-image').append(''); + } + $thisbutton.nextAll( '.generate-page-header-remove-image' ).show(); + if ( 'upload_image' == $thisbutton.prev( 'input' ).attr( 'id' ) ) { + jQuery( '.featured-image-message' ).hide(); + jQuery( '.page-header-image-settings' ).show(); + jQuery( '.generate-page-header-set-featured-image' ).hide(); + } + }); + + // everthing is set open the media manager + frame.open(); + }); +}); +jQuery(document).ready(function($) { + $('#generate-tabs-container .color-picker').wpColorPicker(); + + jQuery( '.generate-page-header-remove-image' ).on( 'click', function( e ) { + e.preventDefault(); + var input = jQuery( this ).data( 'input' ); + var input_id = jQuery( this ).data( 'input-id' ); + var preview = jQuery( this ).data( 'prev' ); + jQuery( input ).attr( 'value', '' ); + jQuery( input_id ).attr( 'value', '' ); + jQuery( preview ).children( '.saved-image' ).remove(); + jQuery( this ).hide(); + if ( '-1' == jQuery( '#_thumbnail_id' ).attr( 'value' ) ) { + jQuery( '.page-header-image-settings' ).hide(); + jQuery( '.generate-page-header-set-featured-image' ).show(); + + } else { + jQuery( '.generate-page-header-set-featured-image' ).hide(); + jQuery( '.page-header-image-settings' ).show(); + jQuery( '.featured-image-message' ).show(); + } + return false; + }); + + $('#postimagediv').on( 'click', '#remove-post-thumbnail', function() { + // The featured image is gone, so we can hide the message + jQuery( '.featured-image-message' ).hide(); + + // If there's no other image set, we can hide the image settings + if ( '' == jQuery( '#_meta-generate-page-header-image-id' ).attr( 'value' ) ) { + jQuery( '.page-header-image-settings' ).hide(); + jQuery( '.generate-page-header-set-featured-image' ).show(); + } + + // No more featured image means we can show the 'show excerpt' option + jQuery( '.show-in-excerpt' ).show(); + + return false; + }); + + wp.media.featuredImage.frame().on('select', function() { + + // We have a featured image, so the 'show excerpt' function isn't necessary + jQuery( '.show-in-excerpt' ).hide(); + + // We can stop here if we have a custom image set + if ( '' !== jQuery( '#_meta-generate-page-header-image-id' ).attr( 'value' ) ) + return; + + // Hide the set your featured image message + jQuery( '.generate-page-header-set-featured-image' ).hide(); + + // Show the "using feaured image" message + jQuery( '.featured-image-message' ).show(); + + // Show the image settings (image link, resizing etc..) + jQuery( '.page-header-image-settings' ).show(); + }); + + $( '.generate-featured-image, .generate-page-header-set-featured-image a' ).on( 'click', function( event ) { + event.preventDefault(); + + // Stop propagation to prevent thickbox from activating. + event.stopPropagation(); + + // Open the featured image modal + wp.media.featuredImage.frame().open(); + }); +}); \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/page-header/functions/js/parallax.js b/wp-content/plugins/gp-premium/page-header/functions/js/parallax.js new file mode 100644 index 0000000..8fe3b26 --- /dev/null +++ b/wp-content/plugins/gp-premium/page-header/functions/js/parallax.js @@ -0,0 +1,17 @@ +function generate_parallax_element( selector, context ) { + context = context || document; + var elements = context.querySelectorAll( selector ); + return Array.prototype.slice.call( elements ); +} + +window.addEventListener( "scroll", function() { + var scrolledHeight= window.pageYOffset; + generate_parallax_element( ".parallax-enabled" ).forEach( function( el, index, array ) { + var limit = el.offsetTop + el.offsetHeight; + if( scrolledHeight > el.offsetTop && scrolledHeight <= limit ) { + el.style.backgroundPositionY = ( scrolledHeight - el.offsetTop ) / el.getAttribute( 'data-parallax-speed' ) + "px"; + } else { + el.style.backgroundPositionY = "0"; + } + }); +}); \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/page-header/functions/js/parallax.min.js b/wp-content/plugins/gp-premium/page-header/functions/js/parallax.min.js new file mode 100644 index 0000000..8263a90 --- /dev/null +++ b/wp-content/plugins/gp-premium/page-header/functions/js/parallax.min.js @@ -0,0 +1 @@ +function generate_parallax_element(e,t){var a=(t=t||document).querySelectorAll(e);return Array.prototype.slice.call(a)}window.addEventListener("scroll",function(){var e=window.pageYOffset;generate_parallax_element(".parallax-enabled").forEach(function(t,a,o){var r=t.offsetTop+t.offsetHeight;e>t.offsetTop&&e<=r?t.style.backgroundPositionY=(e-t.offsetTop)/t.getAttribute("data-parallax-speed")+"px":t.style.backgroundPositionY="0"})}); \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/page-header/functions/js/wp-color-picker-alpha.min.js b/wp-content/plugins/gp-premium/page-header/functions/js/wp-color-picker-alpha.min.js new file mode 100644 index 0000000..c67aacc --- /dev/null +++ b/wp-content/plugins/gp-premium/page-header/functions/js/wp-color-picker-alpha.min.js @@ -0,0 +1,340 @@ +/**! + * wp-color-picker-alpha + * + * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker + * Only run in input and is defined data alpha in true + * + * Version: 1.2.2 + * https://github.com/23r9i0/wp-color-picker-alpha + * Copyright (c) 2015 Sergio P.A. (23r9i0). + * Licensed under the GPLv2 license. + */ +( function( $ ) { + // Variable for some backgrounds ( grid ) + var image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==', + // html stuff for wpColorPicker copy of the original color-picker.js + _before = '', + _after = '
        ', + _wrap = '
        ', + _button = '', + _wrappingLabel = '', + _wrappingLabelText = ''; + + /** + * Overwrite Color + * for enable support rbga + */ + Color.fn.toString = function() { + if ( this._alpha < 1 ) + return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' ); + + var hex = parseInt( this._color, 10 ).toString( 16 ); + + if ( this.error ) + return ''; + + if ( hex.length < 6 ) + hex = ( '00000' + hex ).substr( -6 ); + + return '#' + hex; + }; + + /** + * Overwrite wpColorPicker + */ + $.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, { + _create: function() { + // bail early for unsupported Iris. + if ( ! $.support.iris ) + return; + + var self = this, + el = self.element; + + self.inputWrapper = el.closest( '.wp-picker-input-wrap' ); + + $.extend( self.options, el.data() ); + + // keep close bound so it can be attached to a body listener + self.close = $.proxy( self.close, self ); + + self.initialValue = el.val(); + + // Set up HTML structure, hide things + el.addClass( 'wp-color-picker' ).wrap( _wrap ); + self.wrap = el.parent(); + self.toggler = $( _before ).insertBefore( el ).css( { backgroundColor : self.initialValue } ).attr( 'title', wpColorPickerL10n.pick ).attr( 'data-current', wpColorPickerL10n.current ); + self.pickerContainer = $( _after ).insertAfter( el ); + self.button = $( _button ); + + if ( self.options.defaultColor ) { + self.button.addClass( 'wp-picker-default' ).val( wpColorPickerL10n.defaultString ); + } else { + self.button.addClass( 'wp-picker-clear' ).val( wpColorPickerL10n.clear ); + } + + el.wrap( '
        ', + __( 'Content is required for the below settings to work.', 'gp-premium' ), + '' !== generate_page_header_get_post_meta( get_the_ID(), '_meta-generate-page-header-content', true ) ? 'style="display:none"' : '' + ); + + if ( '' !== generate_page_header_get_post_meta( get_the_ID(), '_meta-generate-page-header-content', true ) ) { + ?> + + +
        +
          +
        • + +
        • + +
        • + +
        • + +
        • + +
        • + + +
        • + +
        • + + +
        • + +
        • + + +
          > +

          +
          + /> +

          +
          + +
        +
        +
        + + + +
        + + + +
        + + + + + + + + +
        > +

        +
        + +

        + +

        +
        + +

        + + +
        +
        + +
        + + +

        + +
        + +
        +

        + /> + +

        + +

        + /> + +

        + +

        + /> + +

        + +

        + /> + +

        + +

        + /> + +

        + +

        + /> + +

        + +

        + /> + +

        +
        + +
        +

        +
        + +

        + +

        +
        + +

        + +

        +
        + +

        + +

        +
        + + +

        + +

        +
        + + +

        +
        + +
        +

        +
        + +

        + +

        +
        + +

        + +

        +
        + +

        + +

        +
        + +

        +
        +
        +
        +
        + + + + +
        + +

        + +

        + +
        + + + +
        + + + + + + + + +

        + +

        + +

        + +
        + + + +
        + + + + + + + + + +
        + + + +
        +
        + 'FILTER_CONTENT', + '_meta-generate-page-header-image' => 'FILTER_SANITIZE_URL', + '_meta-generate-page-header-image-id' => 'FILTER_SANITIZE_NUMBER_INT', + '_meta-generate-page-header-image-link' => 'FILTER_SANITIZE_URL', + '_meta-generate-page-header-enable-image-crop' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-crop' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-width' => 'FILTER_SANITIZE_NUMBER_INT', + '_meta-generate-page-header-image-height' => 'FILTER_SANITIZE_NUMBER_INT', + '_meta-generate-page-header-image-background-type' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-inner-container' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-alignment' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-spacing' => 'FILTER_SANITIZE_NUMBER_INT', + '_meta-generate-page-header-image-background-spacing-unit' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-left-right-padding' => 'FILTER_SANITIZE_NUMBER_INT', + '_meta-generate-page-header-left-right-padding-unit' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-color' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-text-color' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-link-color' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-link-color-hover' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-navigation-background' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-navigation-text' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-navigation-background-hover' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-navigation-text-hover' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-navigation-background-current' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-navigation-text-current' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-site-title' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-site-tagline' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-video' => 'FILTER_SANITIZE_URL', + '_meta-generate-page-header-video-ogv' => 'FILTER_SANITIZE_URL', + '_meta-generate-page-header-video-webm' => 'FILTER_SANITIZE_URL', + '_meta-generate-page-header-video-overlay' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-content-autop' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-content-padding' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-full-screen' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-vertical-center' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-fixed' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-image-background-overlay' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-combine' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-absolute-position' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-transparent-navigation' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-add-to-excerpt' => 'FILTER_SANITIZE_STRING', + '_meta-generate-page-header-logo' => 'FILTER_SANITIZE_URL', + '_meta-generate-page-header-logo-id' => 'FILTER_SANITIZE_NUMBER_INT', + '_meta-generate-page-header-navigation-logo' => 'FILTER_SANITIZE_URL', + '_meta-generate-page-header-navigation-logo-id' => 'FILTER_SANITIZE_NUMBER_INT', + ); + + if ( ! defined( 'GENERATE_LAYOUT_META_BOX' ) ) { + $options[ '_generate-select-page-header' ] = 'FILTER_SANITIZE_NUMBER_INT'; + } + + foreach ( $options as $key => $sanitize ) { + if ( 'FILTER_SANITIZE_STRING' == $sanitize ) { + $value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_STRING ); + } elseif ( 'FILTER_SANITIZE_URL' == $sanitize ) { + $value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_URL ); + } elseif ( 'FILTER_SANITIZE_NUMBER_INT' == $sanitize ) { + $value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_NUMBER_INT ); + } elseif ( 'FILTER_CONTENT' == $sanitize && isset( $_POST[ $key ] ) ) { + if ( current_user_can( 'unfiltered_html' ) ) { + $value = $_POST[ $key ]; + } else { + $value = wp_kses_post( $_POST[ $key ] ); + } + } else { + $value = filter_input( INPUT_POST, $key, FILTER_DEFAULT ); + } + + if ( $value ) { + update_post_meta( $post_id, $key, $value ); + } else { + delete_post_meta( $post_id, $key ); + } + } + } +} + +add_action( 'add_meta_boxes', 'generate_page_header_tags_add_meta_box' ); +/** + * Add our Template Tags meta box. + * + * @param WP_Post $post Current post object. + * + * @since 1.4 + */ +function generate_page_header_tags_add_meta_box( $post ) { + add_meta_box( 'generate_page_header_tags', __( 'Template Tags', 'gp-premium' ), 'generate_page_header_tags_do_meta_box', 'generate_page_header', 'side', 'low' ); +} + +/** + * Meta box display callback. + * + * @param WP_Post $post Current post object. + * + * @since 1.4 + */ +function generate_page_header_tags_do_meta_box( $post ) { + ?> + +

        + + +

        + + +

        + + +

        + + +

        + + + +
      • + ( ! empty( $options[ 'background_video' ] ) ) ? 'mp4:' . esc_url( $options[ 'background_video' ] ) : null, + 'ogv' => ( ! empty( $options[ 'background_video_ogv' ] ) ) ? 'ogv:' . esc_url( $options[ 'background_video_ogv' ] ) : null, + 'webm' => ( ! empty( $options[ 'background_video_webm' ] ) ) ? 'webm:' . esc_url( $options[ 'background_video_webm' ] ) : null, + 'poster' => ( ! empty( $image_url ) ) ? 'poster:' . esc_url( $image_url ) : null + ); + + // Add our videos to a string + $video_output = array(); + foreach( $video_types as $video => $val ) { + $video_output[] = $val; + } + + $video = null; + // Video variable + if ( $video_enabled && '' !== $options[ 'content' ] ) { + + $ext = ( ! empty( $image_url ) ) ? pathinfo( $image_url, PATHINFO_EXTENSION ) : false; + $video_options = array(); + + if ( $ext ) { + $video_options[ 'posterType' ] = 'posterType:' . $ext; + } else { + $video_options[ 'posterType' ] = 'posterType: none'; + } + + $video_options[ 'className' ] = 'className:generate-page-header-video'; + + if ( apply_filters( 'generate_page_header_video_loop', true ) ) { + $video_options[ 'loop' ] = 'loop:true'; + } else { + $video_options[ 'loop' ] = 'loop:false'; + } + + if ( apply_filters( 'generate_page_header_video_muted', true ) ) { + $video_options[ 'muted' ] = 'muted:true'; + } else { + $video_options[ 'muted' ] = 'muted:false'; + } + + $video_options[ 'autoplay' ] = 'autoplay:false'; + + $video = sprintf( ' data-vide-bg="%1$s" data-vide-options="%2$s"', + implode( ', ', array_filter( $video_output ) ), + implode( ', ', array_filter( $video_options ) ) + ); + } + + // Write a class if we're merging the header + $combined_content = ( '' !== $options[ 'merge' ] ) ? ' generate-combined-page-header' : ''; + + // If content is set, show it + if ( '' !== $options[ 'content' ] && false !== $options[ 'content' ] ) { + printf( + '
        +
        ', + ( 'fluid' == $options[ 'container_type' ] ) ? $video : null, + $content_class . $parallax . $full_screen . $vertical_center_container . $container_type . $combined_content . ' generate-page-header generate-content-header', + ( 'fluid' !== $options[ 'container_type' ] ) ? $video : null, + $vertical_center, + ( '' !== $options[ 'merge' ] ) ? 'generate-merged-header' : '', + ( ! empty( $parallax ) ) ? 'data-parallax-speed="' . esc_attr( $parallax_speed ) . '"' : '', + $options[ 'page_header_id' ] + ); + } + + do_action( 'generate_inside_merged_page_header' ); + } +} + +if ( ! function_exists( 'generate_page_header_area' ) ) { + /** + * Build our entire page header. + * + * @since 0.1 + * + * @param $image_class The class to give our element if it's an image. + * @param $content_class The class to give our element if it's content. + */ + function generate_page_header_area( $image_class, $content_class ) { + // Get our options + $options = generate_page_header_get_options(); + + // Get out of here if we don't have content or an image + if ( '' == $options[ 'content' ] && ! generate_page_header_get_image( 'ALL' ) ) { + return; + } + + $inner_container = ( '' == $options[ 'inner_container' ] ) ? ' grid-container grid-parent' : ''; + + do_action( 'generate_before_page_header' ); + + // If an image is set and no content is set + if ( '' == $options[ 'content' ] && generate_page_header_get_image( 'ALL' ) ) { + + printf( + '
        + %2$s + %4$s + %3$s +
        ', + esc_attr( $image_class ) . $inner_container . ' generate-page-header', + ( ! empty( $options[ 'image_link' ] ) ) ? '' : null, + ( ! empty( $options[ 'image_link' ] ) ) ? '' : null, + generate_page_header_get_image_output() + ); + + } + + // If content is set, show it + if ( '' !== $options[ 'content' ] && false !== $options[ 'content' ] ) { + // If we're not merging our header, we can start the container here + // If we were merging, the container would be added in the generate_before_header hook + if ( '' == $options[ 'merge' ] ) { + generate_page_header_area_start_container( 'page-header-image', 'page-header-content' ); + } + + // Replace any found template tags + $options[ 'content' ] = generate_page_header_template_tags( $options[ 'content' ] ); + + // Print the rest of our page header HTML + // The starting elements are inside generate_page_header_area_start_container() + printf ( '
        +
        + %4$s + %6$s + %5$s +
        +
        +
        +
        ', + ( '' !== $options[ 'merge' ] ) ? 'generate-combined-content' : '', + $inner_container, + ( '' !== $options[ 'merge' ] ) ? 'generate-inside-combined-content' : 'generate-inside-page-header-content', + ( ! empty( $options[ 'add_padding' ] ) ) ? '
        ' : null, + ( ! empty( $options[ 'add_padding' ] ) ) ? '
        ' : null, + ( ! empty( $options[ 'autop' ] ) ) ? do_shortcode( wpautop( $options[ 'content' ] ) ) : do_shortcode( $options[ 'content' ] ) + ); + } + + do_action( 'generate_after_page_header' ); + } +} diff --git a/wp-content/plugins/gp-premium/page-header/functions/post-image.php b/wp-content/plugins/gp-premium/page-header/functions/post-image.php new file mode 100644 index 0000000..b88250a --- /dev/null +++ b/wp-content/plugins/gp-premium/page-header/functions/post-image.php @@ -0,0 +1,60 @@ + + %2$s + %4$s + %3$s +
        ', + 'post-image page-header-post-image', + ( ! empty( $options[ 'image_link' ] ) ) ? '' : null, + ( ! empty( $options[ 'image_link' ] ) ) ? '' : null, + generate_page_header_get_image_output() + ); + } + + // If content is set, show it + if ( '' !== $options[ 'content' ] && false !== $options[ 'content' ] ) { + printf( + '
        +
        + %3$s + %5$s + %4$s +
        +
        ', + 'post-image generate-page-header generate-post-content-header page-header-post-image', + 'inside-page-header-container inside-post-content-header grid-container grid-parent', + ( ! empty( $options[ 'add_padding' ] ) ) ? '
        ' : null, + ( ! empty( $options[ 'add_padding' ] ) ) ? '
        ' : null, + ( ! empty( $options[ 'autop' ] ) ) ? do_shortcode( wpautop( $options[ 'content' ] ) ) : do_shortcode( $options[ 'content' ] ) + ); + } + } + } +} diff --git a/wp-content/plugins/gp-premium/page-header/functions/post-type.php b/wp-content/plugins/gp-premium/page-header/functions/post-type.php new file mode 100644 index 0000000..34cd95b --- /dev/null +++ b/wp-content/plugins/gp-premium/page-header/functions/post-type.php @@ -0,0 +1,236 @@ + _x( 'Page Headers', 'Post Type General Name', 'gp-premium' ), + 'singular_name' => _x( 'Page Header', 'Post Type Singular Name', 'gp-premium' ), + 'menu_name' => __( 'Page Headers', 'gp-premium' ), + 'name_admin_bar' => __( 'Page Header', 'gp-premium' ), + 'archives' => __( 'Page Header Archives', 'gp-premium' ), + 'parent_item_colon' => __( 'Parent Page Header:', 'gp-premium' ), + 'all_items' => __( 'All Page Headers', 'gp-premium' ), + 'add_new_item' => __( 'Add New Page Header', 'gp-premium' ), + 'new_item' => __( 'New Page Header', 'gp-premium' ), + 'edit_item' => __( 'Edit Page Header', 'gp-premium' ), + 'update_item' => __( 'Update Page Header', 'gp-premium' ), + 'view_item' => __( 'View Page Header', 'gp-premium' ), + 'search_items' => __( 'Search Page Header', 'gp-premium' ), + 'insert_into_item' => __( 'Insert into Page Header', 'gp-premium' ), + 'uploaded_to_this_item' => __( 'Uploaded to this Page Header', 'gp-premium' ), + ); + $args = array( + 'label' => __( 'Page Header', 'gp-premium' ), + 'labels' => $labels, + 'supports' => array( 'title', 'thumbnail' ), + 'hierarchical' => false, + 'public' => false, + 'show_ui' => true, + 'show_in_menu' => function_exists( 'generate_premium_do_elements' ) ? false : true, + 'menu_position' => 100, + 'menu_icon' => 'dashicons-welcome-widgets-menus', + 'show_in_admin_bar' => false, + 'show_in_nav_menus' => false, + 'can_export' => true, + 'has_archive' => false, + 'exclude_from_search' => true, + 'publicly_queryable' => false, + 'capability_type' => 'page', + ); + register_post_type( 'generate_page_header', $args ); + + $post_types = get_post_types( array( 'public' => true ) ); + $term_args = array( + 'sanitize_callback' => 'int', + 'type' => 'string', + 'description' => '', + 'single' => true, + 'show_in_rest' => true, + ); + foreach ( $post_types as $type ) { + register_meta( $type, 'generate_page_header', $term_args ); + } + + $taxonomies = get_taxonomies( array( 'public' => true ) ); + if ( $taxonomies ) { + foreach ( $taxonomies as $taxonomy ) { + add_action( $taxonomy . '_add_form_fields', 'generate_page_header_tax_new_ph_field' ); + add_action( $taxonomy . '_edit_form_fields', 'generate_page_header_tax_edit_ph_field' ); + add_action( 'edit_' . $taxonomy, 'generate_page_header_tax_save_ph' ); + add_action( 'create_' . $taxonomy, 'generate_page_header_tax_save_ph' ); + } + } +} + +add_action( 'admin_menu', 'generate_old_page_header_options_page' ); +/** + * Add our submenu page to the Appearance tab. + * + * @since 1.7 + */ +function generate_old_page_header_options_page() { + if ( ! function_exists( 'generate_premium_do_elements' ) ) { + return; + } + + add_submenu_page( + 'themes.php', + esc_html__( 'Page Headers', 'gp-premium' ), + esc_html__( 'Page Headers', 'gp-premium' ), + 'manage_options', + 'edit.php?post_type=generate_page_header' + ); +} + +add_action( 'admin_head', 'generate_old_page_header_fix_menu' ); +/** + * Set our current menu in the admin while in the old Page Header pages. + * + * @since 1.7 + */ +function generate_old_page_header_fix_menu() { + if ( ! function_exists( 'generate_premium_do_elements' ) ) { + return; + } + + global $parent_file, $submenu_file, $post_type; + + $screen = get_current_screen(); + + if ( 'generate_page_header' === $post_type || 'appearance_page_page-header-global-locations' === $screen->base ) { + $parent_file = 'themes.php'; + $submenu_file = 'edit.php?post_type=gp_elements'; + } + + remove_submenu_page( 'themes.php', 'edit.php?post_type=generate_page_header' ); + remove_submenu_page( 'themes.php', 'page-header-global-locations' ); +} + +add_action( 'admin_head', 'generate_page_header_add_legacy_locations_button', 999 ); +/** + * Add legacy buttons to our new GP Elements post type. + * + * @since 1.7 + */ +function generate_page_header_add_legacy_locations_button() { + if ( ! function_exists( 'generate_premium_do_elements' ) ) { + return; + } + + $screen = get_current_screen(); + + if ( 'generate_page_header' === $screen->post_type ) : + ?> + + post_type && 'edit' === $screen->base ) : + ?> + + +
        + + +
        + + + + + + + + + + +_selector !== '' ){ + $this->add_selector_rules_to_output(); + } + $this->_selector = $selector; + return $this; + } + + public function add_property( $property, $value, $og_default = false, $unit = false ) + { + // Add our unit to the value if it exists + if ( $unit && '' !== $unit ) { + $value = $value . $unit; + if ( '' !== $og_default ) { + $og_default = $og_default . $unit; + } + } + + // If we don't have a value or our value is the same as our og default, bail + if ( empty( $value ) || $og_default == $value ) + return false; + + $this->_css .= $property . ':' . $value . ';'; + return $this; + } + + private function add_selector_rules_to_output() + { + if( !empty( $this->_css ) ) { + $this->_selector_output = $this->_selector; + $selector_output = sprintf( '%1$s{%2$s}', $this->_selector_output, $this->_css ); + + $this->_output .= $selector_output; + + // Reset the css + $this->_css = ''; + } + + return $this; + } + + public function css_output() + { + // Add current selector's rules to output + $this->add_selector_rules_to_output(); + + // Output minified css + return $this->_output; + } + +} +endif; \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/secondary-nav/functions/css/mobile.css b/wp-content/plugins/gp-premium/secondary-nav/functions/css/mobile.css new file mode 100644 index 0000000..fdd88af --- /dev/null +++ b/wp-content/plugins/gp-premium/secondary-nav/functions/css/mobile.css @@ -0,0 +1,103 @@ +.secondary-navigation.toggled ul ul { + transition: 0s; +} + +.dropdown-hover .secondary-navigation.toggled ul li:hover > ul, +.dropdown-hover .secondary-navigation.toggled ul li.sfHover > ul { + transition-delay: 0s; +} + +.secondary-navigation.toggled ul ul { + visibility: hidden; +} + +.secondary-navigation.toggled ul ul.toggled-on { + visibility: visible; +} + +.secondary-navigation.toggled .main-nav ul ul.toggled-on { + position: relative; + top: 0; + left: auto !important; + right: auto !important; + width: 100%; + pointer-events: auto; + height: auto; + opacity: 1; + display: block; +} + +.secondary-navigation.toggled .main-nav > ul { + display: block; +} + +.secondary-navigation.toggled .main-nav ul ul { + position: relative; + top: 0; + left: 0; + width: 100%; +} + +.secondary-navigation.toggled .main-nav .sf-menu > li { + float: none; + clear: both; + display: block !important; + text-align: left !important; +} + +.secondary-navigation.toggled .main-nav .sf-menu > li.hide-on-mobile { + display: none !important; +} + +.secondary-navigation.toggled .dropdown-menu-toggle:before { + content: "\f107" !important; +} + +.secondary-navigation.toggled .sfHover > a .dropdown-menu-toggle:before { + content: "\f106" !important; +} + +.secondary-navigation.toggled .menu-item-has-children .dropdown-menu-toggle { + float: right; +} + +.secondary-navigation.toggled .sf-menu > li.menu-item-float-right { + float: none !important; + display: inline-block; +} + +.rtl .secondary-navigation.toggled .main-nav .sf-menu > li { + text-align: right !important; +} + +@media (max-width: 768px) { + .secondary-navigation .menu-toggle { + display: block; + } + + .secondary-navigation ul { + display: none; + } + + .secondary-nav-aligned-left .secondary-navigation .top-bar { + position: absolute; + right: 0; + } + + .secondary-nav-aligned-left .secondary-navigation .top-bar + .menu-toggle { + text-align: left; + } + + .secondary-nav-aligned-right .secondary-navigation .top-bar { + position: absolute; + left: 0; + } + + .secondary-nav-aligned-right .secondary-navigation .top-bar + .menu-toggle { + text-align: right; + } + + .secondary-nav-aligned-center .secondary-navigation .top-bar + .menu-toggle + div { + display: block; + } +} diff --git a/wp-content/plugins/gp-premium/secondary-nav/functions/css/mobile.min.css b/wp-content/plugins/gp-premium/secondary-nav/functions/css/mobile.min.css new file mode 100644 index 0000000..3d04621 --- /dev/null +++ b/wp-content/plugins/gp-premium/secondary-nav/functions/css/mobile.min.css @@ -0,0 +1 @@ +.secondary-navigation.toggled ul ul{transition:0s;visibility:hidden}.dropdown-hover .secondary-navigation.toggled ul li.sfHover>ul,.dropdown-hover .secondary-navigation.toggled ul li:hover>ul{transition-delay:0s}.secondary-navigation.toggled ul ul.toggled-on{visibility:visible}.secondary-navigation.toggled .main-nav ul ul.toggled-on{position:relative;top:0;left:auto!important;right:auto!important;width:100%;pointer-events:auto;height:auto;opacity:1;display:block}.secondary-navigation.toggled .main-nav>ul{display:block}.secondary-navigation.toggled .main-nav ul ul{position:relative;top:0;left:0;width:100%}.secondary-navigation.toggled .main-nav .sf-menu>li{float:none;clear:both;display:block!important;text-align:left!important}.secondary-navigation.toggled .main-nav .sf-menu>li.hide-on-mobile{display:none!important}.secondary-navigation.toggled .dropdown-menu-toggle:before{content:"\f107"!important}.secondary-navigation.toggled .sfHover>a .dropdown-menu-toggle:before{content:"\f106"!important}.secondary-navigation.toggled .menu-item-has-children .dropdown-menu-toggle{float:right}.secondary-navigation.toggled .sf-menu>li.menu-item-float-right{float:none!important;display:inline-block}.rtl .secondary-navigation.toggled .main-nav .sf-menu>li{text-align:right!important}@media (max-width:768px){.secondary-nav-aligned-center .secondary-navigation .top-bar+.menu-toggle+div,.secondary-navigation .menu-toggle{display:block}.secondary-navigation ul{display:none}.secondary-nav-aligned-left .secondary-navigation .top-bar{position:absolute;right:0}.secondary-nav-aligned-left .secondary-navigation .top-bar+.menu-toggle{text-align:left}.secondary-nav-aligned-right .secondary-navigation .top-bar{position:absolute;left:0}.secondary-nav-aligned-right .secondary-navigation .top-bar+.menu-toggle{text-align:right}} diff --git a/wp-content/plugins/gp-premium/secondary-nav/functions/css/style.css b/wp-content/plugins/gp-premium/secondary-nav/functions/css/style.css new file mode 100644 index 0000000..638775f --- /dev/null +++ b/wp-content/plugins/gp-premium/secondary-nav/functions/css/style.css @@ -0,0 +1,349 @@ +.secondary-navigation { + clear: both; +} + +.secondary-navigation ul { + list-style: none; + margin: 0; + padding-left: 0; +} + +.secondary-navigation li { + float: left; + position: relative; +} + +.secondary-navigation a { + display: block; + text-decoration: none; +} + +.secondary-navigation ul ul { + display: block; + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1); + float: left; + position: absolute; + left: -99999px; + opacity: 0; + z-index: 99999; + width: 200px; + text-align: left; + top: auto; + transition: opacity 80ms linear; + transition-delay: 0s; + pointer-events: none; + height: 0; + overflow: hidden; +} + +.secondary-navigation ul ul li { + width: 100%; +} + +.secondary-navigation.sub-menu-left .sub-menu { + right: 0; +} + +.dropdown-hover .secondary-navigation:not(.toggled) ul li:hover > ul, +.dropdown-hover .secondary-navigation:not(.toggled) ul li.sfHover > ul { + left: auto; + opacity: 1; + transition-delay: 150ms; + pointer-events: auto; + height: auto; + overflow: visible; +} + +.dropdown-hover .secondary-navigation:not(.toggled) ul ul li:hover > ul, +.dropdown-hover .secondary-navigation:not(.toggled) ul ul li.sfHover > ul { + left: 100%; + top: 0; +} + +.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li:hover > ul, +.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li.sfHover > ul { + right: 100%; + top: 0; + left: auto; +} + +.secondary-nav-float-right .secondary-navigation { + float: right; +} + +.secondary-navigation .main-nav ul ul li a, +.secondary-nav-float-right .secondary-navigation .main-nav ul ul li a { + line-height: normal; +} + +.secondary-nav-float-right .secondary-navigation ul ul ul{ + top: 0 +} + +.secondary-nav-float-left .inside-header .secondary-navigation { + float: left; + clear: left; +} + +.secondary-nav-float-left:not(.nav-float-right) .inside-header .site-branding, +.secondary-nav-float-left:not(.nav-float-right) .inside-header .site-logo { + float: right; + clear: right; +} + +.secondary-nav-float-left.nav-float-right .inside-header .site-branding, +.secondary-nav-float-left.nav-float-right .inside-header .site-logo, +.nav-float-left.secondary-nav-float-right .inside-header .site-branding, +.nav-float-left.secondary-nav-float-right .inside-header .site-logo { + float: none; + clear: none; +} + +.secondary-nav-float-left .inside-header:after { + clear: both; + content: ''; + display: table; +} + +.secondary-nav-float-left.nav-float-right .site-header, +.nav-float-left.secondary-nav-float-right .site-header { + text-align: center; +} + +.secondary-navigation { + z-index: 99; +} + +.secondary-navigation { + padding: 0; +} + +.secondary-navigation .menu-toggle { + margin: 0; +} + +.secondary-navigation ul ul li a { + line-height: normal; +} + +.secondary-navigation ul ul li a { + font-size: 90%; +} + +.widget-area .secondary-navigation li { + display: block; + float: none; + margin: 0; + padding: 0; + width: 100%; +} + +.widget-area .secondary-navigation ul ul { + left: 100%; + top: 0; + width: 220px; +} + +.both-right .widget-area .secondary-navigation ul ul, +.right-sidebar .widget-area .secondary-navigation ul ul, +.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul { + left: auto; + right: 100%; +} + +.secondary-nav-aligned-right.secondary-nav-below-header .secondary-navigation .sf-menu > li, +.secondary-nav-aligned-right.secondary-nav-above-header .secondary-navigation .sf-menu > li, +.secondary-nav-aligned-center.secondary-nav-below-header .secondary-navigation .sf-menu > li, +.secondary-nav-aligned-center.secondary-nav-above-header .secondary-navigation .sf-menu > li { + float: none; + display: inline-block; +} + +.secondary-nav-aligned-right .secondary-navigation ul, +.secondary-nav-aligned-center .secondary-navigation ul { + font-size: 0px; +} + +.secondary-nav-aligned-left.secondary-nav-below-header .secondary-navigation, +.secondary-nav-aligned-left.secondary-nav-above-header .secondary-navigation { + text-align: left; +} + +.secondary-nav-aligned-center.secondary-nav-below-header .secondary-navigation, +.secondary-nav-aligned-center.secondary-nav-above-header .secondary-navigation { + text-align: center; +} + +.secondary-nav-aligned-right.secondary-nav-below-header .secondary-navigation, +.secondary-nav-aligned-right.secondary-nav-above-header .secondary-navigation { + text-align: right; +} + +.dropdown-click .secondary-navigation ul ul { + visibility: hidden; +} + +.dropdown-click .secondary-navigation ul.toggled-on, +.dropdown-click .secondary-navigation ul li.sfHover > ul.toggled-on { + left: auto; + opacity: 1; + visibility: visible; + pointer-events: auto; + height: auto; + overflow: visible; +} + +.dropdown-click .secondary-navigation ul ul ul.toggled-on { + left: 0; + top: auto; + position: relative; +} + +.dropdown-click.both-right .widget-area .secondary-navigation ul ul, +.dropdown-click.right-sidebar .widget-area .secondary-navigation ul ul, +.dropdown-click.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul { + right: 0; +} + +.dropdown-click .widget-area .secondary-navigation ul ul { + top: auto; + position: absolute; + float: none; + width: 100%; + left: -99999px; +} + +.dropdown-click .widget-area .secondary-navigation ul ul.toggled-on { + position: relative; + left: 0; + right: 0; +} + +.secondary-navigation .main-nav ul li.menu-item-has-children > a { + padding-right: 0; + position: relative; +} + +.widget-area .secondary-navigation li { + float: none; + display: block; + width: 100%; + padding: 0; + margin: 0; +} + +.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, +.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li.sfHover > ul { + top: 0; + left: 100%; + width:220px; +} + +.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, +.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul, +.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li:hover ul, +.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul, +.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li:hover ul, +.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li.sfHover ul { + right: 100%; + left: auto; +} + +.widget-area .secondary-navigation ul ul { + top: 0; + left: 100%; + width: 220px; +} + +.rtl .secondary-navigation ul ul { + float: right; + left: auto; + right: 0; + text-align: right; +} + +.rtl .secondary-navigation ul ul ul { + left: auto; + right: 100%; +} + +.rtl .secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle { + transform: rotate(180deg); +} + +/* Default styles */ +.widget-area .secondary-navigation { + margin-bottom: 11px; +} + +.secondary-navigation ul ul { + top: auto; +} + +.secondary-navigation .main-nav ul li a, +.secondary-navigation .menu-toggle { + font-family: inherit; + font-weight: normal; + text-transform: none; + font-size: 13px; + padding-left: 20px; + padding-right: 20px; + line-height: 40px; +} + +.secondary-navigation .main-nav ul ul li a { + font-size: 12px; + padding-left: 20px; + padding-right: 20px; + padding-top: 10px; + padding-bottom: 10px; +} + +.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle { + padding-top: 10px; + padding-bottom: 10px; + margin-top: -10px; +} + +.secondary-navigation .menu-item-has-children .dropdown-menu-toggle { + padding-right: 20px; +} + +/* Top bar */ +.secondary-navigation .top-bar { + background: transparent; +} + +.secondary-navigation .inside-top-bar { + padding: 0; +} + +.secondary-navigation .top-bar a { + display: inline; +} + +.secondary-nav-aligned-right .secondary-navigation .top-bar { + float: left; +} + +.secondary-nav-aligned-right .secondary-navigation .top-bar .inside-top-bar .widget { + margin: 0 10px; +} + +.secondary-nav-aligned-left .secondary-navigation .top-bar { + float: right; +} + +.secondary-nav-aligned-left .secondary-navigation .top-bar .inside-top-bar .widget { + margin-left: 10px; +} + +.secondary-nav-aligned-center .secondary-navigation .top-bar, +.secondary-nav-aligned-center .secondary-navigation .top-bar + .menu-toggle + div { + display: inline-block; + vertical-align: middle; +} + +.secondary-nav-aligned-center .secondary-navigation .top-bar .widget:not(:first-child) { + margin-left: 10px; +} diff --git a/wp-content/plugins/gp-premium/secondary-nav/functions/css/style.min.css b/wp-content/plugins/gp-premium/secondary-nav/functions/css/style.min.css new file mode 100644 index 0000000..64687c0 --- /dev/null +++ b/wp-content/plugins/gp-premium/secondary-nav/functions/css/style.min.css @@ -0,0 +1 @@ +.secondary-navigation{clear:both;z-index:99;padding:0}.secondary-navigation ul{list-style:none;margin:0;padding-left:0}.secondary-navigation li{float:left;position:relative}.secondary-navigation a{display:block;text-decoration:none}.secondary-navigation ul ul{display:block;box-shadow:0 2px 2px rgba(0,0,0,.1);float:left;position:absolute;left:-99999px;opacity:0;z-index:99999;width:200px;text-align:left;transition:opacity 80ms linear;transition-delay:0s;pointer-events:none;height:0;overflow:hidden;top:auto}.secondary-navigation ul ul li{width:100%}.secondary-navigation.sub-menu-left .sub-menu{right:0}.dropdown-hover .secondary-navigation:not(.toggled) ul li.sfHover>ul,.dropdown-hover .secondary-navigation:not(.toggled) ul li:hover>ul{left:auto;opacity:1;transition-delay:150ms;pointer-events:auto;height:auto;overflow:visible}.dropdown-hover .secondary-navigation:not(.toggled) ul ul li.sfHover>ul,.dropdown-hover .secondary-navigation:not(.toggled) ul ul li:hover>ul{left:100%;top:0}.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li.sfHover>ul,.dropdown-hover .secondary-navigation.sub-menu-left:not(.toggled) ul ul li:hover>ul{right:100%;top:0;left:auto}.secondary-nav-float-right .secondary-navigation{float:right}.secondary-nav-float-right .secondary-navigation .main-nav ul ul li a,.secondary-navigation .main-nav ul ul li a,.secondary-navigation ul ul li a{line-height:normal}.secondary-nav-float-right .secondary-navigation ul ul ul{top:0}.secondary-nav-float-left .inside-header .secondary-navigation{float:left;clear:left}.secondary-nav-float-left:not(.nav-float-right) .inside-header .site-branding,.secondary-nav-float-left:not(.nav-float-right) .inside-header .site-logo{float:right;clear:right}.nav-float-left.secondary-nav-float-right .inside-header .site-branding,.nav-float-left.secondary-nav-float-right .inside-header .site-logo,.secondary-nav-float-left.nav-float-right .inside-header .site-branding,.secondary-nav-float-left.nav-float-right .inside-header .site-logo{float:none;clear:none}.secondary-nav-float-left .inside-header:after{clear:both;content:'';display:table}.nav-float-left.secondary-nav-float-right .site-header,.secondary-nav-float-left.nav-float-right .site-header{text-align:center}.secondary-navigation .menu-toggle{margin:0}.secondary-navigation ul ul li a{font-size:90%}.widget-area .secondary-navigation li{float:none;display:block;width:100%;padding:0;margin:0}.both-right .widget-area .secondary-navigation ul ul,.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul,.right-sidebar .widget-area .secondary-navigation ul ul,.rtl .secondary-navigation ul ul ul{left:auto;right:100%}.secondary-nav-aligned-center.secondary-nav-above-header .secondary-navigation .sf-menu>li,.secondary-nav-aligned-center.secondary-nav-below-header .secondary-navigation .sf-menu>li,.secondary-nav-aligned-right.secondary-nav-above-header .secondary-navigation .sf-menu>li,.secondary-nav-aligned-right.secondary-nav-below-header .secondary-navigation .sf-menu>li{float:none;display:inline-block}.secondary-nav-aligned-center .secondary-navigation ul,.secondary-nav-aligned-right .secondary-navigation ul{font-size:0}.secondary-nav-aligned-left.secondary-nav-above-header .secondary-navigation,.secondary-nav-aligned-left.secondary-nav-below-header .secondary-navigation{text-align:left}.secondary-nav-aligned-center.secondary-nav-above-header .secondary-navigation,.secondary-nav-aligned-center.secondary-nav-below-header .secondary-navigation{text-align:center}.secondary-nav-aligned-right.secondary-nav-above-header .secondary-navigation,.secondary-nav-aligned-right.secondary-nav-below-header .secondary-navigation{text-align:right}.dropdown-click .secondary-navigation ul ul{visibility:hidden}.dropdown-click .secondary-navigation ul li.sfHover>ul.toggled-on,.dropdown-click .secondary-navigation ul.toggled-on{left:auto;opacity:1;visibility:visible;pointer-events:auto;height:auto;overflow:visible}.dropdown-click .secondary-navigation ul ul ul.toggled-on{left:0;top:auto;position:relative}.dropdown-click.both-right .widget-area .secondary-navigation ul ul,.dropdown-click.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation ul ul,.dropdown-click.right-sidebar .widget-area .secondary-navigation ul ul{right:0}.dropdown-click .widget-area .secondary-navigation ul ul{top:auto;position:absolute;float:none;width:100%;left:-99999px}.dropdown-click .widget-area .secondary-navigation ul ul.toggled-on{position:relative;left:0;right:0}.secondary-navigation .main-nav ul li.menu-item-has-children>a{padding-right:0;position:relative}.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li.sfHover>ul,.dropdown-hover .widget-area .secondary-navigation:not(.toggled) ul li:hover ul{top:0;left:100%;width:220px}.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.both-right .widget-area .secondary-navigation:not(.toggled) ul li:hover ul,.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.both-sidebars .widget-area .inside-right-sidebar .secondary-navigation:not(.toggled) ul li:hover ul,.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li.sfHover ul,.dropdown-hover.right-sidebar .widget-area .secondary-navigation:not(.toggled) ul li:hover ul{right:100%;left:auto}.widget-area .secondary-navigation ul ul{top:0;left:100%;width:220px}.rtl .secondary-navigation ul ul{float:right;left:auto;right:0;text-align:right}.rtl .secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle{transform:rotate(180deg)}.widget-area .secondary-navigation{margin-bottom:11px}.secondary-navigation .main-nav ul li a,.secondary-navigation .menu-toggle{font-family:inherit;font-weight:400;text-transform:none;font-size:13px;padding-left:20px;padding-right:20px;line-height:40px}.secondary-navigation .main-nav ul ul li a{font-size:12px;padding:10px 20px}.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle{padding-top:10px;padding-bottom:10px;margin-top:-10px}.secondary-navigation .menu-item-has-children .dropdown-menu-toggle{padding-right:20px}.secondary-navigation .top-bar{background:0 0}.secondary-navigation .inside-top-bar{padding:0}.secondary-navigation .top-bar a{display:inline}.secondary-nav-aligned-right .secondary-navigation .top-bar{float:left}.secondary-nav-aligned-right .secondary-navigation .top-bar .inside-top-bar .widget{margin:0 10px}.secondary-nav-aligned-left .secondary-navigation .top-bar{float:right}.secondary-nav-aligned-left .secondary-navigation .top-bar .inside-top-bar .widget{margin-left:10px}.secondary-nav-aligned-center .secondary-navigation .top-bar,.secondary-nav-aligned-center .secondary-navigation .top-bar+.menu-toggle+div{display:inline-block;vertical-align:middle}.secondary-nav-aligned-center .secondary-navigation .top-bar .widget:not(:first-child){margin-left:10px} diff --git a/wp-content/plugins/gp-premium/secondary-nav/functions/functions.php b/wp-content/plugins/gp-premium/secondary-nav/functions/functions.php new file mode 100644 index 0000000..f8e8ecd --- /dev/null +++ b/wp-content/plugins/gp-premium/secondary-nav/functions/functions.php @@ -0,0 +1,1090 @@ + __( 'Secondary Menu', 'gp-premium' ), + ) ); + } +} + +if ( ! function_exists( 'generate_secondary_nav_enqueue_scripts' ) ) { + add_action( 'wp_enqueue_scripts', 'generate_secondary_nav_enqueue_scripts', 100 ); + /** + * Add our necessary scripts + * @since 0.1 + */ + function generate_secondary_nav_enqueue_scripts() { + // Bail if no Secondary menu is set + if ( ! has_nav_menu( 'secondary' ) ) { + return; + } + + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + wp_enqueue_style( 'generate-secondary-nav', plugin_dir_url( __FILE__ ) . "css/style{$suffix}.css", array(), GENERATE_SECONDARY_NAV_VERSION ); + if ( ! defined( 'GENERATE_DISABLE_MOBILE' ) ) { + wp_add_inline_script( 'generate-navigation', + "jQuery( document ).ready( function($) { + $( '.secondary-navigation .menu-toggle' ).on( 'click', function( e ) { + e.preventDefault(); + $( this ).closest( '.secondary-navigation' ).toggleClass( 'toggled' ); + $( this ).closest( '.secondary-navigation' ).attr( 'aria-expanded', $( this ).closest( '.secondary-navigation' ).attr( 'aria-expanded' ) === 'true' ? 'false' : 'true' ); + $( this ).toggleClass( 'toggled' ); + $( this ).children( 'i' ).toggleClass( 'fa-bars' ).toggleClass( 'fa-close' ); + $( this ).attr( 'aria-expanded', $( this ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' ); + }); + });" + ); + + wp_enqueue_style( 'generate-secondary-nav-mobile', plugin_dir_url( __FILE__ ) . "css/mobile{$suffix}.css", array(), GENERATE_SECONDARY_NAV_VERSION, 'all' ); + } + } +} + +if ( ! function_exists( 'generate_secondary_nav_enqueue_customizer_scripts' ) ) { + add_action( 'customize_preview_init', 'generate_secondary_nav_enqueue_customizer_scripts' ); + /** + * Add our Customizer preview JS. + * + * @since 0.1 + */ + function generate_secondary_nav_enqueue_customizer_scripts() { + wp_enqueue_script( 'generate-secondary-nav-customizer', plugin_dir_url( __FILE__ ) . 'js/customizer.js', array( 'jquery', 'customize-preview' ), GENERATE_SECONDARY_NAV_VERSION, true ); + } +} + +if ( ! function_exists( 'generate_secondary_nav_get_defaults' ) ) { + /** + * Set default options. + * + * @since 0.1 + */ + function generate_secondary_nav_get_defaults( $filter = true ) { + $generate_defaults = array( + 'secondary_nav_mobile_label' => 'Menu', + 'secondary_nav_layout_setting' => 'secondary-fluid-nav', + 'secondary_nav_inner_width' => 'contained', + 'secondary_nav_position_setting' => 'secondary-nav-above-header', + 'secondary_nav_alignment' => 'right', + 'secondary_nav_dropdown_direction' => 'right', + 'navigation_background_color' => '#636363', + 'navigation_text_color' => '#ffffff', + 'navigation_background_hover_color' => '#303030', + 'navigation_text_hover_color' => '#ffffff', + 'navigation_background_current_color' => '#ffffff', + 'navigation_text_current_color' => '#222222', + 'subnavigation_background_color' => '#303030', + 'subnavigation_text_color' => '#ffffff', + 'subnavigation_background_hover_color' => '#474747', + 'subnavigation_text_hover_color' => '#ffffff', + 'subnavigation_background_current_color' => '#474747', + 'subnavigation_text_current_color' => '#ffffff', + 'secondary_menu_item' => '20', + 'secondary_menu_item_height' => '40', + 'secondary_sub_menu_item_height' => '10', + 'font_secondary_navigation' => 'inherit', + 'font_secondary_navigation_variants' => '', + 'font_secondary_navigation_category' => '', + 'secondary_navigation_font_weight' => 'normal', + 'secondary_navigation_font_transform' => 'none', + 'secondary_navigation_font_size' => '13', + 'nav_image' => '', + 'nav_repeat' => '', + 'nav_item_image' => '', + 'nav_item_repeat' => '', + 'nav_item_hover_image' => '', + 'nav_item_hover_repeat' => '', + 'nav_item_current_image' => '', + 'nav_item_current_repeat' => '', + 'sub_nav_image' => '', + 'sub_nav_repeat' => '', + 'sub_nav_item_image' => '', + 'sub_nav_item_repeat' => '', + 'sub_nav_item_hover_image' => '', + 'sub_nav_item_hover_repeat' => '', + 'sub_nav_item_current_image' => '', + 'sub_nav_item_current_repeat' => '', + 'merge_top_bar' => false + ); + + if ( $filter ) { + return apply_filters( 'generate_secondary_nav_option_defaults', $generate_defaults ); + } + + return $generate_defaults; + } +} + +if ( ! function_exists( 'generate_secondary_nav_customize_register' ) ) { + add_action( 'customize_register', 'generate_secondary_nav_customize_register', 100 ); + /** + * Register our options. + * + * @since 0.1 + */ + function generate_secondary_nav_customize_register( $wp_customize ) { + // Get our defaults + $defaults = generate_secondary_nav_get_defaults(); + + // Controls + require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; + + if ( method_exists( $wp_customize, 'register_control_type' ) ) { + $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); + } + + // Use the Layout panel in the free theme if it exists + if ( $wp_customize->get_panel( 'generate_layout_panel' ) ) { + $layout_panel = 'generate_layout_panel'; + } else { + $layout_panel = 'secondary_navigation_panel'; + } + + // Add our secondary navigation panel + // This shouldn't be used anymore if the theme is up to date + if ( class_exists( 'WP_Customize_Panel' ) ) { + $wp_customize->add_panel( 'secondary_navigation_panel', array( + 'priority' => 100, + 'capability' => 'edit_theme_options', + 'theme_supports' => '', + 'title' => __( 'Secondary Navigation', 'gp-premium' ), + 'description' => '', + ) ); + } + + // Add secondary navigation section + $wp_customize->add_section( + 'secondary_nav_section', + array( + 'title' => __( 'Secondary Navigation', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 31, + 'panel' => $layout_panel + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_secondary_navigation_layout_shortcuts', + array( + 'section' => 'secondary_nav_section', + 'element' => __( 'Secondary Navigation', 'gp-premium' ), + 'shortcuts' => array( + 'colors' => 'secondary_navigation_color_section', + 'typography' => 'secondary_font_section', + 'backgrounds' => 'secondary_bg_images_section', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + // Mobile menu label + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_nav_mobile_label]', + array( + 'default' => $defaults['secondary_nav_mobile_label'], + 'type' => 'option', + 'sanitize_callback' => 'wp_kses_post' + ) + ); + + $wp_customize->add_control( + 'secondary_nav_mobile_label_control', array( + 'label' => __( 'Mobile Menu Label', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'settings' => 'generate_secondary_nav_settings[secondary_nav_mobile_label]', + 'priority' => 10 + ) + ); + + // Navigation width + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_nav_layout_setting]', + array( + 'default' => $defaults['secondary_nav_layout_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + 'generate_secondary_nav_settings[secondary_nav_layout_setting]', + array( + 'type' => 'select', + 'label' => __( 'Navigation Width', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'choices' => array( + 'secondary-fluid-nav' => _x( 'Full', 'Width', 'gp-premium' ), + 'secondary-contained-nav' => _x( 'Contained', 'Width', 'gp-premium' ) + ), + 'settings' => 'generate_secondary_nav_settings[secondary_nav_layout_setting]', + 'priority' => 15 + ) + ); + + // Inner navigation width + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_nav_inner_width]', + array( + 'default' => $defaults['secondary_nav_inner_width'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + 'generate_secondary_nav_settings[secondary_nav_inner_width]', + array( + 'type' => 'select', + 'label' => __( 'Inner Navigation Width', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'choices' => array( + 'full-width' => _x( 'Full', 'Width', 'gp-premium' ), + 'contained' => _x( 'Contained', 'Width', 'gp-premium' ) + ), + 'settings' => 'generate_secondary_nav_settings[secondary_nav_inner_width]', + 'priority' => 15 + ) + ); + + // Navigation alignment + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_nav_alignment]', + array( + 'default' => $defaults['secondary_nav_alignment'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + 'generate_secondary_nav_settings[secondary_nav_alignment]', + array( + 'type' => 'select', + 'label' => __( 'Navigation Alignment', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'choices' => array( + 'left' => __( 'Left', 'gp-premium' ), + 'center' => __( 'Center', 'gp-premium' ), + 'right' => __( 'Right', 'gp-premium' ) + ), + 'settings' => 'generate_secondary_nav_settings[secondary_nav_alignment]', + 'priority' => 20 + ) + ); + + // Navigation location + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_nav_position_setting]', + array( + 'default' => $defaults['secondary_nav_position_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + 'generate_secondary_nav_settings[secondary_nav_position_setting]', + array( + 'type' => 'select', + 'label' => __( 'Navigation Location', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'choices' => array( + 'secondary-nav-below-header' => __( 'Below Header', 'gp-premium' ), + 'secondary-nav-above-header' => __( 'Above Header', 'gp-premium' ), + 'secondary-nav-float-right' => __( 'Float Right', 'gp-premium' ), + 'secondary-nav-float-left' => __( 'Float Left', 'gp-premium' ), + 'secondary-nav-left-sidebar' => __( 'Left Sidebar', 'gp-premium' ), + 'secondary-nav-right-sidebar' => __( 'Right Sidebar', 'gp-premium' ), + '' => __( 'No Navigation', 'gp-premium' ) + ), + 'settings' => 'generate_secondary_nav_settings[secondary_nav_position_setting]', + 'priority' => 30 + ) + ); + + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_nav_dropdown_direction]', + array( + 'default' => $defaults['secondary_nav_dropdown_direction'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices', + ) + ); + + $wp_customize->add_control( + 'generate_secondary_nav_settings[secondary_nav_dropdown_direction]', + array( + 'type' => 'select', + 'label' => __( 'Dropdown Direction', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'choices' => array( + 'right' => __( 'Right', 'gp-premium' ), + 'left' => __( 'Left', 'gp-premium' ), + ), + 'settings' => 'generate_secondary_nav_settings[secondary_nav_dropdown_direction]', + 'priority' => 35 + ) + ); + + // Merge top bar + $wp_customize->add_setting( + 'generate_secondary_nav_settings[merge_top_bar]', + array( + 'default' => $defaults['merge_top_bar'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_secondary_nav_settings[merge_top_bar]', + array( + 'type' => 'checkbox', + 'label' => __( 'Merge with Secondary Navigation', 'gp-premium' ), + 'section' => 'generate_top_bar', + 'settings' => 'generate_secondary_nav_settings[merge_top_bar]', + 'priority' => 100, + 'active_callback' => 'generate_secondary_nav_show_merge_top_bar' + ) + ); + } +} + +if ( ! function_exists( 'generate_display_secondary_google_fonts' ) ) { + add_filter( 'generate_typography_google_fonts', 'generate_display_secondary_google_fonts', 50 ); + /** + * Add Google Fonts to wp_head if needed. + * + * @since 0.1 + */ + function generate_display_secondary_google_fonts($google_fonts) { + + // Bail if no Secondary menu is set + if ( ! has_nav_menu( 'secondary' ) ) { + return $google_fonts; + } + + $generate_secondary_nav_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + // List our non-Google fonts + if ( function_exists( 'generate_typography_default_fonts' ) ) { + $not_google = str_replace( ' ', '+', generate_typography_default_fonts() ); + } else { + $not_google = array( + 'inherit', + 'Arial,+Helvetica,+sans-serif', + 'Century+Gothic', + 'Comic+Sans+MS', + 'Courier+New', + 'Georgia,+Times+New+Roman,+Times,+serif', + 'Helvetica', + 'Impact', + 'Lucida+Console', + 'Lucida+Sans+Unicode', + 'Palatino+Linotype', + 'Tahoma,+Geneva,+sans-serif', + 'Trebuchet+MS,+Helvetica,+sans-serif', + 'Verdana,+Geneva,+sans-serif' + ); + } + + // Create our Google Fonts array + $secondary_google_fonts = array(); + + if ( function_exists( 'generate_get_google_font_variants' ) ) { + + // If our value is still using the old format, fix it + if ( strpos( $generate_secondary_nav_settings[ 'font_secondary_navigation' ], ':' ) !== false ) { + $generate_secondary_nav_settings[ 'font_secondary_navigation' ] = current( explode( ':', $generate_secondary_nav_settings[ 'font_secondary_navigation' ] ) ); + } + + // Grab the variants using the plain name + $variants = generate_get_google_font_variants( $generate_secondary_nav_settings[ 'font_secondary_navigation' ], 'font_secondary_navigation', generate_secondary_nav_get_defaults() ); + + } else { + $variants = ''; + } + + // Replace the spaces in the names with a plus + $value = str_replace( ' ', '+', $generate_secondary_nav_settings[ 'font_secondary_navigation' ] ); + + // If we have variants, add them to our value + $value = ! empty( $variants ) ? $value . ':' . $variants : $value; + + // Add our value to the array + $secondary_google_fonts[] = $value; + + // Ignore any non-Google fonts + $secondary_google_fonts = array_diff($secondary_google_fonts, $not_google); + + // Separate each different font with a bar + $secondary_google_fonts = implode('|', $secondary_google_fonts); + + if ( !empty( $secondary_google_fonts ) ) { + $print_secondary_fonts = '|' . $secondary_google_fonts; + } else { + $print_secondary_fonts = ''; + } + + // Remove any duplicates + $return = $google_fonts . $print_secondary_fonts; + $return = implode('|',array_unique(explode('|', $return))); + return $return; + + } +} + +if ( ! function_exists( 'generate_add_secondary_navigation_after_header' ) ) { + add_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 7 ); + /** + * Add the navigation after the header. + * + * @since 0.1 + */ + function generate_add_secondary_navigation_after_header() { + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( 'secondary-nav-below-header' == $generate_settings['secondary_nav_position_setting'] ) { + generate_secondary_navigation_position(); + } + + } +} + +if ( ! function_exists( 'generate_add_secondary_navigation_before_header' ) ) { + add_action( 'generate_before_header', 'generate_add_secondary_navigation_before_header', 7 ); + /** + * Add the navigation before the header. + * + * @since 0.1 + */ + function generate_add_secondary_navigation_before_header() { + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( 'secondary-nav-above-header' == $generate_settings['secondary_nav_position_setting'] ) { + generate_secondary_navigation_position(); + } + + } +} + +if ( ! function_exists( 'generate_add_secondary_navigation_float_right' ) ) { + add_action( 'generate_before_header_content', 'generate_add_secondary_navigation_float_right', 7 ); + /** + * Add the navigation inside the header so it can float right. + * + * @since 0.1 + */ + function generate_add_secondary_navigation_float_right() { + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( 'secondary-nav-float-right' == $generate_settings['secondary_nav_position_setting'] || 'secondary-nav-float-left' == $generate_settings['secondary_nav_position_setting'] ) { + generate_secondary_navigation_position(); + } + + } +} + +if ( ! function_exists( 'generate_add_secondary_navigation_before_right_sidebar' ) ) { + add_action( 'generate_before_right_sidebar_content', 'generate_add_secondary_navigation_before_right_sidebar', 7 ); + /** + * Add the navigation into the right sidebar. + * + * @since 0.1 + */ + function generate_add_secondary_navigation_before_right_sidebar() { + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( 'secondary-nav-right-sidebar' == $generate_settings['secondary_nav_position_setting'] ) { + echo '
        '; + generate_secondary_navigation_position(); + echo '
        '; + } + + } +} + +if ( ! function_exists( 'generate_add_secondary_navigation_before_left_sidebar' ) ) { + add_action( 'generate_before_left_sidebar_content', 'generate_add_secondary_navigation_before_left_sidebar', 7 ); + /** + * Add the navigation into the left sidebar. + * + * @since 0.1 + */ + function generate_add_secondary_navigation_before_left_sidebar() { + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( 'secondary-nav-left-sidebar' == $generate_settings['secondary_nav_position_setting'] ) { + echo '
        '; + generate_secondary_navigation_position(); + echo '
        '; + } + + } +} + +if ( ! function_exists( 'generate_secondary_navigation_position' ) ) { + /** + * Build our secondary navigation. + * Would like to change this function name. + * + * @since 0.1 + */ + function generate_secondary_navigation_position() { + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + if ( has_nav_menu( 'secondary' ) ) : + ?> + + + + section using the Theme Customizer. + * + * @since 0.1 + */ + function generate_secondary_nav_css() { + + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + if ( function_exists( 'generate_spacing_get_defaults' ) ) { + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + $separator = $spacing_settings[ 'separator' ]; + } else { + $separator = 20; + } + + if ( function_exists( 'generate_get_font_family_css' ) ) { + $secondary_nav_family = generate_get_font_family_css( 'font_secondary_navigation', 'generate_secondary_nav_settings', generate_secondary_nav_get_defaults() ); + } else { + $secondary_nav_family = current( explode( ':', $generate_settings['font_secondary_navigation'] ) ); + } + + if ( '""' == $secondary_nav_family ) { + $secondary_nav_family = 'inherit'; + } + + // Get our untouched defaults + $og_defaults = generate_secondary_nav_get_defaults( false ); + + // Initiate our CSS class + $css = new GeneratePress_Secondary_Nav_CSS; + + // Navigation background + $css->set_selector( '.secondary-navigation' ); + $css->add_property( 'background-color', esc_attr( $generate_settings[ 'navigation_background_color' ] ) ); + $css->add_property( 'background-image', !empty( $generate_settings['nav_image'] ) ? 'url(' . esc_url( $generate_settings['nav_image'] ) . ')' : '' ); + $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_repeat'] ) ); + + // Top bar + if ( 'secondary-nav-above-header' == $generate_settings[ 'secondary_nav_position_setting' ] && has_nav_menu( 'secondary' ) && is_active_sidebar( 'top-bar' ) ) { + $css->set_selector( '.secondary-navigation .top-bar' ); + $css->add_property( 'color', esc_attr( $generate_settings[ 'navigation_text_color' ] ) ); + $css->add_property( 'line-height', absint( $generate_settings[ 'secondary_menu_item_height' ] ), false, 'px' ); + $css->add_property( 'font-family', $secondary_nav_family ); + $css->add_property( 'font-weight', esc_attr( $generate_settings[ 'secondary_navigation_font_weight' ] ) ); + $css->add_property( 'text-transform', esc_attr( $generate_settings[ 'secondary_navigation_font_transform' ] ) ); + $css->add_property( 'font-size', absint( $generate_settings[ 'secondary_navigation_font_size' ] ), false, 'px' ); + + $css->set_selector( '.secondary-navigation .top-bar a' ); + $css->add_property( 'color', esc_attr( $generate_settings[ 'navigation_text_color' ] ) ); + + $css->set_selector( '.secondary-navigation .top-bar a:hover, .secondary-navigation .top-bar a:focus' ); + $css->add_property( 'color', esc_attr( $generate_settings[ 'navigation_background_hover_color' ] ) ); + } + + // Navigation text + $css->set_selector( '.secondary-navigation .main-nav ul li a,.secondary-navigation .menu-toggle' ); + $css->add_property( 'color', esc_attr( $generate_settings[ 'navigation_text_color' ] ) ); + $css->add_property( 'font-family', ( 'inherit' !== $secondary_nav_family ) ? $secondary_nav_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings[ 'secondary_navigation_font_weight' ] ), $og_defaults[ 'secondary_navigation_font_weight' ] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings[ 'secondary_navigation_font_transform' ] ), $og_defaults[ 'secondary_navigation_font_transform' ] ); + $css->add_property( 'font-size', absint( $generate_settings[ 'secondary_navigation_font_size' ] ), $og_defaults[ 'secondary_navigation_font_size' ], 'px' ); + $css->add_property( 'padding-left', absint( $generate_settings[ 'secondary_menu_item' ] ), $og_defaults[ 'secondary_menu_item' ], 'px' ); + $css->add_property( 'padding-right', absint( $generate_settings[ 'secondary_menu_item' ] ), $og_defaults[ 'secondary_menu_item' ], 'px' ); + $css->add_property( 'line-height', absint( $generate_settings[ 'secondary_menu_item_height' ] ), $og_defaults[ 'secondary_menu_item_height' ], 'px' ); + $css->add_property( 'background-image', !empty( $generate_settings['nav_item_image'] ) ? 'url(' . esc_url( $generate_settings['nav_item_image'] ) . ')' : '' ); + $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_repeat'] ) ); + + // Mobile menu text on hover + $css->set_selector( 'button.secondary-menu-toggle:hover,button.secondary-menu-toggle:focus' ); + $css->add_property( 'color', esc_attr( $generate_settings[ 'navigation_text_color' ] ) ); + + // Widget area navigation + $css->set_selector( '.widget-area .secondary-navigation' ); + $css->add_property( 'margin-bottom', absint( $separator ), false, 'px' ); + + // Sub-navigation background + $css->set_selector( '.secondary-navigation ul ul' ); + $css->add_property( 'background-color', esc_attr( $generate_settings[ 'subnavigation_background_color' ] ) ); + $css->add_property( 'top', 'auto' ); // Added for compatibility purposes on 22/12/2016 + + // Sub-navigation text + $css->set_selector( '.secondary-navigation .main-nav ul ul li a' ); + $css->add_property( 'color', esc_attr( $generate_settings[ 'subnavigation_text_color' ] ) ); + $css->add_property( 'font-size', absint( $generate_settings[ 'secondary_navigation_font_size' ] - 1 ), absint( $og_defaults[ 'secondary_navigation_font_size' ] - 1 ), 'px' ); + $css->add_property( 'padding-left', absint( $generate_settings[ 'secondary_menu_item' ] ), $og_defaults[ 'secondary_menu_item' ], 'px' ); + $css->add_property( 'padding-right', absint( $generate_settings[ 'secondary_menu_item' ] ), $og_defaults[ 'secondary_menu_item' ], 'px' ); + $css->add_property( 'padding-top', absint( $generate_settings[ 'secondary_sub_menu_item_height' ] ), $og_defaults[ 'secondary_sub_menu_item_height' ], 'px' ); + $css->add_property( 'padding-bottom', absint( $generate_settings[ 'secondary_sub_menu_item_height' ] ), $og_defaults[ 'secondary_sub_menu_item_height' ], 'px' ); + $css->add_property( 'background-image', !empty( $generate_settings['sub_nav_item_image'] ) ? 'url(' . esc_url( $generate_settings['sub_nav_item_image'] ) . ')' : '' ); + $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_repeat'] ) ); + + // Menu item padding on RTL + if ( is_rtl() ) { + $css->set_selector( 'nav.secondary-navigation .main-nav ul li.menu-item-has-children > a' ); + $css->add_property( 'padding-right', absint( $generate_settings[ 'secondary_menu_item' ] ), $og_defaults[ 'secondary_menu_item' ], 'px' ); + } + + // Dropdown arrow + $css->set_selector( '.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle' ); + $css->add_property( 'padding-top', absint( $generate_settings[ 'secondary_sub_menu_item_height' ] ), $og_defaults[ 'secondary_sub_menu_item_height' ], 'px' ); + $css->add_property( 'padding-bottom', absint( $generate_settings[ 'secondary_sub_menu_item_height' ] ), $og_defaults[ 'secondary_sub_menu_item_height' ], 'px' ); + $css->add_property( 'margin-top', '-' . absint( $generate_settings[ 'secondary_sub_menu_item_height' ] ), '-' . absint( $og_defaults[ 'secondary_sub_menu_item_height' ] ), 'px' ); + + // Dropdown arrow + $css->set_selector( '.secondary-navigation .menu-item-has-children .dropdown-menu-toggle' ); + $css->add_property( 'padding-right', absint( $generate_settings[ 'secondary_menu_item' ] ), $og_defaults[ 'secondary_menu_item' ], 'px' ); + + // Sub-navigation dropdown arrow + $css->set_selector( '.secondary-navigation .menu-item-has-children ul .dropdown-menu-toggle' ); + $css->add_property( 'padding-top', absint( $generate_settings[ 'secondary_sub_menu_item_height' ] ), $og_defaults[ 'secondary_sub_menu_item_height' ], 'px' ); + $css->add_property( 'padding-bottom', absint( $generate_settings[ 'secondary_sub_menu_item_height' ] ), $og_defaults[ 'secondary_sub_menu_item_height' ], 'px' ); + $css->add_property( 'margin-top', '-' . absint( $generate_settings[ 'secondary_sub_menu_item_height' ] ), '-' . absint( $og_defaults[ 'secondary_sub_menu_item_height' ] ), 'px' ); + + // Navigation background/text on hover + $css->set_selector( '.secondary-navigation .main-nav ul li:hover > a,.secondary-navigation .main-nav ul li:focus > a,.secondary-navigation .main-nav ul li.sfHover > a' ); + $css->add_property( 'color', esc_attr( $generate_settings[ 'navigation_text_hover_color' ] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings[ 'navigation_background_hover_color' ] ) ); + $css->add_property( 'background-image', !empty( $generate_settings[ 'nav_item_hover_image' ] ) ? 'url(' . esc_url( $generate_settings[ 'nav_item_hover_image' ] ) . ')' : '' ); + $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_hover_repeat'] ) ); + + // Sub-Navigation background/text on hover + $css->set_selector( '.secondary-navigation .main-nav ul ul li:hover > a,.secondary-navigation .main-nav ul ul li:focus > a,.secondary-navigation .main-nav ul ul li.sfHover > a' ); + $css->add_property( 'color', esc_attr( $generate_settings[ 'subnavigation_text_hover_color' ] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings[ 'subnavigation_background_hover_color' ] ) ); + $css->add_property( 'background-image', !empty( $generate_settings[ 'sub_nav_item_hover_image' ] ) ? 'url(' . esc_url( $generate_settings[ 'sub_nav_item_hover_image' ] ) . ')' : '' ); + $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_hover_repeat'] ) ); + + // Navigation background / text current + hover + $css->set_selector( '.secondary-navigation .main-nav ul li[class*="current-menu-"] > a, .secondary-navigation .main-nav ul li[class*="current-menu-"] > a:hover,.secondary-navigation .main-nav ul li[class*="current-menu-"].sfHover > a' ); + $css->add_property( 'color', esc_attr( $generate_settings[ 'navigation_text_current_color' ] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings[ 'navigation_background_current_color' ] ) ); + $css->add_property( 'background-image', !empty( $generate_settings[ 'nav_item_current_image' ] ) ? 'url(' . esc_url( $generate_settings[ 'nav_item_current_image' ] ) . ')' : '' ); + $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_current_repeat'] ) ); + + // Sub-Navigation background / text current + hover + $css->set_selector( '.secondary-navigation .main-nav ul ul li[class*="current-menu-"] > a,.secondary-navigation .main-nav ul ul li[class*="current-menu-"] > a:hover,.secondary-navigation .main-nav ul ul li[class*="current-menu-"].sfHover > a' ); + $css->add_property( 'color', esc_attr( $generate_settings[ 'subnavigation_text_current_color' ] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings[ 'subnavigation_background_current_color' ] ) ); + $css->add_property( 'background-image', !empty( $generate_settings[ 'sub_nav_item_current_image' ] ) ? 'url(' . esc_url( $generate_settings[ 'sub_nav_item_current_image' ] ) . ')' : '' ); + $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_current_repeat'] ) ); + + // RTL menu item padding + if ( is_rtl() ) { + $css->set_selector( '.secondary-navigation .main-nav ul li.menu-item-has-children > a' ); + $css->add_property( 'padding-right', absint( $generate_settings[ 'secondary_menu_item' ] ), false, 'px' ); + } + + if ( function_exists( 'generate_get_option' ) && function_exists( 'generate_get_defaults' ) ) { + $theme_defaults = generate_get_defaults(); + + if ( isset( $theme_defaults['icons'] ) ) { + if ( 'svg' === generate_get_option( 'icons' ) ) { + $css->set_selector( '.secondary-navigation.toggled .dropdown-menu-toggle:before' ); + $css->add_property( 'display', 'none' ); + } + } + } + + // Return our dynamic CSS + return $css->css_output(); + } +} + +if ( ! function_exists( 'generate_secondary_color_scripts' ) ) { + add_action( 'wp_enqueue_scripts', 'generate_secondary_color_scripts', 110 ); + /** + * Enqueue scripts and styles + */ + function generate_secondary_color_scripts() { + // Bail if no Secondary menu is set + if ( ! has_nav_menu( 'secondary' ) ) { + return; + } + + wp_add_inline_style( 'generate-secondary-nav', generate_secondary_nav_css() ); + } +} + +if ( ! function_exists( 'generate_secondary_navigation_class' ) ) { + /** + * Display the classes for the secondary navigation. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_secondary_navigation_class( $class = '' ) { + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', generate_get_secondary_navigation_class( $class ) ) . '"'; + } +} + +if ( ! function_exists( 'generate_get_secondary_navigation_class' ) ) { + /** + * Retrieve the classes for the secondary navigation. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ + function generate_get_secondary_navigation_class( $class = '' ) { + + $classes = array(); + + if ( !empty($class) ) { + if ( !is_array( $class ) ) + $class = preg_split('#\s+#', $class); + $classes = array_merge($classes, $class); + } + + $classes = array_map('esc_attr', $classes); + + return apply_filters('generate_secondary_navigation_class', $classes, $class); + } +} + +if ( ! function_exists( 'generate_secondary_menu_class' ) ) { + /** + * Display the classes for the secondary navigation. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_secondary_menu_class( $class = '' ) { + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', generate_get_secondary_menu_class( $class ) ) . '"'; + } +} + +if ( ! function_exists( 'generate_get_secondary_menu_class' ) ) { + /** + * Retrieve the classes for the secondary navigation. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ + function generate_get_secondary_menu_class( $class = '' ) { + + $classes = array(); + + if ( !empty($class) ) { + if ( !is_array( $class ) ) + $class = preg_split('#\s+#', $class); + $classes = array_merge($classes, $class); + } + + $classes = array_map('esc_attr', $classes); + + return apply_filters('generate_secondary_menu_class', $classes, $class); + } +} + +if ( ! function_exists( 'generate_inside_secondary_navigation_class' ) ) { + /** + * Display the classes for the inner navigation. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_inside_secondary_navigation_class( $class = '' ) { + $classes = array(); + + if ( ! empty($class) ) { + if ( ! is_array( $class ) ) { + $class = preg_split('#\s+#', $class); + } + + $classes = array_merge($classes, $class); + } + + $classes = array_map('esc_attr', $classes); + + $return = apply_filters('generate_inside_secondary_navigation_class', $classes, $class); + + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', $return ) . '"'; + } +} + +if ( ! function_exists( 'generate_hidden_secondary_navigation' ) && function_exists( 'is_customize_preview' ) ) { + add_action( 'wp_footer', 'generate_hidden_secondary_navigation' ); + /** + * Adds a hidden navigation if no navigation is set + * This allows us to use postMessage to position the navigation when it doesn't exist + */ + function generate_hidden_secondary_navigation() { + if ( is_customize_preview() && function_exists( 'generate_secondary_navigation_position' ) ) { + ?> +
        + +
        + +
        +
        + +
        +
        + .secondary-navigation .main-nav ul li a, .secondary-navigation .menu-toggle{padding: 0 ' + newval + 'px;}.secondary-navigation .menu-item-has-children .dropdown-menu-toggle{padding-right:' + newval + 'px;}' ); + setTimeout(function() { + jQuery( 'style#secondary_menu_item' ).not( ':last' ).remove(); + }, 50); + } ); + } ); + + wp.customize( 'generate_secondary_nav_settings[secondary_menu_item_height]', function( value ) { + value.bind( function( newval ) { + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#secondary_menu_item_height' ).not( ':last' ).remove(); + }, 50); + } ); + } ); + + wp.customize( 'generate_secondary_nav_settings[secondary_sub_menu_item_height]', function( value ) { + value.bind( function( newval ) { + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#secondary_sub_menu_item_height' ).not( ':last' ).remove(); + }, 50); + } ); + } ); + +})( jQuery ); \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/secondary-nav/generate-secondary-nav.php b/wp-content/plugins/gp-premium/secondary-nav/generate-secondary-nav.php new file mode 100644 index 0000000..77b7ad6 --- /dev/null +++ b/wp-content/plugins/gp-premium/secondary-nav/generate-secondary-nav.php @@ -0,0 +1,19 @@ + *:last-child { + margin-bottom: 0; +} + +.generate-sections-container { + background-size: cover; +} + +.generate-sections-container.no-padding .generate-sections-inside-container { + padding: 0px !important; +} + +.generate-sections-enabled.one-container .site-content { + padding: 0; +} + +.generate-sections-enabled.one-container .container { + background: transparent; +} + +.generate-sections-enabled.one-container .site-main { + margin: 0 !important; +} + +.generate-sections-enabled .entry-content { + text-align: center; +} + +.separate-containers .site-main > .generate-sections-container { + margin-bottom: 0; +} \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/sections/functions/css/style.min.css b/wp-content/plugins/gp-premium/sections/functions/css/style.min.css new file mode 100644 index 0000000..802b011 --- /dev/null +++ b/wp-content/plugins/gp-premium/sections/functions/css/style.min.css @@ -0,0 +1 @@ +.sections-no-sidebars.generate-sections-enabled .container.grid-container,.sections-sidebars.no-sidebar.generate-sections-enabled .container.grid-container{max-width:100%}.sections-no-sidebars.generate-sections-enabled #primary.content-area,.sections-sidebars.no-sidebar.generate-sections-enabled #primary.content-area{width:100%}.sections-no-sidebars.generate-sections-enabled.separate-containers #main.site-main,.sections-no-sidebars.generate-sections-enabled.separate-containers .hentry,.sections-sidebars.no-sidebar.generate-sections-enabled.separate-containers #main.site-main,.sections-sidebars.no-sidebar.generate-sections-enabled.separate-containers .hentry{margin:0}.generate-sections-inside-container>:last-child{margin-bottom:0}.generate-sections-container{background-size:cover}.generate-sections-container.no-padding .generate-sections-inside-container{padding:0!important}.generate-sections-enabled.one-container .site-content{padding:0}.generate-sections-enabled.one-container .container{background:0 0}.generate-sections-enabled.one-container .site-main{margin:0!important}.generate-sections-enabled .entry-content{text-align:center}.separate-containers .site-main>.generate-sections-container{margin-bottom:0} \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/sections/functions/generate-sections.php b/wp-content/plugins/gp-premium/sections/functions/generate-sections.php new file mode 100644 index 0000000..2703c8e --- /dev/null +++ b/wp-content/plugins/gp-premium/sections/functions/generate-sections.php @@ -0,0 +1,329 @@ +ID, '_generate_use_sections', TRUE) : ''; + + if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) { + return $template; + } + + if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { + + $new_template = dirname( __FILE__ ) . '/templates/template.php'; + + if ( '' != $new_template ) { + return $new_template; + } + } + return $template; + + } +} + +if ( ! function_exists( 'generate_sections_show_excerpt' ) ) { + add_filter( 'generate_show_excerpt', 'generate_sections_show_excerpt' ); + /** + * If Sections is enabled on a post, make sure we use the excerpt field on the blog page + */ + function generate_sections_show_excerpt( $show_excerpt ) { + global $post; + $use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : ''; + + if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { + return true; + } + + return $show_excerpt; + } +} + +if ( ! function_exists( 'generate_sections_styles' ) ) { + add_action( 'wp_enqueue_scripts', 'generate_sections_styles' ); + /** + * Enqueue necessary scripts if sections are enabled + */ + function generate_sections_styles() { + + global $post; + $use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : ''; + + // Bail if we're on a posts page + if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) { + return; + } + + if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { + wp_enqueue_style( 'generate-sections-styles', plugin_dir_url( __FILE__ ) . 'css/style.min.css' ); + wp_enqueue_script( 'generate-sections-parallax', plugin_dir_url( __FILE__ ) . 'js/parallax.min.js', array(), GENERATE_SECTIONS_VERSION, true ); + } + } +} + +if ( ! function_exists( 'generate_sections_body_classes' ) ) { + add_filter( 'body_class', 'generate_sections_body_classes' ); + /** + * Add classes to our element when sections are enabled + */ + function generate_sections_body_classes( $classes ) { + global $post; + $use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : ''; + $sidebars = apply_filters( 'generate_sections_sidebars', false ); + + // Bail if we're on a posts page + if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) { + return $classes; + } + + if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) { + $classes[] = 'generate-sections-enabled'; + } + + if ( ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) && ! $sidebars ) { + $classes[] = 'sections-no-sidebars'; + } + + if ( ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) && $sidebars ) { + $classes[] = 'sections-sidebars'; + } + + return $classes; + } +} + +if ( ! function_exists( 'generate_sections_add_css' ) ) { + add_action( 'wp_enqueue_scripts', 'generate_sections_add_css', 500 ); + /** + * Create the CSS for our sections + */ + function generate_sections_add_css() { + global $post; + $use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : ''; + + if ( ! isset( $use_sections['use_sections'] ) ) { + return; + } + + if ( 'true' !== $use_sections['use_sections'] ) { + return; + } + + if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) { + return; + } + + if ( function_exists( 'generate_spacing_get_defaults' ) ) { + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + + $left_padding = $spacing_settings['content_left']; + $right_padding = $spacing_settings['content_right']; + $mobile_padding_left = ( isset( $spacing_settings[ 'mobile_content_left' ] ) ) ? $spacing_settings[ 'mobile_content_left' ] : 30; + $mobile_padding_right = ( isset( $spacing_settings[ 'mobile_content_right' ] ) ) ? $spacing_settings[ 'mobile_content_right' ] : 30; + } else { + $right_padding = 40; + $left_padding = 40; + $mobile_padding = 30; + } + + $sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_sections', TRUE) : ''; + + // check if the repeater field has rows of data + if ( $sections && '' !== $sections ) { + + $css = '.generate-sections-inside-container {padding-left:' . $left_padding . 'px;padding-right:' . $right_padding . 'px;}'; + // loop through the rows of data + $i = 0; + foreach ( $sections['sections'] as $section ) : + $i++; + + // Get image details + $image_id = ( isset( $section['background_image'] ) && '' !== $section['background_image'] ) ? intval( $section['background_image'] ) : ''; + $image_url = ( '' !== $image_id ) ? wp_get_attachment_image_src( $image_id, 'full' ) : ''; + + // Get the padding type + $padding_type = apply_filters( 'generate_sections_padding_type','px' ); + + // If someone has changed the padding type using a filter, use their value + if ( 'px' !== $padding_type ) { + $top_padding_type = $padding_type; + $bottom_padding_type = $padding_type; + } else { + $top_padding_type = ( isset( $section['top_padding_unit'] ) && '' !== $section['top_padding_unit'] ) ? $section['top_padding_unit'] : $padding_type; + $bottom_padding_type = ( isset( $section['bottom_padding_unit'] ) && '' !== $section['bottom_padding_unit'] ) ? $section['bottom_padding_unit'] : $padding_type; + } + + // Default padding top + $padding_top = apply_filters( 'generate_sections_default_padding_top','40' ); + + // Default padding bottom + $padding_bottom = apply_filters( 'generate_sections_default_padding_bottom','40' ); + + $custom_id = ( isset( $section['custom_id'] ) ) ? $section['custom_id'] : ''; + $custom_id = ( '' == $custom_id ) ? "generate-section-$i" : $custom_id; + + // Get the values + $background_color = ( isset( $section['background_color'] ) && '' !== $section['background_color'] ) ? 'background-color:' . esc_attr( $section['background_color'] ) . ';' : ''; + $background_image = ( ! empty( $image_url[0] ) ) ? 'background-image:url(' . esc_url( $image_url[0] ) . ');' : ''; + + if ( isset( $section['background_color_overlay'] ) && '' !== $section['background_color_overlay'] ) { + if ( '' !== $background_image && '' !== $background_color ) { + $background_image = 'background-image:linear-gradient(0deg, ' . $section['background_color'] . ',' . $section['background_color'] . '), url(' . esc_url( $image_url[0] ) . ');'; + $background_color = ''; + } + } + + $text_color = ( isset( $section['text_color'] ) && '' !== $section['text_color'] ) ? 'color:' . esc_attr( $section['text_color'] ) . ';' : ''; + $link_color = ( isset( $section['link_color'] ) && '' !== $section['link_color'] ) ? 'color:' . esc_attr( $section['link_color'] ) . ';' : ''; + $link_color_hover = ( isset( $section['link_color_hover'] ) && '' !== $section['link_color_hover'] ) ? 'color:' . esc_attr( $section['link_color_hover'] ) . ';' : ''; + $top_padding = ( isset( $section['top_padding'] ) && '' !== $section['top_padding'] ) ? 'padding-top:' . absint( $section['top_padding'] ) . $top_padding_type . ';' : 'padding-top:' . $padding_top . 'px;'; + $bottom_padding = ( isset( $section['bottom_padding'] ) && '' !== $section['bottom_padding'] ) ? 'padding-bottom:' . absint( $section['bottom_padding'] ) . $bottom_padding_type . ';' : 'padding-bottom:' . $padding_bottom . 'px;'; + + // Outer container + if ( '' !== $background_color || '' !== $background_image ) { + $css .= '#' . $custom_id . '.generate-sections-container{' . $background_color . $background_image . '}'; + } + + // Inner container + if ( '' !== $top_padding || '' !== $bottom_padding || '' !== $text_color ) { + $css .= '#' . $custom_id . ' .generate-sections-inside-container{' . $top_padding . $bottom_padding . $text_color . '}'; + } + + // Link color + if ( '' !== $link_color ) { + $css .= '#' . $custom_id . ' a,#generate-section-' . $i . ' a:visited{' . $link_color . '}'; + } + + // Link color hover + if ( '' !== $link_color_hover ) { + $css .= '#' . $custom_id . ' a:hover{' . $link_color_hover . '}'; + } + + $mobile = generate_premium_get_media_query( 'mobile' ); + $css .= '@media ' . esc_attr( $mobile ) . ' {.generate-sections-inside-container {padding-left: ' . $mobile_padding_left . 'px;padding-right: ' . $mobile_padding_right . 'px;}}'; + endforeach; + + // Build CSS + wp_add_inline_style( 'generate-style', $css ); + + } + } +} + +if ( ! function_exists( 'generate_sections_filter_admin_init' ) ) { + add_action( 'admin_init', 'generate_sections_filter_admin_init' ); + /* + * Recreate the default filters on the_content + * this will make it much easier to output the meta content with proper/expected formatting + */ + function generate_sections_filter_admin_init() { + if ( user_can_richedit() ) { + add_filter( 'generate_section_content', 'convert_smilies' ); + add_filter( 'generate_section_content', 'convert_chars' ); + add_filter( 'generate_section_content', 'wpautop' ); + add_filter( 'generate_section_content', 'shortcode_unautop' ); + add_filter( 'generate_section_content', 'prepend_attachment' ); + } + } +} + +if ( ! function_exists( 'generate_sections_filter' ) ) { + add_action( 'init', 'generate_sections_filter' ); + /* + * Recreate the default filters on the_content + * this will make it much easier to output the meta content with proper/expected formatting + */ + function generate_sections_filter() { + if ( is_admin() ) { + return; + } + + add_filter( 'generate_section_content', 'convert_smilies' ); + add_filter( 'generate_section_content', 'convert_chars' ); + add_filter( 'generate_section_content', 'wpautop' ); + add_filter( 'generate_section_content', 'shortcode_unautop' ); + add_filter( 'generate_section_content', 'prepend_attachment' ); + add_filter( 'generate_section_content', 'do_shortcode'); + + add_filter( 'generate_the_section_content', array($GLOBALS['wp_embed'], 'autoembed'), 9 ); + } +} + +if ( ! function_exists( 'generate_sections_save_content' ) ) { + add_action( 'save_post', 'generate_sections_save_content', 99, 4 ); + /* + * When we save our post, grab all of the section content and save it as regular content. + * + * This will prevent content loss/theme lock. + */ + function generate_sections_save_content( $post_id, $post ) { + + if ( ! isset( $_POST['_generate_sections_nonce'] ) || ! wp_verify_nonce( $_POST['_generate_sections_nonce'], 'generate_sections_nonce' ) ) { + return; + } + + if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) { + return; + } + + if ( ! current_user_can('edit_post', $post_id ) ) { + return; + } + + // See if we're using sections + $use_sections = get_post_meta( $post_id, '_generate_use_sections', true); + + // Make sure use sections exists and that we're not saving a revision + if ( ! isset( $use_sections['use_sections'] ) || wp_is_post_revision( $post_id ) ) { + return; + } + + // Return if sections are set to false + if ( 'true' !== $use_sections['use_sections'] ) { + return; + } + + // Get our sections + $sections = get_post_meta( $post_id, '_generate_sections', true ); + + // Return if there's nothing in our sections + if ( ! isset( $sections ) || '' == $sections ) { + return; + } + + // Prevent infinite loop + remove_action( 'save_post', 'generate_sections_save_content', 99, 4 ); + + // Let's do some stuff if sections aren't empty + if ( '' !== $sections ) { + // Set up our content variable + $content = ''; + + // Loop through each section and add our content to the content variable + foreach ( $sections['sections'] as $section ) { + $content .= ( isset( $section['content'] ) && '' !== $section['content'] ) ? $section['content'] . "\n\n" : ''; + } + + // Now update our post if we have section content + if ( '' !== $content ) { + $post->post_content = $content; + wp_update_post( $post, true ); + } + } + + // Re-hook the save_post action + add_action('save_post', 'generate_sections_save_content', 99, 4); + } +} diff --git a/wp-content/plugins/gp-premium/sections/functions/js/parallax.js b/wp-content/plugins/gp-premium/sections/functions/js/parallax.js new file mode 100644 index 0000000..2c49e75 --- /dev/null +++ b/wp-content/plugins/gp-premium/sections/functions/js/parallax.js @@ -0,0 +1,17 @@ +function generate_sections_parallax_element( selector, context ) { + context = context || document; + var elements = context.querySelectorAll( selector ); + return Array.prototype.slice.call( elements ); +} + +window.addEventListener( "scroll", function() { + var scrolledHeight= window.pageYOffset; + generate_sections_parallax_element( ".generate-sections-container.enable-parallax" ).forEach( function( el, index, array ) { + var limit = el.offsetTop + el.offsetHeight; + if( scrolledHeight > el.offsetTop && scrolledHeight <= limit ) { + el.style.backgroundPositionY = ( scrolledHeight - el.offsetTop ) / el.getAttribute( 'data-speed' ) + "px"; + } else { + el.style.backgroundPositionY = "0"; + } + }); +}); \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/sections/functions/js/parallax.min.js b/wp-content/plugins/gp-premium/sections/functions/js/parallax.min.js new file mode 100644 index 0000000..7004f63 --- /dev/null +++ b/wp-content/plugins/gp-premium/sections/functions/js/parallax.min.js @@ -0,0 +1 @@ +function generate_sections_parallax_element(e,t){var o=(t=t||document).querySelectorAll(e);return Array.prototype.slice.call(o)}window.addEventListener("scroll",function(){var e=window.pageYOffset;generate_sections_parallax_element(".generate-sections-container.enable-parallax").forEach(function(t,o,n){var a=t.offsetTop+t.offsetHeight;e>t.offsetTop&&e<=a?t.style.backgroundPositionY=(e-t.offsetTop)/t.getAttribute("data-speed")+"px":t.style.backgroundPositionY="0"})}); \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/sections/functions/metaboxes/css/generate-sections-metabox.css b/wp-content/plugins/gp-premium/sections/functions/metaboxes/css/generate-sections-metabox.css new file mode 100644 index 0000000..6f72471 --- /dev/null +++ b/wp-content/plugins/gp-premium/sections/functions/metaboxes/css/generate-sections-metabox.css @@ -0,0 +1,351 @@ +body { + -webkit-backface-visibility: hidden; +} +#_generate_sections_metabox { + opacity: 0; + height: 0; + overflow: hidden; +} + +#_generate_use_sections_metabox { + display: block !important; +} + +.generate_sections_control { + padding-top: 8px; +} + +.generate-sections-enabled #postdivrich { + opacity: 0; + height: 0; + overflow: hidden; +} +.generate-sections-enabled #_generate_sections_metabox { + opacity: 1; + height: auto; +} + +.generate_sections_control .warning { + color: red; +} +.generate_sections_control .dodelete-repeating_textareas { + float: right; +} +.generate_sections_control .section { + border: 1px solid #DFDFDF; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); + margin: 6px 0px 8px; + overflow: hidden; + position: relative; + background: white; +} +.generate_sections_control .section .section-title { + font-size: 14px; + padding: 0 0 0 15px; + margin: 0; + max-height: 50px; +} +.generate_sections_control .section .section-title > span { + cursor: pointer; + overflow:hidden; + display:block; + max-height:50px; + line-height:50px; + width:100%; +} +.generate_sections_control .section .section-controls { + position: absolute; + top:0; + right:0; + text-align: right; +} +.rtl .generate_sections_control .section .section-controls { + right:auto;left:0; +} +.generate_sections_control .section .section-controls a { + color: #aaa; + display:block; + float:left; + border-left: 1px solid #efefef; +} +.generate_sections_control .section .section-controls a:hover { + color: #777; +} +.generate_sections_control .section textarea { + display: none; +} +.generate_sections_control .section h3 { + color: #999; + font-size: 1em; + margin: 15px 6px; + text-transform: uppercase; +} +.generate_sections_control .section .ui-sortable-placeholder { + line-height: 1.4em; + border: 3px dashed #DDD; +} +.generate-sections-modal .media-menu-item { + cursor: pointer; +} +.custom-classes input { + width:100%; +} +.js .generate_sections_control .move-section { + cursor: move; +} +.generate-sections-modal p { + margin-top:5px; +} +#_generate_sections_metabox { + box-shadow: 0 0 0 transparent; +} +.section-controls a { + line-height:50px; + padding: 0 15px; + width:initial; + height:initial; +} + +.generate_sections_control .section .section-controls a.delete-section:hover { + color: red; +} + +.generate_sections_control p { + margin: 5px; +} + +textarea#generate-sections-editor { + border:0; +} + +#generate-sections-editor_ifr { + min-height: 400px; +} + +a#generate-add-section, a#generate-delete-sections { + height: auto; + line-height: inherit; + padding: 10px 20px; +} + +#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > * { + display:none; +} + +#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > .generate-sections-add-media, +#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > .su-generator-button, +#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > .envira-gallery-choose-gallery, +#wp-generate-sections-editor-wrap.old-sections-js .wp-media-buttons > .gridable-insert-row-button { + display: inline-block; +} + +#custom-media-buttons > * { + display: none; +} + +#custom-media-buttons > .insert-media, +#custom-media-buttons > .su-generator-button, +#custom-media-buttons > .envira-gallery-choose-gallery, +#custom-media-buttons > .gridable-insert-row-button, +#custom-media-buttons > .bfa-iconpicker { + display: inline-block; +} + +#_generate_sections_metabox { + background: transparent; + border: 0; +} +#_generate_sections_metabox > .handlediv, #_generate_sections_metabox > .hndle { + display: none; +} +#_generate_sections_metabox > .inside { + padding-left: 0; + padding-right: 0; +} + +body.wp-admin .grid-container { + max-width: 100%; +} + +.generate-sections-modal h3 { + margin-top: 0; +} + +input#custom_classes, +input#custom_id { + width: 100%; + max-width: 300px; +} + +.box-type select, +.inner-box-type select, +.parallax-effect select, +.top-padding input, +.bottom-padding input { + width: 100%; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +.send-to-editor { + display: inline-block; + margin-top: 15px !important; +} + +.gs-grid-container { + margin-left: auto; + margin-right: auto; + max-width: 100%; + padding-left: 10px; + padding-right: 10px; +} + +.gs-grid-parent { + padding-left: 0; + padding-right: 0; +} + +.gs-grid-container:before, +.gs-grid-container:after { + content: "."; + display: block; + overflow: hidden; + visibility: hidden; + font-size: 0; + line-height: 0; + width: 0; + height: 0; + clear: both; +} + +@media screen and (min-width: 769px) { + .gs-grid-50:before, + .gs-grid-50:after, + .gs-grid-33:before, + .gs-grid-33:after, + .gs-grid-25:before, + .gs-grid-25:after + .gs-grid-20:before, + .gs-grid-20:after + .gs-grid-12:before, + .gs-grid-12:after { + content: "."; + display: block; + overflow: hidden; + visibility: hidden; + font-size: 0; + line-height: 0; + width: 0; + height: 0; + clear: both; + } + .gs-grid-50, + .gs-grid-33, + .gs-grid-25, + .gs-grid-20, + .gs-grid-12 { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + padding-left: 10px; + padding-right: 10px; + } + .gs-grid-50 { + width: 50% !important; + float: left; + } + .gs-grid-33 { + width: 33.333% !important; + float: left; + } + .gs-grid-25 { + width: 25% !important; + float: left; + } + .gs-grid-20 { + width: 20% !important; + float: left; + } + .gs-grid-12 { + width: 12.5% !important; + float: left; + } + .top-border { + border-top: 1px solid #EFEFEF; + } + .bottom-border { + border-bottom: 1px solid #EFEFEF; + } + .border-right { + border-right: 1px solid #EFEFEF; + } + .border-left { + border-left: 1px solid #EFEFEF; + } +} + +@media screen and (max-width: 768px) { + .gs-grid-50, .gs-grid-33, .gs-grid-25, .gs-grid-12 { + width: 100% !important; + } + .generate_sections_control .section .section-controls { + position: relative; + } +} + +@media screen and (max-width: 500px) { + .generate_sections_control .section .section-controls a:first-child { + border-left: 0; + } +} + +#generate-sections-modal-dialog .media-modal-close { + text-decoration: none; + text-align: center; +} +/* + The styles below were ripped from the Media Modal in WordPress 3.5 + ~~ Thanks for building a beautiful Modal UI ( that I could steal ) +*/ +body.generate-modal-open { overflow: hidden; } + +.generate-sections-modal .media-modal { z-index: 65535; } +.generate-sections-modal .media-modal-backdrop { z-index: 65534; } +.generate-sections-modal .media-frame-content .panel { display: none; padding: 2em; } +.generate-sections-modal .media-frame-content .panel.active { display: block; } +.generate-sections-modal .media-frame-content .panel .section-title input { width:100%;padding:10px; } +.generate-sections-modal .media-frame-content .panel .html-active .mce-panel { display: none; } +.generate-sections-modal .media-frame-content .panel .html-active .wp-editor-area { display: block !important; min-height: 300px; } +.generate-sections-modal .media-frame-content .panel .mce-wp-dfw, .generate-sections-modal .media-frame-content .panel .qt-dfw { display: none; } +.generate-sections-modal .media-frame-content .panel .generate-sections-remove-image { display: none; } + +textarea.no-rich-edit { + width: 100%; + min-height: 300px; +} + +/*# sourceMappingURL=meta.css.map */ + +.wp-picker-container .wp-color-result.button { + height: 24px; + margin: 0 6px 6px 0px; + padding: 0 0 0 30px; + font-size: 11px; +} + +.wp-color-result:after { + display: none; +} + +.wp-color-result-text { + background: #f7f7f7; + border-radius: 0 2px 2px 0; + border-left: 1px solid #ccc; + color: #555; + display: block; + line-height: 22px; + padding: 0 6px; + text-align: center; +} diff --git a/wp-content/plugins/gp-premium/sections/functions/metaboxes/css/lc_switch.css b/wp-content/plugins/gp-premium/sections/functions/metaboxes/css/lc_switch.css new file mode 100644 index 0000000..829bc8c --- /dev/null +++ b/wp-content/plugins/gp-premium/sections/functions/metaboxes/css/lc_switch.css @@ -0,0 +1,101 @@ +.lcs_wrap { + display: inline-block; + direction: ltr; + height: 28px; + vertical-align: middle; +} +.lcs_wrap input { + display: none; +} + +.lcs_switch { + display: inline-block; + position: relative; + width: 73px; + height: 28px; + border-radius: 30px; + background: #ddd; + overflow: hidden; + cursor: pointer; + + -webkit-transition: all .2s ease-in-out; + -ms-transition: all .2s ease-in-out; + transition: all .2s ease-in-out; +} +.lcs_cursor { + display: inline-block; + position: absolute; + top: 3px; + width: 22px; + height: 22px; + border-radius: 100%; + background: #fff; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.1); + z-index: 10; + + -webkit-transition: all .2s linear; + -ms-transition: all .2s linear; + transition: all .2s linear; +} +.lcs_label { + font-family: "Trebuchet MS", Helvetica, sans-serif; + font-size: 12px; + letter-spacing: 1px; + line-height: 18px; + color: #fff; + font-weight: bold; + position: absolute; + width: 33px; + top: 5px; + overflow: hidden; + text-align: center; + opacity: 0; + + -webkit-transition: all .2s ease-in-out .1s; + -ms-transition: all .2s ease-in-out .1s; + transition: all .2s ease-in-out .1s; +} +.lcs_label.lcs_label_on { + left: -70px; + z-index: 6; +} +.lcs_label.lcs_label_off { + right: -70px; + z-index: 5; +} + + +/* on */ +.lcs_switch.lcs_on { + background: #75b936; + box-shadow: 0 0 2px #579022 inset; +} +.lcs_switch.lcs_on .lcs_cursor { + left: 48px; +} +.lcs_switch.lcs_on .lcs_label_on { + left: 10px; + opacity: 1; +} + + +/* off */ +.lcs_switch.lcs_off { + background: #b2b2b2; + box-shadow: 0px 0px 2px #a4a4a4 inset; +} +.lcs_switch.lcs_off .lcs_cursor { + left: 3px; +} +.lcs_switch.lcs_off .lcs_label_off { + right: 10px; + opacity: 1; +} + + +/* disabled */ +.lcs_switch.lcs_disabled { + opacity: 0.65; + filter: alpha(opacity=65); + cursor: default; +} \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox-4.9.js b/wp-content/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox-4.9.js new file mode 100644 index 0000000..f921506 --- /dev/null +++ b/wp-content/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox-4.9.js @@ -0,0 +1,835 @@ +/*-----------------------------------------------------------------------------------*/ +/* Generate Sections Metabox +/* +/* © Kathy Darling http://www.kathyisawesome.com +/* 2016-07-19. */ +/*-----------------------------------------------------------------------------------*/ + +/** + * @type {Object} JavaScript namespace for our application. + */ +var Generate_Sections = { + backbone_modal: { + __instance: undefined + } +}; + +(function($, Generate_Sections) { + + + // Model + Generate_Sections.Section = Backbone.Model.extend({ + defaults: { + "title": "", + "box_type": "", + "inner_box_type": "", + "custom_classes": "", + "custom_id": "", + "top_padding": "", + "bottom_padding": "", + "top_padding_unit": "", + "bottom_padding_unit": "", + "background_color": "", + "background_image": "", + "background_image_preview": "", + "parallax_effect": "", + "background_color_overlay": "", + "text_color": "", + "link_color": "", + "link_color_hover": "", + "content": "" + } + }); + + + // Collection + Generate_Sections.SectionsCollection = Backbone.Collection.extend({ + model: Generate_Sections.Section, + el: "#generate_sections_container", + comparator: function(model) { + return model.get('index'); + } + }); + + + /** + * Primary Modal Application Class + */ + Generate_Sections.backbone_modal.Application = Backbone.View.extend({ + + attributes: { + id: "generate-sections-modal-dialog", + class: "generate-sections-modal", + role: "dialog" + }, + + template: wp.template("generate-sections-modal-window"), + + mediaUploader: null, + + /*-----------------------------------------------------------------------------------*/ + /* tinyMCE settings + /*-----------------------------------------------------------------------------------*/ + + tmc_settings: {}, + + /*-----------------------------------------------------------------------------------*/ + /* tinyMCE defaults + /*-----------------------------------------------------------------------------------*/ + + tmc_defaults: { + theme: "modern", + menubar: false, + wpautop: true, + indent: false, + toolbar1: "bold,italic,underline,blockquote,strikethrough,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,link,unlink,fullscreen", + plugins: "fullscreen,image,wordpress,wpeditimage,wplink", + max_height: 500 + }, + + /*-----------------------------------------------------------------------------------*/ + /* quicktags settings + /*-----------------------------------------------------------------------------------*/ + + qt_settings: {}, + + /*-----------------------------------------------------------------------------------*/ + /* quicktags defaults + /*-----------------------------------------------------------------------------------*/ + + qt_defaults: { + buttons: "strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,fullscreen" + }, + + model: Generate_Sections.Section, + + events: { + "click .media-modal-backdrop, .media-modal-close, .media-button-close": "closeModal", + "click .media-button-insert": "saveModal", + "click .media-menu-item": "switchTab", + "keydown": "keydown", + "click .generate-sections-upload-button": "openMediaUploader", + "click .generate-sections-remove-image": "removeImage", + "click div.media-frame-title h1": "toggleMenu" + }, + + + + /** + * Simple object to store any UI elements we need to use over the life of the application. + */ + ui: { + nav: undefined, + content: undefined + }, + + + /** + * Instantiates the Template object and triggers load. + */ + initialize: function() { + _.bindAll(this, "render", "closeModal", "saveModal", "switchTab"); + + this.focusManager = new wp.media.view.FocusManager({ + el: this.el + }); + + this.changeInsertText(); + this.tinyMCEsettings(); + this.render(); + }, + + /** + * switch the insert button text to "insert section" + */ + changeInsertText: function(restore) { + + var restore = typeof restore !== 'undefined' && restore == true ? true : false; + + if (restore == false && typeof(wp.media.view.l10n.insertIntoPost) !== "undefined") { + this.insertIntoPost = wp.media.view.l10n.insertIntoPost; + wp.media.view.l10n.insertIntoPost = generate_sections_metabox_i18n.insert_into_section; + // switch the insert button text back + } else if (restore == true && typeof(this.insertIntoPost) !== "undefined") { + wp.media.view.l10n.insertIntoPost = this.insertIntoPost; + } + }, + + + /** + * Merge the default TinyMCE settings + */ + tinyMCEsettings: function() { + // get the #content"s tinyMCE settings or use default + var init_settings = typeof tinyMCEPreInit == "object" && "mceInit" in tinyMCEPreInit && "content" in tinyMCEPreInit.mceInit ? tinyMCEPreInit.mceInit.content : this.tmc_defaults; + + // get the #content"s quicktags settings or use default + var qt_settings = typeof tinyMCEPreInit == "object" && "qtInit" in tinyMCEPreInit && "content" in tinyMCEPreInit.qtInit ? tinyMCEPreInit.qtInit.content : this.qt_defaults; + + var _this = this; + var custom_settings = { + selector: "#generate-sections-editor", + wp_autoresize_on: false, + cache_suffix: "", + min_height: 400, + } + + // merge our settings with WordPress" and store for later use + this.tmc_settings = $.extend({}, init_settings, custom_settings); + + this.qt_settings = $.extend({}, qt_settings, { + id: "generate-sections-editor" + }); + }, + + + /** + * Assembles the UI from loaded template. + * @internal Obviously, if the template fail to load, our modal never launches. + */ + render: function() { + + "use strict"; + + // Build the base window and backdrop, attaching them to the $el. + // Setting the tab index allows us to capture focus and redirect it in Application.preserveFocus + this.$el.attr("tabindex", "0") + .html(this.template); + + // Handle any attempt to move focus out of the modal. + //jQuery(document).on("focusin", this.preserveFocus); + + // set overflow to "hidden" on the body so that it ignores any scroll events while the modal is active + // and append the modal to the body. + jQuery("body").addClass("generate-modal-open").prepend(this.$el); + + // aria hide the background + jQuery("#wpwrap").attr("aria-hidden", "true"); + + this.renderContent(); + + this.renderPreview(); + + this.selected(); + this.colorPicker(); + this.startTinyMCE(); + + // Set focus on the modal to prevent accidental actions in the underlying page + this.$el.focus(); + + return this; + }, + + /** + * Make the menu mobile-friendly + */ + toggleMenu: function() { + this.$el.find('.media-menu').toggleClass('visible'); + }, + + /** + * Create the nav tabs & panels + */ + renderContent: function() { + + var model = this.model; + + var menu_item = wp.template("generate-sections-modal-menu-item"); + + // Save a reference to the navigation bar"s unordered list and populate it with items. + this.ui.nav = this.$el.find(".media-menu"); + + // reference to content area + this.ui.panels = this.$el.find(".media-frame-content"); + + // loop through the tabs + if (generate_sections_metabox_i18n.tabs.length) { + + // for...of is nicer, but not supported by minify, so stay with for...in for now + for (var tab in generate_sections_metabox_i18n.tabs) { + + if (generate_sections_metabox_i18n.tabs.hasOwnProperty(tab)) { + + tab = generate_sections_metabox_i18n.tabs[tab]; + + var $new_tab = $(menu_item({ + target: tab.target, + name: tab.title + })); + + var panel = wp.template("generate-sections-edit-" + tab.target); + + var $new_panel = $(panel(model.toJSON())); + + if (tab.active == "true") { + $new_tab.addClass("active"); + $new_panel.addClass("active"); + } + + jQuery( 'body' ).on( 'generate_section_show_settings', function() { + jQuery( '.generate-sections-modal .media-menu-item' ).removeClass('active'); + jQuery( '.generate-sections-modal .panel' ).removeClass('active'); + jQuery( '.generate-section-item-style' ).addClass('active'); + jQuery( '.generate-section-settings' ).addClass('active'); + }); + + this.ui.nav.append($new_tab); + this.ui.panels.append($new_panel); + } + } + } + + }, + + + /** + * Render the background image preview + */ + renderPreview: function(image_id) { + + var image_id = typeof image_id !== 'undefined' ? image_id : this.model.get("background_image"); + + var $preview = $("#generate-section-image-preview"); + $preview.children().remove(); + + if (image_id > 0) { + this.background = new wp.media.model.Attachment.get(image_id); + + this.background.fetch({ + success: function(att) { + if (_.contains(['png', 'jpg', 'gif', 'jpeg'], att.get('subtype'))) { + $("").attr("src", att.attributes.sizes.thumbnail.url).appendTo($preview); + $preview.next().find(".generate-sections-remove-image").show(); + } + } + }); + } + + }, + + + /** + * Set the default option for the select boxes + */ + selected: function() { + + var _this = this; + + this.$el.find("select").each(function(index, select) { + + var attribute = jQuery(select).attr("name"); + var selected = _this.model.get(attribute); + jQuery(select).val(selected); + + }); + }, + + /** + * Start the colorpicker + */ + colorPicker: function() { + this.$el.find(".generate-sections-color").wpColorPicker(); + }, + + /** + * Start TinyMCE on the textarea + */ + startTinyMCE: function() { + + // set the default editor + this.ui.panels.find("#wp-generate-sections-editor-wrap").addClass(generate_sections_metabox_i18n.default_editor); + + // remove tool buttons if richedit disabled + if (!generate_sections_metabox_i18n.user_can_richedit) { + this.ui.panels.find(".wp-editor-tabs").remove(); + } + + // add our copy to the collection in the tinyMCEPreInit object because switch editors + if (typeof tinyMCEPreInit == 'object') { + tinyMCEPreInit.mceInit["generate-sections-editor"] = this.tmc_settings; + tinyMCEPreInit.qtInit["generate-sections-editor"] = this.qt_settings; + tinyMCEPreInit.mceInit["generate-sections-editor"].wp_keep_scroll_position = false; + } + + try { + + var rich = (typeof tinyMCE != "undefined"); + + // turn on the quicktags editor + quicktags(this.qt_settings); + + // attempt to fix problem of quicktags toolbar with no buttons + QTags._buttonsInit(); + + if (rich !== false) { + // turn on tinyMCE + tinyMCE.init(this.tmc_settings); + } + + } catch (e) {} + + }, + + /** + * Launch Media Uploader + */ + openMediaUploader: function(e) { + + var _this = this; + + $input = jQuery(e.currentTarget).prev("#generate-sections-background-image"); + + e.preventDefault(); + + // If the uploader object has already been created, reopen the dialog + if (this.mediaUploader) { + this.mediaUploader.open(); + return; + } + // Extend the wp.media object + this.mediaUploader = wp.media.frames.file_frame = wp.media({ + title: generate_sections_metabox_i18n.media_library_title, + button: { + text: generate_sections_metabox_i18n.media_library_button + }, + multiple: false + }); + + + // When a file is selected, grab the URL and set it as the text field"s value + this.mediaUploader.on("select", function() { + + attachment = _this.mediaUploader.state().get("selection").first().toJSON(); + + $input.val(attachment.id); + + _this.renderPreview(attachment.id); + }); + // Open the uploader dialog + this.mediaUploader.open(); + + }, + + /** + * Remove the background image + */ + removeImage: function(e) { + e.preventDefault(); + $("#generate-section-image-preview").children().remove(); + $("#generate-section-image-preview").next().find(".generate-sections-remove-image").hide(); + $("#generate-sections-background-image").val(""); + }, + + + /** + * Closes the modal and cleans up after the instance. + * @param e {object} A jQuery-normalized event object. + */ + closeModal: function(e) { + "use strict"; + + e.preventDefault(); + this.undelegateEvents(); + jQuery(document).off("focusin"); + jQuery("body").removeClass("generate-modal-open"); + jQuery("body").removeClass("generate-section-content"); + + // remove restricted media modal tab focus once it's closed + this.$el.undelegate('keydown'); + + // remove the tinymce editor + // this needs to be called before the modal is closed or it will fail in Firefox (that was fun to figure out...) + if (typeof tinyMCE != "undefined") { + tinymce.EditorManager.execCommand("mceRemoveEditor", true, "generate-sections-editor"); + } + + // remove modal and unset instances + this.remove(); + Generate_Sections.backbone_modal.__instance = undefined; + this.mediaUploader = null; + Generate_Sections.modalOpen = null; + + // switch the insert button text back + this.changeInsertText(true); + + // send focus back to where it was prior to modal open + Generate_Sections.lastFocus.focus(); + + // aria unhide the background + jQuery("#wpwrap").attr("aria-hidden", "false"); + + // Fix bug where the window scrolls down 50px on close + var topDistance = jQuery("body").offset().top; + if ( topDistance >= jQuery("body").scrollTop() ) { + jQuery("body").scrollTop(0); + } + + }, + + /** + * Responds to the btn-ok.click event + * @param e {object} A jQuery-normalized event object. + * @todo You should make this your own. + */ + saveModal: function(e) { + "use strict"; + + this.model.get("index"); + + var model = this.model; + + // send the tinymce content to the textarea + if (typeof tinyMCE != "undefined") { + tinymce.triggerSave(); + } + + var $inputs = this.ui.panels.find("input, select, textarea"); + + $inputs.each(function(index, input) { + + var name = $(input).attr("name"); + + if (model.attributes.hasOwnProperty(name)) { + var value = $(input).val(); + model.set(name, value); + } + + }); + + this.closeModal(e); + }, + + /** + * Handles tab clicks and switches to corresponding panel + * @param e {object} A jQuery-normalized event object. + */ + switchTab: function(e) { + "use strict"; + e.preventDefault(); + + // close lingering wp link windows + if (typeof tinyMCE != "undefined" && 'style' == jQuery( e.currentTarget ).data( 'target' ) && this.ui.panels.find( '#wp-generate-sections-editor-wrap' ).hasClass( 'tmce-active' )) { + tinyMCE.activeEditor.execCommand('wp_link_cancel'); + tinyMCE.activeEditor.execCommand('wp_media_cancel'); + } + + this.ui.nav.children().removeClass("active"); + this.ui.panels.children().removeClass("active"); + + var target = jQuery(e.currentTarget).addClass("active").data("target"); + + this.ui.panels.find("div[data-id=" + target + "]").addClass("active"); + }, + + /** + * close on keyboard shortcuts + * @param {Object} event + */ + keydown: function(e) { + // Close the modal when escape is pressed. + if (27 === e.which && this.$el.is(':visible')) { + this.closeModal(e); + e.stopImmediatePropagation(); + } + } + + }); + + + // Singular View + Generate_Sections.sectionView = Backbone.View.extend({ + + model: Generate_Sections.Section, + tagName: 'div', + + initialize: function() { + // re-render on all changes EXCEPT index + this.listenTo(this.model, "change", this.maybeRender); + }, + + attributes: { + class: "ui-state-default section" + }, + + // Get the template from the DOM + template: wp.template("generate-sections-section"), + + events: { + 'click .edit-section': 'editSection', + 'click .section-title > span': 'editSection', + 'click .delete-section': 'removeSection', + 'click .toggle-section': 'toggleSection', + 'reorder': 'reorder', + }, + + maybeRender: function(e) { + if (this.model.hasChanged('index')) return; + this.render(); + }, + + // Render the single model - include an index. + render: function() { + this.model.set('index', this.model.collection.indexOf(this.model)); + this.$el.html(this.template(this.model.toJSON())); + + if (!this.model.get('title')) { + this.$el.find('h3.section-title > span').text(generate_sections_metabox_i18n.default_title); + } + this.$el.find('textarea').val(JSON.stringify(this.model)); + + return this; + }, + + + // launch the edit modal + editSection: function(e) { + + // stash the current focus + Generate_Sections.lastFocus = document.activeElement; + Generate_Sections.modalOpen = true; + + e.preventDefault(); + if (Generate_Sections.backbone_modal.__instance === undefined) { + Generate_Sections.backbone_modal.__instance = new Generate_Sections.backbone_modal.Application({ + model: this.model + }); + } + + }, + + // reorder after sort + reorder: function(event, index) { + this.$el.trigger('update-sort', [this.model, index]); + }, + + // remove/destroy a model + removeSection: function(e) { + e.preventDefault(); + if (confirm(generate_sections_metabox_i18n.confirm)) { + this.model.destroy(); + Generate_Sections.sectionList.render(); // manually calling instead of listening since listening interferes with sorting + } + }, + }); + + + // List View + Generate_Sections.sectionListView = Backbone.View.extend({ + + el: "#generate_sections_container", + events: { + 'update-sort': 'updateSort', + // 'add-section': 'addOne' + }, + + // callback for clone button + addSection: function(model) { + this.collection.add(model); + this.addOne(model); + }, + + addOne: function(model) { + var view = new Generate_Sections.sectionView({ + model: model + }); + this.$el.append(view.render().el); + }, + + render: function() { + this.$el.children().remove(); + this.collection.each(this.addOne, this); + return this; + }, + + updateSort: function(event, model, position) { + this.collection.remove(model); + + // renumber remaining models around missing model + this.collection.each(function(model, index) { + + var new_index = index; + if (index >= position) { + new_index += 1; + } + model.set('index', new_index); + }); + + // set the index of the missing model + model.set('index', position); + + // add the model back to the collection + this.collection.add(model, { + at: position + }); + + this.render(); + + }, + + }); + + + // The Buttons & Nonce + Generate_Sections.ButtonControls = Backbone.View.extend({ + + attributes: { + class: "generate_sections_buttons" + }, + + tagName: 'p', + + el: "#_generate_sections_metabox", + + template: wp.template("generate-sections-buttons"), + + // Attach events + events: { + "click .button-primary": "newSection", + "click #generate-delete-sections": "clearAll", + 'click .edit-section': 'editSection', + }, + + // create new + newSection: function(e) { + e.preventDefault(); + var newSection = new Generate_Sections.Section(); + Generate_Sections.sectionList.addSection(newSection); + }, + + // clear all models + clearAll: function(e) { + e.preventDefault(); + if (confirm(generate_sections_metabox_i18n.confirm)) { + Generate_Sections.sectionCollection.reset(); + Generate_Sections.sectionList.render(); + } + }, + + render: function() { + this.$el.find(".generate_sections_control").append(this.template); + return this; + }, + + }); + + + // init + Generate_Sections.initApplication = function() { + + // Create Collection From Existing Meta + Generate_Sections.sectionCollection = new Generate_Sections.SectionsCollection(generate_sections_metabox_i18n.sections); + + // Create the List View + Generate_Sections.sectionList = new Generate_Sections.sectionListView({ + collection: Generate_Sections.sectionCollection + }); + Generate_Sections.sectionList.render(); + + // Buttons + Generate_Sections.Buttons = new Generate_Sections.ButtonControls({ + collection: Generate_Sections.sectionCollection + }); + Generate_Sections.Buttons.render(); + + }; + + + /*-----------------------------------------------------------------------------------*/ + /* Execute the above methods in the Generate_Sections object. + /*-----------------------------------------------------------------------------------*/ + + jQuery(document).ready(function($) { + + Generate_Sections.initApplication(); + + $( '#generate_sections_container' ).sortable({ + axis: "y", + opacity: 0.5, + grid: [20, 10], + tolerance: "pointer", + handle: ".move-section", + update: function(event, ui) { + ui.item.trigger("reorder", ui.item.index()); + } + } ); + + if ( $( '.use-sections-switch' ).is( ':checked' ) ) { + setTimeout( function() { + generateShowSections(); + }, 200 ); + } else { + generateHideSections(); + } + + $( '.use-sections-switch' ).on( 'change', function( e ) { + var status = ( $(this).is( ':checked' ) ) ? 'checked' : 'unchecked'; + + if ( 'checked' == status ) { + generateShowSections(); + } else if ( 'unchecked' == status ) { + generateHideSections(); + } + } ); + + function generateShowSections() { + + // Hide send to editor button + $('.send-to-editor').css('display', 'none'); + + // Hide the editor + $('#postdivrich').css({ + 'opacity': '0', + 'height': '0', + 'overflow': 'hidden' + }); + + // Show the sections + $('#_generate_sections_metabox').css({ + 'opacity': '1', + 'height': 'auto' + }); + + // Remove and add the default editor - this removes any visible toolbars etc.. + // We need to set a timeout for this to work + // if (typeof tinyMCE != "undefined") { + // tinyMCE.EditorManager.execCommand("mceRemoveEditor", true, "content"); + // $( '.use-sections-cover' ).css( 'z-index','10000' ); + // setTimeout('tinyMCE.EditorManager.execCommand("mceAddEditor", true, "content");', 1); + // setTimeout('jQuery( ".use-sections-cover" ).css( "z-index","-1" );', 1000); + // } + + // Set a trigger + $('body').trigger('generate_show_sections'); + + } + + function generateHideSections() { + + // Show send to editor button + $('.send-to-editor').css('display', 'inline-block'); + + // Show the editor + $('#postdivrich').css({ + 'opacity': '1', + 'height': 'auto' + }); + + // Hide the sections + $('#_generate_sections_metabox').css({ + 'opacity': '0', + 'height': '0', + 'overflow': 'hidden' + }); + + $('body').trigger('generate_hide_sections'); + + } + + $( document ).on( 'click', '.edit-section.edit-settings', function() { + $( 'body' ).trigger( 'generate_section_show_settings' ); + }); + + }); + + +})(jQuery, Generate_Sections); diff --git a/wp-content/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox.js b/wp-content/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox.js new file mode 100644 index 0000000..e6b59fd --- /dev/null +++ b/wp-content/plugins/gp-premium/sections/functions/metaboxes/js/generate-sections-metabox.js @@ -0,0 +1,846 @@ +/*-----------------------------------------------------------------------------------*/ +/* Generate Sections Metabox +/* +/* © Kathy Darling http://www.kathyisawesome.com +/* 2016-07-19. */ +/*-----------------------------------------------------------------------------------*/ + +/** + * @type {Object} JavaScript namespace for our application. + */ +var Generate_Sections = { + backbone_modal: { + __instance: undefined + } +}; + +(function($, Generate_Sections) { + + + // Model + Generate_Sections.Section = Backbone.Model.extend({ + defaults: { + "title": "", + "box_type": "", + "inner_box_type": "", + "custom_classes": "", + "custom_id": "", + "top_padding": "", + "bottom_padding": "", + "top_padding_unit": "", + "bottom_padding_unit": "", + "background_color": "", + "background_image": "", + "background_image_preview": "", + "parallax_effect": "", + "background_color_overlay": "", + "text_color": "", + "link_color": "", + "link_color_hover": "", + "content": "" + } + }); + + + // Collection + Generate_Sections.SectionsCollection = Backbone.Collection.extend({ + model: Generate_Sections.Section, + el: "#generate_sections_container", + comparator: function(model) { + return model.get('index'); + } + }); + + + /** + * Primary Modal Application Class + */ + Generate_Sections.backbone_modal.Application = Backbone.View.extend({ + + attributes: { + id: "generate-sections-modal-dialog", + class: "generate-sections-modal", + role: "dialog" + }, + + template: wp.template("generate-sections-modal-window"), + + mediaUploader: null, + + /*-----------------------------------------------------------------------------------*/ + /* tinyMCE settings + /*-----------------------------------------------------------------------------------*/ + + tmc_settings: {}, + + /*-----------------------------------------------------------------------------------*/ + /* tinyMCE defaults + /*-----------------------------------------------------------------------------------*/ + + tmc_defaults: { + theme: "modern", + menubar: false, + wpautop: true, + indent: false, + toolbar1: "bold,italic,underline,blockquote,strikethrough,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,link,unlink,fullscreen", + plugins: "fullscreen,image,wordpress,wpeditimage,wplink", + max_height: 500 + }, + + /*-----------------------------------------------------------------------------------*/ + /* quicktags settings + /*-----------------------------------------------------------------------------------*/ + + qt_settings: {}, + + /*-----------------------------------------------------------------------------------*/ + /* quicktags defaults + /*-----------------------------------------------------------------------------------*/ + + qt_defaults: { + buttons: "strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,fullscreen" + }, + + model: Generate_Sections.Section, + + events: { + "click .media-modal-backdrop, .media-modal-close, .media-button-close": "closeModal", + "click .media-button-insert": "saveModal", + "click .media-menu-item": "switchTab", + "keydown": "keydown", + "click .generate-sections-upload-button": "openMediaUploader", + "click .generate-sections-remove-image": "removeImage", + "click div.media-frame-title h1": "toggleMenu" + }, + + + + /** + * Simple object to store any UI elements we need to use over the life of the application. + */ + ui: { + nav: undefined, + content: undefined + }, + + + /** + * Instantiates the Template object and triggers load. + */ + initialize: function() { + _.bindAll(this, "render", "closeModal", "saveModal", "switchTab"); + + this.focusManager = new wp.media.view.FocusManager({ + el: this.el + }); + + this.changeInsertText(); + //this.tinyMCEsettings(); + this.render(); + }, + + /** + * switch the insert button text to "insert section" + */ + changeInsertText: function(restore) { + + var restore = typeof restore !== 'undefined' && restore == true ? true : false; + + if (restore == false && typeof(wp.media.view.l10n.insertIntoPost) !== "undefined") { + this.insertIntoPost = wp.media.view.l10n.insertIntoPost; + wp.media.view.l10n.insertIntoPost = generate_sections_metabox_i18n.insert_into_section; + // switch the insert button text back + } else if (restore == true && typeof(this.insertIntoPost) !== "undefined") { + wp.media.view.l10n.insertIntoPost = this.insertIntoPost; + } + }, + + /** + * Assembles the UI from loaded template. + * @internal Obviously, if the template fail to load, our modal never launches. + */ + render: function() { + + "use strict"; + + // Build the base window and backdrop, attaching them to the $el. + // Setting the tab index allows us to capture focus and redirect it in Application.preserveFocus + this.$el.attr("tabindex", "0").html(this.template); + + // Handle any attempt to move focus out of the modal. + //jQuery(document).on("focusin", this.preserveFocus); + + // set overflow to "hidden" on the body so that it ignores any scroll events while the modal is active + // and append the modal to the body. + jQuery("body").addClass("generate-modal-open").prepend(this.$el); + + // aria hide the background + jQuery("#wpwrap").attr("aria-hidden", "true"); + + this.renderContent(); + + this.renderPreview(); + + this.selected(); + this.colorPicker(); + //this.startTinyMCE(); + this.launchEditor(); + + // Set focus on the modal to prevent accidental actions in the underlying page + this.$el.focus(); + + return this; + }, + + launchEditor: function() { + var id = this.ui.panels.find( ".generate-sections-editor-wrap" ).find( 'textarea' ).attr( 'id' ), + customButtonsContainer = this.ui.panels.find( '.generate-sections-editor-wrap' ).find( '#custom-media-buttons' ); + + customButtonsContainer.find( '.insert-media' ).remove(); + var customButtons = customButtonsContainer.html(); + customButtonsContainer.remove(); + + var init_settings = true; + + if ( typeof tinyMCEPreInit == "object" && "mceInit" in tinyMCEPreInit && "content" in tinyMCEPreInit.mceInit ) { + init_settings = tinyMCEPreInit.mceInit.content; + } else if ( typeof window.wpEditorL10n !== "undefined" ) { + init_settings = window.wpEditorL10n.tinymce.settings; + } else { + init_settings = this.tmc_defaults; + } + + var thisPanel = this.ui.panels; + + var custom_settings = { + wp_autoresize_on: false, + cache_suffix: "", + min_height: 400, + wp_keep_scroll_position: false, + setup: function( editor ) { + editor.on( 'init', function( e ) { + if ( 'html-active' === generate_sections_metabox_i18n.default_editor && generate_sections_metabox_i18n.user_can_richedit ) { + thisPanel.find( '#wp-generate-sections-editor-wrap' ).removeClass( 'tmce-active' ).addClass( 'html-active' ); + editor.hidden = true; + } + } ); + } + } + + init_settings = $.extend({}, init_settings, custom_settings); + + var qt_settings = true; + + if ( typeof tinyMCEPreInit == "object" && "qtInit" in tinyMCEPreInit && "content" in tinyMCEPreInit.qtInit ) { + qt_settings = tinyMCEPreInit.qtInit.content; + } else { + qt_settings = this.qt_defaults; + } + + if ( ! generate_sections_metabox_i18n.user_can_richedit ) { + init_settings = false; + } + + wp.sectionsEditor.initialize( id, { + tinymce: init_settings, + quicktags: qt_settings, + mediaButtons: true + } ); + + var buttonsElement = this.ui.panels.find( '#wp-generate-sections-editor-wrap' ).find( '.wp-media-buttons' ); + buttonsElement.attr( 'id', 'custom-media-buttons' ); + $( customButtons ).appendTo( buttonsElement ); + + if ( ! generate_sections_metabox_i18n.user_can_richedit ) { + this.ui.panels.find( '#generate-sections-editor' ).addClass( 'no-rich-edit' ); + } + }, + + /** + * Make the menu mobile-friendly + */ + toggleMenu: function() { + this.$el.find('.media-menu').toggleClass('visible'); + }, + + /** + * Create the nav tabs & panels + */ + renderContent: function() { + + var model = this.model; + + var menu_item = wp.template("generate-sections-modal-menu-item"); + + // Save a reference to the navigation bar"s unordered list and populate it with items. + this.ui.nav = this.$el.find(".media-menu"); + + // reference to content area + this.ui.panels = this.$el.find(".media-frame-content"); + + // loop through the tabs + if (generate_sections_metabox_i18n.tabs.length) { + + // for...of is nicer, but not supported by minify, so stay with for...in for now + for (var tab in generate_sections_metabox_i18n.tabs) { + + if (generate_sections_metabox_i18n.tabs.hasOwnProperty(tab)) { + + tab = generate_sections_metabox_i18n.tabs[tab]; + + var $new_tab = $(menu_item({ + target: tab.target, + name: tab.title + })); + + var panel = wp.template("generate-sections-edit-" + tab.target); + + var $new_panel = $(panel(model.toJSON())); + + if (tab.active == "true") { + $new_tab.addClass("active"); + $new_panel.addClass("active"); + } + + jQuery( 'body' ).on( 'generate_section_show_settings', function() { + jQuery( '.generate-sections-modal .media-menu-item' ).removeClass('active'); + jQuery( '.generate-sections-modal .panel' ).removeClass('active'); + jQuery( '.generate-section-item-style' ).addClass('active'); + jQuery( '.generate-section-settings' ).addClass('active'); + }); + + this.ui.nav.append($new_tab); + this.ui.panels.append($new_panel); + } + } + } + + }, + + + /** + * Render the background image preview + */ + renderPreview: function(image_id) { + + var image_id = typeof image_id !== 'undefined' ? image_id : this.model.get("background_image"); + + var $preview = $("#generate-section-image-preview"); + $preview.children().remove(); + + if (image_id > 0) { + this.background = new wp.media.model.Attachment.get(image_id); + + this.background.fetch({ + success: function(att) { + if (_.contains(['png', 'jpg', 'gif', 'jpeg'], att.get('subtype'))) { + $("").attr("src", att.attributes.sizes.thumbnail.url).appendTo($preview); + $preview.next().find(".generate-sections-remove-image").show(); + } + } + }); + } + + }, + + + /** + * Set the default option for the select boxes + */ + selected: function() { + + var _this = this; + + this.$el.find("select").each(function(index, select) { + + var attribute = jQuery(select).attr("name"); + var selected = _this.model.get(attribute); + jQuery(select).val(selected); + + }); + }, + + /** + * Start the colorpicker + */ + colorPicker: function() { + this.$el.find(".generate-sections-color").wpColorPicker(); + }, + + /** + * Launch Media Uploader + */ + openMediaUploader: function(e) { + + var _this = this; + + $input = jQuery(e.currentTarget).prev("#generate-sections-background-image"); + + e.preventDefault(); + + // If the uploader object has already been created, reopen the dialog + if (this.mediaUploader) { + this.mediaUploader.open(); + return; + } + // Extend the wp.media object + this.mediaUploader = wp.media.frames.file_frame = wp.media({ + title: generate_sections_metabox_i18n.media_library_title, + button: { + text: generate_sections_metabox_i18n.media_library_button + }, + multiple: false + }); + + + // When a file is selected, grab the URL and set it as the text field"s value + this.mediaUploader.on("select", function() { + + attachment = _this.mediaUploader.state().get("selection").first().toJSON(); + + $input.val(attachment.id); + + _this.renderPreview(attachment.id); + }); + // Open the uploader dialog + this.mediaUploader.open(); + + }, + + /** + * Remove the background image + */ + removeImage: function(e) { + e.preventDefault(); + $("#generate-section-image-preview").children().remove(); + $("#generate-section-image-preview").next().find(".generate-sections-remove-image").hide(); + $("#generate-sections-background-image").val(""); + }, + + + /** + * Closes the modal and cleans up after the instance. + * @param e {object} A jQuery-normalized event object. + */ + closeModal: function(e) { + "use strict"; + + e.preventDefault(); + this.undelegateEvents(); + jQuery(document).off("focusin"); + jQuery("body").removeClass("generate-modal-open"); + jQuery("body").removeClass("generate-section-content"); + + // remove restricted media modal tab focus once it's closed + this.$el.undelegate('keydown'); + + // remove the tinymce editor + // this needs to be called before the modal is closed or it will fail in Firefox (that was fun to figure out...) + if (typeof tinyMCE != "undefined") { + tinymce.EditorManager.execCommand("mceRemoveEditor", true, "generate-sections-editor"); + } + + // remove modal and unset instances + this.remove(); + Generate_Sections.backbone_modal.__instance = undefined; + this.mediaUploader = null; + Generate_Sections.modalOpen = null; + + // switch the insert button text back + this.changeInsertText(true); + + // send focus back to where it was prior to modal open + Generate_Sections.lastFocus.focus(); + + // aria unhide the background + jQuery("#wpwrap").attr("aria-hidden", "false"); + + // Fix bug where the window scrolls down 50px on close + var topDistance = jQuery("body").offset().top; + if ( topDistance >= jQuery("body").scrollTop() ) { + jQuery("body").scrollTop(0); + } + + }, + + /** + * Responds to the btn-ok.click event + * @param e {object} A jQuery-normalized event object. + * @todo You should make this your own. + */ + saveModal: function(e) { + "use strict"; + + this.model.get("index"); + + var model = this.model; + + // send the tinymce content to the textarea + if (typeof tinyMCE != "undefined") { + tinymce.triggerSave(); + } + + var $inputs = this.ui.panels.find("input, select, textarea"); + + $inputs.each(function(index, input) { + + var name = $(input).attr("name"); + + if (model.attributes.hasOwnProperty(name)) { + var value = $(input).val(); + model.set(name, value); + } + + }); + + this.closeModal(e); + }, + + /** + * Handles tab clicks and switches to corresponding panel + * @param e {object} A jQuery-normalized event object. + */ + switchTab: function(e) { + "use strict"; + e.preventDefault(); + + // close lingering wp link windows + if (typeof tinyMCE != "undefined" && 'style' == jQuery( e.currentTarget ).data( 'target' ) && this.ui.panels.find( '#wp-generate-sections-editor-wrap' ).hasClass( 'tmce-active' )) { + tinyMCE.activeEditor.execCommand('wp_link_cancel'); + tinyMCE.activeEditor.execCommand('wp_media_cancel'); + } + + this.ui.nav.children().removeClass("active"); + this.ui.panels.children().removeClass("active"); + + var target = jQuery(e.currentTarget).addClass("active").data("target"); + + this.ui.panels.find("div[data-id=" + target + "]").addClass("active"); + }, + + /** + * close on keyboard shortcuts + * @param {Object} event + */ + keydown: function(e) { + // Close the modal when escape is pressed. + if (27 === e.which && this.$el.is(':visible')) { + this.closeModal(e); + e.stopImmediatePropagation(); + } + } + + }); + + + // Singular View + Generate_Sections.sectionView = Backbone.View.extend({ + + model: Generate_Sections.Section, + tagName: 'div', + + initialize: function() { + // re-render on all changes EXCEPT index + this.listenTo(this.model, "change", this.maybeRender); + }, + + attributes: { + class: "ui-state-default section" + }, + + // Get the template from the DOM + template: wp.template("generate-sections-section"), + + events: { + 'click .edit-section': 'editSection', + 'click .section-title > span': 'editSection', + 'click .delete-section': 'removeSection', + 'click .toggle-section': 'toggleSection', + 'reorder': 'reorder', + }, + + maybeRender: function(e) { + if (this.model.hasChanged('index')) return; + this.render(); + }, + + // Render the single model - include an index. + render: function() { + this.model.set('index', this.model.collection.indexOf(this.model)); + this.$el.html(this.template(this.model.toJSON())); + + if (!this.model.get('title')) { + this.$el.find('h3.section-title > span').text(generate_sections_metabox_i18n.default_title); + } + this.$el.find('textarea').val(JSON.stringify(this.model)); + + return this; + }, + + + // launch the edit modal + editSection: function(e) { + + // stash the current focus + Generate_Sections.lastFocus = document.activeElement; + Generate_Sections.modalOpen = true; + + e.preventDefault(); + if (Generate_Sections.backbone_modal.__instance === undefined) { + Generate_Sections.backbone_modal.__instance = new Generate_Sections.backbone_modal.Application({ + model: this.model + }); + } + + }, + + // reorder after sort + reorder: function(event, index) { + this.$el.trigger('update-sort', [this.model, index]); + }, + + // remove/destroy a model + removeSection: function(e) { + e.preventDefault(); + if (confirm(generate_sections_metabox_i18n.confirm)) { + this.model.destroy(); + Generate_Sections.sectionList.render(); // manually calling instead of listening since listening interferes with sorting + } + }, + }); + + + // List View + Generate_Sections.sectionListView = Backbone.View.extend({ + + el: "#generate_sections_container", + events: { + 'update-sort': 'updateSort', + // 'add-section': 'addOne' + }, + + // callback for clone button + addSection: function(model) { + this.collection.add(model); + this.addOne(model); + }, + + addOne: function(model) { + var view = new Generate_Sections.sectionView({ + model: model + }); + this.$el.append(view.render().el); + }, + + render: function() { + this.$el.children().remove(); + this.collection.each(this.addOne, this); + return this; + }, + + updateSort: function(event, model, position) { + this.collection.remove(model); + + // renumber remaining models around missing model + this.collection.each(function(model, index) { + + var new_index = index; + if (index >= position) { + new_index += 1; + } + model.set('index', new_index); + }); + + // set the index of the missing model + model.set('index', position); + + // add the model back to the collection + this.collection.add(model, { + at: position + }); + + this.render(); + + }, + + }); + + + // The Buttons & Nonce + Generate_Sections.ButtonControls = Backbone.View.extend({ + + attributes: { + class: "generate_sections_buttons" + }, + + tagName: 'p', + + el: "#_generate_sections_metabox", + + template: wp.template("generate-sections-buttons"), + + // Attach events + events: { + "click .button-primary": "newSection", + "click #generate-delete-sections": "clearAll", + 'click .edit-section': 'editSection', + }, + + // create new + newSection: function(e) { + e.preventDefault(); + var newSection = new Generate_Sections.Section(); + Generate_Sections.sectionList.addSection(newSection); + }, + + // clear all models + clearAll: function(e) { + e.preventDefault(); + if (confirm(generate_sections_metabox_i18n.confirm)) { + Generate_Sections.sectionCollection.reset(); + Generate_Sections.sectionList.render(); + } + }, + + render: function() { + this.$el.find(".generate_sections_control").append(this.template); + return this; + }, + + }); + + + // init + Generate_Sections.initApplication = function() { + + // Create Collection From Existing Meta + Generate_Sections.sectionCollection = new Generate_Sections.SectionsCollection(generate_sections_metabox_i18n.sections); + + // Create the List View + Generate_Sections.sectionList = new Generate_Sections.sectionListView({ + collection: Generate_Sections.sectionCollection + }); + Generate_Sections.sectionList.render(); + + // Buttons + Generate_Sections.Buttons = new Generate_Sections.ButtonControls({ + collection: Generate_Sections.sectionCollection + }); + Generate_Sections.Buttons.render(); + + }; + + + /*-----------------------------------------------------------------------------------*/ + /* Execute the above methods in the Generate_Sections object. + /*-----------------------------------------------------------------------------------*/ + + jQuery(document).ready(function($) { + + Generate_Sections.initApplication(); + + $( '#generate_sections_container' ).sortable({ + axis: "y", + opacity: 0.5, + grid: [20, 10], + tolerance: "pointer", + handle: ".move-section", + update: function(event, ui) { + ui.item.trigger("reorder", ui.item.index()); + } + } ); + + if ( $( '.use-sections-switch' ).is( ':checked' ) ) { + setTimeout( function() { + generateShowSections(); + }, 200 ); + } else { + generateHideSections(); + } + + $( '.use-sections-switch' ).on( 'change', function( e ) { + var status = ( $(this).is( ':checked' ) ) ? 'checked' : 'unchecked'; + + if ( 'checked' == status ) { + generateShowSections(); + } else if ( 'unchecked' == status ) { + generateHideSections(); + } + } ); + + function generateShowSections() { + + // Hide send to editor button + $('.send-to-editor').css('display', 'none'); + + // Hide the editor + $('#postdivrich').css({ + 'opacity': '0', + 'height': '0', + 'overflow': 'hidden' + }); + + $( '.editor-block-list__layout' ).hide(); + $( '.edit-post-layout__content .edit-post-visual-editor' ).css( { + 'flex-grow': 'unset', + 'flex-basis': '0' + } ); + $( '.edit-post-layout__metaboxes:not(:empty)' ).css( 'border-top', '0' ); + + // Show the sections + $('#_generate_sections_metabox').css({ + 'opacity': '1', + 'height': 'auto' + }); + + // Remove and add the default editor - this removes any visible toolbars etc.. + // We need to set a timeout for this to work + // if (typeof tinyMCE != "undefined") { + // tinyMCE.EditorManager.execCommand("mceRemoveEditor", true, "content"); + // $( '.use-sections-cover' ).css( 'z-index','10000' ); + // setTimeout('tinyMCE.EditorManager.execCommand("mceAddEditor", true, "content");', 1); + // setTimeout('jQuery( ".use-sections-cover" ).css( "z-index","-1" );', 1000); + // } + + // Set a trigger + $('body').trigger('generate_show_sections'); + + } + + function generateHideSections() { + + // Show send to editor button + $('.send-to-editor').css('display', 'inline-block'); + + // Show the editor + $('#postdivrich').css({ + 'opacity': '1', + 'height': 'auto' + }); + + $( '.editor-block-list__layout' ).show(); + $( '.edit-post-layout__content .edit-post-visual-editor' ).css( { + 'flex-grow': '', + 'flex-basis': '' + } ); + $( '.edit-post-layout__metaboxes:not(:empty)' ).css( 'border-top', '' ); + + // Hide the sections + $('#_generate_sections_metabox').css({ + 'opacity': '0', + 'height': '0', + 'overflow': 'hidden' + }); + + $('body').trigger('generate_hide_sections'); + + } + + $( document ).on( 'click', '.edit-section.edit-settings', function() { + $( 'body' ).trigger( 'generate_section_show_settings' ); + }); + + }); + + +})(jQuery, Generate_Sections); diff --git a/wp-content/plugins/gp-premium/sections/functions/metaboxes/js/wp-color-picker-alpha.min.js b/wp-content/plugins/gp-premium/sections/functions/metaboxes/js/wp-color-picker-alpha.min.js new file mode 100644 index 0000000..c67aacc --- /dev/null +++ b/wp-content/plugins/gp-premium/sections/functions/metaboxes/js/wp-color-picker-alpha.min.js @@ -0,0 +1,340 @@ +/**! + * wp-color-picker-alpha + * + * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker + * Only run in input and is defined data alpha in true + * + * Version: 1.2.2 + * https://github.com/23r9i0/wp-color-picker-alpha + * Copyright (c) 2015 Sergio P.A. (23r9i0). + * Licensed under the GPLv2 license. + */ +( function( $ ) { + // Variable for some backgrounds ( grid ) + var image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==', + // html stuff for wpColorPicker copy of the original color-picker.js + _before = '', + _after = '
        ', + _wrap = '
        ', + _button = '', + _wrappingLabel = '', + _wrappingLabelText = ''; + + /** + * Overwrite Color + * for enable support rbga + */ + Color.fn.toString = function() { + if ( this._alpha < 1 ) + return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' ); + + var hex = parseInt( this._color, 10 ).toString( 16 ); + + if ( this.error ) + return ''; + + if ( hex.length < 6 ) + hex = ( '00000' + hex ).substr( -6 ); + + return '#' + hex; + }; + + /** + * Overwrite wpColorPicker + */ + $.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, { + _create: function() { + // bail early for unsupported Iris. + if ( ! $.support.iris ) + return; + + var self = this, + el = self.element; + + self.inputWrapper = el.closest( '.wp-picker-input-wrap' ); + + $.extend( self.options, el.data() ); + + // keep close bound so it can be attached to a body listener + self.close = $.proxy( self.close, self ); + + self.initialValue = el.val(); + + // Set up HTML structure, hide things + el.addClass( 'wp-color-picker' ).wrap( _wrap ); + self.wrap = el.parent(); + self.toggler = $( _before ).insertBefore( el ).css( { backgroundColor : self.initialValue } ).attr( 'title', wpColorPickerL10n.pick ).attr( 'data-current', wpColorPickerL10n.current ); + self.pickerContainer = $( _after ).insertAfter( el ); + self.button = $( _button ); + + if ( self.options.defaultColor ) { + self.button.addClass( 'wp-picker-default' ).val( wpColorPickerL10n.defaultString ); + } else { + self.button.addClass( 'wp-picker-clear' ).val( wpColorPickerL10n.clear ); + } + + el.wrap( '
        + + * { + pointer-events :none; +} + +.site-step-details > div { + border-bottom: 1px solid #ddd; + margin: 0 0 30px; + padding: 0 0 30px 60px; + position: relative; +} + +.site-step-details > div:last-child { + border: 0; + margin: 0; + padding-bottom: 0; +} + +.site-step-details > div p:last-child { + margin-bottom: 0; +} + +.number, +.big-loader { + position: absolute; + width: 40px; + height: 40px; + background: #fff; + border-radius: 50%; + line-height: 40px; + text-align: center; + top: 5px; + left: 0; + border: 2px solid #555; + font-size: 20px; + font-weight: 600; + transition: opacity 250ms ease-in-out; +} + +.site-step-details > div:nth-child(1) .number:before { + content: "1"; +} + +.site-step-details > div:nth-child(2) .number:before { + content: "2"; +} + +.site-step-details > div:nth-child(3) .number:before { + content: "3"; +} + +.site-step-details > div:nth-child(4) .number:before { + content: "4"; +} + +.big-loader { + border-color: transparent; +} + +.big-loader svg { + height: 50px; + width: 50px; + position: relative; + top: -5px; + left: -5px; +} + +.site-step-details > div .number.step-complete:before { + content: "\f147"; + font-family: dashicons; + color: #4BB543; + font-size: 20px; +} + +.number.step-complete { + border-color: #4BB543; + font-size: 0; +} + +.site-step-details h3 { + margin-bottom: 0; +} + +.site-step-details p { + margin: 0; +} + +.replace-elementor-urls, +.site-step-details .replace-elementor-urls p:not(:first-child) { + margin-top: 1em; +} + +.action-area { + margin: 40px 0; + display: flex; + align-items: center; +} + +.action-buttons input[type="submit"] { + border-radius: 0; + font-size: 17px; + line-height: 50px; + height: auto; + padding: 0 20px; +} + +.big-loader { + opacity: 0; +} + +.loading, +.error-message { + font-size: 15px; + line-height: 52px; +} + +.loading svg { + width: 20px; + height: 20px; + position: relative; + top: 5px; +} + +.checking-for-plugins { + line-height: normal; +} + +.action-area { + display: flex; + align-items: center; +} + +.important-note { + padding-left: 20px; + width: 75%; + margin-left: auto; +} + +.important-note label { + display: flex; + align-items: baseline; +} + +.important-note input { + position: relative; + top: 3px; + margin-right: 10px; +} + +.site-open .site-box .step-information { + background: #fff; + box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #DDD; + padding: 40px; + position: relative; +} + +.step-information h1 { + margin-top: 0; +} + +.site-open .site-overview-details { + grid-area: right; + margin-left: 20px; +} + +.site-open .site-description h3 { + margin-bottom: 0; + text-transform: uppercase; + font-size: 14px; +} + +.site-open .site-screenshot { + margin-bottom: 40px; + padding: 5px; + box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #DDD; +} + +.site-description > div:not(:last-child) { + margin-bottom: 20px; + padding-bottom: 20px; + border-bottom: 1px solid #ddd; +} + +.site-description > div > *:last-child { + margin-bottom: 0; +} + +.site-step-details ul li { + list-style-type: none; + display: inline-block; + padding: 2px 5px; + background: #f5f5f5; + margin: 2px; +} + +.elementor-urls input { + display: block; + width: 100%; + padding: 8px; +} + +.elementor-urls label { + font-size: 12px; + font-weight: bold; +} + +.elementor-urls { + margin-top: 10px; +} + +.site-open .site-box .controls button { + background: #fff; + border: none; + font-size: 20px; + cursor: pointer; + padding: 10px; + line-height: 1; + box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #DDD; + margin-right: 5px; +} + +.site-open .site-box .controls button:before { + line-height: 0; + position: relative; + top: 2px; +} + +.site-open .site-box .controls .preview-site { + font-size: inherit; + color: #000; + padding-left: 20px; + padding-right: 20px; + margin-left: auto; + margin-right: 0; + font-weight: 600; +} + +.site-open .site-box .controls .preview-site:hover { + color: #0073aa; +} + +.site-box:not(.no-page-builder) { + display: none; +} + +.site-card-buttons { + display: flex; + margin-top: 20px; +} + +.site-card-buttons button.button, +.site-card-buttons button.button-primary { + width: 50%; + height: 40px; + line-height: 40px; + border-radius: 0; +} + +.site-details p { + margin: 0; +} + +.plugin-area { + display: none; + margin-top: 1em; +} + +.site-plugins { + margin-top: 1em; +} + +.skip-content-import { + font-size: 11px; + font-weight: normal; + padding: 2px 5px; + margin-left: 5px; + position: relative; + top: -1px; +} + +.no-site-library-results { + text-align: center; + margin-bottom: 2em; +} + +.remove-site { + background: #fff; + padding: 40px; + box-shadow: 0 0 10px 10px rgba(0,0,0,0.01); + border: 1px solid #ddd; + margin-bottom: 40px; +} + +.remove-site h2 { + margin-top: 0; + font-size: 25px; + margin-bottom: 30px; +} + +.remove-site button.button-primary { + font-size: 17px; + line-height: 50px; + height: 50px; + padding: 0 20px; + border-radius: 0; +} + +.remove-site .loading { + height: 50px; +} + +.close-remove-site, +.skip-remove-site { + display: inline-block; + margin-left: 15px; + font-size: 15px; +} + +.remove-site p { + font-size: 16px; +} + +.remove-site-actions { + margin-top: 30px; +} + +.generatepress-sites.remove-site-needed { + pointer-events: none; + opacity: 0.2; +} diff --git a/wp-content/plugins/gp-premium/sites/assets/css/loading.svg b/wp-content/plugins/gp-premium/sites/assets/css/loading.svg new file mode 100644 index 0000000..2aeb6ba --- /dev/null +++ b/wp-content/plugins/gp-premium/sites/assets/css/loading.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/wp-content/plugins/gp-premium/sites/assets/images/screenshot.png b/wp-content/plugins/gp-premium/sites/assets/images/screenshot.png new file mode 100644 index 0000000..95b5ca3 Binary files /dev/null and b/wp-content/plugins/gp-premium/sites/assets/images/screenshot.png differ diff --git a/wp-content/plugins/gp-premium/sites/assets/js/admin.js b/wp-content/plugins/gp-premium/sites/assets/js/admin.js new file mode 100644 index 0000000..edd7123 --- /dev/null +++ b/wp-content/plugins/gp-premium/sites/assets/js/admin.js @@ -0,0 +1,913 @@ +jQuery( document ).ready( function($) { + + var bLazy = new Blazy({ + selector: '.lazyload', + success: function(ele){ + $( ele ).parent().addClass( 'image-loaded' ); + } + }); + + /** + * Demo sites + */ + $( '.site-box .preview-site' ).on( 'click', function( e ) { + e.preventDefault(); + var _this = $( this ); + var site_box = _this.closest( '.site-box' ); + + if ( ! site_box.find( 'iframe' ).attr( 'src' ) ) { + site_box.find( 'iframe' ).attr( 'src', site_box.data( 'site-data' ).preview_url ); + } + + site_box.find( 'iframe' ).on( 'load', function () { + site_box.find( '.demo-loading' ).fadeOut().remove(); + }); + + site_box.find( '.site-demo' ).show().addClass( 'open' ); + } ); + + $( '.site-demo .close-demo' ).on( 'click', function( e ) { + $( '.site-demo' ).hide().removeClass( 'open' ); + bLazy.revalidate(); + } ); + + $( '.demo-panel .show-desktop' ).on( 'click', function( e ) { + $( this ).addClass( 'active' ).siblings().removeClass( 'active' ); + $( '.site-demo' ).removeClass( 'mobile' ).removeClass( 'tablet' ); + } ); + + $( '.demo-panel .show-tablet' ).on( 'click', function( e ) { + $( this ).addClass( 'active' ).siblings().removeClass( 'active' ); + $( '.site-demo' ).removeClass( 'mobile' ).addClass( 'tablet' ); + } ); + + $( '.demo-panel .show-mobile' ).on( 'click', function( e ) { + $( this ).addClass( 'active' ).siblings().removeClass( 'active' ); + $( '.site-demo' ).addClass( 'mobile' ).removeClass( 'tablet' ); + } ); + + $( '.site-demo .get-started' ).on( 'click', function( e ) { + $( '.site-demo' ).hide().removeClass( 'open' ); + + if ( ! $( '.generatepress-sites' ).hasClass( 'site-open' ) ) { + var this_site = $( this ).closest( '.site-box' ); + + $( '.generatepress-sites' ).addClass( 'site-open' ); + $( '.library-filters' ).hide(); + var screenshot = this_site.find( '.site-card-screenshot img' ).attr( 'src' ); + + this_site.find( '.site-overview-screenshot img' ).attr( 'src', screenshot ); + this_site.siblings().hide(); + this_site.find( '.step-one' ).hide().next().show(); + } + } ); + + /** + * Site card controls + */ + $( '.site-box .close' ).on( 'click', function( e ) { + e.preventDefault(); + var siteBox = $( '.site-box' ), + page_builder = $( '.generatepress-sites' ).attr( 'data-page-builder' ); + + siteBox.find( '.steps' ).hide(); + siteBox.find( '.step-one' ).fadeIn().css( 'display', '' ); + + $( '.generatepress-sites' ).removeClass( 'site-open' ); + $( '.library-filters' ).show(); + siteBox.siblings( page_builder ).fadeIn( 'fast' ); + + bLazy.revalidate(); + + if ( $( 'body' ).hasClass( 'site-import-data-exists' ) ) { + $( '.remove-site' ).show(); + $( '.remove-site .do-remove-site' ).show(); + $( '.remove-site .skip-remove-site' ).show(); + $( '.generatepress-sites' ).addClass( 'remove-site-needed' ); + window.scrollTo( { top: 0 } ); + } + } ); + + $( '.site-box .next' ).on( 'click', function( e ) { + var page_builder = $( '.generatepress-sites' ).attr( 'data-page-builder' ); + var this_site = $( this ).closest( '.site-box' ); + var next_site = this_site.nextAll( page_builder ).not( '.disabled-site' ).first(); + + if ( ! next_site.length ) { + next_site = $( '.generatepress-sites' ).find( '.site-box' + page_builder ).first(); + } + + var screenshot = next_site.find( '.site-card-screenshot img' ).attr( 'data-src' ); + + if ( ! screenshot ) { + screenshot = next_site.find( '.site-card-screenshot img' ).attr( 'src' ); + } + + if ( this_site.parent().hasClass( 'site-open' ) ) { + this_site.hide(); + next_site.show().find( '.step-one' ).hide().next().show(); + next_site.find( '.site-overview-screenshot img' ).attr( 'src', screenshot ); + } + + if ( this_site.find( '.site-demo' ).hasClass( 'open' ) ) { + this_site.find( '.site-demo' ).hide().removeClass( 'open' ); + + if ( ! next_site.find( 'iframe' ).attr( 'src' ) ) { + next_site.find( 'iframe' ).attr( 'src', next_site.data( 'site-data' ).preview_url ); + } + + next_site.find( 'iframe' ).on( 'load', function () { + next_site.find( '.demo-loading' ).fadeOut().remove(); + }); + + next_site.find( '.site-demo' ).show().addClass( 'open' ); + } + + if ( $( 'body' ).hasClass( 'site-import-data-exists' ) ) { + $( '.remove-site' ).show(); + $( '.remove-site .do-remove-site' ).show(); + $( '.remove-site .skip-remove-site' ).show(); + $( '.generatepress-sites' ).addClass( 'remove-site-needed' ); + } + } ); + + $( '.site-box .prev' ).on( 'click', function( e ) { + var page_builder = $( '.generatepress-sites' ).attr( 'data-page-builder' ); + var this_site = $( this ).closest( '.site-box' ); + var prev_site = this_site.prevAll( page_builder ).not( '.disabled-site' ).first(); + + if ( ! prev_site.length ) { + prev_site = $( '.generatepress-sites' ).find( '.site-box' + page_builder ).last(); + } + + var screenshot = prev_site.find( '.site-card-screenshot img' ).attr( 'data-src' ); + + if ( ! screenshot ) { + screenshot = prev_site.find( '.site-card-screenshot img' ).attr( 'src' ); + } + + if ( this_site.parent().hasClass( 'site-open' ) ) { + this_site.hide(); + prev_site.show().find( '.step-one' ).hide().next().show(); + prev_site.find( '.site-overview-screenshot img' ).attr( 'src', screenshot ); + } + + if ( this_site.find( '.site-demo' ).hasClass( 'open' ) ) { + this_site.find( '.site-demo' ).hide().removeClass( 'open' ); + + if ( ! prev_site.find( 'iframe' ).attr( 'src' ) ) { + prev_site.find( 'iframe' ).attr( 'src', prev_site.data( 'site-data' ).preview_url ); + } + + prev_site.find( 'iframe' ).on( 'load', function () { + prev_site.find( '.demo-loading' ).fadeOut().remove(); + }); + + prev_site.find( '.site-demo' ).show().addClass( 'open' ); + } + + if ( $( 'body' ).hasClass( 'site-import-data-exists' ) ) { + $( '.remove-site' ).show(); + $( '.remove-site .do-remove-site' ).show(); + $( '.remove-site .skip-remove-site' ).show(); + $( '.generatepress-sites' ).addClass( 'remove-site-needed' ); + } + } ); + + $( '.site-box .site-details' ).on( 'click', function( e ) { + var _this = $( this ), + siteBox = _this.closest( '.site-box' ), + step = _this.closest( '.steps' ), + screenshot = step.find( '.site-card-screenshot img' ).attr( 'data-src' ); + + if ( ! screenshot ) { + screenshot = step.find( '.site-card-screenshot img' ).attr( 'src' ); + } + + $( '.generatepress-sites' ).addClass( 'site-open' ); + $( '.library-filters' ).hide(); + + _this.closest( '.site-box' ).siblings().hide(); + step.hide(); + step.next().fadeIn( 'fast' ); + siteBox.find( '.site-overview-screenshot img' ).attr( 'src', screenshot ); + } ); + + $( '.confirm-content-import' ).on( 'change', function() { + var siteBox = $( this ).closest( '.site-box' ); + + if ( $( this ).is( ':checked' ) ) { + siteBox.find( 'input.import-content' ).attr( 'disabled', false ); + } else { + siteBox.find( 'input.import-content' ).attr( 'disabled', 'disabled' ); + } + } ); + + $( '.confirm-options-import' ).on( 'change', function() { + var siteBox = $( this ).closest( '.site-box' ); + + if ( $( this ).is( ':checked' ) ) { + siteBox.find( 'input.backup-options' ).attr( 'disabled', false ); + siteBox.find( 'input.import-options' ).attr( 'disabled', false ); + } else { + siteBox.find( 'input.backup-options' ).attr( 'disabled', 'disabled' ); + siteBox.find( 'input.import-options' ).attr( 'disabled', 'disabled' ); + } + } ); + + $( '.page-builder-group' ).on( 'change', function( e ) { + e.preventDefault(); + + var _this = $( this ), + filter = _this.val(); + + // _this.siblings().removeClass( 'active' ); + // _this.addClass( 'active' ); + + if ( '' == filter ) { + $( '.site-box' ).show(); + $( '.generatepress-sites' ).attr( 'data-page-builder', '' ); + } else { + $( '.site-box:not(.' + filter + ')' ).hide(); + $( '.site-box.' + filter ).show(); + $( '.generatepress-sites' ).attr( 'data-page-builder', '.' + filter ); + } + + bLazy.revalidate(); + } ); + + var setup_demo_content = function( _this ) { + var site_box = _this.closest( '.site-box' ); + var site_data = site_box.data( 'site-data' ); + + if ( ! site_box.hasClass( 'data-content-loaded' ) ) { + // Prevent duplicate setup. + site_box.addClass( 'data-content-loaded' ); + + $.ajax({ + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_setup_demo_content_' + site_data.slug, + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + console.log(data); + + if ( data.content ) { + if ( data.widgets ) { + site_box.find( '.site-action.import-content' ).attr( 'data-widgets', true ); + } else { + site_box.find( '.site-action.import-content' ).attr( 'data-widgets', false ); + } + + if ( data.plugins ) { + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_check_plugins_' + site_data.slug, + nonce: generate_sites_params.nonce, + data: site_box.data( 'site-data' ), + }, + success: function( data ) { + console.log( data ); + site_box.find( '.site-plugins' ).hide(); + site_box.find( '.plugin-area' ).show(); + site_box.find( '.site-action.import-content' ).attr( 'data-plugins', JSON.stringify( data.plugin_data ) ); + + $.each( data.plugin_data, function( index, value ) { + var slug = value.slug.substring( 0, value.slug.indexOf( '/' ) ); + + if ( value.repo && ! value.installed ) { + site_box.find( '.automatic-plugins' ).fadeIn(); + site_box.find( '.automatic-plugins ul' ).append( '
      • ' + value.name + '
      • ' ); + } else if ( value.installed || value.active ) { + site_box.find( '.installed-plugins' ).fadeIn(); + site_box.find( '.installed-plugins ul' ).append( '
      • ' + value.name + '
      • ' ); + } else { + site_box.find( '.manual-plugins' ).fadeIn(); + site_box.find( '.manual-plugins ul' ).append( '
      • ' + value.name + '
      • ' ); + } + } ); + + if ( $.isEmptyObject( data.plugin_data ) ) { + site_box.find( '.no-plugins' ).fadeIn(); + } + + site_box.find( '.loading' ).hide(); + site_box.find( '.site-action.import-content' ).show(); + site_box.find( '.confirm-content-import-message' ).show(); + site_box.find( '.skip-content-import' ).show(); + }, + error: function( data ) { + console.log( data ); + site_box.find( '.site-message' ).hide(); + site_box.find( '.error-message' ).html( data.status + ' ' + data.statusText + ' [?]' ).show(); + siteBox.find( '.theme-options .big-loader' ).css( 'opacity', '0' ); + siteBox.find( '.theme-options .number' ).css( 'opacity', '1' ); + } + } ); + } else { + site_box.find( '.loading' ).hide(); + site_box.find( '.site-action.import-content' ).show(); + site_box.find( '.confirm-content-import-message' ).show(); + site_box.find( '.skip-content-import' ).show(); + } + } else { + site_box.find( '.loading' ).hide(); + site_box.find( '.demo-content .big-loader' ).css( 'opacity', '0' ); + site_box.find( '.demo-content .number' ).css( 'opacity', '1' ).addClass( 'step-complete' ); + _this.next( 'input' ).show(); + + setTimeout( function() { + site_box.find( '.import-complete .number' ).css( 'opacity', '1' ).addClass( 'step-complete' ); + }, 500 ); + } + + + }, + error: function( data ) { + console.log( data ); + site_box.removeClass( 'data-loaded' ); + site_box.find( '.loading' ).hide(); + site_box.find( '.error-message' ).html( data.status + ' ' + data.statusText + ' [?]' ).show(); + } + }); + } + }; + + /** + * Backup options. + */ + $( '.site-box .backup-options' ).on( 'click', function(e) { + e.preventDefault(); + + var _this = $( this ), + siteBox = _this.closest( '.site-box' ); + + _this.hide(); + siteBox.find( '.confirm-backup-options' ).hide(); + backup_options( _this ); + } ); + + /** + * Backup and import theme options. + */ + $( '.site-box .import-options' ).on( 'click', function( e ) { + e.preventDefault(); + + var _this = $( this ); + + _this.hide(); + _this.closest( '.site-box' ).find( '.confirm-backup-options' ).hide(); + import_options( _this ); + } ); + + function backup_options( _this ) { + var siteBox = _this.closest( '.site-box' ) + data = siteBox.data( 'site-data' ); + + siteBox.find( '.site-message' ).text( generate_sites_params.backing_up_options ); + siteBox.find( '.loading' ).show(); + + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_backup_options_' + data.slug, + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + download( data, 'generatepress-options-backup.json', 'application/json' ); + + siteBox.find( '.loading' ).hide(); + _this.next( 'input' ).show(); + }, + error: function( data ) { + console.log( data ); + siteBox.find( '.error-message' ).html( data.status + ' ' + data.statusText + ' [?]' ).show(); + } + } ); + } + + function import_options( _this ) { + var siteBox = _this.closest( '.site-box' ), + data = siteBox.data( 'site-data' ); + + siteBox.find( '.site-message' ).text( generate_sites_params.importing_options ); + siteBox.find( '.loading' ).show(); + siteBox.find( '.theme-options .big-loader' ).css( 'opacity', '1' );; + siteBox.find( '.theme-options .number' ).css( 'opacity', '0' ); + + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_import_options_' + data.slug, + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + if ( 'undefined' !== typeof data.success && ! data.success ) { + siteBox.find( '.loading' ).hide(); + siteBox.find( '.error-message' ).html( data.data ).show(); + siteBox.find( '.theme-options .big-loader' ).css( 'opacity', '0' ); + siteBox.find( '.theme-options .number' ).css( 'opacity', '1' ); + return; + } + + console.log( 'Options imported.' ); + + _this.hide(); + siteBox.find( '.loading' ).hide(); + siteBox.find( '.theme-options .big-loader' ).css( 'opacity', '0' ); + siteBox.find( '.theme-options .number' ).css( 'opacity', '1' ).addClass( 'step-complete' ); + $( 'body' ).addClass( 'site-import-data-exists' ); + + siteBox.find( '.site-message' ).text( generate_sites_params.checking_demo_content ); + siteBox.find( '.loading' ).show(); + setup_demo_content( _this ); + }, + error: function( data ) { + console.log( data ); + siteBox.find( '.loading' ).hide(); + siteBox.find( '.error-message' ).html( data.status + ' ' + data.statusText + ' [?]' ).show(); + siteBox.find( '.theme-options .big-loader' ).css( 'opacity', '0' ); + siteBox.find( '.theme-options .number' ).css( 'opacity', '1' ); + } + } ); + } + + $( '.site-box' ).on( 'click', '.skip-content-import a', function(e) { + e.preventDefault(); + + var _this = $( this ), + siteBox = _this.closest( '.site-box' ); + + siteBox.find( '.skip-content-import' ).hide(); + siteBox.find( '.demo-content' ).css( 'opacity', '0.5' ); + siteBox.find( '.confirm-content-import-message' ).hide(); + siteBox.find( '.action-buttons input' ).hide(); + siteBox.find( '.action-buttons input.view-site' ).show(); + siteBox.find( '.import-complete .number' ).css( 'opacity', '1' ).addClass( 'step-complete' ); + } ); + + /** + * Install and activate plugins. + * Before content, as content may be depedent on plugins. + */ + $( '.site-box' ).on( 'click', '.import-content', function(e) { + e.preventDefault(); + + var _this = $( this ) + siteBox = _this.closest( '.site-box' ), + plugins = _this.data( 'plugins' ), + plugin_text = siteBox.find( '.automatic-plugins li' ); + + _this.hide(); + siteBox.find( '.skip-content-import' ).hide(); + siteBox.find( '.loading' ).show(); + siteBox.find( '.confirm-content-import-message' ).hide(); + siteBox.find( '.demo-content .big-loader' ).css( 'opacity', '1' ); + siteBox.find( '.demo-content .number' ).css( 'opacity', '0' ); + $( 'body' ).addClass( 'site-import-content-exists' ); + + siteBox.attr( 'data-plugins', JSON.stringify( plugins ) ); + + if ( ! $.isEmptyObject( plugins ) ) { + siteBox.find( '.site-message' ).text( generate_sites_params.installing_plugins ); + + $.each( plugins, function( index, value ) { + var plugin_slug = value.slug.split('/')[0]; + + var plugin_row = plugin_text.filter( function () { + return $( this ).attr( 'data-slug' ) == plugin_slug; + } ); + + if ( 'elementor' === plugin_slug ) { + siteBox.find( '.replace-elementor-urls' ).show(); + } + + if ( ! value.installed ) { + plugin_row.find( '.loading' ).show(); + plugin_row.addClass( 'installing-plugins' ); + + // Install BB Lite if Pro doesn't exist. + if ( 'bb-plugin' == plugin_slug ) { + plugin_slug = 'beaver-builder-lite-version'; + } + + wp.updates.installPlugin( { + slug: plugin_slug, + success: function( data ) { + console.log( data ); + + plugin_row.removeClass( 'installing-plugins' ).addClass( 'plugin-installed' ); + plugin_row.removeClass( 'show-loading' ).next().addClass( 'show-loading' ); + + // Remove current plugin from queue + delete plugins[index]; + + if ( $.isEmptyObject( plugins ) ) { + // Onto the next step + activate_plugins( _this ); + } + }, + error: function( data ) { + console.log(data); + + plugin_row.append( '' + data.errorMessage + '' ); + plugin_row.removeClass( 'installing-plugins' ).addClass( 'plugin-install-failed' ); + plugin_row.removeClass( 'show-loading' ).next().addClass( 'show-loading' ); + + // Remove current plugin from queue + delete plugins[index]; + + if ( $.isEmptyObject( plugins ) ) { + // Onto the next step + activate_plugins( _this ); + } + } + } ); + } else { + // Remove current plugin from queue + delete plugins[index]; + + if ( $.isEmptyObject( plugins ) ) { + // Onto the next step + activate_plugins( _this ); + } + } + + } ); + } else { + download_content( _this ); + } + } ); + + function activate_plugins( _this ) { + var siteBox = _this.closest( '.site-box' ), + data = siteBox.data( 'site-data' ); + + siteBox.find( '.site-message' ).text( generate_sites_params.activating_plugins ); + + setTimeout( function() { + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_activate_plugins_' + data.slug, + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + console.log( data ); + download_content( _this ); + }, + error: function( data ) { + console.log( data ); + siteBox.find( '.loading' ).hide(); + siteBox.find( '.error-message' ).html( data.status + ' ' + data.statusText + ' [?]' ).show(); + siteBox.find( '.theme-options .big-loader' ).css( 'opacity', '0' ); + siteBox.find( '.theme-options .number' ).css( 'opacity', '1' ); + } + } ); + }, 250 ); + } + + function download_content( _this ) { + var siteBox = _this.closest( '.site-box' ), + data = siteBox.data( 'site-data' ); + + siteBox.find( '.site-message' ).text( generate_sites_params.downloading_content ); + + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_download_content_' + data.slug, + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + console.log( data ); + + import_content( _this ); + }, + error: function( data ) { + console.log( data ); + + siteBox.find( '.loading' ).hide(); + siteBox.find( '.error-message' ).html( data.status + ' ' + data.statusText + ' [?]' ).show(); + siteBox.find( '.theme-options .big-loader' ).css( 'opacity', '0' ); + siteBox.find( '.theme-options .number' ).css( 'opacity', '1' ); + } + } ); + } + + function import_content( _this ) { + var siteBox = _this.closest( '.site-box' ), + data = siteBox.data( 'site-data' ); + + siteBox.find( '.site-message' ).text( generate_sites_params.importing_content ); + + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_import_content_' + data.slug, + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + console.log( data ); + + import_site_options( _this ); + }, + error: function( data ) { + console.log( data ); + + siteBox.find( '.loading' ).hide(); + siteBox.find( '.error-message' ).html( data.status + ' ' + data.statusText + ' [?]' ).show(); + siteBox.find( '.theme-options .big-loader' ).css( 'opacity', '0' ); + siteBox.find( '.theme-options .number' ).css( 'opacity', '1' ); + } + } ); + } + + /** + * Import site options. + * Comes last, as options may be dependent on plugins. + */ + function import_site_options( _this ) { + var siteBox = _this.closest( '.site-box' ), + data = siteBox.data( 'site-data' ); + + siteBox.find( '.site-message' ).text( generate_sites_params.importing_site_options ); + + setTimeout( function() { + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_import_site_options_' + data.slug, + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + console.log( data ); + + if ( '1' == _this.data( 'widgets' ) ) { + + import_widgets( _this ); + + } else { + + siteBox.find( '.loading' ).hide(); + siteBox.find( '.site-message' ).hide(); + siteBox.find( '.demo-content .big-loader' ).css( 'opacity', '0' ); + siteBox.find( '.demo-content .number' ).css( 'opacity', '1' ).addClass( 'step-complete' ); + _this.next( 'input' ).show(); + siteBox.find( '.import-complete .number' ).css( 'opacity', '1' ).addClass( 'step-complete' ); + + } + }, + error: function( data ) { + console.log( data ); + + siteBox.find( '.loading' ).hide(); + siteBox.find( '.error-message' ).html( data.status + ' ' + data.statusText + ' [?]' ).show(); + siteBox.find( '.theme-options .big-loader' ).css( 'opacity', '0' ); + siteBox.find( '.theme-options .number' ).css( 'opacity', '1' ); + } + } ); + }, 250 ); + } + + /** + * Import widgets. + */ + function import_widgets( _this ) { + var siteBox = _this.closest( '.site-box' ), + data = siteBox.data( 'site-data' ); + + siteBox.find( '.site-message' ).text( generate_sites_params.importing_widgets ); + + setTimeout( function() { + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_import_widgets_' + data.slug, + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + console.log( data ); + + siteBox.find( '.loading' ).hide(); + siteBox.find( '.site-message' ).hide(); + siteBox.find( '.demo-content .big-loader' ).css( 'opacity', '0' ); + siteBox.find( '.demo-content .number' ).css( 'opacity', '1' ).addClass( 'step-complete' ); + _this.next( 'input' ).show(); + siteBox.find( '.import-complete .number' ).css( 'opacity', '1' ).addClass( 'step-complete' ); + }, + error: function( data ) { + console.log( data ); + + siteBox.find( '.loading' ).hide(); + siteBox.find( '.error-message' ).html( data.status + ' ' + data.statusText + ' [?]' ).show(); + siteBox.find( '.theme-options .big-loader' ).css( 'opacity', '0' ); + siteBox.find( '.theme-options .number' ).css( 'opacity', '1' ); + } + } ); + }, 250 ); + } + + /** + * View our completed site. + */ + $( '.site-box .view-site, .remove-site .view-site' ).on( 'click', function( e ) { + e.preventDefault(); + + window.location.href = generate_sites_params.home_url; + } ); + + function restoreThemeOptions() { + var restoreBox = $( '.remove-site' ); + + restoreBox.find( '.do-remove-site' ).hide() + restoreBox.find( '.skip-remove-site' ).hide(); + restoreBox.find( '.loading' ).show(); + restoreBox.find( '.remove-site-message' ).text( generate_sites_params.restoreThemeOptions ); + + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_restore_theme_options', + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + if ( generate_sites_params.hasContentBackup || $( 'body' ).hasClass( 'site-import-content-exists' ) ) { + restoreSiteOptions(); + } else { + restoreCSS(); + } + console.log( data ); + }, + error: function( data ) { + console.log( data ); + } + } ); + } + + function restoreSiteOptions() { + var restoreBox = $( '.remove-site' ); + + restoreBox.find( '.remove-site-message' ).text( generate_sites_params.restoreSiteOptions ); + + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_restore_site_options', + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + restoreContent(); + console.log( data ); + }, + error: function( data ) { + console.log( data ); + } + } ); + } + + function restoreContent() { + var restoreBox = $( '.remove-site' ); + + restoreBox.find( '.remove-site-message' ).text( generate_sites_params.restoreContent ); + + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_restore_content', + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + restorePlugins(); + console.log( data ); + }, + error: function( data ) { + console.log( data ); + } + } ); + } + + function restorePlugins() { + var restoreBox = $( '.remove-site' ); + + restoreBox.find( '.remove-site-message' ).text( generate_sites_params.restorePlugins ); + + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_restore_plugins', + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + restoreWidgets(); + console.log( data ); + }, + error: function( data ) { + console.log( data ); + } + } ); + } + + function restoreWidgets() { + var restoreBox = $( '.remove-site' ); + + restoreBox.find( '.remove-site-message' ).text( generate_sites_params.restoreWidgets ); + + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_restore_widgets', + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + restoreCSS(); + console.log( data ); + }, + error: function( data ) { + console.log( data ); + } + } ); + } + + function restoreCSS() { + var restoreBox = $( '.remove-site' ); + + restoreBox.find( '.remove-site-message' ).text( generate_sites_params.restoreCSS ); + + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_restore_css', + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + cleanUp(); + console.log( data ); + }, + error: function( data ) { + console.log( data ); + } + } ); + } + + function cleanUp() { + var restoreBox = $( '.remove-site' ); + + restoreBox.find( '.remove-site-message' ).text( generate_sites_params.cleanUp ); + + $.ajax( { + type: 'POST', + url: generate_sites_params.ajaxurl, + data: { + action: 'generate_restore_site_clean_up', + nonce: generate_sites_params.nonce, + }, + success: function( data ) { + restoreBox.find( '.loading' ).hide(); + restoreBox.hide(); + + $( '.generatepress-sites' ).removeClass( 'remove-site-needed' ); + $( 'body' ).removeClass( 'site-import-content-exists' ); + $( 'body' ).removeClass( 'site-import-data-exists' ); + console.log( data ); + }, + error: function( data ) { + console.log( data ); + } + } ); + } + + $( '.do-remove-site' ).on( 'click', function( e ) { + e.preventDefault(); + + if ( confirm( generate_sites_params.confirmRemoval ) ) { + restoreThemeOptions(); + } + } ); + + $( '.skip-remove-site' ).on( 'click', function( e ) { + e.preventDefault(); + + $( '.remove-site' ).hide(); + $( '.generatepress-sites' ).removeClass( 'remove-site-needed' ); + $( 'body' ).removeClass( 'site-import-content-exists' ); + $( 'body' ).removeClass( 'site-import-data-exists' ); + } ); +} ); diff --git a/wp-content/plugins/gp-premium/sites/assets/js/blazy.min.js b/wp-content/plugins/gp-premium/sites/assets/js/blazy.min.js new file mode 100644 index 0000000..3957cac --- /dev/null +++ b/wp-content/plugins/gp-premium/sites/assets/js/blazy.min.js @@ -0,0 +1,6 @@ +/*! + hey, [be]Lazy.js - v1.8.2 - 2016.10.25 + A fast, small and dependency free lazy load script (https://github.com/dinbror/blazy) + (c) Bjoern Klinggaard - @bklinggaard - http://dinbror.dk/blazy +*/ + (function(q,m){"function"===typeof define&&define.amd?define(m):"object"===typeof exports?module.exports=m():q.Blazy=m()})(this,function(){function q(b){var c=b._util;c.elements=E(b.options);c.count=c.elements.length;c.destroyed&&(c.destroyed=!1,b.options.container&&l(b.options.container,function(a){n(a,"scroll",c.validateT)}),n(window,"resize",c.saveViewportOffsetT),n(window,"resize",c.validateT),n(window,"scroll",c.validateT));m(b)}function m(b){for(var c=b._util,a=0;a=c.left&&b.bottom>=c.top&&b.left<=c.right&&b.top<=c.bottom}function z(b,c,a){if(!t(b,a.successClass)&&(c||a.loadInvisible||0=window.screen.width)return u=a.src,!1});setTimeout(function(){q(a)})}}); diff --git a/wp-content/plugins/gp-premium/sites/assets/js/download.js b/wp-content/plugins/gp-premium/sites/assets/js/download.js new file mode 100644 index 0000000..469a96b --- /dev/null +++ b/wp-content/plugins/gp-premium/sites/assets/js/download.js @@ -0,0 +1,167 @@ +//download.js v4.2, by dandavis; 2008-2016. [MIT] see http://danml.com/download.html for tests/usage +// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime +// v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs +// v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support. 3.1 improved safari handling. +// v4 adds AMD/UMD, commonJS, and plain browser support +// v4.1 adds url download capability via solo URL argument (same domain/CORS only) +// v4.2 adds semantic variable names, long (over 2MB) dataURL support, and hidden by default temp anchors +// https://github.com/rndme/download + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define([], factory); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } else { + // Browser globals (root is window) + root.download = factory(); + } +}(this, function () { + + return function download(data, strFileName, strMimeType) { + + var self = window, // this script is only for browsers anyway... + defaultMime = "application/octet-stream", // this default mime also triggers iframe downloads + mimeType = strMimeType || defaultMime, + payload = data, + url = !strFileName && !strMimeType && payload, + anchor = document.createElement("a"), + toString = function(a){return String(a);}, + myBlob = (self.Blob || self.MozBlob || self.WebKitBlob || toString), + fileName = strFileName || "download", + blob, + reader; + myBlob= myBlob.call ? myBlob.bind(self) : Blob ; + + if(String(this)==="true"){ //reverse arguments, allowing download.bind(true, "text/xml", "export.xml") to act as a callback + payload=[payload, mimeType]; + mimeType=payload[0]; + payload=payload[1]; + } + + + if(url && url.length< 2048){ // if no filename and no mime, assume a url was passed as the only argument + fileName = url.split("/").pop().split("?")[0]; + anchor.href = url; // assign href prop to temp anchor + if(anchor.href.indexOf(url) !== -1){ // if the browser determines that it's a potentially valid url path: + var ajax=new XMLHttpRequest(); + ajax.open( "GET", url, true); + ajax.responseType = 'blob'; + ajax.onload= function(e){ + download(e.target.response, fileName, defaultMime); + }; + setTimeout(function(){ ajax.send();}, 0); // allows setting custom ajax headers using the return: + return ajax; + } // end if valid url? + } // end if url? + + + //go ahead and download dataURLs right away + if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(payload)){ + + if(payload.length > (1024*1024*1.999) && myBlob !== toString ){ + payload=dataUrlToBlob(payload); + mimeType=payload.type || defaultMime; + }else{ + return navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs: + navigator.msSaveBlob(dataUrlToBlob(payload), fileName) : + saver(payload) ; // everyone else can save dataURLs un-processed + } + + }else{//not data url, is it a string with special needs? + if(/([\x80-\xff])/.test(payload)){ + var i=0, tempUiArr= new Uint8Array(payload.length), mx=tempUiArr.length; + for(i;iimage_importer = new GeneratePress_Sites_Image_Importer(); + } + + /** + * Import + * + * @since 1.6 + * @return void + */ + public function import() { + GeneratePress_Sites_Helper::log( '== Start Processing Beaver Builder Images ==' ); + + $post_ids = GeneratePress_Sites_Helper::get_all_posts(); + + if ( is_array( $post_ids ) ) { + foreach ( $post_ids as $post_id ) { + $this->import_single_post( $post_id ); + } + } + } + + /** + * Update post meta. + * + * @param integer $post_id Post ID. + * @return void + */ + public function import_single_post( $post_id = 0 ) { + + if ( ! empty( $post_id ) ) { + + // Get page builder data. + $data = get_post_meta( $post_id, '_fl_builder_data', true ); + + if ( ! empty( $data ) ) { + + foreach ( $data as $key => $el ) { + + // Import background images. + if ( 'row' === $el->type || 'column' === $el->type ) { + $data[ $key ]->settings = $this->import_background_images( $el->settings ); + } + + // Import module images. + if ( 'module' === $el->type ) { + $data[ $key ]->settings = $this->import_module_images( $el->settings ); + } + + } + + // Update page builder data. + update_post_meta( $post_id, '_fl_builder_data', $data ); + update_post_meta( $post_id, '_fl_builder_draft', $data ); + + // Clear all cache. + FLBuilderModel::delete_asset_cache_for_all_posts(); + } + } + } + + /** + * Import Module Images. + * + * @param object $settings Module settings object. + * @return object + */ + public function import_module_images( $settings ) { + + /** + * 1) Set photos. + */ + $settings = $this->import_photo( $settings ); + + /** + * 2) Set `$settings->data` for Only type 'image-icon' + * + * @todo Remove the condition `'image-icon' === $settings->type` if `$settings->data` is used only for the Image Icon. + */ + if ( isset( $settings->data ) && isset( $settings->photo ) && ! empty( $settings->photo ) && 'image-icon' === $settings->type ) { + $settings->data = FLBuilderPhoto::get_attachment_data( $settings->photo ); + } + + /** + * 3) Set `list item` module images + */ + if ( isset( $settings->add_list_item ) ) { + foreach ( $settings->add_list_item as $key => $value ) { + $settings->add_list_item[ $key ] = $this->import_photo( $value ); + } + } + + return $settings; + } + + /** + * Helper: Import BG Images. + * + * @param object $settings Row settings object. + * @return object + */ + public function import_background_images( $settings ) { + + if ( ! empty( $settings->bg_image ) && ! empty( $settings->bg_image_src ) ) { + $image = array( + 'url' => $settings->bg_image_src, + 'id' => $settings->bg_image, + ); + + $downloaded_image = $this->image_importer->import( $image ); + + $settings->bg_image_src = $downloaded_image['url']; + $settings->bg_image = $downloaded_image['id']; + } + + return $settings; + } + + /** + * Helper: Import Photo. + * + * @param object $settings Row settings object. + * @return object + */ + public function import_photo( $settings ) { + + if ( ! empty( $settings->photo ) && ! empty( $settings->photo_src ) ) { + $image = array( + 'url' => $settings->photo_src, + 'id' => $settings->photo, + ); + + $downloaded_image = $this->image_importer->import( $image ); + + $settings->photo_src = $downloaded_image['url']; + $settings->photo = $downloaded_image['id']; + } + + return $settings; + } + + +} diff --git a/wp-content/plugins/gp-premium/sites/classes/class-content-importer.php b/wp-content/plugins/gp-premium/sites/classes/class-content-importer.php new file mode 100644 index 0000000..35c3fbd --- /dev/null +++ b/wp-content/plugins/gp-premium/sites/classes/class-content-importer.php @@ -0,0 +1,36 @@ +mapping['user_slug'][ $current_user_obj->user_login ] = $current_user_obj->ID; + } + + /** + * Get all protected variables from the WXR_Importer needed for continuing the import. + */ + public function get_importer_data() { + return array( + 'mapping' => $this->mapping + ); + } + + /** + * Sets all protected variables from the WXR_Importer needed for continuing the import. + * + * @param array $data with set variables. + */ + public function set_importer_data( $data ) { + //$this->mapping = empty( $data['mapping'] ) ? array() : $data['mapping']; + //$this->requires_remapping = empty( $data['requires_remapping'] ) ? array() : $data['requires_remapping']; + } +} diff --git a/wp-content/plugins/gp-premium/sites/classes/class-site-helper.php b/wp-content/plugins/gp-premium/sites/classes/class-site-helper.php new file mode 100644 index 0000000..765a677 --- /dev/null +++ b/wp-content/plugins/gp-premium/sites/classes/class-site-helper.php @@ -0,0 +1,990 @@ + $widgets ) { + // Skip inactive widgets (should not be in export file). + if ( 'wp_inactive_widgets' === $sidebar_id ) { + continue; + } + + if ( is_array( $widgets ) ) { + foreach ( $widgets as $widget_instance_id => $widget ) { + $all_widgets[] = $widget; + } + } + } + + $results['wp_inactive_widgets'] = $all_widgets; + + update_option( 'sidebars_widgets', $results ); + + } + + /** + * Checks to see whether options exist or not. + * + * @since 1.8 + * + * @return bool + */ + public static function do_options_exist() { + $theme_mods = self::get_theme_mods(); + $settings = self::get_theme_settings(); + + $has_data = array( + 'mods' => array(), + 'options' => array() + ); + + foreach ( $theme_mods as $theme_mod ) { + if ( get_theme_mod( $theme_mod ) ) { + $has_data['mods'][$theme_mod] = get_theme_mod( $theme_mod ); + } + } + + foreach ( $settings as $setting ) { + if ( get_option( $setting ) ) { + + // The blog module runs a migration script on activation for now. This checks if those migrated values have been changed. + if ( 'generate_blog_settings' === $setting && function_exists( 'generate_blog_get_defaults' ) ) { + $defaults = generate_blog_get_defaults(); + $options = get_option( $setting ); + $diff = array(); + + foreach ( $options as $option => $value ) { + if ( isset( $defaults[ $option ] ) && $value !== $defaults[ $option ] ) { + $diff[ $option ] = $value; + } + } + + if ( empty( $diff ) ) { + continue; + } + } + + $has_data['options'][$setting] = get_option( $setting ); + } + } + + if ( ! array_filter( $has_data ) ) { + return false; + } else { + return true; + } + } + + /** + * Imports our content and custom CSS. + * + * @since 1.6 + * + * @param string $path + */ + public static function import_xml( $path, $slug ) { + $options = array( + 'fetch_attachments' => true, + 'default_author' => 0, + ); + + $current_css = wp_get_custom_css_post(); + + $logger = new GeneratePress\WPContentImporter2\WPImporterLogger(); + $importer = new GeneratePress_Sites_Content_Importer( $options ); + $importer->set_logger( $logger ); + $result = $importer->import( $path ); + + // Get all mapped post and term data. + $existing_data = self::get_mapped_post_ids( $slug ); + $mapped_data = $importer->get_importer_data(); + $mapped_posts = $mapped_data['mapping']['post']; + + // Merge exiting mapped posts with any new ones. Existing posts don't get mapped, so we need to preserve them. + $all_data = $mapped_posts + $existing_data; + + // Set our site specific mapped posts with all of our data. + update_option( 'generatepress_sites_mapped_ids_' . $slug, $all_data, false ); + + // Set mapped term IDs. + // These are always the same, even if the site has been imported before. No fancy stuff needed. + $term_mapping = $mapped_data['mapping']['term_id']; + set_transient( 'generatepress_sites_mapped_term_ids', $term_mapping, 0.1 * HOUR_IN_SECONDS ); + + wp_update_custom_css_post( $current_css->post_content ); + + // Page builders need so much extra work. + self::update_page_builder_content(); + + // Log our content + //self::log( $logger ); + } + + /** + * List plugins that have a pro version. + * + * We want to check to see if these exist before installing or activating + * the free versions. + * + * @since 1.6 + * + * @return array + */ + public static function check_for_pro_plugins() { + return apply_filters( 'generate_sites_pro_plugins', array( + 'beaver-builder-lite-version/fl-builder.php' => 'bb-plugin/fl-builder.php', + 'ultimate-addons-for-beaver-builder-lite/bb-ultimate-addon.php' => 'bb-ultimate-addon/bb-ultimate-addon.php', + 'powerpack-addon-for-beaver-builder/bb-powerpack-lite.php' => 'bbpowerpack/bb-powerpack.php', + ) ); + } + + /** + * Check to see if required plugins are active. + * + * @since 1.6 + * + * @param string $plugin + */ + public static function is_plugin_installed( $plugin ) { + $pro_plugins = self::check_for_pro_plugins(); + + // Check to see if this plugin has a pro version. + if ( array_key_exists( $plugin, $pro_plugins ) ) { + if ( file_exists( WP_PLUGIN_DIR . '/' . $pro_plugins[$plugin] ) ) { + return true; + } + } + + if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin ) ) { + return true; + } + + return false; + + } + + /** + * Allow SVG images. + * + * @since 1.6 + * + * @param array $response Attachment response. + * @param object $attachment Attachment object. + * @param array $meta Attachment meta data. + */ + public static function add_svg_image_support( $response, $attachment, $meta ) { + if ( ! function_exists( 'simplexml_load_file' ) ) { + return $response; + } + + if ( ! empty( $response['sizes'] ) ) { + return $response; + } + + if ( 'image/svg+xml' !== $response['mime'] ) { + return $response; + } + + $svg_path = get_attached_file( $attachment->ID ); + + $dimensions = self::get_svg_dimensions( $svg_path ); + + $response['sizes'] = array( + 'full' => array( + 'url' => $response['url'], + 'width' => $dimensions->width, + 'height' => $dimensions->height, + 'orientation' => $dimensions->width > $dimensions->height ? 'landscape' : 'portrait', + ), + ); + + return $response; + } + + /** + * Get the dimensions of the uploaded SVG. + * + * @since 1.6 + * + * @param string $svg SVG file path. + * @return array Return SVG file height & width for valid SVG file. + */ + public static function get_svg_dimensions( $svg ) { + $svg = simplexml_load_file( $svg ); + + if ( false === $svg ) { + $width = '0'; + $height = '0'; + } else { + $attributes = $svg->attributes(); + $width = (string) $attributes->width; + $height = (string) $attributes->height; + } + + return (object) array( + 'width' => $width, + 'height' => $height, + ); + } + + /** + * Taken from the core media_sideload_image function and + * modified to return an array of data instead of html. + * + * @since 1.6 + * + * @param string $file The image file path. + * @return array An array of image data. + */ + public static function sideload_image( $file ) { + + $data = new stdClass(); + + if ( ! function_exists( 'media_handle_sideload' ) ) { + require_once( ABSPATH . 'wp-admin/includes/media.php' ); + require_once( ABSPATH . 'wp-admin/includes/file.php' ); + require_once( ABSPATH . 'wp-admin/includes/image.php' ); + } + + if ( ! empty( $file ) ) { + + // Set variables for storage, fix file filename for query strings. + preg_match( '/[^\?]+\.(jpe?g|jpe|svg|gif|png)\b/i', $file, $matches ); + $file_array = array(); + $file_array['name'] = basename( $matches[0] ); + + // Download file to temp location. + $file_array['tmp_name'] = download_url( $file ); + + // If error storing temporarily, return the error. + if ( is_wp_error( $file_array['tmp_name'] ) ) { + return $file_array['tmp_name']; + } + + // Do the validation and storage stuff. + $id = media_handle_sideload( $file_array, 0 ); + + // If error storing permanently, unlink. + if ( is_wp_error( $id ) ) { + @unlink( $file_array['tmp_name'] ); + return $id; + } + + // Build the object to return. + $meta = wp_get_attachment_metadata( $id ); + $data->attachment_id = $id; + $data->url = wp_get_attachment_url( $id ); + $data->thumbnail_url = wp_get_attachment_thumb_url( $id ); + + if ( isset( $meta['height'] ) ) { + $data->height = $meta['height']; + } + + if ( isset( $meta['width'] ) ) { + $data->width = $meta['width']; + } + } + + return $data; + + } + + /** + * Re-maps menu locations. + * + * @since 1.6 + * + * @param array Incoming locations. + */ + public static function set_nav_menu_locations( $locations = array() ) { + $menu_locations = array(); + + $term_ids = self::get_mapped_term_ids(); + + if ( isset( $locations ) ) { + self::log( '== Start mapping menu locations ==' ); + + foreach ( $locations as $menu => $value ) { + if ( empty( $value ) ) { + continue; + } + + $menu_locations[$menu] = $term_ids[$value]; + self::log( $value . ' -> ' . $term_ids[$value] ); + } + + set_theme_mod( 'nav_menu_locations', $menu_locations ); + } + } + + /** + * Re-maps the global Page Header locations. + * + * @since 1.6 + * + * @param array Incoming locations. + */ + public static function set_global_page_header_locations( $locations = array(), $slug ) { + $new_locations = array(); + + $post_ids = self::get_mapped_post_ids( $slug ); + + if ( isset( $locations ) && ! empty( $locations ) ) { + self::log( '== Start mapping global page headers ==' ); + + foreach( $locations as $key => $value ) { + if ( empty( $value ) ) { + continue; + } + + $new_locations[$key] = $post_ids[$value]; + self::log( $value . ' -> ' . $post_ids[$value] ); + } + + update_option( 'generate_page_header_global_locations', $new_locations ); + } + } + + /** + * Re-maps the per-page Page Headers. + * + * @since 1.6 + * + * @param array Incoming locations. + */ + public static function set_page_headers( $headers = array(), $slug ) { + $new_headers = array(); + + $post_ids = self::get_mapped_post_ids( $slug ); + + if ( isset( $headers ) && ! empty( $headers ) ) { + self::log( '== Start mapping individual page headers ==' ); + + foreach ( $headers as $post_id => $header_id ) { + update_post_meta( $post_ids[$post_id], '_generate-select-page-header', $post_ids[$header_id] ); + self::log( $header_id . ' -> ' . $post_ids[$header_id] ); + } + } + } + + /** + * Re-maps the front page and posts page. + * + * @since 1.6 + * + * @param string Name of the option to update. + * @param string Title of the page. + */ + public static function set_reading_pages( $name, $value, $slug ) { + if ( empty( $value ) ) { + return; + } + + self::log( '== Start mapping front and blog pages ==' ); + + // Get import data, with new menu IDs. + $post_ids = self::get_mapped_post_ids( $slug ); + + update_option( $name, $post_ids[$value] ); + self::log( $value . ' -> ' . $post_ids[$value] ); + } + + /** + * Re-maps WooCommerce pages. + * + * @since 1.6 + * + * @param string Name of the option to update. + * @param string Title of the page. + */ + public static function set_woocommerce_pages( $name, $value, $slug ) { + if ( empty( $value ) ) { + return; + } + + self::log( '== Start mapping WooCommerce pages ==' ); + + $post_ids = self::get_mapped_post_ids( $slug ); + + update_option( $name, $post_ids[$value] ); + self::log( $value . ' -> ' . $post_ids[$value] ); + } + + /** + * Change the menu IDs in the custom menu widgets in the widget import data. + * This solves the issue with custom menu widgets not having the correct (new) menu ID, because they + * have the old menu ID from the export site. + * + * @param array $widget The widget settings array. + */ + public static function fix_custom_menu_widget_ids( $widget ) { + // Skip (no changes needed), if this is not a custom menu widget. + if ( ! array_key_exists( 'nav_menu', $widget ) || empty( $widget['nav_menu'] ) || ! is_int( $widget['nav_menu'] ) ) { + return $widget; + } + + // Get import data, with new menu IDs. + $term_ids = self::get_mapped_term_ids(); + + if ( ! isset( $term_ids[ $widget['nav_menu'] ] ) ) { + return $widget; + } + + self::log( '== Start mapping navigation widgets ==' ); + self::log( $widget['nav_menu'] . ' -> ' . $term_ids[ $widget['nav_menu'] ] ); + + // Set the new menu ID for the widget. + $widget['nav_menu'] = $term_ids[ $widget['nav_menu'] ]; + + return $widget; + } + + /** + * Re-maps the element locations. + * + * @since 1.7 + * + * @param array Incoming locations. + */ + public static function set_element_locations( $locations = array(), $slug ) { + $post_ids = self::get_mapped_post_ids( $slug ); + + if ( isset( $locations ) && ! empty( $locations ) ) { + self::log( '== Start mapping element locations ==' ); + + foreach( $locations as $key => $value ) { + $new_locations = array(); + if ( empty( $value ) ) { + continue; + } + + foreach ( ( array ) $value as $data ) { + if ( $data['object'] ) { + self::log( $data['object'] . ' -> ' . $post_ids[$data['object']] ); + $data['object'] = $post_ids[$data['object']]; + } + + $new_locations[] = $data; + } + + update_post_meta( $post_ids[$key], '_generate_element_display_conditions', $new_locations ); + } + } + } + + /** + * Re-maps the element exclusions. + * + * @since 1.7 + * + * @param array Incoming locations. + */ + public static function set_element_exclusions( $locations = array(), $slug ) { + $post_ids = self::get_mapped_post_ids( $slug ); + + if ( isset( $locations ) && ! empty( $locations ) ) { + self::log( '== Start mapping element exclusions ==' ); + + foreach( $locations as $key => $value ) { + $new_locations = array(); + if ( empty( $value ) ) { + continue; + } + + foreach ( ( array ) $value as $data ) { + if ( $data['object'] ) { + self::log( $data['object'] . ' -> ' . $post_ids[$data['object']] ); + $data['object'] = $post_ids[$data['object']]; + } + + $new_locations[] = $data; + } + + update_post_meta( $post_ids[$key], '_generate_element_exclude_conditions', $new_locations ); + } + } + } + + /** + * Update menu URLs. + * + * @since 1.7.3 + * + * @param string Preview URL + */ + public static function update_menu_urls( $url ) { + $args = array ( + 'post_type' => 'nav_menu_item', + 'fields' => 'ids', + 'no_found_rows' => true, + 'post_status' => 'any', + 'numberposts' => 50, + ); + + $items = get_posts( $args ); + + foreach ( $items as $item_id ) { + $item_type = get_post_meta( $item_id, '_menu_item_type', true ); + + if ( 'custom' === $item_type ) { + $item_url = get_post_meta( $item_id, '_menu_item_url', true ); + + if ( $item_url && '#' !== $item_url ) { + $item_url = str_replace( $url, site_url(), $item_url ); + + update_post_meta( $item_id, '_menu_item_url', $item_url ); + } + } + } + } + + /** + * Allow other files types to be uploaded. + * + * @since 1.6 + * + * @param array Existing types. + * @return array Merged types. + */ + public static function mime_types( $mimes ) { + $mimes = array_merge( + $mimes, array( + 'xml' => 'text/xml', + 'wie' => 'text/plain', + 'svg' => 'image/svg+xml', + 'svgz' => 'image/svg+xml' + ) + ); + + return $mimes; + } + + /** + * Different MIME type of different PHP version + * + * Filters the "real" file type of the given file. + * + * @since 1.8 + * + * @param array $wp_check_filetype_and_ext File data array containing 'ext', 'type', and + * 'proper_filename' keys. + * @param string $file Full path to the file. + * @param string $filename The name of the file (may differ from $file due to + * $file being in a tmp directory). + * @param array $mimes Key is the file extension with value as the mime type. + */ + public static function check_real_mime_type( $defaults, $file, $filename, $mimes ) { + if ( 'content.xml' === $filename ) { + $defaults['ext'] = 'xml'; + $defaults['type'] = 'text/xml'; + } + + if ( 'widgets.wie' === $filename ) { + $defaults['ext'] = 'wie'; + $defaults['type'] = 'text/plain'; + } + + return $defaults; + } + + /** + * Download a file to WordPress from a URL. + * + * @since 1.6 + * + * @param string URL of the file. + * @return array + */ + public static function download_file( $file ) { + // Gives us access to the download_url() and wp_handle_sideload() functions + require_once( ABSPATH . 'wp-admin/includes/file.php' ); + + // URL to the WordPress logo + $url = $file; + $timeout_seconds = 10; + + // Download file to temp dir + $temp_file = download_url( $url, $timeout_seconds ); + + if ( is_wp_error( $temp_file ) ) { + + return array( + 'success' => false, + 'data' => $temp_file->get_error_message() + ); + + } + + // Array based on $_FILE as seen in PHP file uploads + $file = array( + 'name' => basename( $url ), + 'tmp_name' => $temp_file, + 'error' => 0, + 'size' => filesize( $temp_file ), + ); + + $overrides = array( + 'test_form' => false, + 'test_size' => true, + ); + + // Move the temporary file into the uploads directory + $results = wp_handle_sideload( $file, $overrides ); + + if ( empty( $results['error'] ) ) { + + return array( + 'success' => true, + 'data' => $results, + ); + + } else { + + return array( + 'success' => false, + 'error' => $results['error'], + ); + + } + + } + + /** + * Get data from the options.json file. + * + * @since 1.6 + * + * @param string URL of the file. + * @return array + */ + public static function get_options( $url ) { + $url = wp_safe_remote_get( esc_url( $url ) ); + + if ( is_wp_error( $url ) ) { + return false; + } + + return json_decode( wp_remote_retrieve_body( $url ), true ); + } + + /** + * Check to see if a remote file exists. + * + * @since 1.6 + * + * @param string URL of the file. + * @return bool + */ + public static function file_exists( $url ) { + $response = wp_safe_remote_get( esc_url( $url ) ); + + if ( is_wp_error( $response ) ) { + self::log( $response->get_error_message() ); + return false; + } + + return strlen( $response['body'] ) > 100 && ( '200' == $response['response']['code'] || '301' == $response['response']['code'] ) ? true : false; + } + + /** + * Log events to the debug.log file. + * + * @since 1.6 + * @param mixed $log Log data. + * @return void + */ + public static function log( $log ) { + if ( ! WP_DEBUG_LOG ) { + return; + } + + if ( is_array( $log ) || is_object( $log ) ) { + error_log( print_r( $log, true ) ); + } else { + error_log( $log ); + } + } + + /** + * Get all posts to run through batch processing. + * + * @since 1.6 + * + * @return object All posts. + */ + public static function get_all_posts() { + $args = array( + 'post_type' => 'any', + 'fields' => 'ids', + 'no_found_rows' => true, + 'post_status' => 'publish', + 'numberposts' => -1, + 'meta_query' => array( + 'relation' => 'OR', + array( + 'key' => '_fl_builder_data', + 'compare' => 'EXISTS', + ), + array( + 'key' => '_elementor_data', + 'compare' => 'EXISTS', + ) + ) + ); + + $posts = get_posts( $args ); + + if ( $posts ) { + return $posts; + } + + return false; + } + + /** + * Searches Elementor and Beaver Builder content for images to download. + * + * @since 1.6 + */ + public static function update_page_builder_content() { + + // Add "bb-plugin" in import [queue]. + // Add "beaver-builder-lite-version" in import [queue]. + if ( is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' ) || is_plugin_active( 'bb-plugin/fl-builder.php' ) ) { + if ( class_exists( 'GeneratePress_Sites_Process_Beaver_Builder' ) ) { + $import = new GeneratePress_Sites_Process_Beaver_Builder(); + self::$background_process->push_to_queue( $import ); + } + } + + // Dispatch Queue. + self::$background_process->save()->dispatch(); + } + + /** + * Clear Elementor & Beaver Builder caches when needed. + * + * @since 1.6 + */ + public static function clear_page_builder_cache() { + + if ( class_exists( 'FLBuilderModel' ) && method_exists( 'FLBuilderModel', 'delete_asset_cache_for_all_posts' ) ) { + // Clear all cache. + FLBuilderModel::delete_asset_cache_for_all_posts(); + self::log( 'Cleared Beaver Builder cache.' ); + } + + if ( class_exists( 'Elementor\Plugin' ) && method_exists( 'Elementor\Posts_CSS_Manager', 'clear_cache' ) ) { + // !important, Clear the cache after images import. + Elementor\Plugin::instance()->posts_css_manager->clear_cache(); + self::log( 'Cleared Elementor cache.' ); + } + + } + + /** + * List out GP option names. + * + * @since 1.6 + * + * @return array + */ + public static function get_theme_settings() { + return array( + 'generate_settings', + 'generate_background_settings', + 'generate_blog_settings', + 'generate_hooks', + 'generate_page_header_settings', + 'generate_secondary_nav_settings', + 'generate_spacing_settings', + 'generate_menu_plus_settings', + 'generate_woocommerce_settings', + ); + } + + /** + * List out GP theme mods. + * + * @since 1.6 + * + * @return array + */ + public static function get_theme_mods() { + return array( + 'font_body_variants', + 'font_body_category', + 'font_site_title_variants', + 'font_site_title_category', + 'font_site_tagline_variants', + 'font_site_tagline_category', + 'font_navigation_variants', + 'font_navigation_category', + 'font_secondary_navigation_variants', + 'font_secondary_navigation_category', + 'font_buttons_variants', + 'font_buttons_category', + 'font_heading_1_variants', + 'font_heading_1_category', + 'font_heading_2_variants', + 'font_heading_2_category', + 'font_heading_3_variants', + 'font_heading_3_category', + 'font_heading_4_variants', + 'font_heading_4_category', + 'font_heading_5_variants', + 'font_heading_5_category', + 'font_heading_6_variants', + 'font_heading_6_category', + 'font_widget_title_variants', + 'font_widget_title_category', + 'font_footer_variants', + 'font_footer_category', + 'generate_copyright', + ); + } + + /** + * Build the loading icon. + * + * @since 1.6 + */ + public static function loading_icon() { + ?> + + + + + + + + + + + + + $attachment ) { + $downloaded_images[] = $this->import( $attachment ); + } + + return $downloaded_images; + } + + /** + * Get Hash Image. + * + * @since 1.6 + * @param string $attachment_url Attachment URL. + * @return string Hash string. + */ + private function get_hash_image( $attachment_url ) { + return sha1( $attachment_url ); + } + + /** + * Get Saved Image. + * + * @since 1.6 + * @param string $attachment Attachment Data. + * @return string Hash string. + */ + private function get_saved_image( $attachment ) { + + global $wpdb; + + // Already imported? Then return! + if ( isset( $this->already_imported_ids[ $attachment['id'] ] ) ) { + GeneratePress_Sites_Helper::log( 'Successfully replaced: ' . $attachment['url'] ); + + return $this->already_imported_ids[ $attachment['id'] ]; + } + + // 1. Is already imported in Batch Import Process? + $post_id = $wpdb->get_var( + $wpdb->prepare( + 'SELECT `post_id` FROM `' . $wpdb->postmeta . '` + WHERE `meta_key` = \'_generatepress_sites_image_hash\' + AND `meta_value` = %s + ;', + $this->get_hash_image( $attachment['url'] ) + ) + ); + + // 2. Is image already imported though XML? + if ( empty( $post_id ) ) { + // Get file name without extension. + // To check it exist in attachment. + $filename = preg_replace( '/\\.[^.\\s]{3,4}$/', '', basename( $attachment['url'] ) ); + + $post_id = $wpdb->get_var( + $wpdb->prepare( + 'SELECT `post_id` FROM `' . $wpdb->postmeta . '` + WHERE `meta_key` = \'_wp_attached_file\' + AND `meta_value` LIKE %s + ;', + '%' . $filename . '%' + ) + ); + + GeneratePress_Sites_Helper::log( 'Successfully replaced: ' . $attachment['url'] ); + } + + if ( $post_id ) { + $new_attachment = array( + 'id' => $post_id, + 'url' => wp_get_attachment_url( $post_id ), + ); + + $this->already_imported_ids[ $attachment['id'] ] = $new_attachment; + + return $new_attachment; + } + + return false; + } + + /** + * Import Image + * + * @since 1.6 + * @param array $attachment Attachment array. + * @return array Attachment array. + */ + public function import( $attachment ) { + + $saved_image = $this->get_saved_image( $attachment ); + + if ( $saved_image ) { + return $saved_image; + } + + $file_content = wp_remote_retrieve_body( wp_safe_remote_get( $attachment['url'] ) ); + + // Empty file content? + if ( empty( $file_content ) ) { + GeneratePress_Sites_Helper::log( 'Failed to replace: ' . $attachment['url'] ); + GeneratePress_Sites_Helper::log( 'Error: Failed wp_remote_retrieve_body().' ); + + return $attachment; + } + + // Extract the file name and extension from the URL. + $filename = basename( $attachment['url'] ); + + $upload = wp_upload_bits( + $filename, + null, + $file_content + ); + + $post = array( + 'post_title' => $filename, + 'guid' => $upload['url'], + ); + + $info = wp_check_filetype( $upload['file'] ); + + if ( $info ) { + $post['post_mime_type'] = $info['type']; + } else { + // For now just return the origin attachment. + return $attachment; + } + + $post_id = wp_insert_attachment( $post, $upload['file'] ); + + wp_update_attachment_metadata( + $post_id, + wp_generate_attachment_metadata( $post_id, $upload['file'] ) + ); + + update_post_meta( $post_id, '_generatepress_sites_image_hash', $this->get_hash_image( $attachment['url'] ) ); + + $new_attachment = array( + 'id' => $post_id, + 'url' => $upload['url'], + ); + + GeneratePress_Sites_Helper::log( 'Successfully replaced: ' . $attachment['url'] ); + + $this->already_imported_ids[ $attachment['id'] ] = $new_attachment; + + return $new_attachment; + } +} diff --git a/wp-content/plugins/gp-premium/sites/classes/class-site-restore.php b/wp-content/plugins/gp-premium/sites/classes/class-site-restore.php new file mode 100644 index 0000000..b9ddbbd --- /dev/null +++ b/wp-content/plugins/gp-premium/sites/classes/class-site-restore.php @@ -0,0 +1,246 @@ + $key ) { + delete_option( $key ); + } + + if ( ! empty( $backup_data['modules'] ) ) { + foreach ( (array) $backup_data['modules'] as $name => $key ) { + update_option( $key, 'activated' ); + } + } + + // Theme options. + foreach ( $backup_data['theme_options']['mods'] as $key => $val ) { + // Only allow valid theme mods. + if ( ! in_array( $key, GeneratePress_Sites_Helper::get_theme_mods() ) ) { + GeneratePress_Sites_Helper::log( 'Bad theme mod key: ' . $key ); + continue; + } + + set_theme_mod( $key, $val ); + } + + foreach ( $backup_data['theme_options']['options'] as $key => $val ) { + // Only allow valid options. + if ( ! in_array( $key, GeneratePress_Sites_Helper::get_theme_settings() ) ) { + GeneratePress_Sites_Helper::log( 'Bad theme setting key: ' . $key ); + continue; + } + + update_option( $key, $val ); + } + } + + wp_send_json( __( 'Theme options restored.', 'gp-premium' ) ); + + die(); + } + + public function site_options() { + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + + if ( ! empty( $backup_data ) ) { + foreach ( $backup_data['site_options'] as $key => $val ) { + if ( in_array( $key, ( array ) generatepress_sites_disallowed_options() ) ) { + GeneratePress_Sites_Helper::log( 'Disallowed option: ' . $key ); + continue; + } + + if ( 'nav_menu_locations' === $key || 'custom_logo' === $key ) { + set_theme_mod( $key, $val ); + } else { + update_option( $key, $val ); + } + } + } + + wp_send_json( __( 'Site options restored.', 'gp-premium' ) ); + + die(); + } + + public function content() { + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + + if ( ! empty( $backup_data ) ) { + global $wpdb; + $post_ids = $wpdb->get_col( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='_generatepress_sites_imported_post'" ); + $term_ids = $wpdb->get_col( "SELECT term_id FROM {$wpdb->termmeta} WHERE meta_key='_generatepress_sites_imported_term'" ); + + foreach ( $post_ids as $id ) { + wp_delete_post( $id, true ); + } + } + + wp_send_json( __( 'Content restored.', 'gp-premium' ) ); + + die(); + } + + public function plugins() { + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + + if ( ! empty( $backup_data['plugins'] ) && ! empty( $backup_data['site_options'] ) ) { + update_option( 'active_plugins', $backup_data['plugins'] ); + } + + wp_send_json( __( 'Plugins restored.', 'gp-premium' ) ); + + die(); + } + + public function widgets() { + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + + if ( ! empty( $backup_data['widgets'] ) ) { + update_option( 'sidebars_widgets', $backup_data['widgets'] ); + } + + wp_send_json( __( 'Widgets restored.', 'gp-premium' ) ); + + die(); + } + + public function css() { + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + + if ( ! empty( $backup_data ) ) { + $css = ''; + $current_css = wp_get_custom_css_post(); + + if ( isset( $current_css->post_content ) ) { + // Remove existing library CSS. + $current_css->post_content = preg_replace( '#(/\\* GeneratePress Site CSS \\*/).*?(/\\* End GeneratePress Site CSS \\*/)#s', '', $current_css->post_content ); + } + + if ( ! empty( $backup_data['css'] ) ) { + $current_css->post_content .= $backup_data['css']; + } + + wp_update_custom_css_post( $current_css->post_content ); + } + + wp_send_json( __( 'CSS restored.', 'gp-premium' ) ); + + die(); + } + + public function clean_up() { + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + delete_option( 'generate_dynamic_css_output' ); + delete_option( 'generate_dynamic_css_cached_version' ); + delete_option( '_generatepress_site_library_backup' ); + + wp_send_json( __( 'Completed clean-up.', 'gp-premium' ) ); + + die(); + } +} + +GeneratePress_Sites_Restore::get_instance(); \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/sites/classes/class-site-widget-importer.php b/wp-content/plugins/gp-premium/sites/classes/class-site-widget-importer.php new file mode 100644 index 0000000..b240927 --- /dev/null +++ b/wp-content/plugins/gp-premium/sites/classes/class-site-widget-importer.php @@ -0,0 +1,259 @@ + true, + ) + ); + } + + // Hook before import. + do_action( 'wie_before_import' ); + + $data = apply_filters( 'wie_import_data', $data ); + + // Get all available widgets site supports. + $available_widgets = $this->wie_available_widgets(); + + // Get all existing widget instances. + $widget_instances = array(); + + foreach ( $available_widgets as $widget_data ) { + $widget_instances[ $widget_data['id_base'] ] = get_option( 'widget_' . $widget_data['id_base'] ); + } + + // Begin results. + $results = array(); + + // Loop import data's sidebars. + foreach ( $data as $sidebar_id => $widgets ) { + // Skip inactive widgets (should not be in export file). + if ( 'wp_inactive_widgets' === $sidebar_id ) { + continue; + } + + // Check if sidebar is available on this site. + // Otherwise add widgets to inactive, and say so. + if ( isset( $wp_registered_sidebars[ $sidebar_id ] ) ) { + $sidebar_available = true; + $use_sidebar_id = $sidebar_id; + $sidebar_message_type = 'success'; + $sidebar_message = ''; + } else { + $sidebar_available = false; + $use_sidebar_id = 'wp_inactive_widgets'; // Add to inactive if sidebar does not exist in theme. + $sidebar_message_type = 'error'; + $sidebar_message = esc_html__( 'Widget area does not exist in theme (using Inactive)', 'widget-importer-exporter' ); + } + + // Result for sidebar + // Sidebar name if theme supports it; otherwise ID. + $results[ $sidebar_id ]['name'] = ! empty( $wp_registered_sidebars[ $sidebar_id ]['name'] ) ? $wp_registered_sidebars[ $sidebar_id ]['name'] : $sidebar_id; + $results[ $sidebar_id ]['message_type'] = $sidebar_message_type; + $results[ $sidebar_id ]['message'] = $sidebar_message; + $results[ $sidebar_id ]['widgets'] = array(); + + // Loop widgets. + foreach ( $widgets as $widget_instance_id => $widget ) { + $fail = false; + + // Get id_base (remove -# from end) and instance ID number. + $id_base = preg_replace( '/-[0-9]+$/', '', $widget_instance_id ); + $instance_id_number = str_replace( $id_base . '-', '', $widget_instance_id ); + + // Does site support this widget? + if ( ! $fail && ! isset( $available_widgets[ $id_base ] ) ) { + $fail = true; + $widget_message_type = 'error'; + $widget_message = esc_html__( 'Site does not support widget', 'widget-importer-exporter' ); // Explain why widget not imported. + } + + // Filter to modify settings object before conversion to array and import + // Leave this filter here for backwards compatibility with manipulating objects (before conversion to array below) + // Ideally the newer wie_widget_settings_array below will be used instead of this. + $widget = apply_filters( 'wie_widget_settings', $widget ); + + // Convert multidimensional objects to multidimensional arrays + // Some plugins like Jetpack Widget Visibility store settings as multidimensional arrays + // Without this, they are imported as objects and cause fatal error on Widgets page + // If this creates problems for plugins that do actually intend settings in objects then may need to consider other approach: https://wordpress.org/support/topic/problem-with-array-of-arrays + // It is probably much more likely that arrays are used than objects, however. + $widget = json_decode( wp_json_encode( $widget ), true ); + + // Filter to modify settings array + // This is preferred over the older wie_widget_settings filter above + // Do before identical check because changes may make it identical to end result (such as URL replacements). + $widget = apply_filters( 'wie_widget_settings_array', $widget ); + + // Does widget with identical settings already exist in same sidebar? + if ( ! $fail && isset( $widget_instances[ $id_base ] ) ) { + // Get existing widgets in this sidebar. + $sidebars_widgets = get_option( 'sidebars_widgets' ); + $sidebar_widgets = isset( $sidebars_widgets[ $use_sidebar_id ] ) ? $sidebars_widgets[ $use_sidebar_id ] : array(); // Check Inactive if that's where will go. + + // Loop widgets with ID base. + $single_widget_instances = ! empty( $widget_instances[ $id_base ] ) ? $widget_instances[ $id_base ] : array(); + + foreach ( $single_widget_instances as $check_id => $check_widget ) { + // Is widget in same sidebar and has identical settings? + if ( in_array( "$id_base-$check_id", $sidebar_widgets, true ) && (array) $widget === $check_widget ) { + $fail = true; + $widget_message_type = 'warning'; + // Explain why widget not imported. + $widget_message = esc_html__( 'Widget already exists', 'widget-importer-exporter' ); + break; + } + } + } + + // No failure. + if ( ! $fail ) { + // Add widget instance + $single_widget_instances = get_option( 'widget_' . $id_base ); // All instances for that widget ID base, get fresh every time. + + $single_widget_instances = ! empty( $single_widget_instances ) ? $single_widget_instances : array( + '_multiwidget' => 1, // Start fresh if have to. + ); + + $single_widget_instances[] = $widget; // Add it. + + // Get the key it was given. + end( $single_widget_instances ); + + $new_instance_id_number = key( $single_widget_instances ); + + // If key is 0, make it 1 + // When 0, an issue can occur where adding a widget causes data from other widget to load, + // and the widget doesn't stick (reload wipes it). + if ( '0' === strval( $new_instance_id_number ) ) { + $new_instance_id_number = 1; + $single_widget_instances[ $new_instance_id_number ] = $single_widget_instances[0]; + unset( $single_widget_instances[0] ); + } + + // Move _multiwidget to end of array for uniformity. + if ( isset( $single_widget_instances['_multiwidget'] ) ) { + $multiwidget = $single_widget_instances['_multiwidget']; + unset( $single_widget_instances['_multiwidget'] ); + $single_widget_instances['_multiwidget'] = $multiwidget; + } + + // Update option with new widget. + update_option( 'widget_' . $id_base, $single_widget_instances ); + + // Assign widget instance to sidebar. + // Which sidebars have which widgets, get fresh every time. + $sidebars_widgets = get_option( 'sidebars_widgets' ); + + // Avoid rarely fatal error when the option is an empty string + // https://github.com/stevengliebe/widget-importer-exporter/pull/11. + if ( ! $sidebars_widgets ) { + $sidebars_widgets = array(); + } + + // Use ID number from new widget instance. + $new_instance_id = $id_base . '-' . $new_instance_id_number; + + // Add new instance to sidebar. + $sidebars_widgets[ $use_sidebar_id ][] = $new_instance_id; + + // Save the amended data. + update_option( 'sidebars_widgets', $sidebars_widgets ); + + // After widget import action. + $after_widget_import = array( + 'sidebar' => $use_sidebar_id, + 'sidebar_old' => $sidebar_id, + 'widget' => $widget, + 'widget_type' => $id_base, + 'widget_id' => $new_instance_id, + 'widget_id_old' => $widget_instance_id, + 'widget_id_num' => $new_instance_id_number, + 'widget_id_num_old' => $instance_id_number, + ); + + do_action( 'wie_after_widget_import', $after_widget_import ); + + // Success message. + if ( $sidebar_available ) { + $widget_message_type = 'success'; + $widget_message = esc_html__( 'Imported', 'widget-importer-exporter' ); + } else { + $widget_message_type = 'warning'; + $widget_message = esc_html__( 'Imported to Inactive', 'widget-importer-exporter' ); + } + } + + // Result for widget instance + $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['name'] = isset( $available_widgets[ $id_base ]['name'] ) ? $available_widgets[ $id_base ]['name'] : $id_base; // Widget name or ID if name not available (not supported by site). + $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['title'] = ! empty( $widget['title'] ) ? $widget['title'] : esc_html__( 'No Title', 'widget-importer-exporter' ); // Show "No Title" if widget instance is untitled. + $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['message_type'] = $widget_message_type; + $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['message'] = $widget_message; + } + } + + // Hook after import. + do_action( 'wie_after_import' ); + + // Return results. + return apply_filters( 'wie_import_results', $results ); + } +} diff --git a/wp-content/plugins/gp-premium/sites/classes/class-site.php b/wp-content/plugins/gp-premium/sites/classes/class-site.php new file mode 100644 index 0000000..ec8eaea --- /dev/null +++ b/wp-content/plugins/gp-premium/sites/classes/class-site.php @@ -0,0 +1,1091 @@ + '', + 'name' => '', + 'preview_url' => '', + 'author_name' => '', + 'author_url' => '', + 'icon' => 'icon.png', + 'screenshot' => 'screenshot.png', + 'page_builder' => array(), + 'uploads_url' => array(), + 'min_version' => GP_PREMIUM_VERSION, + 'plugins' => '', + 'documentation' => '', + ) ); + + $this->helpers = new GeneratePress_Sites_Helper(); + + $this->directory = trailingslashit( $config['directory'] ); + + $provider = parse_url( $this->directory ); + + if ( ! isset( $provider['host'] ) ) { + return; + } + + if ( ! in_array( $provider['host'], ( array ) get_transient( 'generatepress_sites_trusted_providers' ) ) ) { + return; + } + + $this->name = $config['name']; + $this->slug = str_replace( ' ', '_', strtolower( $this->name ) ); + $this->preview_url = $config['preview_url']; + $this->author_name = $config['author_name']; + $this->author_url = $config['author_url']; + $this->description = $config['description']; + $this->icon = $config['icon']; + $this->screenshot = $config['screenshot']; + $this->page_builder = $config['page_builder']; + $this->min_version = $config['min_version']; + $this->uploads_url = $config['uploads_url']; + $this->plugins = $config['plugins']; + $this->documentation = $config['documentation']; + $this->installable = true; + + if ( empty( $this->min_version ) ) { + $this->min_version = GP_PREMIUM_VERSION; + } + + if ( version_compare( GP_PREMIUM_VERSION, $config['min_version'], '<' ) ) { + $this->installable = false; + } + + add_action( 'generate_inside_sites_container', array( $this, 'build_box' ) ); + add_action( "wp_ajax_generate_setup_demo_content_{$this->slug}", array( $this, 'setup_demo_content' ), 10, 0 ); + add_action( "wp_ajax_generate_check_plugins_{$this->slug}", array( $this, 'check_plugins' ), 10, 0 ); + add_action( "wp_ajax_generate_backup_options_{$this->slug}", array( $this, 'backup_options' ), 10, 0 ); + add_action( "wp_ajax_generate_import_options_{$this->slug}", array( $this, 'import_options' ), 10, 0 ); + add_action( "wp_ajax_generate_activate_plugins_{$this->slug}", array( $this, 'activate_plugins' ), 10, 0 ); + add_action( "wp_ajax_generate_import_site_options_{$this->slug}", array( $this, 'import_site_options' ), 10, 0 ); + add_action( "wp_ajax_generate_download_content_{$this->slug}", array( $this, 'download_content' ), 10, 0 ); + add_action( "wp_ajax_generate_import_content_{$this->slug}", array( $this, 'import_content' ), 10, 0 ); + add_action( "wp_ajax_generate_import_widgets_{$this->slug}", array( $this, 'import_widgets' ), 10, 0 ); + + // Don't do the WC setup. This wouldn't be necessary if they used an activation hook. + add_filter( 'woocommerce_prevent_automatic_wizard_redirect', '__return_true' ); + + } + + /** + * Build the site details, including the screenshot and description. + * + * @since 1.6 + */ + public function site_details() { + + printf( '
        + %s +
        ', + esc_attr( $this->name ) + ); + + ?> + +
        + documentation ) : ?> +
        +

        +

        + + +

        +
        + + +
        +

        + +

        + + +

        +
        + + author_name && 'GeneratePress' !== $this->author_name ) : ?> +
        +

        +

        + name + ); + ?> + author_name; ?>. +

        +
        + +
        + + +
        + + + + +
        + $this->slug, + 'preview_url' => $this->preview_url, + 'plugins' => $this->plugins, + ); + + $page_builders = array(); + foreach ( ( array ) $this->page_builder as $builder ) { + $page_builders = str_replace( ' ', '-', strtolower( $builder ) ); + } + + $site_classes = array( + 'site-box', + $page_builders, + ! $this->installable ? 'disabled-site' : '' + ); + + ?> +
        +
        +
        +
        +

        name; ?>

        + description ) { + echo ' ' . wpautop( $this->description ) . ''; + } + ?> + + installable ) : ?> +
        + + +
        + + + min_version ); ?> + + +
        +
        + +
        + +
        + +
        + author_name; ?> +

        name; ?>

        +
        +
        + + + + +
        + '', + 'disabled' => 'disabled', + 'style' => ! $options ? 'display: none;' : '', + ) + ); + + submit_button( + __( 'Import Options', 'gp-premium' ), + 'button-primary import-options site-action', + 'submit', + false, + array( + 'id' => '', + 'style' => $options ? 'display:none' : '', + ) + ); + + submit_button( + __( 'Import Content', 'gp-premium' ), + 'button-primary import-content site-action', + 'submit', + false, + array( + 'id' => '', + 'disabled' => 'disabled', + 'style' => 'display: none;', + ) + ); + + submit_button( + __( 'View Your Site', 'gp-premium' ), + 'button-primary view-site', + 'submit', + false, + array( + 'id' => '', + 'style' => 'display: none;', + ) + ); + } + + /** + * Backup our existing GeneratePress options. + * + * @since 1.6 + */ + public function backup_options() { + + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + $theme_mods = GeneratePress_Sites_Helper::get_theme_mods(); + $settings = GeneratePress_Sites_Helper::get_theme_settings(); + + $data = array( + 'mods' => array(), + 'options' => array() + ); + + foreach ( $theme_mods as $theme_mod ) { + $data['mods'][$theme_mod] = get_theme_mod( $theme_mod ); + } + + foreach ( $settings as $setting ) { + $data['options'][$setting] = get_option( $setting ); + } + + echo json_encode( $data ); + + die(); + + } + + /** + * Tells our JS which files exist. + * + * @since 1.8 + */ + public function setup_demo_content() { + + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + $settings = GeneratePress_Sites_Helper::get_options( $this->directory . 'options.json' ); + + $data['plugins'] = $settings['plugins']; + + if ( GeneratePress_Sites_Helper::file_exists( $this->directory . 'content.xml' ) ) { + $data['content'] = true; + } else { + $data['content'] = false; + } + + if ( GeneratePress_Sites_Helper::file_exists( $this->directory . 'widgets.wie' ) ) { + $data['widgets'] = true; + } else { + $data['widgets'] = false; + } + + // Backup our plugins early. + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + $backup_data['plugins'] = get_option( 'active_plugins', array() ); + update_option( '_generatepress_site_library_backup', $backup_data ); + + wp_send_json( $data ); + + die(); + + } + + /** + * Import our demo GeneratePress options. + * + * @since 1.6 + */ + public function import_options() { + + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + if ( ! GeneratePress_Sites_Helper::file_exists( $this->directory . 'options.json' ) ) { + wp_send_json_error( __( 'No theme options exist.', 'gp-premium' ) ); + } + + // Delete existing backup. + delete_option( '_generatepress_site_library_backup' ); + + // Backup options. + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + + $theme_mods = GeneratePress_Sites_Helper::get_theme_mods(); + $settings = GeneratePress_Sites_Helper::get_theme_settings(); + + $data = array( + 'mods' => array(), + 'options' => array() + ); + + foreach ( $theme_mods as $theme_mod ) { + $data['mods'][$theme_mod] = get_theme_mod( $theme_mod ); + } + + foreach ( $settings as $setting ) { + $data['options'][$setting] = get_option( $setting ); + } + + $backup_data['theme_options'] = $data; + + $modules = generatepress_get_site_premium_modules(); + + $active_modules = array(); + foreach ( $modules as $name => $key ) { + if ( 'activated' == get_option( $key ) ) { + $active_modules[ $name ] = $key; + } + } + + $backup_data['modules'] = $active_modules; + + $settings = GeneratePress_Sites_Helper::get_options( $this->directory . 'options.json' ); + + // Remove all existing theme options. + $option_keys = array( + 'generate_settings', + 'generate_background_settings', + 'generate_blog_settings', + 'generate_hooks', + 'generate_page_header_settings', + 'generate_secondary_nav_settings', + 'generate_spacing_settings', + 'generate_menu_plus_settings', + 'generate_woocommerce_settings', + ); + + foreach ( $option_keys as $key ) { + delete_option( $key ); + } + + // Need to backup these items before we remove all theme mods. + $backup_data['site_options']['nav_menu_locations'] = get_theme_mod( 'nav_menu_locations' ); + $backup_data['site_options']['custom_logo'] = get_theme_mod( 'custom_logo' ); + + // Remove existing theme mods. + remove_theme_mods(); + + // Remove existing activated premium modules. + $premium_modules = generatepress_get_site_premium_modules(); + + foreach ( $premium_modules as $name => $key ) { + delete_option( $key ); + } + + // Activate necessary modules. + foreach ( $settings['modules'] as $name => $key ) { + // Only allow valid premium modules. + if ( ! in_array( $key, $premium_modules ) ) { + GeneratePress_Sites_Helper::log( 'Bad premium module key: ' . $key ); + continue; + } + + update_option( $key, 'activated' ); + } + + // Set theme mods. + foreach ( $settings['mods'] as $key => $val ) { + // Only allow valid theme mods. + if ( ! in_array( $key, GeneratePress_Sites_Helper::get_theme_mods() ) ) { + GeneratePress_Sites_Helper::log( 'Bad theme mod key: ' . $key ); + continue; + } + + set_theme_mod( $key, $val ); + } + + // Set theme options. + foreach ( $settings['options'] as $key => $val ) { + // Only allow valid options. + if ( ! in_array( $key, GeneratePress_Sites_Helper::get_theme_settings() ) ) { + GeneratePress_Sites_Helper::log( 'Bad theme setting key: ' . $key ); + continue; + } + + // Import any images + if ( is_array( $val ) || is_object( $val ) ) { + foreach ( $val as $option_name => $option_value ) { + if ( is_string( $option_value ) && preg_match( '/\.(jpg|jpeg|png|gif)/i', $option_value ) ) { + + $data = GeneratePress_Sites_Helper::sideload_image( $option_value ); + + if ( ! is_wp_error( $data ) ) { + $val[$option_name] = $data->url; + } + + } + } + } + + update_option( $key, $val ); + } + + // Remove dynamic CSS cache. + delete_option( 'generate_dynamic_css_output' ); + delete_option( 'generate_dynamic_css_cached_version' ); + + // Custom CSS. + $css = $settings['custom_css']; + $css = '/* GeneratePress Site CSS */ ' . $css . ' /* End GeneratePress Site CSS */'; + + $current_css = wp_get_custom_css_post(); + + if ( isset( $current_css->post_content ) ) { + preg_match( '#(/\* GeneratePress Site CSS).*?(End GeneratePress Site CSS \*/)#s', $current_css->post_content, $matches ); + + if ( ! empty( $matches ) ) { + $backup_data['css'] = $matches[0]; + } + + $current_css->post_content = preg_replace( '#(/\\* GeneratePress Site CSS \\*/).*?(/\\* End GeneratePress Site CSS \\*/)#s', '', $current_css->post_content ); + $css = $current_css->post_content . $css; + } + + wp_update_custom_css_post( $css ); + + update_option( '_generatepress_site_library_backup', $backup_data ); + + die(); + + } + + public function download_content() { + + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + // Increase PHP max execution time. + set_time_limit( apply_filters( 'generate_sites_content_import_time_limit', 300 ) ); + + $xml_path = $this->directory . 'content.xml'; + $xml_file = GeneratePress_Sites_Helper::download_file( $xml_path ); + $xml_path = $xml_file['data']['file']; + + if ( file_exists( $xml_path ) ) { + set_transient( 'generatepress_sites_content_file', $xml_path, HOUR_IN_SECONDS ); + } + + die(); + } + + /** + * Import our demo content. + * + * @since 1.6 + */ + public function import_content() { + + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + // Increase PHP max execution time. + set_time_limit( apply_filters( 'generate_sites_content_import_time_limit', 300 ) ); + + // Disable import of authors. + add_filter( 'wxr_importer.pre_process.user', '__return_false' ); + + // Keep track of our progress. + add_action( 'wxr_importer.processed.post', array( $this, 'track_post' ) ); + add_action( 'wxr_importer.processed.term', array( $this, 'track_term' ) ); + + // Disables generation of multiple image sizes (thumbnails) in the content import step. + if ( ! apply_filters( 'generate_sites_regen_thumbnails', true ) ) { + add_filter( 'intermediate_image_sizes_advanced', '__return_null' ); + } + + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + $backup_data['content'] = true; + update_option( '_generatepress_site_library_backup', $backup_data ); + + // Import content + $content = get_transient( 'generatepress_sites_content_file' ); + + if ( $content ) { + GeneratePress_Sites_Helper::import_xml( $content, $this->slug ); + delete_transient( 'generatepress_sites_content_file' ); + } + + die(); + + } + + /** + * Import our widgets. + * + * @since 1.6 + */ + public function import_widgets() { + + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + $widgets_path = $this->directory . 'widgets.wie'; + + $wie_file = GeneratePress_Sites_Helper::download_file( $widgets_path ); + $wie_path = $wie_file['data']['file']; + + $data = implode( '', file( $wie_path ) ); + $data = json_decode( $data ); + + GeneratePress_Sites_Helper::clear_widgets(); + + $widgets_importer = GeneratePress_Sites_Widget_Importer::instance(); + $widgets_importer->wie_import_data( $data ); + + die(); + + } + + /** + * Import any necessary site options. + * + * @since 1.6 + */ + public function import_site_options() { + + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + + $settings = GeneratePress_Sites_Helper::get_options( $this->directory . 'options.json' ); + + delete_option( 'generate_page_header_global_locations' ); + + foreach( $settings['site_options'] as $key => $val ) { + + switch( $key ) { + + case 'page_for_posts': + case 'page_on_front': + $backup_data['site_options'][ $key ] = get_option( $key ); + GeneratePress_Sites_Helper::set_reading_pages( $key, $val, $this->slug ); + break; + + case 'woocommerce_shop_page_id': + case 'woocommerce_cart_page_id': + case 'woocommerce_checkout_page_id': + case 'woocommerce_myaccount_page_id': + $backup_data['site_options'][ $key ] = get_option( $key ); + GeneratePress_Sites_Helper::set_woocommerce_pages( $key, $val, $this->slug ); + break; + + case 'nav_menu_locations': + GeneratePress_Sites_Helper::set_nav_menu_locations( $val ); + break; + + case 'page_header_global_locations': + GeneratePress_Sites_Helper::set_global_page_header_locations( $val, $this->slug ); + break; + + case 'page_headers': + GeneratePress_Sites_Helper::set_page_headers( $val, $this->slug ); + break; + + case 'element_locations': + GeneratePress_Sites_Helper::set_element_locations( $val, $this->slug ); + break; + + case 'element_exclusions': + GeneratePress_Sites_Helper::set_element_exclusions( $val, $this->slug ); + break; + + case 'custom_logo': + $data = GeneratePress_Sites_Helper::sideload_image( $val ); + + if ( ! is_wp_error( $data ) && isset( $data->attachment_id ) ) { + set_theme_mod( 'custom_logo', $data->attachment_id ); + update_post_meta( $data->attachment_id, '_wp_attachment_is_custom_header', get_option( 'stylesheet' ) ); + } else { + remove_theme_mod( 'custom_logo' ); + } + + break; + + default: + if ( in_array( $key, ( array ) generatepress_sites_disallowed_options() ) ) { + GeneratePress_Sites_Helper::log( 'Disallowed option: ' . $key ); + } else { + $backup_data['site_options'][ $key ] = get_option( $key ); + delete_option( $key ); + update_option( $key, $val ); + } + break; + + } + + } + + // Set our backed up options. + update_option( '_generatepress_site_library_backup', $backup_data ); + + // Update any custom menu link URLs. + GeneratePress_Sites_Helper::update_menu_urls( $this->preview_url ); + + // Clear page builder cache. + GeneratePress_Sites_Helper::clear_page_builder_cache(); + + wp_send_json( __( 'Site options imported', 'gp-premium' ) ); + + die(); + + } + + /** + * Activates our freshly installed plugins. + * + * @since 1.6 + */ + public function activate_plugins() { + + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + $settings = GeneratePress_Sites_Helper::get_options( $this->directory . 'options.json' ); + $plugins = $settings['plugins']; + + if ( ! empty( $plugins ) ) { + + $pro_plugins = GeneratePress_Sites_Helper::check_for_pro_plugins(); + + foreach( $plugins as $plugin ) { + // If the plugin has a pro version and it exists, activate it instead. + if ( array_key_exists( $plugin, $pro_plugins ) ) { + if ( file_exists( WP_PLUGIN_DIR . '/' . $pro_plugins[$plugin] ) ) { + $plugin = $pro_plugins[$plugin]; + } + } + + // Install BB lite if pro doesn't exist. + if ( 'bb-plugin/fl-builder.php' === $plugin && ! file_exists( WP_PLUGIN_DIR . '/bb-plugin/fl-builder.php' ) ) { + $plugin = 'beaver-builder-lite-version/fl-builder.php'; + } + + if ( ! is_plugin_active( $plugin ) ) { + activate_plugin( $plugin, '', false, true ); + } + } + + wp_send_json( __( 'Plugins activated', 'gp-premium' ) ); + + } + + die(); + + } + + /** + * Checks a few things: + * 1. Is the plugin installed already? + * 2. Is the plugin active already? + * 3. Can the plugin be downloaded from WordPress.org? + * + * @since 1.6 + */ + public function check_plugins() { + + check_ajax_referer( 'generate_sites_nonce', 'nonce' ); + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + if ( GeneratePress_Sites_Helper::file_exists( $this->directory . 'options.json' ) ) { + $data['options'] = true; + + $settings = GeneratePress_Sites_Helper::get_options( $this->directory . 'options.json' ); + $data['modules'] = $settings['modules']; + $data['plugins'] = $settings['plugins']; + + if ( ! is_array( $data['plugins'] ) ) { + return; + } + + $plugin_data = array(); + foreach( $data['plugins'] as $name => $slug ) { + $basename = strtok( $slug, '/' ); + $plugin_data[$name] = array( + 'name' => $name, + 'slug' => $slug, + 'installed' => GeneratePress_Sites_Helper::is_plugin_installed( $slug ) ? true : false, + 'active' => is_plugin_active( $slug ) ? true : false, + 'repo' => GeneratePress_Sites_Helper::file_exists( 'https://api.wordpress.org/plugins/info/1.0/' . $basename ) ? true : false, + ); + } + + $data['plugin_data'] = $plugin_data; + } + + wp_send_json( array( + 'plugins' => $data['plugins'], + 'plugin_data' => $data['plugin_data'], + ) ); + + die(); + + } + + /** + * Track Imported Post + * + * @param int $post_id Post ID. + * @return void + */ + function track_post( $post_id ) { + update_post_meta( $post_id, '_generatepress_sites_imported_post', true ); + } + + /** + * Track Imported Term + * + * @param int $term_id Term ID. + * @return void + */ + function track_term( $term_id ) { + $term = get_term( $term_id ); + + update_term_meta( $term_id, '_generatepress_sites_imported_term', true ); + } +} diff --git a/wp-content/plugins/gp-premium/sites/classes/class-sites-background-process.php b/wp-content/plugins/gp-premium/sites/classes/class-sites-background-process.php new file mode 100644 index 0000000..e181bef --- /dev/null +++ b/wp-content/plugins/gp-premium/sites/classes/class-sites-background-process.php @@ -0,0 +1,34 @@ +import(); + } + + return false; + } + + protected function complete() { + + parent::complete(); + + } + + } + +} diff --git a/wp-content/plugins/gp-premium/sites/libs/wxr-importer/WPImporterLogger.php b/wp-content/plugins/gp-premium/sites/libs/wxr-importer/WPImporterLogger.php new file mode 100644 index 0000000..0818391 --- /dev/null +++ b/wp-content/plugins/gp-premium/sites/libs/wxr-importer/WPImporterLogger.php @@ -0,0 +1,138 @@ +log( 'emergency', $message, $context ); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * @return null + */ + public function alert( $message, array $context = array() ) { + return $this->log( 'alert', $message, $context ); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * @return null + */ + public function critical( $message, array $context = array() ) { + return $this->log( 'critical', $message, $context ); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * @return null + */ + public function error( $message, array $context = array()) { + return $this->log( 'error', $message, $context ); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * @return null + */ + public function warning( $message, array $context = array() ) { + return $this->log( 'warning', $message, $context ); + } + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * @return null + */ + public function notice( $message, array $context = array() ) { + return $this->log( 'notice', $message, $context ); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * @return null + */ + public function info( $message, array $context = array() ) { + return $this->log( 'info', $message, $context ); + } + + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * @return null + */ + public function debug( $message, array $context = array() ) { + return $this->log( 'debug', $message, $context ); + } + + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * @return null + */ + public function log( $level, $message, array $context = array() ) { + $this->messages[] = array( + 'timestamp' => time(), + 'level' => $level, + 'message' => $message, + 'context' => $context, + ); + } +} diff --git a/wp-content/plugins/gp-premium/sites/libs/wxr-importer/WXRImportInfo.php b/wp-content/plugins/gp-premium/sites/libs/wxr-importer/WXRImportInfo.php new file mode 100644 index 0000000..a7e75aa --- /dev/null +++ b/wp-content/plugins/gp-premium/sites/libs/wxr-importer/WXRImportInfo.php @@ -0,0 +1,16 @@ +` tag at the start of the file. + * + * @var string + */ + protected $version = '1.0'; + + // information to import from WXR file + protected $categories = array(); + protected $tags = array(); + protected $base_url = ''; + + // TODO: REMOVE THESE + protected $processed_terms = array(); + protected $processed_posts = array(); + protected $processed_menu_items = array(); + protected $menu_item_orphans = array(); + protected $missing_menu_items = array(); + + // NEW STYLE + protected $mapping = array(); + protected $requires_remapping = array(); + protected $exists = array(); + protected $user_slug_override = array(); + + protected $url_remap = array(); + protected $featured_images = array(); + + /** + * Logger instance. + * + * @var WP_Importer_Logger + */ + protected $logger; + + /** + * Constructor + * + * @param array $options { + * @var bool $prefill_existing_posts Should we prefill `post_exists` calls? (True prefills and uses more memory, false checks once per imported post and takes longer. Default is true.) + * @var bool $prefill_existing_comments Should we prefill `comment_exists` calls? (True prefills and uses more memory, false checks once per imported comment and takes longer. Default is true.) + * @var bool $prefill_existing_terms Should we prefill `term_exists` calls? (True prefills and uses more memory, false checks once per imported term and takes longer. Default is true.) + * @var bool $update_attachment_guids Should attachment GUIDs be updated to the new URL? (True updates the GUID, which keeps compatibility with v1, false doesn't update, and allows deduplication and reimporting. Default is false.) + * @var bool $fetch_attachments Fetch attachments from the remote server. (True fetches and creates attachment posts, false skips attachments. Default is false.) + * @var bool $aggressive_url_search Should we search/replace for URLs aggressively? (True searches all posts' content for old URLs and replaces, false checks for `` only. Default is false.) + * @var int $default_author User ID to use if author is missing or invalid. (Default is null, which leaves posts unassigned.) + * } + */ + public function __construct( $options = array() ) { + // Initialize some important variables + $empty_types = array( + 'post' => array(), + 'comment' => array(), + 'term' => array(), + 'user' => array(), + ); + + $this->mapping = $empty_types; + $this->mapping['user_slug'] = array(); + $this->mapping['term_id'] = array(); + $this->requires_remapping = $empty_types; + $this->exists = $empty_types; + + $this->options = wp_parse_args( $options, array( + 'prefill_existing_posts' => true, + 'prefill_existing_comments' => true, + 'prefill_existing_terms' => true, + 'update_attachment_guids' => false, + 'fetch_attachments' => false, + 'aggressive_url_search' => false, + 'default_author' => null, + ) ); + } + + public function set_logger( $logger ) { + $this->logger = $logger; + } + + /** + * Get a stream reader for the file. + * + * @param string $file Path to the XML file. + * @return XMLReader|WP_Error Reader instance on success, error otherwise. + */ + protected function get_reader( $file ) { + // Avoid loading external entities for security + $old_value = null; + if ( function_exists( 'libxml_disable_entity_loader' ) ) { + // $old_value = libxml_disable_entity_loader( true ); + } + + $reader = new \XMLReader(); + $status = $reader->open( $file ); + + if ( ! is_null( $old_value ) ) { + // libxml_disable_entity_loader( $old_value ); + } + + if ( ! $status ) { + return new \WP_Error( 'wxr_importer.cannot_parse', __( 'Could not open the file for parsing', 'wordpress-importer' ) ); + } + + return $reader; + } + + /** + * The main controller for the actual import stage. + * + * @param string $file Path to the WXR file for importing + */ + public function get_preliminary_information( $file ) { + // Let's run the actual importer now, woot + $reader = $this->get_reader( $file ); + if ( is_wp_error( $reader ) ) { + return $reader; + } + + // Set the version to compatibility mode first + $this->version = '1.0'; + + // Start parsing! + $data = new WXRImportInfo(); + while ( $reader->read() ) { + // Only deal with element opens + if ( $reader->nodeType !== \XMLReader::ELEMENT ) { + continue; + } + + switch ( $reader->name ) { + case 'wp:wxr_version': + // Upgrade to the correct version + $this->version = $reader->readString(); + + if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) { + $this->logger->warning( sprintf( + __( 'This WXR file (version %s) is newer than the importer (version %s) and may not be supported. Please consider updating.', 'wordpress-importer' ), + $this->version, + self::MAX_WXR_VERSION + ) ); + } + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'generator': + $data->generator = $reader->readString(); + $reader->next(); + break; + + case 'title': + $data->title = $reader->readString(); + $reader->next(); + break; + + case 'wp:base_site_url': + $data->siteurl = $reader->readString(); + $reader->next(); + break; + + case 'wp:base_blog_url': + $data->home = $reader->readString(); + $reader->next(); + break; + + case 'wp:author': + $node = $reader->expand(); + + $parsed = $this->parse_author_node( $node ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + $data->users[] = $parsed; + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'item': + $node = $reader->expand(); + $parsed = $this->parse_post_node( $node ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + if ( $parsed['data']['post_type'] === 'attachment' ) { + $data->media_count++; + } else { + $data->post_count++; + } + $data->comment_count += count( $parsed['comments'] ); + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'wp:category': + case 'wp:tag': + case 'wp:term': + $data->term_count++; + + // Handled everything in this node, move on to the next + $reader->next(); + break; + } + } + + $data->version = $this->version; + + return $data; + } + + /** + * The main controller for the actual import stage. + * + * @param string $file Path to the WXR file for importing + */ + public function parse_authors( $file ) { + // Let's run the actual importer now, woot + $reader = $this->get_reader( $file ); + if ( is_wp_error( $reader ) ) { + return $reader; + } + + // Set the version to compatibility mode first + $this->version = '1.0'; + + // Start parsing! + $authors = array(); + while ( $reader->read() ) { + // Only deal with element opens + if ( $reader->nodeType !== \XMLReader::ELEMENT ) { + continue; + } + + switch ( $reader->name ) { + case 'wp:wxr_version': + // Upgrade to the correct version + $this->version = $reader->readString(); + + if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) { + $this->logger->warning( sprintf( + __( 'This WXR file (version %s) is newer than the importer (version %s) and may not be supported. Please consider updating.', 'wordpress-importer' ), + $this->version, + self::MAX_WXR_VERSION + ) ); + } + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'wp:author': + $node = $reader->expand(); + + $parsed = $this->parse_author_node( $node ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + $authors[] = $parsed; + + // Handled everything in this node, move on to the next + $reader->next(); + break; + } + } + + return $authors; + } + + /** + * The main controller for the actual import stage. + * + * @param string $file Path to the WXR file for importing + */ + public function import( $file ) { + add_filter( 'import_post_meta_key', array( $this, 'is_valid_meta_key' ) ); + add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) ); + + $result = $this->import_start( $file ); + if ( is_wp_error( $result ) ) { + return $result; + } + + // Let's run the actual importer now, woot + $reader = $this->get_reader( $file ); + if ( is_wp_error( $reader ) ) { + return $reader; + } + + // Set the version to compatibility mode first + $this->version = '1.0'; + + // Reset other variables + $this->base_url = ''; + + // Start parsing! + while ( $reader->read() ) { + // Only deal with element opens + if ( $reader->nodeType !== \XMLReader::ELEMENT ) { + continue; + } + + switch ( $reader->name ) { + case 'wp:wxr_version': + // Upgrade to the correct version + $this->version = $reader->readString(); + + if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) { + $this->logger->warning( sprintf( + __( 'This WXR file (version %s) is newer than the importer (version %s) and may not be supported. Please consider updating.', 'wordpress-importer' ), + $this->version, + self::MAX_WXR_VERSION + ) ); + } + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'wp:base_site_url': + $this->base_url = $reader->readString(); + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'item': + $node = $reader->expand(); + $parsed = $this->parse_post_node( $node ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + $this->process_post( $parsed['data'], $parsed['meta'], $parsed['comments'], $parsed['terms'] ); + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'wp:author': + $node = $reader->expand(); + + $parsed = $this->parse_author_node( $node ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + $status = $this->process_author( $parsed['data'], $parsed['meta'] ); + if ( is_wp_error( $status ) ) { + $this->log_error( $status ); + } + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'wp:category': + $node = $reader->expand(); + + $parsed = $this->parse_term_node( $node, 'category' ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + $status = $this->process_term( $parsed['data'], $parsed['meta'] ); + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'wp:tag': + $node = $reader->expand(); + + $parsed = $this->parse_term_node( $node, 'tag' ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + $status = $this->process_term( $parsed['data'], $parsed['meta'] ); + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + case 'wp:term': + $node = $reader->expand(); + + $parsed = $this->parse_term_node( $node ); + if ( is_wp_error( $parsed ) ) { + $this->log_error( $parsed ); + + // Skip the rest of this post + $reader->next(); + break; + } + + $status = $this->process_term( $parsed['data'], $parsed['meta'] ); + + // Handled everything in this node, move on to the next + $reader->next(); + break; + + default: + // Skip this node, probably handled by something already + break; + } + } + + // Now that we've done the main processing, do any required + // post-processing and remapping. + $this->post_process(); + + if ( $this->options['aggressive_url_search'] ) { + $this->replace_attachment_urls_in_content(); + } + + $this->remap_featured_images(); + + $this->import_end(); + } + + /** + * Log an error instance to the logger. + * + * @param WP_Error $error Error instance to log. + */ + protected function log_error( WP_Error $error ) { + $this->logger->warning( $error->get_error_message() ); + + // Log the data as debug info too + $data = $error->get_error_data(); + if ( ! empty( $data ) ) { + $this->logger->debug( var_export( $data, true ) ); + } + } + + /** + * Parses the WXR file and prepares us for the task of processing parsed data + * + * @param string $file Path to the WXR file for importing + */ + protected function import_start( $file ) { + if ( ! is_file( $file ) ) { + return new \WP_Error( 'wxr_importer.file_missing', __( 'The file does not exist, please try again.', 'wordpress-importer' ) ); + } + + // Suspend bunches of stuff in WP core + wp_defer_term_counting( true ); + wp_defer_comment_counting( true ); + wp_suspend_cache_invalidation( true ); + + // Prefill exists calls if told to + if ( $this->options['prefill_existing_posts'] ) { + $this->prefill_existing_posts(); + } + if ( $this->options['prefill_existing_comments'] ) { + $this->prefill_existing_comments(); + } + if ( $this->options['prefill_existing_terms'] ) { + $this->prefill_existing_terms(); + } + + /** + * Begin the import. + * + * Fires before the import process has begun. If you need to suspend + * caching or heavy processing on hooks, do so here. + */ + do_action( 'import_start' ); + } + + /** + * Performs post-import cleanup of files and the cache + */ + protected function import_end() { + // Re-enable stuff in core + wp_suspend_cache_invalidation( false ); + wp_cache_flush(); + foreach ( get_taxonomies() as $tax ) { + delete_option( "{$tax}_children" ); + _get_term_hierarchy( $tax ); + } + + wp_defer_term_counting( false ); + wp_defer_comment_counting( false ); + + /** + * Complete the import. + * + * Fires after the import process has finished. If you need to update + * your cache or re-enable processing, do so here. + */ + do_action( 'import_end' ); + } + + /** + * Set the user mapping. + * + * @param array $mapping List of map arrays (containing `old_slug`, `old_id`, `new_id`) + */ + public function set_user_mapping( $mapping ) { + foreach ( $mapping as $map ) { + if ( empty( $map['old_slug'] ) || empty( $map['old_id'] ) || empty( $map['new_id'] ) ) { + $this->logger->warning( __( 'Invalid author mapping', 'wordpress-importer' ) ); + $this->logger->debug( var_export( $map, true ) ); + continue; + } + + $old_slug = $map['old_slug']; + $old_id = $map['old_id']; + $new_id = $map['new_id']; + + $this->mapping['user'][ $old_id ] = $new_id; + $this->mapping['user_slug'][ $old_slug ] = $new_id; + } + } + + /** + * Set the user slug overrides. + * + * Allows overriding the slug in the import with a custom/renamed version. + * + * @param string[] $overrides Map of old slug to new slug. + */ + public function set_user_slug_overrides( $overrides ) { + foreach ( $overrides as $original => $renamed ) { + $this->user_slug_override[ $original ] = $renamed; + } + } + + /** + * Parse a post node into post data. + * + * @param DOMElement $node Parent node of post data (typically `item`). + * @return array|WP_Error Post data array on success, error otherwise. + */ + protected function parse_post_node( $node ) { + $data = array(); + $meta = array(); + $comments = array(); + $terms = array(); + + foreach ( $node->childNodes as $child ) { + // We only care about child elements + if ( $child->nodeType !== XML_ELEMENT_NODE ) { + continue; + } + + switch ( $child->tagName ) { + case 'wp:post_type': + $data['post_type'] = $child->textContent; + break; + + case 'title': + $data['post_title'] = $child->textContent; + break; + + case 'guid': + $data['guid'] = $child->textContent; + break; + + case 'dc:creator': + $data['post_author'] = $child->textContent; + break; + + case 'content:encoded': + $data['post_content'] = $child->textContent; + break; + + case 'excerpt:encoded': + $data['post_excerpt'] = $child->textContent; + break; + + case 'wp:post_id': + $data['post_id'] = $child->textContent; + break; + + case 'wp:post_date': + $data['post_date'] = $child->textContent; + break; + + case 'wp:post_date_gmt': + $data['post_date_gmt'] = $child->textContent; + break; + + case 'wp:comment_status': + $data['comment_status'] = $child->textContent; + break; + + case 'wp:ping_status': + $data['ping_status'] = $child->textContent; + break; + + case 'wp:post_name': + $data['post_name'] = $child->textContent; + break; + + case 'wp:status': + $data['post_status'] = $child->textContent; + + if ( $data['post_status'] === 'auto-draft' ) { + // Bail now + return new \WP_Error( + 'wxr_importer.post.cannot_import_draft', + __( 'Cannot import auto-draft posts' ), + $data + ); + } + break; + + case 'wp:post_parent': + $data['post_parent'] = $child->textContent; + break; + + case 'wp:menu_order': + $data['menu_order'] = $child->textContent; + break; + + case 'wp:post_password': + $data['post_password'] = $child->textContent; + break; + + case 'wp:is_sticky': + $data['is_sticky'] = $child->textContent; + break; + + case 'wp:attachment_url': + $data['attachment_url'] = $child->textContent; + break; + + case 'wp:postmeta': + $meta_item = $this->parse_meta_node( $child ); + if ( ! empty( $meta_item ) ) { + $meta[] = $meta_item; + } + break; + + case 'wp:comment': + $comment_item = $this->parse_comment_node( $child ); + if ( ! empty( $comment_item ) ) { + $comments[] = $comment_item; + } + break; + + case 'category': + $term_item = $this->parse_category_node( $child ); + if ( ! empty( $term_item ) ) { + $terms[] = $term_item; + } + break; + } + } + + return compact( 'data', 'meta', 'comments', 'terms' ); + } + + /** + * Create new posts based on import information + * + * Posts marked as having a parent which doesn't exist will become top level items. + * Doesn't create a new post if: the post type doesn't exist, the given post ID + * is already noted as imported or a post with the same title and date already exists. + * Note that new/updated terms, comments and meta are imported for the last of the above. + */ + protected function process_post( $data, $meta, $comments, $terms ) { + /** + * Pre-process post data. + * + * @param array $data Post data. (Return empty to skip.) + * @param array $meta Meta data. + * @param array $comments Comments on the post. + * @param array $terms Terms on the post. + */ + $data = apply_filters( 'wxr_importer.pre_process.post', $data, $meta, $comments, $terms ); + if ( empty( $data ) ) { + return false; + } + + $original_id = isset( $data['post_id'] ) ? (int) $data['post_id'] : 0; + $parent_id = isset( $data['post_parent'] ) ? (int) $data['post_parent'] : 0; + $author_id = isset( $data['post_author'] ) ? (int) $data['post_author'] : 0; + + // Have we already processed this? + if ( isset( $this->mapping['post'][ $original_id ] ) ) { + return; + } + + $post_type_object = get_post_type_object( $data['post_type'] ); + + // Is this type even valid? + if ( ! $post_type_object ) { + $this->logger->warning( sprintf( + __( 'Failed to import "%s": Invalid post type %s', 'wordpress-importer' ), + $data['post_title'], + $data['post_type'] + ) ); + return false; + } + + $post_exists = $this->post_exists( $data ); + if ( $post_exists ) { + $this->logger->info( sprintf( + __( '%s "%s" already exists.', 'wordpress-importer' ), + $post_type_object->labels->singular_name, + $data['post_title'] + ) ); + + /** + * Post processing already imported. + * + * @param array $data Raw data imported for the post. + */ + do_action( 'wxr_importer.process_already_imported.post', $data ); + + // Even though this post already exists, new comments might need importing + $this->process_comments( $comments, $original_id, $data, $post_exists ); + + return false; + } + + // Map the parent post, or mark it as one we need to fix + $requires_remapping = false; + if ( $parent_id ) { + if ( isset( $this->mapping['post'][ $parent_id ] ) ) { + $data['post_parent'] = $this->mapping['post'][ $parent_id ]; + } else { + $meta[] = array( 'key' => '_wxr_import_parent', 'value' => $parent_id ); + $requires_remapping = true; + + $data['post_parent'] = 0; + } + } + + // Map the author, or mark it as one we need to fix + $author = sanitize_user( $data['post_author'], true ); + if ( empty( $author ) ) { + // Missing or invalid author, use default if available. + $data['post_author'] = $this->options['default_author']; + } elseif ( isset( $this->mapping['user_slug'][ $author ] ) ) { + $data['post_author'] = $this->mapping['user_slug'][ $author ]; + } else { + $meta[] = array( 'key' => '_wxr_import_user_slug', 'value' => $author ); + $requires_remapping = true; + + $data['post_author'] = (int) get_current_user_id(); + } + + // Does the post look like it contains attachment images? + if ( preg_match( self::REGEX_HAS_ATTACHMENT_REFS, $data['post_content'] ) ) { + $meta[] = array( 'key' => '_wxr_import_has_attachment_refs', 'value' => true ); + $requires_remapping = true; + } + + // Whitelist to just the keys we allow + $postdata = array( + 'import_id' => $data['post_id'], + ); + $allowed = array( + 'post_author' => true, + 'post_date' => true, + 'post_date_gmt' => true, + 'post_content' => true, + 'post_excerpt' => true, + 'post_title' => true, + 'post_status' => true, + 'post_name' => true, + 'comment_status' => true, + 'ping_status' => true, + 'guid' => true, + 'post_parent' => true, + 'menu_order' => true, + 'post_type' => true, + 'post_password' => true, + ); + foreach ( $data as $key => $value ) { + if ( ! isset( $allowed[ $key ] ) ) { + continue; + } + + $postdata[ $key ] = $data[ $key ]; + } + + $postdata = apply_filters( 'wp_import_post_data_processed', $postdata, $data ); + + if ( 'attachment' === $postdata['post_type'] ) { + if ( ! $this->options['fetch_attachments'] ) { + $this->logger->notice( sprintf( + __( 'Skipping attachment "%s", fetching attachments disabled' ), + $data['post_title'] + ) ); + /** + * Post processing skipped. + * + * @param array $data Raw data imported for the post. + * @param array $meta Raw meta data, already processed by {@see process_post_meta}. + */ + do_action( 'wxr_importer.process_skipped.post', $data, $meta ); + return false; + } + $remote_url = ! empty( $data['attachment_url'] ) ? $data['attachment_url'] : $data['guid']; + $post_id = $this->process_attachment( $postdata, $meta, $remote_url ); + } else { + $post_id = wp_insert_post( $postdata, true ); + do_action( 'wp_import_insert_post', $post_id, $original_id, $postdata, $data ); + } + + if ( is_wp_error( $post_id ) ) { + $this->logger->error( sprintf( + __( 'Failed to import "%s" (%s)', 'wordpress-importer' ), + $data['post_title'], + $post_type_object->labels->singular_name + ) ); + $this->logger->debug( $post_id->get_error_message() ); + + /** + * Post processing failed. + * + * @param WP_Error $post_id Error object. + * @param array $data Raw data imported for the post. + * @param array $meta Raw meta data, already processed by {@see process_post_meta}. + * @param array $comments Raw comment data, already processed by {@see process_comments}. + * @param array $terms Raw term data, already processed. + */ + do_action( 'wxr_importer.process_failed.post', $post_id, $data, $meta, $comments, $terms ); + return false; + } + + // Ensure stickiness is handled correctly too + if ( $data['is_sticky'] === '1' ) { + stick_post( $post_id ); + } + + // map pre-import ID to local ID + $this->mapping['post'][ $original_id ] = (int) $post_id; + if ( $requires_remapping ) { + $this->requires_remapping['post'][ $post_id ] = true; + } + $this->mark_post_exists( $data, $post_id ); + + $this->logger->info( sprintf( + __( 'Imported "%s" (%s)', 'wordpress-importer' ), + $data['post_title'], + $post_type_object->labels->singular_name + ) ); + $this->logger->debug( sprintf( + __( 'Post %d remapped to %d', 'wordpress-importer' ), + $original_id, + $post_id + ) ); + + // Handle the terms too + $terms = apply_filters( 'wp_import_post_terms', $terms, $post_id, $data ); + + if ( ! empty( $terms ) ) { + $term_ids = array(); + foreach ( $terms as $term ) { + $taxonomy = $term['taxonomy']; + $key = sha1( $taxonomy . ':' . $term['slug'] ); + + if ( isset( $this->mapping['term'][ $key ] ) ) { + $term_ids[ $taxonomy ][] = (int) $this->mapping['term'][ $key ]; + } else { + $meta[] = array( 'key' => '_wxr_import_term', 'value' => $term ); + $requires_remapping = true; + } + } + + foreach ( $term_ids as $tax => $ids ) { + $tt_ids = wp_set_post_terms( $post_id, $ids, $tax ); + do_action( 'wp_import_set_post_terms', $tt_ids, $ids, $tax, $post_id, $data ); + } + } + + $this->process_comments( $comments, $post_id, $data ); + $this->process_post_meta( $meta, $post_id, $data ); + + if ( 'nav_menu_item' === $data['post_type'] ) { + $this->process_menu_item_meta( $post_id, $data, $meta ); + } + + /** + * Post processing completed. + * + * @param int $post_id New post ID. + * @param array $data Raw data imported for the post. + * @param array $meta Raw meta data, already processed by {@see process_post_meta}. + * @param array $comments Raw comment data, already processed by {@see process_comments}. + * @param array $terms Raw term data, already processed. + */ + do_action( 'wxr_importer.processed.post', $post_id, $data, $meta, $comments, $terms ); + } + + /** + * Attempt to create a new menu item from import data + * + * Fails for draft, orphaned menu items and those without an associated nav_menu + * or an invalid nav_menu term. If the post type or term object which the menu item + * represents doesn't exist then the menu item will not be imported (waits until the + * end of the import to retry again before discarding). + * + * @param array $item Menu item details from WXR file + */ + protected function process_menu_item_meta( $post_id, $data, $meta ) { + + $item_type = get_post_meta( $post_id, '_menu_item_type', true ); + $original_object_id = get_post_meta( $post_id, '_menu_item_object_id', true ); + $object_id = null; + + $this->logger->debug( sprintf( 'Processing menu item %s', $item_type ) ); + + $requires_remapping = false; + switch ( $item_type ) { + case 'taxonomy': + if ( isset( $this->mapping['term_id'][ $original_object_id ] ) ) { + $object_id = $this->mapping['term_id'][ $original_object_id ]; + } else { + add_post_meta( $post_id, '_wxr_import_menu_item', wp_slash( $original_object_id ) ); + $requires_remapping = true; + } + break; + + case 'post_type': + if ( isset( $this->mapping['post'][ $original_object_id ] ) ) { + $object_id = $this->mapping['post'][ $original_object_id ]; + } else { + add_post_meta( $post_id, '_wxr_import_menu_item', wp_slash( $original_object_id ) ); + $requires_remapping = true; + } + break; + + case 'custom': + // Custom refers to itself, wonderfully easy. + $object_id = $post_id; + break; + + default: + // associated object is missing or not imported yet, we'll retry later + $this->missing_menu_items[] = $item; + $this->logger->debug( 'Unknown menu item type' ); + break; + } + + if ( $requires_remapping ) { + $this->requires_remapping['post'][ $post_id ] = true; + } + + if ( empty( $object_id ) ) { + // Nothing needed here. + return; + } + + $this->logger->debug( sprintf( 'Menu item %d mapped to %d', $original_object_id, $object_id ) ); + update_post_meta( $post_id, '_menu_item_object_id', wp_slash( $object_id ) ); + } + + /** + * If fetching attachments is enabled then attempt to create a new attachment + * + * @param array $post Attachment post details from WXR + * @param string $url URL to fetch attachment from + * @return int|WP_Error Post ID on success, WP_Error otherwise + */ + protected function process_attachment( $post, $meta, $remote_url ) { + // try to use _wp_attached file for upload folder placement to ensure the same location as the export site + // e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload() + $post['upload_date'] = $post['post_date']; + foreach ( $meta as $meta_item ) { + if ( $meta_item['key'] !== '_wp_attached_file' ) { + continue; + } + + if ( preg_match( '%^[0-9]{4}/[0-9]{2}%', $meta_item['value'], $matches ) ) { + $post['upload_date'] = $matches[0]; + } + break; + } + + // if the URL is absolute, but does not contain address, then upload it assuming base_site_url + if ( preg_match( '|^/[\w\W]+$|', $remote_url ) ) { + $remote_url = rtrim( $this->base_url, '/' ) . $remote_url; + } + + $upload = $this->fetch_remote_file( $remote_url, $post ); + if ( is_wp_error( $upload ) ) { + return $upload; + } + + $info = wp_check_filetype( $upload['file'] ); + if ( ! $info ) { + return new \WP_Error( 'attachment_processing_error', __( 'Invalid file type', 'wordpress-importer' ) ); + } + + $post['post_mime_type'] = $info['type']; + + // WP really likes using the GUID for display. Allow updating it. + // See https://core.trac.wordpress.org/ticket/33386 + if ( $this->options['update_attachment_guids'] ) { + $post['guid'] = $upload['url']; + } + + // as per wp-admin/includes/upload.php + $post_id = wp_insert_attachment( $post, $upload['file'] ); + if ( is_wp_error( $post_id ) ) { + return $post_id; + } + + $attachment_metadata = wp_generate_attachment_metadata( $post_id, $upload['file'] ); + wp_update_attachment_metadata( $post_id, $attachment_metadata ); + + // Map this image URL later if we need to + $this->url_remap[ $remote_url ] = $upload['url']; + + // If we have a HTTPS URL, ensure the HTTP URL gets replaced too + if ( substr( $remote_url, 0, 8 ) === 'https://' ) { + $insecure_url = 'http' . substr( $remote_url, 5 ); + $this->url_remap[ $insecure_url ] = $upload['url']; + } + + if ( $this->options['aggressive_url_search'] ) { + // remap resized image URLs, works by stripping the extension and remapping the URL stub. + /*if ( preg_match( '!^image/!', $info['type'] ) ) { + $parts = pathinfo( $remote_url ); + $name = basename( $parts['basename'], ".{$parts['extension']}" ); // PATHINFO_FILENAME in PHP 5.2 + + $parts_new = pathinfo( $upload['url'] ); + $name_new = basename( $parts_new['basename'], ".{$parts_new['extension']}" ); + + $this->url_remap[$parts['dirname'] . '/' . $name] = $parts_new['dirname'] . '/' . $name_new; + }*/ + } + + return $post_id; + } + + /** + * Parse a meta node into meta data. + * + * @param DOMElement $node Parent node of meta data (typically `wp:postmeta` or `wp:commentmeta`). + * @return array|null Meta data array on success, or null on error. + */ + protected function parse_meta_node( $node ) { + foreach ( $node->childNodes as $child ) { + // We only care about child elements + if ( $child->nodeType !== XML_ELEMENT_NODE ) { + continue; + } + + switch ( $child->tagName ) { + case 'wp:meta_key': + $key = $child->textContent; + break; + + case 'wp:meta_value': + $value = $child->textContent; + break; + } + } + + if ( empty( $key ) || empty( $value ) ) { + return null; + } + + return compact( 'key', 'value' ); + } + + /** + * Process and import post meta items. + * + * @param array $meta List of meta data arrays + * @param int $post_id Post to associate with + * @param array $post Post data + * @return int|WP_Error Number of meta items imported on success, error otherwise. + */ + protected function process_post_meta( $meta, $post_id, $post ) { + if ( empty( $meta ) ) { + return true; + } + + foreach ( $meta as $meta_item ) { + /** + * Pre-process post meta data. + * + * @param array $meta_item Meta data. (Return empty to skip.) + * @param int $post_id Post the meta is attached to. + */ + $meta_item = apply_filters( 'wxr_importer.pre_process.post_meta', $meta_item, $post_id ); + if ( empty( $meta_item ) ) { + return false; + } + + $key = apply_filters( 'import_post_meta_key', $meta_item['key'], $post_id, $post ); + $value = false; + + if ( '_edit_last' === $key ) { + $value = intval( $meta_item['value'] ); + if ( ! isset( $this->mapping['user'][ $value ] ) ) { + // Skip! + continue; + } + + $value = $this->mapping['user'][ $value ]; + } + + if ( $key ) { + // export gets meta straight from the DB so could have a serialized string + if ( ! $value ) { + $value = maybe_unserialize( $meta_item['value'] ); + } + + add_post_meta( $post_id, $key, $value ); + do_action( 'import_post_meta', $post_id, $key, $value ); + + // if the post has a featured image, take note of this in case of remap + if ( '_thumbnail_id' === $key ) { + $this->featured_images[ $post_id ] = (int) $value; + } + } + } + + return true; + } + + /** + * Parse a comment node into comment data. + * + * @param DOMElement $node Parent node of comment data (typically `wp:comment`). + * @return array Comment data array. + */ + protected function parse_comment_node( $node ) { + $data = array( + 'commentmeta' => array(), + ); + + foreach ( $node->childNodes as $child ) { + // We only care about child elements + if ( $child->nodeType !== XML_ELEMENT_NODE ) { + continue; + } + + switch ( $child->tagName ) { + case 'wp:comment_id': + $data['comment_id'] = $child->textContent; + break; + case 'wp:comment_author': + $data['comment_author'] = $child->textContent; + break; + + case 'wp:comment_author_email': + $data['comment_author_email'] = $child->textContent; + break; + + case 'wp:comment_author_IP': + $data['comment_author_IP'] = $child->textContent; + break; + + case 'wp:comment_author_url': + $data['comment_author_url'] = $child->textContent; + break; + + case 'wp:comment_user_id': + $data['comment_user_id'] = $child->textContent; + break; + + case 'wp:comment_date': + $data['comment_date'] = $child->textContent; + break; + + case 'wp:comment_date_gmt': + $data['comment_date_gmt'] = $child->textContent; + break; + + case 'wp:comment_content': + $data['comment_content'] = $child->textContent; + break; + + case 'wp:comment_approved': + $data['comment_approved'] = $child->textContent; + break; + + case 'wp:comment_type': + $data['comment_type'] = $child->textContent; + break; + + case 'wp:comment_parent': + $data['comment_parent'] = $child->textContent; + break; + + case 'wp:commentmeta': + $meta_item = $this->parse_meta_node( $child ); + if ( ! empty( $meta_item ) ) { + $data['commentmeta'][] = $meta_item; + } + break; + } + } + + return $data; + } + + /** + * Process and import comment data. + * + * @param array $comments List of comment data arrays. + * @param int $post_id Post to associate with. + * @param array $post Post data. + * @return int|WP_Error Number of comments imported on success, error otherwise. + */ + protected function process_comments( $comments, $post_id, $post, $post_exists = false ) { + + $comments = apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ); + if ( empty( $comments ) ) { + return 0; + } + + $num_comments = 0; + + // Sort by ID to avoid excessive remapping later + usort( $comments, array( $this, 'sort_comments_by_id' ) ); + + foreach ( $comments as $key => $comment ) { + /** + * Pre-process comment data + * + * @param array $comment Comment data. (Return empty to skip.) + * @param int $post_id Post the comment is attached to. + */ + $comment = apply_filters( 'wxr_importer.pre_process.comment', $comment, $post_id ); + if ( empty( $comment ) ) { + return false; + } + + $original_id = isset( $comment['comment_id'] ) ? (int) $comment['comment_id'] : 0; + $parent_id = isset( $comment['comment_parent'] ) ? (int) $comment['comment_parent'] : 0; + $author_id = isset( $comment['comment_user_id'] ) ? (int) $comment['comment_user_id'] : 0; + + // if this is a new post we can skip the comment_exists() check + // TODO: Check comment_exists for performance + if ( $post_exists ) { + $existing = $this->comment_exists( $comment ); + if ( $existing ) { + + /** + * Comment processing already imported. + * + * @param array $comment Raw data imported for the comment. + */ + do_action( 'wxr_importer.process_already_imported.comment', $comment ); + + $this->mapping['comment'][ $original_id ] = $existing; + continue; + } + } + + // Remove meta from the main array + $meta = isset( $comment['commentmeta'] ) ? $comment['commentmeta'] : array(); + unset( $comment['commentmeta'] ); + + // Map the parent comment, or mark it as one we need to fix + $requires_remapping = false; + if ( $parent_id ) { + if ( isset( $this->mapping['comment'][ $parent_id ] ) ) { + $comment['comment_parent'] = $this->mapping['comment'][ $parent_id ]; + } else { + // Prepare for remapping later + $meta[] = array( 'key' => '_wxr_import_parent', 'value' => $parent_id ); + $requires_remapping = true; + + // Wipe the parent for now + $comment['comment_parent'] = 0; + } + } + + // Map the author, or mark it as one we need to fix + if ( $author_id ) { + if ( isset( $this->mapping['user'][ $author_id ] ) ) { + $comment['user_id'] = $this->mapping['user'][ $author_id ]; + } else { + // Prepare for remapping later + $meta[] = array( 'key' => '_wxr_import_user', 'value' => $author_id ); + $requires_remapping = true; + + // Wipe the user for now + $comment['user_id'] = 0; + } + } + + // Run standard core filters + $comment['comment_post_ID'] = $post_id; + $comment = wp_filter_comment( $comment ); + + // wp_insert_comment expects slashed data + $comment_id = wp_insert_comment( wp_slash( $comment ) ); + $this->mapping['comment'][ $original_id ] = $comment_id; + if ( $requires_remapping ) { + $this->requires_remapping['comment'][ $comment_id ] = true; + } + $this->mark_comment_exists( $comment, $comment_id ); + + /** + * Comment has been imported. + * + * @param int $comment_id New comment ID + * @param array $comment Comment inserted (`comment_id` item refers to the original ID) + * @param int $post_id Post parent of the comment + * @param array $post Post data + */ + do_action( 'wp_import_insert_comment', $comment_id, $comment, $post_id, $post ); + + // Process the meta items + foreach ( $meta as $meta_item ) { + $value = maybe_unserialize( $meta_item['value'] ); + add_comment_meta( $comment_id, wp_slash( $meta_item['key'] ), wp_slash( $value ) ); + } + + /** + * Post processing completed. + * + * @param int $post_id New post ID. + * @param array $comment Raw data imported for the comment. + * @param array $meta Raw meta data, already processed by {@see process_post_meta}. + * @param array $post_id Parent post ID. + */ + do_action( 'wxr_importer.processed.comment', $comment_id, $comment, $meta, $post_id ); + + $num_comments++; + } + + return $num_comments; + } + + protected function parse_category_node( $node ) { + $data = array( + // Default taxonomy to "category", since this is a `` tag + 'taxonomy' => 'category', + ); + $meta = array(); + + if ( $node->hasAttribute( 'domain' ) ) { + $data['taxonomy'] = $node->getAttribute( 'domain' ); + } + if ( $node->hasAttribute( 'nicename' ) ) { + $data['slug'] = $node->getAttribute( 'nicename' ); + } + + $data['name'] = $node->textContent; + + if ( empty( $data['slug'] ) ) { + return null; + } + + // Just for extra compatibility + if ( $data['taxonomy'] === 'tag' ) { + $data['taxonomy'] = 'post_tag'; + } + + return $data; + } + + /** + * Callback for `usort` to sort comments by ID + * + * @param array $a Comment data for the first comment + * @param array $b Comment data for the second comment + * @return int + */ + public static function sort_comments_by_id( $a, $b ) { + if ( empty( $a['comment_id'] ) ) { + return 1; + } + + if ( empty( $b['comment_id'] ) ) { + return -1; + } + + return $a['comment_id'] - $b['comment_id']; + } + + protected function parse_author_node( $node ) { + $data = array(); + $meta = array(); + foreach ( $node->childNodes as $child ) { + // We only care about child elements + if ( $child->nodeType !== XML_ELEMENT_NODE ) { + continue; + } + + switch ( $child->tagName ) { + case 'wp:author_login': + $data['user_login'] = $child->textContent; + break; + + case 'wp:author_id': + $data['ID'] = $child->textContent; + break; + + case 'wp:author_email': + $data['user_email'] = $child->textContent; + break; + + case 'wp:author_display_name': + $data['display_name'] = $child->textContent; + break; + + case 'wp:author_first_name': + $data['first_name'] = $child->textContent; + break; + + case 'wp:author_last_name': + $data['last_name'] = $child->textContent; + break; + } + } + + return compact( 'data', 'meta' ); + } + + protected function process_author( $data, $meta ) { + /** + * Pre-process user data. + * + * @param array $data User data. (Return empty to skip.) + * @param array $meta Meta data. + */ + $data = apply_filters( 'wxr_importer.pre_process.user', $data, $meta ); + if ( empty( $data ) ) { + return false; + } + + // Have we already handled this user? + $original_id = isset( $data['ID'] ) ? $data['ID'] : 0; + $original_slug = $data['user_login']; + + if ( isset( $this->mapping['user'][ $original_id ] ) ) { + $existing = $this->mapping['user'][ $original_id ]; + + // Note the slug mapping if we need to too + if ( ! isset( $this->mapping['user_slug'][ $original_slug ] ) ) { + $this->mapping['user_slug'][ $original_slug ] = $existing; + } + + return false; + } + + if ( isset( $this->mapping['user_slug'][ $original_slug ] ) ) { + $existing = $this->mapping['user_slug'][ $original_slug ]; + + // Ensure we note the mapping too + $this->mapping['user'][ $original_id ] = $existing; + + return false; + } + + // Allow overriding the user's slug + $login = $original_slug; + if ( isset( $this->user_slug_override[ $login ] ) ) { + $login = $this->user_slug_override[ $login ]; + } + + $userdata = array( + 'user_login' => sanitize_user( $login, true ), + 'user_pass' => wp_generate_password(), + ); + + $allowed = array( + 'user_email' => true, + 'display_name' => true, + 'first_name' => true, + 'last_name' => true, + ); + foreach ( $data as $key => $value ) { + if ( ! isset( $allowed[ $key ] ) ) { + continue; + } + + $userdata[ $key ] = $data[ $key ]; + } + + $user_id = wp_insert_user( wp_slash( $userdata ) ); + if ( is_wp_error( $user_id ) ) { + $this->logger->error( sprintf( + __( 'Failed to import user "%s"', 'wordpress-importer' ), + $userdata['user_login'] + ) ); + $this->logger->debug( $user_id->get_error_message() ); + + /** + * User processing failed. + * + * @param WP_Error $user_id Error object. + * @param array $userdata Raw data imported for the user. + */ + do_action( 'wxr_importer.process_failed.user', $user_id, $userdata ); + return false; + } + + if ( $original_id ) { + $this->mapping['user'][ $original_id ] = $user_id; + } + $this->mapping['user_slug'][ $original_slug ] = $user_id; + + $this->logger->info( sprintf( + __( 'Imported user "%s"', 'wordpress-importer' ), + $userdata['user_login'] + ) ); + $this->logger->debug( sprintf( + __( 'User %d remapped to %d', 'wordpress-importer' ), + $original_id, + $user_id + ) ); + + // TODO: Implement meta handling once WXR includes it + /** + * User processing completed. + * + * @param int $user_id New user ID. + * @param array $userdata Raw data imported for the user. + */ + do_action( 'wxr_importer.processed.user', $user_id, $userdata ); + } + + protected function parse_term_node( $node, $type = 'term' ) { + $data = array(); + $meta = array(); + + $tag_name = array( + 'id' => 'wp:term_id', + 'taxonomy' => 'wp:term_taxonomy', + 'slug' => 'wp:term_slug', + 'parent' => 'wp:term_parent', + 'name' => 'wp:term_name', + 'description' => 'wp:term_description', + ); + $taxonomy = null; + + // Special casing! + switch ( $type ) { + case 'category': + $tag_name['slug'] = 'wp:category_nicename'; + $tag_name['parent'] = 'wp:category_parent'; + $tag_name['name'] = 'wp:cat_name'; + $tag_name['description'] = 'wp:category_description'; + $tag_name['taxonomy'] = null; + + $data['taxonomy'] = 'category'; + break; + + case 'tag': + $tag_name['slug'] = 'wp:tag_slug'; + $tag_name['parent'] = null; + $tag_name['name'] = 'wp:tag_name'; + $tag_name['description'] = 'wp:tag_description'; + $tag_name['taxonomy'] = null; + + $data['taxonomy'] = 'post_tag'; + break; + } + + foreach ( $node->childNodes as $child ) { + // We only care about child elements + if ( $child->nodeType !== XML_ELEMENT_NODE ) { + continue; + } + + $key = array_search( $child->tagName, $tag_name ); + if ( $key ) { + $data[ $key ] = $child->textContent; + } + } + + if ( empty( $data['taxonomy'] ) ) { + return null; + } + + // Compatibility with WXR 1.0 + if ( $data['taxonomy'] === 'tag' ) { + $data['taxonomy'] = 'post_tag'; + } + + return compact( 'data', 'meta' ); + } + + protected function process_term( $data, $meta ) { + /** + * Pre-process term data. + * + * @param array $data Term data. (Return empty to skip.) + * @param array $meta Meta data. + */ + $data = apply_filters( 'wxr_importer.pre_process.term', $data, $meta ); + if ( empty( $data ) ) { + return false; + } + + $original_id = isset( $data['id'] ) ? (int) $data['id'] : 0; + $parent_id = isset( $data['parent'] ) ? (int) $data['parent'] : 0; + + $mapping_key = sha1( $data['taxonomy'] . ':' . $data['slug'] ); + $existing = $this->term_exists( $data ); + if ( $existing ) { + + /** + * Term processing already imported. + * + * @param array $data Raw data imported for the term. + */ + do_action( 'wxr_importer.process_already_imported.term', $data ); + + $this->mapping['term'][ $mapping_key ] = $existing; + $this->mapping['term_id'][ $original_id ] = $existing; + return false; + } + + // WP really likes to repeat itself in export files + if ( isset( $this->mapping['term'][ $mapping_key ] ) ) { + return false; + } + + $termdata = array(); + $allowed = array( + 'slug' => true, + 'description' => true, + ); + + // Map the parent comment, or mark it as one we need to fix + // TODO: add parent mapping and remapping + /*$requires_remapping = false; + if ( $parent_id ) { + if ( isset( $this->mapping['term'][ $parent_id ] ) ) { + $data['parent'] = $this->mapping['term'][ $parent_id ]; + } else { + // Prepare for remapping later + $meta[] = array( 'key' => '_wxr_import_parent', 'value' => $parent_id ); + $requires_remapping = true; + + // Wipe the parent for now + $data['parent'] = 0; + } + }*/ + + foreach ( $data as $key => $value ) { + if ( ! isset( $allowed[ $key ] ) ) { + continue; + } + + $termdata[ $key ] = $data[ $key ]; + } + + $result = wp_insert_term( $data['name'], $data['taxonomy'], $termdata ); + if ( is_wp_error( $result ) ) { + $this->logger->warning( sprintf( + __( 'Failed to import %s %s', 'wordpress-importer' ), + $data['taxonomy'], + $data['name'] + ) ); + $this->logger->debug( $result->get_error_message() ); + do_action( 'wp_import_insert_term_failed', $result, $data ); + + /** + * Term processing failed. + * + * @param WP_Error $result Error object. + * @param array $data Raw data imported for the term. + * @param array $meta Meta data supplied for the term. + */ + do_action( 'wxr_importer.process_failed.term', $result, $data, $meta ); + return false; + } + + $term_id = $result['term_id']; + + $this->mapping['term'][ $mapping_key ] = $term_id; + $this->mapping['term_id'][ $original_id ] = $term_id; + + $this->logger->info( sprintf( + __( 'Imported "%s" (%s)', 'wordpress-importer' ), + $data['name'], + $data['taxonomy'] + ) ); + $this->logger->debug( sprintf( + __( 'Term %d remapped to %d', 'wordpress-importer' ), + $original_id, + $term_id + ) ); + + do_action( 'wp_import_insert_term', $term_id, $data ); + + /** + * Term processing completed. + * + * @param int $term_id New term ID. + * @param array $data Raw data imported for the term. + */ + do_action( 'wxr_importer.processed.term', $term_id, $data ); + } + + /** + * Attempt to download a remote file attachment + * + * @param string $url URL of item to fetch + * @param array $post Attachment details + * @return array|WP_Error Local file location details on success, WP_Error otherwise + */ + protected function fetch_remote_file( $url, $post ) { + // extract the file name and extension from the url + $file_name = basename( $url ); + + // get placeholder file in the upload dir with a unique, sanitized filename + $upload = wp_upload_bits( $file_name, 0, '', $post['upload_date'] ); + if ( $upload['error'] ) { + return new \WP_Error( 'upload_dir_error', $upload['error'] ); + } + + // fetch the remote url and write it to the placeholder file + $response = wp_remote_get( $url, array( + 'stream' => true, + 'filename' => $upload['file'], + ) ); + + // request failed + if ( is_wp_error( $response ) ) { + unlink( $upload['file'] ); + return $response; + } + + $code = (int) wp_remote_retrieve_response_code( $response ); + + // make sure the fetch was successful + if ( $code !== 200 ) { + unlink( $upload['file'] ); + return new \WP_Error( + 'import_file_error', + sprintf( + __( 'Remote server returned %1$d %2$s for %3$s', 'wordpress-importer' ), + $code, + get_status_header_desc( $code ), + $url + ) + ); + } + + $filesize = filesize( $upload['file'] ); + $headers = wp_remote_retrieve_headers( $response ); + + if ( isset( $headers['content-length'] ) && $filesize !== (int) $headers['content-length'] ) { + unlink( $upload['file'] ); + return new \WP_Error( 'import_file_error', __( 'Remote file is incorrect size', 'wordpress-importer' ) ); + } + + if ( 0 === $filesize ) { + unlink( $upload['file'] ); + return new \WP_Error( 'import_file_error', __( 'Zero size file downloaded', 'wordpress-importer' ) ); + } + + $max_size = (int) $this->max_attachment_size(); + if ( ! empty( $max_size ) && $filesize > $max_size ) { + unlink( $upload['file'] ); + $message = sprintf( __( 'Remote file is too large, limit is %s', 'wordpress-importer' ), size_format( $max_size ) ); + return new \WP_Error( 'import_file_error', $message ); + } + + return $upload; + } + + protected function post_process() { + // Time to tackle any left-over bits + if ( ! empty( $this->requires_remapping['post'] ) ) { + $this->post_process_posts( $this->requires_remapping['post'] ); + } + if ( ! empty( $this->requires_remapping['comment'] ) ) { + $this->post_process_comments( $this->requires_remapping['comment'] ); + } + } + + protected function post_process_posts( $todo ) { + foreach ( $todo as $post_id => $_ ) { + $this->logger->debug( sprintf( + // Note: title intentionally not used to skip extra processing + // for when debug logging is off + __( 'Running post-processing for post %d', 'wordpress-importer' ), + $post_id + ) ); + + $data = array(); + + $parent_id = get_post_meta( $post_id, '_wxr_import_parent', true ); + if ( ! empty( $parent_id ) ) { + // Have we imported the parent now? + if ( isset( $this->mapping['post'][ $parent_id ] ) ) { + $data['post_parent'] = $this->mapping['post'][ $parent_id ]; + } else { + $this->logger->warning( sprintf( + __( 'Could not find the post parent for "%s" (post #%d)', 'wordpress-importer' ), + get_the_title( $post_id ), + $post_id + ) ); + $this->logger->debug( sprintf( + __( 'Post %d was imported with parent %d, but could not be found', 'wordpress-importer' ), + $post_id, + $parent_id + ) ); + } + } + + $author_slug = get_post_meta( $post_id, '_wxr_import_user_slug', true ); + if ( ! empty( $author_slug ) ) { + // Have we imported the user now? + if ( isset( $this->mapping['user_slug'][ $author_slug ] ) ) { + $data['post_author'] = $this->mapping['user_slug'][ $author_slug ]; + } else { + $this->logger->warning( sprintf( + __( 'Could not find the author for "%s" (post #%d)', 'wordpress-importer' ), + get_the_title( $post_id ), + $post_id + ) ); + $this->logger->debug( sprintf( + __( 'Post %d was imported with author "%s", but could not be found', 'wordpress-importer' ), + $post_id, + $author_slug + ) ); + } + } + + $has_attachments = get_post_meta( $post_id, '_wxr_import_has_attachment_refs', true ); + if ( ! empty( $has_attachments ) ) { + $post = get_post( $post_id ); + $content = $post->post_content; + + // Replace all the URLs we've got + $new_content = str_replace( array_keys( $this->url_remap ), $this->url_remap, $content ); + if ( $new_content !== $content ) { + $data['post_content'] = $new_content; + } + } + + if ( get_post_type( $post_id ) === 'nav_menu_item' ) { + $this->post_process_menu_item( $post_id ); + } + + // Do we have updates to make? + if ( empty( $data ) ) { + $this->logger->debug( sprintf( + __( 'Post %d was marked for post-processing, but none was required.', 'wordpress-importer' ), + $post_id + ) ); + continue; + } + + // Run the update + $data['ID'] = $post_id; + $result = wp_update_post( $data, true ); + if ( is_wp_error( $result ) ) { + $this->logger->warning( sprintf( + __( 'Could not update "%s" (post #%d) with mapped data', 'wordpress-importer' ), + get_the_title( $post_id ), + $post_id + ) ); + $this->logger->debug( $result->get_error_message() ); + continue; + } + + // Clear out our temporary meta keys + delete_post_meta( $post_id, '_wxr_import_parent' ); + delete_post_meta( $post_id, '_wxr_import_user_slug' ); + delete_post_meta( $post_id, '_wxr_import_has_attachment_refs' ); + } + } + + protected function post_process_menu_item( $post_id ) { + $menu_object_id = get_post_meta( $post_id, '_wxr_import_menu_item', true ); + if ( empty( $menu_object_id ) ) { + // No processing needed! + return; + } + + $menu_item_type = get_post_meta( $post_id, '_menu_item_type', true ); + switch ( $menu_item_type ) { + case 'taxonomy': + if ( isset( $this->mapping['term_id'][ $menu_object_id ] ) ) { + $menu_object = $this->mapping['term_id'][ $menu_object_id ]; + } + break; + + case 'post_type': + if ( isset( $this->mapping['post'][ $menu_object_id ] ) ) { + $menu_object = $this->mapping['post'][ $menu_object_id ]; + } + break; + + default: + // Cannot handle this. + return; + } + + if ( ! empty( $menu_object ) ) { + update_post_meta( $post_id, '_menu_item_object_id', wp_slash( $menu_object ) ); + } else { + $this->logger->warning( sprintf( + __( 'Could not find the menu object for "%s" (post #%d)', 'wordpress-importer' ), + get_the_title( $post_id ), + $post_id + ) ); + $this->logger->debug( sprintf( + __( 'Post %d was imported with object "%d" of type "%s", but could not be found', 'wordpress-importer' ), + $post_id, + $menu_object_id, + $menu_item_type + ) ); + } + + delete_post_meta( $post_id, '_wxr_import_menu_item' ); + } + + + protected function post_process_comments( $todo ) { + foreach ( $todo as $comment_id => $_ ) { + $data = array(); + + $parent_id = get_comment_meta( $comment_id, '_wxr_import_parent', true ); + if ( ! empty( $parent_id ) ) { + // Have we imported the parent now? + if ( isset( $this->mapping['comment'][ $parent_id ] ) ) { + $data['comment_parent'] = $this->mapping['comment'][ $parent_id ]; + } else { + $this->logger->warning( sprintf( + __( 'Could not find the comment parent for comment #%d', 'wordpress-importer' ), + $comment_id + ) ); + $this->logger->debug( sprintf( + __( 'Comment %d was imported with parent %d, but could not be found', 'wordpress-importer' ), + $comment_id, + $parent_id + ) ); + } + } + + $author_id = get_comment_meta( $comment_id, '_wxr_import_user', true ); + if ( ! empty( $author_id ) ) { + // Have we imported the user now? + if ( isset( $this->mapping['user'][ $author_id ] ) ) { + $data['user_id'] = $this->mapping['user'][ $author_id ]; + } else { + $this->logger->warning( sprintf( + __( 'Could not find the author for comment #%d', 'wordpress-importer' ), + $comment_id + ) ); + $this->logger->debug( sprintf( + __( 'Comment %d was imported with author %d, but could not be found', 'wordpress-importer' ), + $comment_id, + $author_id + ) ); + } + } + + // Do we have updates to make? + if ( empty( $data ) ) { + continue; + } + + // Run the update + $data['comment_ID'] = $comment_ID; + $result = wp_update_comment( wp_slash( $data ) ); + if ( empty( $result ) ) { + $this->logger->warning( sprintf( + __( 'Could not update comment #%d with mapped data', 'wordpress-importer' ), + $comment_id + ) ); + continue; + } + + // Clear out our temporary meta keys + delete_comment_meta( $comment_id, '_wxr_import_parent' ); + delete_comment_meta( $comment_id, '_wxr_import_user' ); + } + } + + /** + * Use stored mapping information to update old attachment URLs + */ + protected function replace_attachment_urls_in_content() { + global $wpdb; + // make sure we do the longest urls first, in case one is a substring of another + uksort( $this->url_remap, array( $this, 'cmpr_strlen' ) ); + + foreach ( $this->url_remap as $from_url => $to_url ) { + // remap urls in post_content + $query = $wpdb->prepare( "UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)", $from_url, $to_url ); + $wpdb->query( $query ); + + // remap enclosure urls + $query = $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = REPLACE(meta_value, %s, %s) WHERE meta_key='enclosure'", $from_url, $to_url ); + $result = $wpdb->query( $query ); + } + } + + /** + * Update _thumbnail_id meta to new, imported attachment IDs + */ + function remap_featured_images() { + + if ( empty( $this->featured_images ) ) { + return; + } + + // cycle through posts that have a featured image + $this->logger->info( 'Starting remapping of featured images' ); + + foreach ( $this->featured_images as $post_id => $value ) { + if ( isset( $this->mapping['post'][ $value ] ) ) { + $new_id = $this->mapping['post'][ $value ]; + + // only update if there's a difference + if ( $new_id !== $value ) { + $this->logger->info( sprintf( 'Remapping featured image ID %d to new ID %d for post ID %d',$value, $new_id, $post_id ) ); + update_post_meta( $post_id, '_thumbnail_id', $new_id ); + } + } + } + } + + /** + * Decide if the given meta key maps to information we will want to import + * + * @param string $key The meta key to check + * @return string|bool The key if we do want to import, false if not + */ + public function is_valid_meta_key( $key ) { + // skip attachment metadata since we'll regenerate it from scratch + // skip _edit_lock as not relevant for import + if ( in_array( $key, array( '_wp_attached_file', '_wp_attachment_metadata', '_edit_lock' ) ) ) { + return false; + } + + return $key; + } + + /** + * Decide what the maximum file size for downloaded attachments is. + * Default is 0 (unlimited), can be filtered via import_attachment_size_limit + * + * @return int Maximum attachment file size to import + */ + protected function max_attachment_size() { + return apply_filters( 'import_attachment_size_limit', 0 ); + } + + /** + * Added to http_request_timeout filter to force timeout at 60 seconds during import + * + * @access protected + * @return int 60 + */ + function bump_request_timeout($val) { + return 60; + } + + // return the difference in length between two strings + function cmpr_strlen( $a, $b ) { + return strlen( $b ) - strlen( $a ); + } + + /** + * Prefill existing post data. + * + * This preloads all GUIDs into memory, allowing us to avoid hitting the + * database when we need to check for existence. With larger imports, this + * becomes prohibitively slow to perform SELECT queries on each. + * + * By preloading all this data into memory, it's a constant-time lookup in + * PHP instead. However, this does use a lot more memory, so for sites doing + * small imports onto a large site, it may be a better tradeoff to use + * on-the-fly checking instead. + */ + protected function prefill_existing_posts() { + global $wpdb; + $posts = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts}" ); + + foreach ( $posts as $item ) { + $this->exists['post'][ $item->guid ] = $item->ID; + } + } + + /** + * Does the post exist? + * + * @param array $data Post data to check against. + * @return int|bool Existing post ID if it exists, false otherwise. + */ + protected function post_exists( $data ) { + // Constant-time lookup if we prefilled + $exists_key = $data['guid']; + + $exists = null; + + if ( $this->options['prefill_existing_posts'] ) { + // Sites: fix for custom post types. The guids in the prefilled section are escaped, so these ones should be as well. + $exists_key = htmlentities( $exists_key ); + $exists = isset( $this->exists['post'][ $exists_key ] ) ? $this->exists['post'][ $exists_key ] : false; + } else if ( isset( $this->exists['post'][ $exists_key ] ) ) { + // No prefilling, but might have already handled it + $exists = $this->exists['post'][ $exists_key ]; + } else { + // Still nothing, try post_exists, and cache it + $exists = post_exists( $data['post_title'], $data['post_content'], $data['post_date'] ); + } + + /** + * Filter ID of the existing post corresponding to post currently importing. + * + * Return 0 to force the post to be imported. Filter the ID to be something else + * to override which existing post is mapped to the imported post. + * + * @see post_exists() + * + * @param int $post_exists Post ID, or 0 if post did not exist. + * @param array $data The post array to be inserted. + */ + $exists = apply_filters( 'wp_import_existing_post', $exists, $data ); + + $this->exists['post'][ $exists_key ] = $exists; + + return $exists; + } + + /** + * Mark the post as existing. + * + * @param array $data Post data to mark as existing. + * @param int $post_id Post ID. + */ + protected function mark_post_exists( $data, $post_id ) { + $exists_key = $data['guid']; + $this->exists['post'][ $exists_key ] = $post_id; + } + + /** + * Prefill existing comment data. + * + * @see self::prefill_existing_posts() for justification of why this exists. + */ + protected function prefill_existing_comments() { + global $wpdb; + $posts = $wpdb->get_results( "SELECT comment_ID, comment_author, comment_date FROM {$wpdb->comments}" ); + + foreach ( $posts as $item ) { + $exists_key = sha1( $item->comment_author . ':' . $item->comment_date ); + $this->exists['comment'][ $exists_key ] = $item->comment_ID; + } + } + + /** + * Does the comment exist? + * + * @param array $data Comment data to check against. + * @return int|bool Existing comment ID if it exists, false otherwise. + */ + protected function comment_exists( $data ) { + $exists_key = sha1( $data['comment_author'] . ':' . $data['comment_date'] ); + + // Constant-time lookup if we prefilled + if ( $this->options['prefill_existing_comments'] ) { + return isset( $this->exists['comment'][ $exists_key ] ) ? $this->exists['comment'][ $exists_key ] : false; + } + + // No prefilling, but might have already handled it + if ( isset( $this->exists['comment'][ $exists_key ] ) ) { + return $this->exists['comment'][ $exists_key ]; + } + + // Still nothing, try comment_exists, and cache it + $exists = comment_exists( $data['comment_author'], $data['comment_date'] ); + $this->exists['comment'][ $exists_key ] = $exists; + + return $exists; + } + + /** + * Mark the comment as existing. + * + * @param array $data Comment data to mark as existing. + * @param int $comment_id Comment ID. + */ + protected function mark_comment_exists( $data, $comment_id ) { + $exists_key = sha1( $data['comment_author'] . ':' . $data['comment_date'] ); + $this->exists['comment'][ $exists_key ] = $comment_id; + } + + /** + * Prefill existing term data. + * + * @see self::prefill_existing_posts() for justification of why this exists. + */ + protected function prefill_existing_terms() { + global $wpdb; + $query = "SELECT t.term_id, tt.taxonomy, t.slug FROM {$wpdb->terms} AS t"; + $query .= " JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id"; + $terms = $wpdb->get_results( $query ); + + foreach ( $terms as $item ) { + $exists_key = sha1( $item->taxonomy . ':' . $item->slug ); + $this->exists['term'][ $exists_key ] = $item->term_id; + } + } + + /** + * Does the term exist? + * + * @param array $data Term data to check against. + * @return int|bool Existing term ID if it exists, false otherwise. + */ + protected function term_exists( $data ) { + $exists_key = sha1( $data['taxonomy'] . ':' . $data['slug'] ); + + // Constant-time lookup if we prefilled + if ( $this->options['prefill_existing_terms'] ) { + return isset( $this->exists['term'][ $exists_key ] ) ? $this->exists['term'][ $exists_key ] : false; + } + + // No prefilling, but might have already handled it + if ( isset( $this->exists['term'][ $exists_key ] ) ) { + return $this->exists['term'][ $exists_key ]; + } + + // Still nothing, try comment_exists, and cache it + $exists = term_exists( $data['slug'], $data['taxonomy'] ); + if ( is_array( $exists ) ) { + $exists = $exists['term_id']; + } + + $this->exists['term'][ $exists_key ] = $exists; + + return $exists; + } + + /** + * Mark the term as existing. + * + * @param array $data Term data to mark as existing. + * @param int $term_id Term ID. + */ + protected function mark_term_exists( $data, $term_id ) { + $exists_key = sha1( $data['taxonomy'] . ':' . $data['slug'] ); + $this->exists['term'][ $exists_key ] = $term_id; + } +} diff --git a/wp-content/plugins/gp-premium/sites/sites.php b/wp-content/plugins/gp-premium/sites/sites.php new file mode 100644 index 0000000..415e2a7 --- /dev/null +++ b/wp-content/plugins/gp-premium/sites/sites.php @@ -0,0 +1,750 @@ +id ) { + return true; + } + + return false; +} + +add_filter( 'generate_dashboard_tabs', 'generate_sites_dashboard_tab' ); +/** + * Add the Sites tab to our Dashboard tabs. + * + * @since 1.6 + * + * @param array $tabs Existing tabs. + * @return array New tabs. + */ +function generate_sites_dashboard_tab( $tabs ) { + $tabs['Sites'] = array( + 'name' => __( 'Site Library', 'gp-premium' ), + 'url' => admin_url( 'themes.php?page=generatepress-site-library' ), + 'class' => generate_is_sites_dashboard() ? 'active' : '', + ); + + return $tabs; +} + +add_action( 'admin_menu', 'generate_site_library_register' ); +/** + * Register our Site Library page. + * + * @since 1.7 + */ +function generate_site_library_register() { + add_submenu_page( + 'themes.php', + __( 'Site Library', 'gp-premium' ), + __( 'Site Library', 'gp-premium' ), + 'manage_options', + 'generatepress-site-library', + 'generate_sites_container' + ); +} + +add_action( 'admin_head', 'generate_site_library_fix_menu' ); +/** + * Set our current menu item as the GeneratePress Dashboard. + * + * @since 1.7 + */ +function generate_site_library_fix_menu() { + global $parent_file, $submenu_file, $post_type; + + if ( generate_is_sites_dashboard() ) { + $parent_file = 'themes.php'; + $submenu_file = 'generate-options'; + } + + remove_submenu_page( 'themes.php', 'generatepress-site-library' ); +} + +add_action( 'admin_enqueue_scripts', 'generate_sites_do_enqueue_scripts' ); +/** + * Add our scripts for the site library. + * + * @since 1.8 + */ +function generate_sites_do_enqueue_scripts() { + if ( ! generate_is_sites_dashboard() ) { + return; + } + + $backup_data = get_option( '_generatepress_site_library_backup', array() ); + + wp_enqueue_script( + 'generate-sites-admin', + GENERATE_SITES_URL . 'assets/js/admin.js', + array( 'jquery', 'wp-util', 'updates', 'generate-sites-blazy' ), + GP_PREMIUM_VERSION, + true + ); + + wp_enqueue_script( + 'generate-sites-download', + GENERATE_SITES_URL . 'assets/js/download.js', + array( 'jquery', 'generate-sites-admin' ), + GP_PREMIUM_VERSION, + true + ); + + wp_enqueue_script( + 'generate-sites-blazy', + GENERATE_SITES_URL . 'assets/js/blazy.min.js', + array(), + GP_PREMIUM_VERSION, + true + ); + + wp_localize_script( + 'generate-sites-admin', + 'generate_sites_params', + array( + 'ajaxurl' => admin_url( 'admin-ajax.php' ), + 'nonce' => wp_create_nonce( 'generate_sites_nonce' ), + 'importing_options' => __( 'Importing options', 'gp-premium' ), + 'backing_up_options' => __( 'Backing up options', 'gp-premium' ), + 'checking_demo_content' => __( 'Checking demo content', 'gp-premium' ), + 'downloading_content' => __( 'Downloading content', 'gp-premium' ), + 'importing_content' => __( 'Importing content', 'gp-premium' ), + 'importing_site_options' => __( 'Importing site options', 'gp-premium' ), + 'importing_widgets' => __( 'Importing widgets', 'gp-premium' ), + 'activating_plugins' => __( 'Activating plugins', 'gp-premium' ), + 'installing_plugins' => __( 'Installing plugins', 'gp-premium' ), + 'automatic_plugins' => __( 'Automatic', 'gp-premium' ), + 'manual_plugins' => __( 'Manual', 'gp-premium' ), + 'home_url' => home_url(), + 'restoreThemeOptions' => __( 'Restoring theme options', 'gp-premium' ), + 'restoreSiteOptions' => __( 'Restoring site options', 'gp-premium' ), + 'restoreContent' => __( 'Removing imported content', 'gp-premium' ), + 'restorePlugins' => __( 'Deactivating imported plugins', 'gp-premium' ), + 'restoreWidgets' => __( 'Restoring widgets', 'gp-premium' ), + 'restoreCSS' => __( 'Restoring CSS', 'gp-premium' ), + 'cleanUp' => __( 'Cleaning up', 'gp-premium' ), + 'hasContentBackup' => ! empty( $backup_data['content'] ), + 'confirmRemoval' => __( 'This process makes changes to your database. If you have existing data, be sure to create a backup as a precaution.', 'gp-premium' ), + ) + ); + + wp_enqueue_style( + 'generate-sites-admin', + GENERATE_SITES_URL . 'assets/css/admin.css', + array(), + GP_PREMIUM_VERSION + ); + + wp_enqueue_style( + 'generate-premium-dashboard', + plugin_dir_url( dirname(__FILE__) ) . 'inc/assets/dashboard.css', + array(), + GP_PREMIUM_VERSION + ); +} + +add_filter( 'admin_body_class', 'generate_sites_do_admin_body_classes' ); +/** + * Add a body class while in the Site Library. + * + * @since 1.8 + * + * @param array Current body classes. + * @return array Existing and our new body classes + */ +function generate_sites_do_admin_body_classes( $classes ) { + if ( generate_is_sites_dashboard() ) { + $classes .= ' generate-sites'; + } + + return $classes; +} + +add_action( 'generate_inside_site_library_container', 'generate_sites_add_tabs_wrapper_open', 4 ); +/** + * Add an opening wrapper element for our Dashboard tabs and page builder links. + * + * @since 1.8 + */ +function generate_sites_add_tabs_wrapper_open() { + echo '
        '; +} + +/** + * Adds our Site dashboard container. + * + * @since 1.6 + */ +function generate_sites_container() { + ?> +
        +
        +
        +
        + +
        + + +
        +
        +
        + '; + + if ( ! empty( $page_builders ) ) : ?> +
        + +
        + +
        +
        + +
        + +
        + +
        +
        + + +
        + +
        + + + + +
        +

        + +
        +

        +

        +
        + +
        + + + + +
        +
        + +
        + +
        + + + %2$s +
        ', + wp_nonce_url( admin_url( 'themes.php?page=generatepress-site-library' ), 'refresh_sites', 'refresh_sites_nonce' ), + __( 'Refresh Sites', 'gp-premium' ) + ); + ?> +
        +
        + get_post_types( array( 'public' => true ) ), + 'showposts' => -1, + 'meta_query' => array( + array( + 'key' => '_generate-select-page-header', + 'compare' => 'EXISTS', + ) + ) + ); + + $posts = get_posts( $args ); + $new_values = array(); + + foreach ( $posts as $post ) { + $page_header_id = get_post_meta( $post->ID, '_generate-select-page-header', true ); + + if ( $page_header_id ) { + $new_values[$post->ID] = $page_header_id; + } + } + + return $new_values; +} + +/** + * Get our Element display locations. + * + * @since 1.7 + * + * @return array + */ +function generate_sites_export_elements_location() { + $args = array( + 'post_type' => 'gp_elements', + 'showposts' => -1, + ); + + $posts = get_posts( $args ); + $new_values = array(); + + foreach ( $posts as $post ) { + $display_conditions = get_post_meta( $post->ID, '_generate_element_display_conditions', true ); + + if ( $display_conditions ) { + $new_values[$post->ID] = $display_conditions; + } + } + + return $new_values; +} + +/** + * Get our Element display locations. + * + * @since 1.7 + * + * @return array + */ +function generate_sites_export_elements_exclusion() { + $args = array( + 'post_type' => 'gp_elements', + 'showposts' => -1, + ); + + $posts = get_posts( $args ); + $new_values = array(); + + foreach ( $posts as $post ) { + $display_conditions = get_post_meta( $post->ID, '_generate_element_exclude_conditions', true ); + + if ( $display_conditions ) { + $new_values[$post->ID] = $display_conditions; + } + } + + return $new_values; +} + +/** + * List out compatible theme modules Sites can activate. + * + * @since 1.6 + * + * @return array + */ +function generatepress_get_site_premium_modules() { + return array( + 'Backgrounds' => 'generate_package_backgrounds', + 'Blog' => 'generate_package_blog', + 'Colors' => 'generate_package_colors', + 'Copyright' => 'generate_package_copyright', + 'Elements' => 'generate_package_elements', + 'Disable Elements' => 'generate_package_disable_elements', + 'Hooks' => 'generate_package_hooks', + 'Menu Plus' => 'generate_package_menu_plus', + 'Page Header' => 'generate_package_page_header', + 'Secondary Nav' => 'generate_package_secondary_nav', + 'Sections' => 'generate_package_sections', + 'Spacing' => 'generate_package_spacing', + 'Typography' => 'generate_package_typography', + 'WooCommerce' => 'generate_package_woocommerce', + ); +} + +/** + * Don't allow Sites to modify these options. + * + * @since 1.6 + * + * @return array + */ +function generatepress_sites_disallowed_options() { + return array( + 'admin_email', + 'siteurl', + 'home', + 'blog_charset', + 'blog_public', + 'current_theme', + 'stylesheet', + 'template', + 'default_role', + 'mailserver_login', + 'mailserver_pass', + 'mailserver_port', + 'mailserver_url', + 'permalink_structure', + 'rewrite_rules', + 'users_can_register', + ); +} + +add_action( 'generate_export_items', 'generatepress_sites_add_export_checkbox' ); +/** + * Add our GeneratePress Site export checkbox to the Export module. + * + * @since 1.7 + */ +function generatepress_sites_add_export_checkbox() { + ?> +
        + + + $key ) { + if ( 'activated' == get_option( $key ) ) { + $data['modules'][ $name ] = $key; + } + } + + // Site options + $data['site_options']['nav_menu_locations'] = get_theme_mod( 'nav_menu_locations' ); + $data['site_options']['custom_logo'] = wp_get_attachment_url( get_theme_mod( 'custom_logo' ) ); + $data['site_options']['show_on_front'] = get_option( 'show_on_front' ); + $data['site_options']['page_on_front'] = get_option( 'page_on_front' ); + $data['site_options']['page_for_posts'] = get_option( 'page_for_posts' ); + + // Page header + $data['site_options']['page_header_global_locations'] = get_option( 'generate_page_header_global_locations' ); + $data['site_options']['page_headers'] = generate_sites_export_page_headers(); + + // Elements + $data['site_options']['element_locations'] = generate_sites_export_elements_location(); + $data['site_options']['element_exclusions'] = generate_sites_export_elements_exclusion(); + + // Custom CSS. + if ( function_exists( 'wp_get_custom_css_post' ) ) { + $data['custom_css'] = wp_get_custom_css_post()->post_content; + } + + // WooCommerce. + if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { + $data['site_options']['woocommerce_shop_page_id'] = get_option( 'woocommerce_shop_page_id' ); + $data['site_options']['woocommerce_cart_page_id'] = get_option( 'woocommerce_cart_page_id' ); + $data['site_options']['woocommerce_checkout_page_id'] = get_option( 'woocommerce_checkout_page_id' ); + $data['site_options']['woocommerce_myaccount_page_id'] = get_option( 'woocommerce_myaccount_page_id' ); + $data['site_options']['woocommerce_single_image_width'] = get_option( 'woocommerce_single_image_width' ); + $data['site_options']['woocommerce_thumbnail_image_width'] = get_option( 'woocommerce_thumbnail_image_width' ); + $data['site_options']['woocommerce_thumbnail_cropping'] = get_option( 'woocommerce_thumbnail_cropping' ); + $data['site_options']['woocommerce_shop_page_display'] = get_option( 'woocommerce_shop_page_display' ); + $data['site_options']['woocommerce_category_archive_display'] = get_option( 'woocommerce_category_archive_display' ); + $data['site_options']['woocommerce_default_catalog_orderby'] = get_option( 'woocommerce_default_catalog_orderby' ); + } + + // Elementor + if ( is_plugin_active( 'elementor/elementor.php' ) ) { + $data['site_options']['elementor_container_width'] = get_option( 'elementor_container_width' ); + $data['site_options']['elementor_cpt_support'] = get_option( 'elementor_cpt_support' ); + $data['site_options']['elementor_css_print_method'] = get_option( 'elementor_css_print_method' ); + $data['site_options']['elementor_default_generic_fonts'] = get_option( 'elementor_default_generic_fonts' ); + $data['site_options']['elementor_disable_color_schemes'] = get_option( 'elementor_disable_color_schemes' ); + $data['site_options']['elementor_disable_typography_schemes'] = get_option( 'elementor_disable_typography_schemes' ); + $data['site_options']['elementor_editor_break_lines'] = get_option( 'elementor_editor_break_lines' ); + $data['site_options']['elementor_exclude_user_roles'] = get_option( 'elementor_exclude_user_roles' ); + $data['site_options']['elementor_global_image_lightbox'] = get_option( 'elementor_global_image_lightbox' ); + $data['site_options']['elementor_page_title_selector'] = get_option( 'elementor_page_title_selector' ); + $data['site_options']['elementor_scheme_color'] = get_option( 'elementor_scheme_color' ); + $data['site_options']['elementor_scheme_color-picker'] = get_option( 'elementor_scheme_color-picker' ); + $data['site_options']['elementor_scheme_typography'] = get_option( 'elementor_scheme_typography' ); + $data['site_options']['elementor_space_between_widgets'] = get_option( 'elementor_space_between_widgets' ); + $data['site_options']['elementor_stretched_section_container'] = get_option( 'elementor_stretched_section_container' ); + } + + // Beaver Builder + if ( is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' ) || is_plugin_active( 'bb-plugin/fl-builder.php' ) ) { + $data['site_options']['_fl_builder_enabled_icons'] = get_option( '_fl_builder_enabled_icons' ); + $data['site_options']['_fl_builder_enabled_modules'] = get_option( '_fl_builder_enabled_modules' ); + $data['site_options']['_fl_builder_post_types'] = get_option( '_fl_builder_post_types' ); + $data['site_options']['_fl_builder_color_presets'] = get_option( '_fl_builder_color_presets' ); + $data['site_options']['_fl_builder_services'] = get_option( '_fl_builder_services' ); + $data['site_options']['_fl_builder_settings'] = get_option( '_fl_builder_settings' ); + $data['site_options']['_fl_builder_user_access'] = get_option( '_fl_builder_user_access' ); + $data['site_options']['_fl_builder_enabled_templates'] = get_option( '_fl_builder_enabled_templates' ); + } + + // Menu Icons + if ( is_plugin_active( 'menu-icons/menu-icons.php' ) ) { + $data['site_options']['menu-icons'] = get_option( 'menu-icons' ); + } + + // Ninja Forms + if ( is_plugin_active( 'ninja-forms/ninja-forms.php' ) ) { + $data['site_options']['ninja_forms_settings'] = get_option( 'ninja_forms_settings' ); + } + + // Social Warfare + if ( is_plugin_active( 'social-warfare/social-warfare.php' ) ) { + $data['site_options']['socialWarfareOptions'] = get_option( 'socialWarfareOptions' ); + } + + // Elements Plus + if ( is_plugin_active( 'elements-plus/elements-plus.php' ) ) { + $data['site_options']['elements_plus_settings'] = get_option( 'elements_plus_settings' ); + } + + // Ank Google Map + if ( is_plugin_active( 'ank-google-map/ank-google-map.php' ) ) { + $data['site_options']['ank_google_map'] = get_option( 'ank_google_map' ); + } + + // GP Social Share + if ( is_plugin_active( 'gp-social-share-svg/gp-social-share.php' ) ) { + $data['site_options']['gp_social_settings'] = get_option( 'gp_social_settings' ); + } + + // Active plugins + $active_plugins = get_option( 'active_plugins' ); + $all_plugins = get_plugins(); + + $ignore = apply_filters( 'generate_sites_ignore_plugins', array( + 'gp-premium/gp-premium.php', + 'widget-importer-exporter/widget-importer-exporter.php' + ) ); + + foreach ( $ignore as $plugin ) { + unset( $all_plugins[ $plugin ] ); + } + + $activated_plugins = array(); + + foreach ( $active_plugins as $p ) { + if ( isset( $all_plugins[$p] ) ) { + $activated_plugins[$all_plugins[$p]['Name']] = $p; + } + } + + $data['plugins'] = $activated_plugins; + + return $data; + +} + +add_action( 'current_screen', 'generatepress_sites_init', 5 ); +/** + * Fetch our sites and trusted authors. Stores them in their own transients. + * We use current_screen instead of admin_init so we can check what admin page we're on. + * + * @since 1.6 + */ +function generatepress_sites_init() { + $screen = get_current_screen(); + + if ( 'appearance_page_generate-options' === $screen->id || 'appearance_page_generatepress-site-library' === $screen->id ) { + $remote_sites = get_transient( 'generatepress_sites' ); + $trusted_authors = get_transient( 'generatepress_sites_trusted_providers' ); + + if ( empty( $remote_sites ) ) { + $sites = array(); + + $data = wp_safe_remote_get( 'https://gpsites.co/wp-json/wp/v2/sites?per_page=100' ); + + if ( is_wp_error( $data ) ) { + set_transient( 'generatepress_sites', 'no results', 5 * MINUTE_IN_SECONDS ); + return; + } + + $data = json_decode( wp_remote_retrieve_body( $data ), true ); + + if ( ! is_array( $data ) ) { + set_transient( 'generatepress_sites', 'no results', 5 * MINUTE_IN_SECONDS ); + return; + } + + foreach( ( array ) $data as $site ) { + $sites[$site['name']] = array( + 'name' => $site['name'], + 'directory' => $site['directory'], + 'preview_url' => $site['preview_url'], + 'author_name' => $site['author_name'], + 'author_url' => $site['author_url'], + 'description' => $site['description'], + 'page_builder' => $site['page_builder'], + 'min_version' => $site['min_version'], + 'uploads_url' => $site['uploads_url'], + 'plugins' => $site['plugins'], + 'documentation' => $site['documentation'], + ); + } + + $sites = apply_filters( 'generate_add_sites', $sites ); + + set_transient( 'generatepress_sites', $sites, 24 * HOUR_IN_SECONDS ); + } + + if ( empty( $trusted_authors ) ) { + $trusted_authors = wp_safe_remote_get( 'https://gpsites.co/wp-json/sites/site' ); + + if ( is_wp_error( $trusted_authors ) || empty( $trusted_authors ) ) { + set_transient( 'generatepress_sites_trusted_providers', 'no results', 5 * MINUTE_IN_SECONDS ); + return; + } + + $trusted_authors = json_decode( wp_remote_retrieve_body( $trusted_authors ), true ); + + $authors = array(); + foreach ( ( array ) $trusted_authors['trusted_author'] as $author ) { + $authors[] = $author; + } + + set_transient( 'generatepress_sites_trusted_providers', $authors, 24 * HOUR_IN_SECONDS ); + } + } +} + +add_action( 'plugins_loaded', 'generatepress_sites_output' ); +/** + * Initiate our Sites once everything has loaded. + * We use current_screen instead of admin_init so we can check what admin page we're on. + * + * @since 1.6 + */ +function generatepress_sites_output() { + if ( ! class_exists( 'GeneratePress_Site' ) ) { + return; // Bail if we don't have the needed class. + } + + $sites = get_transient( 'generatepress_sites' ); + + if ( empty( $sites ) || ! is_array( $sites ) ) { + add_action( 'generate_inside_sites_container', 'generatepress_sites_no_results_error' ); + return; + } + + if ( apply_filters( 'generate_sites_randomize', true ) ) { + shuffle( $sites ); + } + + foreach( $sites as $site ) { + new GeneratePress_Site( $site ); + } +} + +/** + * Show an error message when no sites exist. + * + * @since 1.8.2 + */ +function generatepress_sites_no_results_error() { + printf( + '
        + %1$s %2$s +
        ', + __( 'No sites found.', 'gp-premium' ), + __( 'Why?', 'gp-premium' ), + 'https://docs.generatepress.com/article/site-library-unavailable/' + ); +} diff --git a/wp-content/plugins/gp-premium/spacing/functions/customizer/content-spacing.php b/wp-content/plugins/gp-premium/spacing/functions/customizer/content-spacing.php new file mode 100644 index 0000000..2379a05 --- /dev/null +++ b/wp-content/plugins/gp-premium/spacing/functions/customizer/content-spacing.php @@ -0,0 +1,229 @@ +add_section( + 'generate_spacing_content', + array( + 'title' => __( 'Content', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 10, + 'panel' => 'generate_spacing_panel' + ) +); + +// If we don't have a layout panel, use our old spacing section +if ( $wp_customize->get_panel( 'generate_layout_panel' ) ) { + $content_section = 'generate_layout_container'; +} else { + $content_section = 'generate_spacing_content'; +} + +// Take control of the container width control +// This control is handled by the free theme, but we take control of it here for consistency between control styles +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[container_width]', + array( + 'label' => __( 'Container Width', 'generatepress' ), + 'section' => 'generate_layout_container', + 'settings' => array( + 'desktop' => 'generate_settings[container_width]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 700, + 'max' => 2000, + 'step' => 5, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 0, + ) + ) +); + +// Separating space +$wp_customize->add_setting( + 'generate_spacing_settings[separator]', array( + 'default' => $defaults['separator'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[separator]', + array( + 'label' => __( 'Separating Space', 'gp-premium' ), + 'section' => $content_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[separator]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) +); + +// Content padding top +$wp_customize->add_setting( 'generate_spacing_settings[content_top]', + array( + 'default' => $defaults['content_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Content padding right +$wp_customize->add_setting( 'generate_spacing_settings[content_right]', + array( + 'default' => $defaults['content_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Content padding bottom +$wp_customize->add_setting( 'generate_spacing_settings[content_bottom]', + array( + 'default' => $defaults['content_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Content padding left +$wp_customize->add_setting( 'generate_spacing_settings[content_left]', + array( + 'default' => $defaults['content_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +$content_padding_settings = array( + 'desktop_top' => 'generate_spacing_settings[content_top]', + 'desktop_right' => 'generate_spacing_settings[content_right]', + 'desktop_bottom' => 'generate_spacing_settings[content_bottom]', + 'desktop_left' => 'generate_spacing_settings[content_left]', +); + +// If mobile_content_top is set, the rest of them are too +// We have to check as these defaults are set in the theme +if ( isset( $defaults[ 'mobile_content_top' ] ) ) { + $content_padding_settings['mobile_top'] = 'generate_spacing_settings[mobile_content_top]'; + $content_padding_settings['mobile_right'] = 'generate_spacing_settings[mobile_content_right]'; + $content_padding_settings['mobile_bottom'] = 'generate_spacing_settings[mobile_content_bottom]'; + $content_padding_settings['mobile_left'] = 'generate_spacing_settings[mobile_content_left]'; + + // Mobile content padding top + $wp_customize->add_setting( 'generate_spacing_settings[mobile_content_top]', + array( + 'default' => $defaults['mobile_content_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + // Content padding right + $wp_customize->add_setting( 'generate_spacing_settings[mobile_content_right]', + array( + 'default' => $defaults['mobile_content_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + // Content padding bottom + $wp_customize->add_setting( 'generate_spacing_settings[mobile_content_bottom]', + array( + 'default' => $defaults['mobile_content_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + // Content padding left + $wp_customize->add_setting( 'generate_spacing_settings[mobile_content_left]', + array( + 'default' => $defaults['mobile_content_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); +} + +// Make use of the content padding settings +$wp_customize->add_control( + new GeneratePress_Spacing_Control( + $wp_customize, + 'content_spacing', + array( + 'type' => 'generatepress-spacing', + 'label' => esc_html__( 'Content Padding', 'gp-premium' ), + 'section' => $content_section, + 'settings' => $content_padding_settings, + 'element' => 'content', + 'priority' => 99 + ) + ) +); + +$wp_customize->add_setting( + 'generate_spacing_settings[content_element_separator]', array( + 'default' => $defaults['content_element_separator'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage' + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[content_element_separator]', + array( + 'label' => __( 'Content Separator', 'gp-premium' ), + 'sub_description' => __( 'The content separator controls the space between the featured image, title, content and entry meta.', 'gp-premium' ), + 'section' => $content_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[content_element_separator]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 10, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) +); diff --git a/wp-content/plugins/gp-premium/spacing/functions/customizer/footer-spacing.php b/wp-content/plugins/gp-premium/spacing/functions/customizer/footer-spacing.php new file mode 100644 index 0000000..61f94ac --- /dev/null +++ b/wp-content/plugins/gp-premium/spacing/functions/customizer/footer-spacing.php @@ -0,0 +1,190 @@ +add_section( + 'generate_spacing_footer', + array( + 'title' => __( 'Footer', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 20, + 'panel' => 'generate_spacing_panel' + ) +); + +// Use our layout panel if it exists +if ( $wp_customize->get_panel( 'generate_layout_panel' ) ) { + $footer_section = 'generate_layout_footer'; +} else { + $footer_section = 'generate_spacing_footer'; +} + +// Footer widget area padding top +$wp_customize->add_setting( 'generate_spacing_settings[footer_widget_container_top]', + array( + 'default' => $defaults['footer_widget_container_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Footer widget area padding right +$wp_customize->add_setting( 'generate_spacing_settings[footer_widget_container_right]', + array( + 'default' => $defaults['footer_widget_container_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Footer widget area padding bottom +$wp_customize->add_setting( 'generate_spacing_settings[footer_widget_container_bottom]', + array( + 'default' => $defaults['footer_widget_container_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Footer widget area padding left +$wp_customize->add_setting( 'generate_spacing_settings[footer_widget_container_left]', + array( + 'default' => $defaults['footer_widget_container_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Footer widget area padding top +$wp_customize->add_setting( 'generate_spacing_settings[mobile_footer_widget_container_top]', + array( + 'default' => $defaults['mobile_footer_widget_container_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Footer widget area padding right +$wp_customize->add_setting( 'generate_spacing_settings[mobile_footer_widget_container_right]', + array( + 'default' => $defaults['mobile_footer_widget_container_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Footer widget area padding bottom +$wp_customize->add_setting( 'generate_spacing_settings[mobile_footer_widget_container_bottom]', + array( + 'default' => $defaults['mobile_footer_widget_container_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Footer widget area padding left +$wp_customize->add_setting( 'generate_spacing_settings[mobile_footer_widget_container_left]', + array( + 'default' => $defaults['mobile_footer_widget_container_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Make use of the Footer widget area padding settings +$wp_customize->add_control( + new GeneratePress_Spacing_Control( + $wp_customize, + 'footer_widget_area_spacing', + array( + 'type' => 'generatepress-spacing', + 'label' => esc_html__( 'Footer Widget Area Padding', 'gp-premium' ), + 'section' => $footer_section, + 'settings' => array( + 'desktop_top' => 'generate_spacing_settings[footer_widget_container_top]', + 'desktop_right' => 'generate_spacing_settings[footer_widget_container_right]', + 'desktop_bottom' => 'generate_spacing_settings[footer_widget_container_bottom]', + 'desktop_left' => 'generate_spacing_settings[footer_widget_container_left]', + 'mobile_top' => 'generate_spacing_settings[mobile_footer_widget_container_top]', + 'mobile_right' => 'generate_spacing_settings[mobile_footer_widget_container_right]', + 'mobile_bottom' => 'generate_spacing_settings[mobile_footer_widget_container_bottom]', + 'mobile_left' => 'generate_spacing_settings[mobile_footer_widget_container_left]' + ), + 'element' => 'footer_widget_area', + 'priority' => 99 + ) + ) +); + +// Footer padding top +$wp_customize->add_setting( 'generate_spacing_settings[footer_top]', + array( + 'default' => $defaults['footer_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Footer padding right +$wp_customize->add_setting( 'generate_spacing_settings[footer_right]', + array( + 'default' => $defaults['footer_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Footer padding bottom +$wp_customize->add_setting( 'generate_spacing_settings[footer_bottom]', + array( + 'default' => $defaults['footer_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Footer padding left +$wp_customize->add_setting( 'generate_spacing_settings[footer_left]', + array( + 'default' => $defaults['footer_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Make use of the footer padding settings +$wp_customize->add_control( + new GeneratePress_Spacing_Control( + $wp_customize, + 'footer_spacing', + array( + 'type' => 'generatepress-spacing', + 'label' => esc_html__( 'Footer Padding', 'gp-premium' ), + 'section' => $footer_section, + 'settings' => array( + 'desktop_top' => 'generate_spacing_settings[footer_top]', + 'desktop_right' => 'generate_spacing_settings[footer_right]', + 'desktop_bottom' => 'generate_spacing_settings[footer_bottom]', + 'desktop_left' => 'generate_spacing_settings[footer_left]' + ), + 'element' => 'footer', + 'priority' => 105 + ) + ) +); diff --git a/wp-content/plugins/gp-premium/spacing/functions/customizer/header-spacing.php b/wp-content/plugins/gp-premium/spacing/functions/customizer/header-spacing.php new file mode 100644 index 0000000..4dd2747 --- /dev/null +++ b/wp-content/plugins/gp-premium/spacing/functions/customizer/header-spacing.php @@ -0,0 +1,122 @@ +add_section( + 'generate_spacing_header', + array( + 'title' => __( 'Header', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 5, + 'panel' => 'generate_spacing_panel' + ) +); + +// If we don't have a layout panel, use our old spacing section +$header_section = ( $wp_customize->get_panel( 'generate_layout_panel' ) ) ? 'generate_layout_header' : 'generate_spacing_header'; + +// Header top +$wp_customize->add_setting( 'generate_spacing_settings[header_top]', + array( + 'default' => $defaults['header_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Header right +$wp_customize->add_setting( 'generate_spacing_settings[header_right]', + array( + 'default' => $defaults['header_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Header bottom +$wp_customize->add_setting( 'generate_spacing_settings[header_bottom]', + array( + 'default' => $defaults['header_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Header left +$wp_customize->add_setting( 'generate_spacing_settings[header_left]', + array( + 'default' => $defaults['header_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +$wp_customize->add_setting( 'generate_spacing_settings[mobile_header_top]', + array( + 'default' => $defaults['mobile_header_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Header right +$wp_customize->add_setting( 'generate_spacing_settings[mobile_header_right]', + array( + 'default' => $defaults['mobile_header_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Header bottom +$wp_customize->add_setting( 'generate_spacing_settings[mobile_header_bottom]', + array( + 'default' => $defaults['mobile_header_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Header left +$wp_customize->add_setting( 'generate_spacing_settings[mobile_header_left]', + array( + 'default' => $defaults['mobile_header_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Do something with our header controls +$wp_customize->add_control( + new GeneratePress_Spacing_Control( + $wp_customize, + 'header_spacing', + array( + 'type' => 'generatepress-spacing', + 'label' => esc_html__( 'Header Padding', 'gp-premium' ), + 'section' => $header_section, + 'settings' => array( + 'desktop_top' => 'generate_spacing_settings[header_top]', + 'desktop_right' => 'generate_spacing_settings[header_right]', + 'desktop_bottom' => 'generate_spacing_settings[header_bottom]', + 'desktop_left' => 'generate_spacing_settings[header_left]', + 'mobile_top' => 'generate_spacing_settings[mobile_header_top]', + 'mobile_right' => 'generate_spacing_settings[mobile_header_right]', + 'mobile_bottom' => 'generate_spacing_settings[mobile_header_bottom]', + 'mobile_left' => 'generate_spacing_settings[mobile_header_left]' + ), + 'element' => 'header', + ) + ) +); diff --git a/wp-content/plugins/gp-premium/spacing/functions/customizer/js/customizer.js b/wp-content/plugins/gp-premium/spacing/functions/customizer/js/customizer.js new file mode 100644 index 0000000..131ed57 --- /dev/null +++ b/wp-content/plugins/gp-premium/spacing/functions/customizer/js/customizer.js @@ -0,0 +1,551 @@ +function generate_spacing_live_update( name, id, selector, property, negative, divide, media, unit ) { + settings = typeof settings !== 'undefined' ? settings : 'generate_spacing_settings'; + wp.customize( settings + '[' + id + ']', function( value ) { + value.bind( function( newval ) { + negative = typeof negative !== 'undefined' ? negative : false; + media = typeof media !== 'undefined' ? media : ''; + divide = typeof divide !== 'undefined' ? divide : false; + unit = typeof unit !== 'undefined' ? unit : 'px'; + + // Get new value + newval = ( divide ) ? newval / 2 : newval; + + // Check if negative integer + negative = ( negative ) ? '-' : ''; + + var isTablet = ( 'tablet' == id.substring( 0, 6 ) ) ? true : false, + isMobile = ( 'mobile' == id.substring( 0, 6 ) ) ? true : false; + + if ( isTablet ) { + if ( '' == wp.customize(settings + '[' + id + ']').get() ) { + var desktopID = id.replace( 'tablet_', '' ); + newval = wp.customize(settings + '[' + desktopID + ']').get(); + } + } + + if ( isMobile ) { + if ( '' == wp.customize(settings + '[' + id + ']').get() ) { + var desktopID = id.replace( 'mobile_', '' ); + newval = wp.customize(settings + '[' + desktopID + ']').get(); + } + } + + // We're using a desktop value + if ( ! isTablet && ! isMobile ) { + + var tabletValue = ( typeof wp.customize(settings + '[tablet_' + id + ']') !== 'undefined' ) ? wp.customize(settings + '[tablet_' + id + ']').get() : '', + mobileValue = ( typeof wp.customize(settings + '[mobile_' + id + ']') !== 'undefined' ) ? wp.customize(settings + '[mobile_' + id + ']').get() : ''; + + // The tablet setting exists, mobile doesn't + if ( '' !== tabletValue && '' == mobileValue ) { + media = gp_spacing.desktop + ', ' + gp_spacing.mobile; + } + + // The tablet setting doesn't exist, mobile does + if ( '' == tabletValue && '' !== mobileValue ) { + media = gp_spacing.desktop + ', ' + gp_spacing.tablet; + } + + // The tablet setting doesn't exist, neither does mobile + if ( '' == tabletValue && '' == mobileValue ) { + media = gp_spacing.desktop + ', ' + gp_spacing.tablet + ', ' + gp_spacing.mobile; + } + + } + + // Check if media query + media_query = ( '' !== media ) ? 'media="' + media + '"' : ''; + + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#' + name ).not( ':last' ).remove(); + }, 50 ); + + jQuery('body').trigger('generate_spacing_updated'); + } ); + } ); +} + +/** + * Top bar padding + */ +generate_spacing_live_update( 'top_bar_top', 'top_bar_top', '.inside-top-bar', 'padding-top' ); +generate_spacing_live_update( 'top_bar_right', 'top_bar_right', '.inside-top-bar', 'padding-right' ); +generate_spacing_live_update( 'top_bar_bottom', 'top_bar_bottom', '.inside-top-bar', 'padding-bottom' ); +generate_spacing_live_update( 'top_bar_left', 'top_bar_left', '.inside-top-bar', 'padding-left' ); + +/** + * Header padding + */ +generate_spacing_live_update( 'header_top', 'header_top', '.inside-header', 'padding-top', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'header_right', 'header_right', '.inside-header', 'padding-right', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'header_bottom', 'header_bottom', '.inside-header', 'padding-bottom', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'header_left', 'header_left', '.inside-header', 'padding-left', false, false, gp_spacing.desktop ); + +generate_spacing_live_update( 'mobile_header_top', 'mobile_header_top', '.inside-header', 'padding-top', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_header_right', 'mobile_header_right', '.inside-header', 'padding-right', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_header_bottom', 'mobile_header_bottom', '.inside-header', 'padding-bottom', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_header_left', 'mobile_header_left', '.inside-header', 'padding-left', false, false, gp_spacing.mobile ); + +/** + * Content padding + */ +var content_areas = '.separate-containers .inside-article, \ + .separate-containers .comments-area, \ + .separate-containers .page-header, \ + .separate-containers .paging-navigation, \ + .one-container .site-content, \ + .inside-page-header, \ + .wp-block-group__inner-container'; + +generate_spacing_live_update( 'content_top', 'content_top', content_areas, 'padding-top', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'content_right', 'content_right', content_areas, 'padding-right', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'content_bottom', 'content_bottom', content_areas, 'padding-bottom', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'content_left', 'content_left', content_areas, 'padding-left', false, false, gp_spacing.desktop ); + +/* Mobile content padding */ +generate_spacing_live_update( 'mobile_content_top', 'mobile_content_top', content_areas, 'padding-top', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_content_right', 'mobile_content_right', content_areas, 'padding-right', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_content_bottom', 'mobile_content_bottom', content_areas, 'padding-bottom', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_content_left', 'mobile_content_left', content_areas, 'padding-left', false, false, gp_spacing.mobile ); + +generate_spacing_live_update( 'content-margin-right', 'content_right', '.one-container.right-sidebar .site-main,.one-container.both-right .site-main', 'margin-right' ); +generate_spacing_live_update( 'content-margin-left', 'content_left', '.one-container.left-sidebar .site-main,.one-container.both-left .site-main', 'margin-left' ); +generate_spacing_live_update( 'content-margin-right-both', 'content_right', '.one-container.both-sidebars .site-main', 'margin-right' ); +generate_spacing_live_update( 'content-margin-left-both', 'content_left', '.one-container.both-sidebars .site-main', 'margin-left' ); + +/* Content element separator */ + +generate_spacing_live_update( 'content_element_separator_top', 'content_element_separator', '.post-image, .page-content, .entry-content, .entry-summary, footer.entry-meta', 'margin-top', false, false, false, 'em' ); +generate_spacing_live_update( 'content_element_separator_bottom', 'content_element_separator', '.post-image-above-header .inside-article div.featured-image, .post-image-above-header .inside-article div.post-image', 'margin-bottom', false, false, false, 'em' ); + +/** + * Featured image padding + */ +var featured_image_no_padding_x = '.post-image-below-header.post-image-aligned-center .no-featured-image-padding .post-image, \ + .post-image-below-header.post-image-aligned-center .no-featured-image-padding .featured-image'; + +generate_spacing_live_update( 'featured_image_padding_right', 'content_right', featured_image_no_padding_x, 'margin-right', true, false, gp_spacing.desktop ); +generate_spacing_live_update( 'featured_image_padding_left', 'content_left', featured_image_no_padding_x, 'margin-left', true, false, gp_spacing.desktop ); +generate_spacing_live_update( 'mobile_featured_image_padding_right', 'mobile_content_right', featured_image_no_padding_x, 'margin-right', true, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_featured_image_padding_left', 'mobile_content_left', featured_image_no_padding_x, 'margin-left', true, false, gp_spacing.mobile ); + +var featured_image_no_padding_y = '.post-image-above-header.post-image-aligned-center .no-featured-image-padding .post-image, \ + .post-image-above-header.post-image-aligned-center .no-featured-image-padding .featured-image'; + +generate_spacing_live_update( 'featured_image_padding_top', 'content_top', featured_image_no_padding_y, 'margin-top', true, false, gp_spacing.desktop ); +generate_spacing_live_update( 'featured_image_padding_right', 'content_right', featured_image_no_padding_y, 'margin-right', true, false, gp_spacing.desktop ); +generate_spacing_live_update( 'featured_image_padding_left', 'content_left', featured_image_no_padding_y, 'margin-left', true, false, gp_spacing.desktop ); +generate_spacing_live_update( 'mobile_featured_image_padding_top', 'mobile_content_top', featured_image_no_padding_y, 'margin-top', true, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_featured_image_padding_right', 'mobile_content_right', featured_image_no_padding_y, 'margin-right', true, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_featured_image_padding_left', 'mobile_content_left', featured_image_no_padding_y, 'margin-left', true, false, gp_spacing.mobile ); + +/** + * Main navigation spacing + */ +var menu_items = '.main-navigation .main-nav ul li a,\ + .menu-toggle,\ + .main-navigation .mobile-bar-items a'; + +// Menu item width +generate_spacing_live_update( 'menu_item_padding_left', 'menu_item', menu_items + ', .slideout-navigation button.slideout-exit', 'padding-left', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'menu_item_padding_right', 'menu_item', menu_items + ', .slideout-navigation button.slideout-exit', 'padding-right', false, false, gp_spacing.desktop ); + +// Tablet menu item width +//generate_spacing_live_update( 'tablet_menu_item_padding_left', 'tablet_menu_item', menu_items, 'padding-left', false, false, gp_spacing.tablet ); +//generate_spacing_live_update( 'tablet_menu_item_padding_right', 'tablet_menu_item', menu_items, 'padding-right', false, false, gp_spacing.tablet ); + +// Mobile menu item width +generate_spacing_live_update( 'mobile_menu_item_padding_left', 'mobile_menu_item', '.menu-toggle,.main-navigation .mobile-bar-items a', 'padding-left', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_menu_item_padding_right', 'mobile_menu_item', '.menu-toggle,.main-navigation .mobile-bar-items a', 'padding-right', false, false, gp_spacing.mobile ); + +// Menu item height +generate_spacing_live_update( 'menu_item_height', 'menu_item_height', menu_items, 'line-height', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'navigation_logo_height', 'menu_item_height', '.main-navigation .navigation-logo img, .main-navigation .site-logo img', 'height', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'nav_title_height', 'menu_item_height', '.navigation-branding .main-title', 'line-height', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'mobile_header_logo_height', 'menu_item_height', '.mobile-header-navigation .mobile-header-logo img', 'height', false, false, gp_spacing.desktop ); + +//generate_spacing_live_update( 'tablet_menu_item_height', 'tablet_menu_item_height', menu_items, 'line-height', false, false, gp_spacing.tablet ); +//generate_spacing_live_update( 'tablet_navigation_logo_height', 'tablet_menu_item_height', '.main-navigation .navigation-logo img', 'height', false, false, gp_spacing.tablet ); +//generate_spacing_live_update( 'tablet_mobile_header_logo_height', 'tablet_menu_item_height', '.mobile-header-navigation .mobile-header-logo img', 'height', false, false, gp_spacing.tablet ); + +generate_spacing_live_update( 'mobile_menu_item_height', 'mobile_menu_item_height', menu_items, 'line-height', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_navigation_logo_height', 'mobile_menu_item_height', '.main-navigation .site-logo.navigation-logo img, .main-navigation .site-logo img, .main-navigation .navigation-branding img', 'height', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_nav_title_height', 'menu_item_height', '.navigation-branding .main-title', 'line-height', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_mobile_header_logo_height', 'mobile_menu_item_height', '.mobile-header-navigation .site-logo.mobile-header-logo img', 'height', false, false, gp_spacing.mobile ); + +// Off canvas menu item height +wp.customize( 'generate_spacing_settings[off_canvas_menu_item_height]', function( value ) { + value.bind( function( newval ) { + + if ( '' == newval ) { + newval = wp.customize('generate_spacing_settings[menu_item_height]').get(); + } + + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#off_canvas_menu_item_height' ).not( ':last' ).remove(); + }, 200 ); + + } ); +} ); + +/** + * Main sub-navigation spacing + */ +generate_spacing_live_update( 'sub_menu_item_height_top', 'sub_menu_item_height', '.main-navigation .main-nav ul ul li a', 'padding-top' ); +generate_spacing_live_update( 'sub_menu_item_height_right', 'menu_item', '.main-navigation .main-nav ul ul li a', 'padding-right', false, false, gp_spacing.desktop ); +//generate_spacing_live_update( 'tablet_sub_menu_item_height_right', 'tablet_menu_item', '.main-navigation .main-nav ul ul li a', 'padding-right', false, false, gp_spacing.tablet ); +generate_spacing_live_update( 'sub_menu_item_height_bottom', 'sub_menu_item_height', '.main-navigation .main-nav ul ul li a', 'padding-bottom' ); +generate_spacing_live_update( 'sub_menu_item_height_left', 'menu_item', '.main-navigation .main-nav ul ul li a', 'padding-left', false, false, gp_spacing.desktop ); +//generate_spacing_live_update( 'tablet_sub_menu_item_height_left', 'tablet_menu_item', '.main-navigation .main-nav ul ul li a', 'padding-left', false, false, gp_spacing.tablet ); +generate_spacing_live_update( 'sub_menu_item_offset', 'menu_item_height', '.main-navigation ul ul', 'top' ); + +/** + * Main navigation RTL arrow spacing + */ +generate_spacing_live_update( 'dropdown_menu_arrow', 'menu_item', '.menu-item-has-children .dropdown-menu-toggle', 'padding-right', false, false, gp_spacing.desktop ); +//generate_spacing_live_update( 'tablet_dropdown_menu_arrow', 'tablet_menu_item', '.menu-item-has-children .dropdown-menu-toggle', 'padding-right', false, false, gp_spacing.tablet ); + +/** + * Main sub-navigation arrow spacing + */ +generate_spacing_live_update( 'dropdown_submenu_arrow_top', 'sub_menu_item_height', '.menu-item-has-children ul .dropdown-menu-toggle', 'padding-top' ); +generate_spacing_live_update( 'dropdown_submenu_arrow_bottom', 'sub_menu_item_height', '.menu-item-has-children ul .dropdown-menu-toggle', 'padding-bottom' ); +generate_spacing_live_update( 'dropdown_submenu_arrow_margin', 'sub_menu_item_height', '.menu-item-has-children ul .dropdown-menu-toggle', 'margin-top', true ); + +/** + * Sub-Menu Width + */ +generate_spacing_live_update( 'sub_menu_width', 'sub_menu_width', '.main-navigation ul ul', 'width' ); + +/** + - * Sticky menu item height + - */ +wp.customize( 'generate_spacing_settings[sticky_menu_item_height]', function( value ) { + value.bind( function( newval ) { + + if ( '' == newval ) { + newval = wp.customize('generate_spacing_settings[menu_item_height]').get(); + } + + jQuery( 'head' ).append( '' ); + jQuery( 'head' ).append( '' ); + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#sticky_menu_item_height' ).not( ':last' ).remove(); + jQuery( 'style#sticky_menu_item_logo_height' ).not( ':last' ).remove(); + jQuery( 'style#sticky_menu_item_height_transition' ).remove(); + }, 200 ); + + } ); +} ); + +// Disable the transition while we resize +wp.customize( 'generate_spacing_settings[menu_item_height]', function( value ) { + value.bind( function( newval ) { + + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#menu_item_height_transition' ).remove(); + }, 200 ); + + } ); +} ); + +wp.customize( 'generate_spacing_settings[off_canvas_menu_item_height]', function( value ) { + value.bind( function( newval ) { + + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#off_canvas_menu_item_height_transition' ).remove(); + }, 200 ); + + } ); +} ); + +/** + * Widget padding + */ +generate_spacing_live_update( 'widget_top', 'widget_top', '.widget-area .widget, .one-container .widget-area .widget', 'padding-top', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'widget_right', 'widget_right', '.widget-area .widget, .one-container .widget-area .widget', 'padding-right', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'widget_bottom', 'widget_bottom', '.widget-area .widget, .one-container .widget-area .widget', 'padding-bottom', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'widget_left', 'widget_left', '.widget-area .widget, .one-container .widget-area .widget', 'padding-left', false, false, gp_spacing.desktop ); + +generate_spacing_live_update( 'mobile_widget_top', 'mobile_widget_top', '.widget-area .widget', 'padding-top', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_widget_right', 'mobile_widget_right', '.widget-area .widget', 'padding-right', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_widget_bottom', 'mobile_widget_bottom', '.widget-area .widget', 'padding-bottom', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_widget_left', 'mobile_widget_left', '.widget-area .widget', 'padding-left', false, false, gp_spacing.mobile ); + +/** + * Footer widget area + */ +generate_spacing_live_update( 'footer_widget_container_top', 'footer_widget_container_top', '.footer-widgets', 'padding-top', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'footer_widget_container_right', 'footer_widget_container_right', '.footer-widgets', 'padding-right', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'footer_widget_container_bottom', 'footer_widget_container_bottom', '.footer-widgets', 'padding-bottom', false, false, gp_spacing.desktop ); +generate_spacing_live_update( 'footer_widget_container_left', 'footer_widget_container_left', '.footer-widgets', 'padding-left', false, false, gp_spacing.desktop ); + +generate_spacing_live_update( 'mobile_footer_widget_container_top', 'mobile_footer_widget_container_top', '.footer-widgets', 'padding-top', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_footer_widget_container_right', 'mobile_footer_widget_container_right', '.footer-widgets', 'padding-right', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_footer_widget_container_bottom', 'mobile_footer_widget_container_bottom', '.footer-widgets', 'padding-bottom', false, false, gp_spacing.mobile ); +generate_spacing_live_update( 'mobile_footer_widget_container_left', 'mobile_footer_widget_container_left', '.footer-widgets', 'padding-left', false, false, gp_spacing.mobile ); + +/** + * Footer + */ +generate_spacing_live_update( 'footer_top', 'footer_top', '.site-info', 'padding-top' ); +generate_spacing_live_update( 'footer_right', 'footer_right', '.site-info', 'padding-right' ); +generate_spacing_live_update( 'footer_bottom', 'footer_bottom', '.site-info', 'padding-bottom' ); +generate_spacing_live_update( 'footer_left', 'footer_left', '.site-info', 'padding-left' ); + +/** + * Separator + */ + +/* Masonry */ +if ( jQuery( 'body' ).hasClass( 'masonry-enabled' ) ) { + generate_spacing_live_update( 'masonry_separator', 'separator', '.masonry-post .inside-article', 'margin-left' ); + generate_spacing_live_update( 'masonry_separator_bottom', 'separator', '.masonry-container > article', 'margin-bottom' ); + generate_spacing_live_update( 'masonry_separator_container', 'separator', '.masonry-container', 'margin-left', 'negative' ); + generate_spacing_live_update( 'masonry_separator_page_header_left', 'separator', '.masonry-enabled .page-header', 'margin-left' ); + generate_spacing_live_update( 'masonry_separator_page_header_bottom', 'separator', '.masonry-enabled .page-header', 'margin-bottom' ); + generate_spacing_live_update( 'masonry_separator_load_more', 'separator', '.separate-containers .site-main > .masonry-load-more', 'margin-bottom' ); +} + +/* Columns */ +if ( jQuery( 'body' ).hasClass( 'generate-columns-activated' ) ) { + generate_spacing_live_update( 'columns_bottom', 'separator', '.generate-columns', 'margin-bottom' ); + generate_spacing_live_update( 'columns_left', 'separator', '.generate-columns', 'padding-left' ); + generate_spacing_live_update( 'columns_container', 'separator', '.generate-columns-container', 'padding-left', 'negative' ); + generate_spacing_live_update( 'columns_page_header_bottom', 'separator', '.generate-columns-container .page-header', 'margin-bottom' ); + generate_spacing_live_update( 'columns_page_header_left', 'separator', '.generate-columns-container .page-header', 'margin-left' ); + generate_spacing_live_update( 'columns_pagination', 'separator', '.separate-containers .generate-columns-container > .paging-navigation', 'margin-left' ); +} + +/* Right sidebar */ +if ( jQuery( 'body' ).hasClass( 'right-sidebar' ) ) { + generate_spacing_live_update( 'right_sidebar_sepatator_top', 'separator', '.right-sidebar.separate-containers .site-main', 'margin-top' ); + generate_spacing_live_update( 'right_sidebar_sepatator_right', 'separator', '.right-sidebar.separate-containers .site-main', 'margin-right' ); + generate_spacing_live_update( 'right_sidebar_sepatator_bottom', 'separator', '.right-sidebar.separate-containers .site-main', 'margin-bottom' ); +} + +/* Left sidebar */ +if ( jQuery( 'body' ).hasClass( 'left-sidebar' ) ) { + generate_spacing_live_update( 'left_sidebar_sepatator_top', 'separator', '.left-sidebar.separate-containers .site-main', 'margin-top' ); + generate_spacing_live_update( 'left_sidebar_sepatator_left', 'separator', '.left-sidebar.separate-containers .site-main', 'margin-left' ); + generate_spacing_live_update( 'left_sidebar_sepatator_bottom', 'separator', '.left-sidebar.separate-containers .site-main', 'margin-bottom' ); +} + +/* Both sidebars */ +if ( jQuery( 'body' ).hasClass( 'both-sidebars' ) ) { + generate_spacing_live_update( 'both_sidebars_sepatator', 'separator', '.both-sidebars.separate-containers .site-main', 'margin' ); +} + +/* Both sidebars right */ +if ( jQuery( 'body' ).hasClass( 'both-right' ) ) { + generate_spacing_live_update( 'both_right_sidebar_sepatator_top', 'separator', '.both-right.separate-containers .site-main', 'margin-top' ); + generate_spacing_live_update( 'both_right_sidebar_sepatator_right', 'separator', '.both-right.separate-containers .site-main', 'margin-right' ); + generate_spacing_live_update( 'both_right_sidebar_sepatator_bottom', 'separator', '.both-right.separate-containers .site-main', 'margin-bottom' ); + generate_spacing_live_update( 'both_right_left_sidebar', 'separator', '.both-right.separate-containers .inside-left-sidebar', 'margin-right', false, true ); + generate_spacing_live_update( 'both_right_right_sidebar', 'separator', '.both-right.separate-containers .inside-right-sidebar', 'margin-left', false, true ); +} + +/* Both sidebars left */ +if ( jQuery( 'body' ).hasClass( 'both-left' ) ) { + generate_spacing_live_update( 'both_left_sidebar_sepatator_top', 'separator', '.both-left.separate-containers .site-main', 'margin-top' ); + generate_spacing_live_update( 'both_left_sidebar_sepatator_right', 'separator', '.both-left.separate-containers .site-main', 'margin-bottom' ); + generate_spacing_live_update( 'both_left_sidebar_sepatator_bottom', 'separator', '.both-left.separate-containers .site-main', 'margin-left' ); + generate_spacing_live_update( 'both_left_left_sidebar', 'separator', '.both-left.separate-containers .inside-left-sidebar', 'margin-right', false, true ); + generate_spacing_live_update( 'both_left_right_sidebar', 'separator', '.both-left.separate-containers .inside-right-sidebar', 'margin-left', false, true ); +} + +/* Main element margin */ +generate_spacing_live_update( 'site_main_separator_top', 'separator', '.separate-containers .site-main', 'margin-top' ); +generate_spacing_live_update( 'site_main_separator_bottom', 'separator', '.separate-containers .site-main', 'margin-bottom' ); + +/* Page header element */ +generate_spacing_live_update( 'page_header_separator_top', 'separator', + '.separate-containers .page-header-image, \ + .separate-containers .page-header-contained, \ + .separate-containers .page-header-image-single, \ + .separate-containers .page-header-content-single', 'margin-top' ); + +/* Top and bottom sidebar margin */ +generate_spacing_live_update( 'right_sidebar_separator_top', 'separator', '.separate-containers .inside-right-sidebar, .separate-containers .inside-left-sidebar', 'margin-top' ); +generate_spacing_live_update( 'right_sidebar_separator_bottom', 'separator', '.separate-containers .inside-right-sidebar, .separate-containers .inside-left-sidebar', 'margin-bottom' ); + +/* Element separators */ +generate_spacing_live_update( 'content_separator', 'separator', + '.separate-containers .widget, \ + .separate-containers .site-main > *, \ + .separate-containers .page-header, \ + .widget-area .main-navigation', 'margin-bottom' ); + +/** + * Right sidebar width + */ +wp.customize( 'generate_spacing_settings[right_sidebar_width]', function( value ) { + value.bind( function( newval ) { + var body = jQuery( 'body' ); + + if ( jQuery( '#right-sidebar' ).length ) { + + // Left sidebar width + var left_sidebar = ( jQuery( '#left-sidebar' ).length ) ? wp.customize.value('generate_spacing_settings[left_sidebar_width]')() : 0; + + // Right sidebar class + jQuery( "#right-sidebar" ).removeClass(function (index, css) { + return (css.match (/(^|\s)grid-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-grid-\S+/g) || []).join(' '); + }).addClass( 'grid-' + newval ).addClass( 'tablet-grid-' + newval ).addClass( 'grid-parent' ); + + // Content area class + jQuery( ".content-area" ).removeClass(function (index, css) { + return (css.match (/(^|\s)grid-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-grid-\S+/g) || []).join(' '); + }).addClass( 'grid-' + ( 100 - newval - left_sidebar ) ).addClass( 'tablet-grid-' + ( 100 - newval - left_sidebar ) ).addClass( 'grid-parent' ); + + if ( body.hasClass( 'both-sidebars' ) ) { + var content_width = ( 100 - newval - left_sidebar ); + jQuery( '#left-sidebar' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)push-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); + }).addClass( 'pull-' + ( content_width ) ).addClass( 'tablet-pull-' + ( content_width ) ); + } + + if ( body.hasClass( 'both-left' ) ) { + var total_sidebar_width = ( parseInt( left_sidebar ) + parseInt( newval ) ); + + jQuery( '#right-sidebar' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).addClass( 'pull-' + ( 100 - total_sidebar_width ) ).addClass( 'tablet-pull-' + ( 100 - total_sidebar_width ) ); + + jQuery( '#left-sidebar' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).addClass( 'pull-' + ( 100 - total_sidebar_width ) ).addClass( 'tablet-pull-' + ( 100 - total_sidebar_width ) ); + + jQuery( '.content-area' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)push-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); + }).addClass( 'push-' + ( total_sidebar_width ) ).addClass( 'tablet-push-' + ( total_sidebar_width ) ); + } + jQuery('body').trigger('generate_spacing_updated'); + } + } ); +} ); + +/** + * Left sidebar width + */ +wp.customize( 'generate_spacing_settings[left_sidebar_width]', function( value ) { + value.bind( function( newval ) { + var body = jQuery( 'body' ); + if ( jQuery( '#left-sidebar' ).length ) { + // Right sidebar width + var right_sidebar = ( jQuery( '#right-sidebar' ).length ) ? wp.customize.value('generate_spacing_settings[right_sidebar_width]')() : 0; + + // Right sidebar class + jQuery( "#left-sidebar" ).removeClass(function (index, css) { + return (css.match (/(^|\s)grid-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-grid-\S+/g) || []).join(' '); + }).addClass( 'grid-' + newval ).addClass( 'tablet-grid-' + newval ).addClass( 'grid-parent' ); + + // Content area class + jQuery( ".content-area" ).removeClass(function (index, css) { + return (css.match (/(^|\s)grid-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-grid-\S+/g) || []).join(' '); + }).addClass( 'grid-' + ( 100 - newval - right_sidebar ) ).addClass( 'tablet-grid-' + ( 100 - newval - right_sidebar ) ).addClass( 'grid-parent' ); + + if ( body.hasClass( 'left-sidebar' ) ) { + jQuery( '#left-sidebar' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)push-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); + }).addClass( 'pull-' + ( 100 - newval ) ).addClass( 'tablet-pull-' + ( 100 - newval ) ); + + jQuery( '.content-area' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)push-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); + }).addClass( 'push-' + newval ).addClass( 'tablet-push-' + newval ).addClass( 'grid-' + ( 100 - newval ) ).addClass( 'tablet-grid-' + ( 100 - newval ) ); + } + + if ( body.hasClass( 'both-sidebars' ) ) { + var content_width = ( 100 - newval - right_sidebar ); + jQuery( '#left-sidebar' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)push-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); + }).addClass( 'pull-' + ( content_width ) ).addClass( 'tablet-pull-' + ( content_width ) ); + + jQuery( '.content-area' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)push-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); + }).addClass( 'push-' + ( newval ) ).addClass( 'tablet-push-' + ( newval ) ); + } + + if ( body.hasClass( 'both-left' ) ) { + var content_width = ( 100 - newval - right_sidebar ); + var total_sidebar_width = ( parseInt( right_sidebar ) + parseInt( newval ) ); + + jQuery( '#right-sidebar' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).addClass( 'pull-' + ( 100 - total_sidebar_width ) ).addClass( 'tablet-pull-' + ( 100 - total_sidebar_width ) ); + + jQuery( '#left-sidebar' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).addClass( 'pull-' + ( 100 - total_sidebar_width ) ).addClass( 'tablet-pull-' + ( 100 - total_sidebar_width ) ); + + jQuery( '.content-area' ).removeClass(function (index, css) { + return (css.match (/(^|\s)pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-pull-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)push-\S+/g) || []).join(' '); + }).removeClass(function (index, css) { + return (css.match (/(^|\s)tablet-push-\S+/g) || []).join(' '); + }).addClass( 'push-' + ( total_sidebar_width ) ).addClass( 'tablet-push-' + ( total_sidebar_width ) ); + } + jQuery('body').trigger('generate_spacing_updated'); + } + } ); +} ); diff --git a/wp-content/plugins/gp-premium/spacing/functions/customizer/navigation-spacing.php b/wp-content/plugins/gp-premium/spacing/functions/customizer/navigation-spacing.php new file mode 100644 index 0000000..54ec0e6 --- /dev/null +++ b/wp-content/plugins/gp-premium/spacing/functions/customizer/navigation-spacing.php @@ -0,0 +1,269 @@ +add_section( + 'generate_spacing_navigation', + array( + 'title' => __( 'Primary Navigation', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 15, + 'panel' => 'generate_spacing_panel' + ) +); + +// If our new Layout section doesn't exist, use the old navigation section +$navigation_section = ( $wp_customize->get_panel( 'generate_layout_panel' ) ) ? 'generate_layout_navigation' : 'generate_spacing_navigation'; + +// Menu item width +$wp_customize->add_setting( + 'generate_spacing_settings[menu_item]', array( + 'default' => $defaults['menu_item'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_menu_item]', array( + 'default' => $defaults['mobile_menu_item'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[menu_item]', + array( + 'label' => __( 'Menu Item Width', 'gp-premium' ), + 'section' => $navigation_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[menu_item]', + 'mobile' => 'generate_spacing_settings[mobile_menu_item]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 220, + ) + ) +); + +// Menu item height +$wp_customize->add_setting( + 'generate_spacing_settings[menu_item_height]', array( + 'default' => $defaults['menu_item_height'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +$wp_customize->add_setting( + 'generate_spacing_settings[mobile_menu_item_height]', array( + 'default' => $defaults['mobile_menu_item_height'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[menu_item_height]', + array( + 'label' => __( 'Menu Item Height', 'gp-premium' ), + 'section' => $navigation_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[menu_item_height]', + 'mobile' => 'generate_spacing_settings[mobile_menu_item_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 20, + 'max' => 150, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 20, + 'max' => 150, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 240, + ) + ) +); + +// Sub-menu item height +$wp_customize->add_setting( + 'generate_spacing_settings[sub_menu_item_height]', array( + 'default' => $defaults['sub_menu_item_height'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[sub_menu_item_height]', + array( + 'label' => __( 'Sub-Menu Item Height', 'gp-premium' ), + 'section' => $navigation_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[sub_menu_item_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 50, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 260, + ) + ) +); + +if ( isset( $defaults['sub_menu_width'] ) ) { + // Sub-menu item height + $wp_customize->add_setting( + 'generate_spacing_settings[sub_menu_width]', array( + 'default' => $defaults['sub_menu_width'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[sub_menu_width]', + array( + 'label' => __( 'Sub-Menu Width', 'gp-premium' ), + 'section' => $navigation_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[sub_menu_width]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 100, + 'max' => 500, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 265, + ) + ) + ); +} + +// Sticky menu height +$wp_customize->add_setting( + 'generate_spacing_settings[sticky_menu_item_height]', array( + 'default' => $defaults['sticky_menu_item_height'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[sticky_menu_item_height]', + array( + 'label' => __( 'Menu Item Height', 'gp-premium' ), + 'section' => 'menu_plus_sticky_menu', + 'settings' => array( + 'desktop' => 'generate_spacing_settings[sticky_menu_item_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 20, + 'max' => 150, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 150, + 'active_callback' => 'generate_sticky_navigation_activated', + ) + ) +); + +// Off canvas menu height +$wp_customize->add_setting( + 'generate_spacing_settings[off_canvas_menu_item_height]', array( + 'default' => $defaults['off_canvas_menu_item_height'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[off_canvas_menu_item_height]', + array( + 'label' => __( 'Menu Item Height', 'gp-premium' ), + 'section' => 'menu_plus_slideout_menu', + 'settings' => array( + 'desktop' => 'generate_spacing_settings[off_canvas_menu_item_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 20, + 'max' => 150, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 200, + 'active_callback' => 'generate_slideout_navigation_activated', + ) + ) +); diff --git a/wp-content/plugins/gp-premium/spacing/functions/customizer/secondary-nav-spacing.php b/wp-content/plugins/gp-premium/spacing/functions/customizer/secondary-nav-spacing.php new file mode 100644 index 0000000..12398c8 --- /dev/null +++ b/wp-content/plugins/gp-premium/spacing/functions/customizer/secondary-nav-spacing.php @@ -0,0 +1,147 @@ +get_section( 'secondary_nav_section' ) ) { + return; + } + + // Get our controls + require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; + + // Get our defaults + $defaults = generate_secondary_nav_get_defaults(); + + // Remove our old label control if it exists + // It only would if the user is using an old Secondary Nav add-on version + if ( $wp_customize->get_control( 'generate_secondary_navigation_spacing_title' ) ) $wp_customize->remove_control( 'generate_secondary_navigation_spacing_title' ); + + // Menu item width + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_menu_item]', array( + 'default' => $defaults['secondary_menu_item'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_secondary_nav_settings[secondary_menu_item]', + array( + 'label' => __( 'Menu Item Width', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'settings' => array( + 'desktop' => 'generate_secondary_nav_settings[secondary_menu_item]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 220, + ) + ) + ); + + // Menu item height + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_menu_item_height]', array( + 'default' => $defaults['secondary_menu_item_height'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_secondary_nav_settings[secondary_menu_item_height]', + array( + 'label' => __( 'Menu Item Height', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'settings' => array( + 'desktop' => 'generate_secondary_nav_settings[secondary_menu_item_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 20, + 'max' => 150, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 240, + ) + ) + ); + + // Sub-menu height + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_sub_menu_item_height]', array( + 'default' => $defaults['secondary_sub_menu_item_height'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_secondary_nav_settings[secondary_sub_menu_item_height]', + array( + 'label' => __( 'Sub-Menu Item Height', 'gp-premium' ), + 'section' => 'secondary_nav_section', + 'settings' => array( + 'desktop' => 'generate_secondary_nav_settings[secondary_sub_menu_item_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 50, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 260, + ) + ) + ); + } +} diff --git a/wp-content/plugins/gp-premium/spacing/functions/customizer/sidebar-spacing.php b/wp-content/plugins/gp-premium/spacing/functions/customizer/sidebar-spacing.php new file mode 100644 index 0000000..ac6845c --- /dev/null +++ b/wp-content/plugins/gp-premium/spacing/functions/customizer/sidebar-spacing.php @@ -0,0 +1,196 @@ +add_section( + 'generate_spacing_sidebar', + array( + 'title' => __( 'Sidebars', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 15, + 'panel' => 'generate_spacing_panel' + ) +); + +// Add our controls to the Layout panel if it exists +// If not, use the old section +$widget_section = ( $wp_customize->get_panel( 'generate_layout_panel' ) ) ? 'generate_layout_sidebars' : 'generate_spacing_sidebar'; + +// Widget padding top +$wp_customize->add_setting( 'generate_spacing_settings[widget_top]', + array( + 'default' => $defaults['widget_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Widget padding right +$wp_customize->add_setting( 'generate_spacing_settings[widget_right]', + array( + 'default' => $defaults['widget_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Widget padding bottom +$wp_customize->add_setting( 'generate_spacing_settings[widget_bottom]', + array( + 'default' => $defaults['widget_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Widget padding left +$wp_customize->add_setting( 'generate_spacing_settings[widget_left]', + array( + 'default' => $defaults['widget_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Widget padding top +$wp_customize->add_setting( 'generate_spacing_settings[mobile_widget_top]', + array( + 'default' => $defaults['mobile_widget_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Widget padding right +$wp_customize->add_setting( 'generate_spacing_settings[mobile_widget_right]', + array( + 'default' => $defaults['mobile_widget_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Widget padding bottom +$wp_customize->add_setting( 'generate_spacing_settings[mobile_widget_bottom]', + array( + 'default' => $defaults['mobile_widget_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Widget padding left +$wp_customize->add_setting( 'generate_spacing_settings[mobile_widget_left]', + array( + 'default' => $defaults['mobile_widget_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +// Make use of the widget padding settings +$wp_customize->add_control( + new GeneratePress_Spacing_Control( + $wp_customize, + 'widget_spacing', + array( + 'type' => 'generatepress-spacing', + 'label' => esc_html__( 'Widget Padding', 'gp-premium' ), + 'section' => $widget_section, + 'settings' => array( + 'desktop_top' => 'generate_spacing_settings[widget_top]', + 'desktop_right' => 'generate_spacing_settings[widget_right]', + 'desktop_bottom' => 'generate_spacing_settings[widget_bottom]', + 'desktop_left' => 'generate_spacing_settings[widget_left]', + 'mobile_top' => 'generate_spacing_settings[mobile_widget_top]', + 'mobile_right' => 'generate_spacing_settings[mobile_widget_right]', + 'mobile_bottom' => 'generate_spacing_settings[mobile_widget_bottom]', + 'mobile_left' => 'generate_spacing_settings[mobile_widget_left]' + ), + 'element' => 'widget', + 'priority' => 99 + ) + ) +); + +// Left sidebar width +$wp_customize->add_setting( + 'generate_spacing_settings[left_sidebar_width]', array( + 'default' => $defaults['left_sidebar_width'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[left_sidebar_width]', + array( + 'label' => esc_html__( 'Left Sidebar Width', 'gp-premium' ), + 'section' => $widget_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[left_sidebar_width]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 15, + 'max' => 50, + 'step' => 5, + 'edit' => false, + 'unit' => '%', + ), + ), + 'priority' => 125, + ) + ) +); + +// Right sidebar width +$wp_customize->add_setting( + 'generate_spacing_settings[right_sidebar_width]', array( + 'default' => $defaults['right_sidebar_width'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) +); + +$wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_spacing_settings[right_sidebar_width]', + array( + 'label' => esc_html__( 'Right Sidebar Width', 'gp-premium' ), + 'section' => $widget_section, + 'settings' => array( + 'desktop' => 'generate_spacing_settings[right_sidebar_width]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 15, + 'max' => 50, + 'step' => 5, + 'edit' => false, + 'unit' => '%', + ), + ), + 'priority' => 125, + ) + ) +); diff --git a/wp-content/plugins/gp-premium/spacing/functions/customizer/top-bar-spacing.php b/wp-content/plugins/gp-premium/spacing/functions/customizer/top-bar-spacing.php new file mode 100644 index 0000000..84c9631 --- /dev/null +++ b/wp-content/plugins/gp-premium/spacing/functions/customizer/top-bar-spacing.php @@ -0,0 +1,69 @@ +add_setting( 'generate_spacing_settings[top_bar_top]', + array( + 'default' => $defaults['top_bar_top'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + // Widget padding right + $wp_customize->add_setting( 'generate_spacing_settings[top_bar_right]', + array( + 'default' => $defaults['top_bar_right'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + // Widget padding bottom + $wp_customize->add_setting( 'generate_spacing_settings[top_bar_bottom]', + array( + 'default' => $defaults['top_bar_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + // Widget padding left + $wp_customize->add_setting( 'generate_spacing_settings[top_bar_left]', + array( + 'default' => $defaults['top_bar_left'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + // Make use of the widget padding settings + $wp_customize->add_control( + new GeneratePress_Spacing_Control( + $wp_customize, + 'top_bar_spacing', + array( + 'type' => 'generatepress-spacing', + 'label' => esc_html__( 'Top Bar Padding', 'gp-premium' ), + 'section' => 'generate_top_bar', + 'settings' => array( + 'desktop_top' => 'generate_spacing_settings[top_bar_top]', + 'desktop_right' => 'generate_spacing_settings[top_bar_right]', + 'desktop_bottom' => 'generate_spacing_settings[top_bar_bottom]', + 'desktop_left' => 'generate_spacing_settings[top_bar_left]' + ), + 'element' => 'top_bar', + 'priority' => 99, + 'active_callback' => 'generate_premium_is_top_bar_active', + ) + ) + ); +} diff --git a/wp-content/plugins/gp-premium/spacing/functions/functions.php b/wp-content/plugins/gp-premium/spacing/functions/functions.php new file mode 100644 index 0000000..4ad2352 --- /dev/null +++ b/wp-content/plugins/gp-premium/spacing/functions/functions.php @@ -0,0 +1,298 @@ +register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Spacing_Control' ); + } + + // Add our Spacing panel + // This is only used if the Layout panel in the free theme doesn't exist + if ( class_exists( 'WP_Customize_Panel' ) ) { + if ( ! $wp_customize->get_panel( 'generate_spacing_panel' ) ) { + $wp_customize->add_panel( 'generate_spacing_panel', array( + 'capability' => 'edit_theme_options', + 'theme_supports' => '', + 'title' => __( 'Spacing', 'gp-premium' ), + 'description' => __( 'Change the spacing for various elements using pixels.', 'gp-premium' ), + 'priority' => 35 + ) ); + } + } + + require_once plugin_dir_path( __FILE__ ) . 'customizer/top-bar-spacing.php'; + require_once plugin_dir_path( __FILE__ ) . 'customizer/header-spacing.php'; + require_once plugin_dir_path( __FILE__ ) . 'customizer/content-spacing.php'; + require_once plugin_dir_path( __FILE__ ) . 'customizer/sidebar-spacing.php'; + require_once plugin_dir_path( __FILE__ ) . 'customizer/navigation-spacing.php'; + require_once plugin_dir_path( __FILE__ ) . 'customizer/footer-spacing.php'; + + } +} + +if ( ! function_exists( 'generate_right_sidebar_width' ) ) { + add_filter( 'generate_right_sidebar_width', 'generate_right_sidebar_width' ); + /* + * Set our right sidebar width + */ + function generate_right_sidebar_width( $width ) { + // Bail if we don't have our defaults + if ( ! function_exists( 'generate_spacing_get_defaults' ) ) { + return $width; + } + + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + + return absint( $spacing_settings['right_sidebar_width'] ); + } +} + +if ( ! function_exists( 'generate_left_sidebar_width' ) ) { + add_filter( 'generate_left_sidebar_width', 'generate_left_sidebar_width' ); + /* + * Set our left sidebar width + */ + function generate_left_sidebar_width( $width ) { + // Bail if we don't have our defaults + if ( ! function_exists( 'generate_spacing_get_defaults' ) ) { + return $width; + } + + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + + return absint( $spacing_settings['left_sidebar_width'] ); + } +} + +if ( ! function_exists( 'generate_spacing_customizer_live_preview' ) ) { + add_action( 'customize_preview_init', 'generate_spacing_customizer_live_preview' ); + /* + * Add our live preview JS + */ + function generate_spacing_customizer_live_preview() { + wp_enqueue_script( + 'generate-spacing-customizer', + trailingslashit( plugin_dir_url( __FILE__ ) ) . 'customizer/js/customizer.js', + array( 'jquery','customize-preview' ), + GENERATE_SPACING_VERSION, + true + ); + + wp_localize_script( 'generate-spacing-customizer', 'gp_spacing', array( + 'mobile' => generate_premium_get_media_query( 'mobile' ), + 'tablet' => generate_premium_get_media_query( 'tablet' ), + 'desktop' => generate_premium_get_media_query( 'desktop' ), + ) ); + } +} + +if ( ! function_exists( 'generate_include_spacing_defaults' ) ) { + /** + * Check if we should include our default.css file + * @since 1.3.42 + */ + function generate_include_spacing_defaults() { + return true; + } +} + +if ( ! function_exists( 'generate_spacing_premium_defaults' ) ) { + add_filter( 'generate_spacing_option_defaults', 'generate_spacing_premium_defaults' ); + /** + * Add premium spacing defaults + * + * @since 1.3 + */ + function generate_spacing_premium_defaults( $defaults ) { + $defaults['mobile_menu_item'] = ''; + $defaults['mobile_menu_item_height'] = ''; + $defaults['sticky_menu_item_height'] = ''; + $defaults['off_canvas_menu_item_height'] = ''; + $defaults['content_element_separator'] = '2'; // em + + $defaults['mobile_header_top'] = ''; + $defaults['mobile_header_right'] = ''; + $defaults['mobile_header_bottom'] = ''; + $defaults['mobile_header_left'] = ''; + + $defaults['mobile_widget_top'] = ''; + $defaults['mobile_widget_right'] = ''; + $defaults['mobile_widget_bottom'] = ''; + $defaults['mobile_widget_left'] = ''; + + $defaults['mobile_footer_widget_container_top'] = ''; + $defaults['mobile_footer_widget_container_right'] = ''; + $defaults['mobile_footer_widget_container_bottom'] = ''; + $defaults['mobile_footer_widget_container_left'] = ''; + + return $defaults; + } +} + +if ( ! function_exists( 'generate_spacing_premium_css' ) ) { + add_action( 'wp_enqueue_scripts', 'generate_spacing_premium_css', 105 ); + /** + * Add premium spacing CSS + * + * @since 1.3 + */ + function generate_spacing_premium_css() { + + // Bail if we don't have our defaults + if ( ! function_exists( 'generate_spacing_get_defaults' ) ) { + return; + } + + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + + require_once GP_LIBRARY_DIRECTORY . 'class-make-css.php'; + $premium_css = new GeneratePress_Pro_CSS; + + // Mobile spacing + $premium_css->start_media_query( generate_premium_get_media_query( 'mobile-menu' ) ); + + if ( '' !== $spacing_settings[ 'mobile_menu_item' ] ) { + $premium_css->set_selector( '.menu-toggle,.main-navigation .mobile-bar-items a' ); + $premium_css->add_property( 'padding-left', absint( $spacing_settings['mobile_menu_item'] ), false, 'px' ); + $premium_css->add_property( 'padding-right', absint( $spacing_settings['mobile_menu_item'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings[ 'mobile_menu_item_height' ] ) { + $premium_css->set_selector( '.main-navigation .main-nav ul li a,.menu-toggle,.main-navigation .mobile-bar-items a' ); + $premium_css->add_property( 'line-height', absint( $spacing_settings['mobile_menu_item_height'] ), false, 'px' ); + + $premium_css->set_selector( '.main-navigation .site-logo.navigation-logo img, .mobile-header-navigation .site-logo.mobile-header-logo img, .navigation-search input' ); + $premium_css->add_property( 'height', absint( $spacing_settings['mobile_menu_item_height'] ), false, 'px' ); + } + + $premium_css->stop_media_query(); + + $premium_css->start_media_query( generate_premium_get_media_query( 'mobile' ) ); + + $premium_css->set_selector( '.inside-header' ); + + if ( '' !== $spacing_settings['mobile_header_top'] ) { + $premium_css->add_property( 'padding-top', absint( $spacing_settings['mobile_header_top'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_header_right'] ) { + $premium_css->add_property( 'padding-right', absint( $spacing_settings['mobile_header_right'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_header_bottom'] ) { + $premium_css->add_property( 'padding-bottom', absint( $spacing_settings['mobile_header_bottom'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_header_left'] ) { + $premium_css->add_property( 'padding-left', absint( $spacing_settings['mobile_header_left'] ), false, 'px' ); + } + + $premium_css->set_selector( '.widget-area .widget' ); + + if ( '' !== $spacing_settings['mobile_widget_top'] ) { + $premium_css->add_property( 'padding-top', absint( $spacing_settings['mobile_widget_top'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_widget_right'] ) { + $premium_css->add_property( 'padding-right', absint( $spacing_settings['mobile_widget_right'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_widget_bottom'] ) { + $premium_css->add_property( 'padding-bottom', absint( $spacing_settings['mobile_widget_bottom'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_widget_left'] ) { + $premium_css->add_property( 'padding-left', absint( $spacing_settings['mobile_widget_left'] ), false, 'px' ); + } + + $premium_css->set_selector( '.footer-widgets' ); + + if ( '' !== $spacing_settings['mobile_footer_widget_container_top'] ) { + $premium_css->add_property( 'padding-top', absint( $spacing_settings['mobile_footer_widget_container_top'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_footer_widget_container_right'] ) { + $premium_css->add_property( 'padding-right', absint( $spacing_settings['mobile_footer_widget_container_right'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_footer_widget_container_bottom'] ) { + $premium_css->add_property( 'padding-bottom', absint( $spacing_settings['mobile_footer_widget_container_bottom'] ), false, 'px' ); + } + + if ( '' !== $spacing_settings['mobile_footer_widget_container_left'] ) { + $premium_css->add_property( 'padding-left', absint( $spacing_settings['mobile_footer_widget_container_left'] ), false, 'px' ); + } + + $premium_css->stop_media_query(); + + $premium_css->set_selector( '.post-image, .page-content, .entry-content, .entry-summary, footer.entry-meta' ); + $premium_css->add_property( 'margin-top', floatval( $spacing_settings['content_element_separator'] ), '2', 'em' ); + + $premium_css->set_selector( '.post-image-above-header .inside-article div.featured-image, .post-image-above-header .inside-article div.post-image' ); + $premium_css->add_property( 'margin-bottom', floatval( $spacing_settings['content_element_separator'] ), '2', 'em' ); + + if ( function_exists( 'generate_menu_plus_get_defaults' ) ) { + $menu_plus = wp_parse_args( + get_option( 'generate_menu_plus_settings', array() ), + generate_menu_plus_get_defaults() + ); + + if ( 'false' !== $menu_plus[ 'sticky_menu' ] && '' !== $spacing_settings[ 'sticky_menu_item_height' ] ) { + $premium_css->start_media_query( generate_premium_get_media_query( 'tablet' ) . ',' . generate_premium_get_media_query( 'desktop' ) ); + + $premium_css->set_selector( '.main-navigation.sticky-navigation-transition .main-nav > ul > li > a,.sticky-navigation-transition .menu-toggle,.main-navigation.sticky-navigation-transition .mobile-bar-items a, .sticky-navigation-transition .navigation-branding .main-title' ); + $premium_css->add_property( 'line-height', absint( $spacing_settings[ 'sticky_menu_item_height' ] ), false, 'px' ); + + $premium_css->set_selector( '.main-navigation.sticky-navigation-transition .site-logo img, .main-navigation.sticky-navigation-transition .navigation-search input, .main-navigation.sticky-navigation-transition .navigation-branding img' ); + $premium_css->add_property( 'height', absint( $spacing_settings[ 'sticky_menu_item_height' ] ), false, 'px' ); + + $premium_css->stop_media_query(); + } + + if ( 'false' !== $menu_plus[ 'slideout_menu' ] ) { + $premium_css->set_selector( '.main-navigation.slideout-navigation .main-nav > ul > li > a' ); + if ( '' !== $spacing_settings['off_canvas_menu_item_height'] ) { + $premium_css->add_property( 'line-height', absint( $spacing_settings['off_canvas_menu_item_height'] ), false, 'px' ); + } + } + } + + if ( '' !== $premium_css->css_output() ) { + wp_add_inline_style( 'generate-style', $premium_css->css_output() ); + } + } +} diff --git a/wp-content/plugins/gp-premium/spacing/functions/migration.php b/wp-content/plugins/gp-premium/spacing/functions/migration.php new file mode 100644 index 0000000..1eac04b --- /dev/null +++ b/wp-content/plugins/gp-premium/spacing/functions/migration.php @@ -0,0 +1,102 @@ +register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Pro_Typography_Customize_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); + } + + // Add the typography panel + if ( class_exists( 'WP_Customize_Panel' ) ) { + $wp_customize->add_panel( 'generate_typography_panel', array( + 'priority' => 30, + 'capability' => 'edit_theme_options', + 'theme_supports' => '', + 'title' => __( 'Typography', 'gp-premium' ), + 'description' => '', + ) ); + } + + // Body section + $wp_customize->add_section( + 'font_section', + array( + 'title' => __( 'Body', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 30, + 'panel' => 'generate_typography_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_body_typography_shortcuts', + array( + 'section' => 'font_section', + 'element' => __( 'Body', 'gp-premium' ), + 'shortcuts' => array( + 'colors' => 'body_section', + 'backgrounds' => 'generate_backgrounds_body', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 0, + ) + ) + ); + + // Font family + $wp_customize->add_setting( + 'generate_settings[font_body]', + array( + 'default' => $defaults['font_body'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Variants + $wp_customize->add_setting( + 'font_body_variants', + array( + 'default' => $defaults['font_body_variants'], + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + // Category + $wp_customize->add_setting( + 'font_body_category', + array( + 'default' => $defaults['font_body_category'], + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Font weight + $wp_customize->add_setting( + 'generate_settings[body_font_weight]', + array( + 'default' => $defaults['body_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + // Text transform + $wp_customize->add_setting( + 'generate_settings[body_font_transform]', + array( + 'default' => $defaults['body_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'body_typography', + array( + 'section' => 'font_section', + 'priority' => 1, + 'settings' => array( + 'family' => 'generate_settings[font_body]', + 'variant' => 'font_body_variants', + 'category' => 'font_body_category', + 'weight' => 'generate_settings[body_font_weight]', + 'transform' => 'generate_settings[body_font_transform]', + ), + ) + ) + ); + + // Font size + $wp_customize->add_setting( + 'generate_settings[body_font_size]', + array( + 'default' => $defaults['body_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[body_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_section', + 'priority' => 40, + 'settings' => array( + 'desktop' => 'generate_settings[body_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 25, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + // Line height + $wp_customize->add_setting( + 'generate_settings[body_line_height]', + array( + 'default' => $defaults['body_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[body_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_section', + 'priority' => 45, + 'settings' => array( + 'desktop' => 'generate_settings[body_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 1, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => '', + ), + ), + ) + ) + ); + + // Paragraph margin + $wp_customize->add_setting( + 'generate_settings[paragraph_margin]', + array( + 'default' => $defaults['paragraph_margin'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[paragraph_margin]', + array( + 'description' => __( 'Paragraph margin', 'gp-premium' ), + 'section' => 'font_section', + 'priority' => 47, + 'settings' => array( + 'desktop' => 'generate_settings[paragraph_margin]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + + // Top bar section + $wp_customize->add_section( + 'generate_top_bar_typography', + array( + 'title' => __( 'Top Bar', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 30, + 'panel' => 'generate_typography_panel' + ) + ); + + if ( isset( $defaults[ 'font_top_bar' ] ) && function_exists( 'generate_is_top_bar_active' ) ) { + + // Font family + $wp_customize->add_setting( + 'generate_settings[font_top_bar]', + array( + 'default' => $defaults['font_top_bar'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Category + $wp_customize->add_setting( + 'font_top_bar_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Variants + $wp_customize->add_setting( + 'font_top_bar_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + // Font weight + $wp_customize->add_setting( + 'generate_settings[top_bar_font_weight]', + array( + 'default' => $defaults['top_bar_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + + // Text transform + $wp_customize->add_setting( + 'generate_settings[top_bar_font_transform]', + array( + 'default' => $defaults['top_bar_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'top_bar_typography', + array( + 'section' => 'generate_top_bar_typography', + 'settings' => array( + 'family' => 'generate_settings[font_top_bar]', + 'variant' => 'font_top_bar_variants', + 'category' => 'font_top_bar_category', + 'weight' => 'generate_settings[top_bar_font_weight]', + 'transform' => 'generate_settings[top_bar_font_transform]', + ), + 'active_callback' => 'generate_premium_is_top_bar_active', + ) + ) + ); + + } + + if ( isset( $defaults[ 'top_bar_font_size' ] ) && function_exists( 'generate_is_top_bar_active' ) ) { + // Font size + $wp_customize->add_setting( + 'generate_settings[top_bar_font_size]', + array( + 'default' => $defaults['top_bar_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[top_bar_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'generate_top_bar_typography', + 'priority' => 75, + 'settings' => array( + 'desktop' => 'generate_settings[top_bar_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 25, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'active_callback' => 'generate_premium_is_top_bar_active', + ) + ) + ); + } + + // Header section + $wp_customize->add_section( + 'font_header_section', + array( + 'title' => __( 'Header', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 40, + 'panel' => 'generate_typography_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_header_typography_shortcuts', + array( + 'section' => 'font_header_section', + 'element' => __( 'Header', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'generate_layout_header', + 'colors' => 'header_color_section', + 'backgrounds' => 'generate_backgrounds_header', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + // Font family + $wp_customize->add_setting( + 'generate_settings[font_site_title]', + array( + 'default' => $defaults['font_site_title'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Category + $wp_customize->add_setting( + 'font_site_title_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Variants + $wp_customize->add_setting( + 'font_site_title_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + // Font weight + $wp_customize->add_setting( + 'generate_settings[site_title_font_weight]', + array( + 'default' => $defaults['site_title_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + // Text transform + $wp_customize->add_setting( + 'generate_settings[site_title_font_transform]', + array( + 'default' => $defaults['site_title_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'site_title_typography', + array( + 'label' => __( 'Site Title', 'gp-premium' ), + 'section' => 'font_header_section', + 'settings' => array( + 'family' => 'generate_settings[font_site_title]', + 'variant' => 'font_site_title_variants', + 'category' => 'font_site_title_category', + 'weight' => 'generate_settings[site_title_font_weight]', + 'transform' => 'generate_settings[site_title_font_transform]', + ), + 'priority' => 50, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[site_title_font_size]', + array( + 'default' => $defaults['site_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[tablet_site_title_font_size]', + array( + 'default' => $defaults['tablet_site_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[mobile_site_title_font_size]', + array( + 'default' => $defaults['mobile_site_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[site_title_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_header_section', + 'priority' => 75, + 'settings' => array( + 'desktop' => 'generate_settings[site_title_font_size]', + 'tablet' => 'generate_settings[tablet_site_title_font_size]', + 'mobile' => 'generate_settings[mobile_site_title_font_size]' + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 200, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'tablet' => array( + 'min' => 10, + 'max' => 200, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 10, + 'max' => 200, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + // Tagline font family + $wp_customize->add_setting( + 'generate_settings[font_site_tagline]', + array( + 'default' => $defaults['font_site_tagline'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Category + $wp_customize->add_setting( + 'font_site_tagline_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Variants + $wp_customize->add_setting( + 'font_site_tagline_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + // Font weight + $wp_customize->add_setting( + 'generate_settings[site_tagline_font_weight]', + array( + 'default' => $defaults['site_tagline_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + // Text transform + $wp_customize->add_setting( + 'generate_settings[site_tagline_font_transform]', + array( + 'default' => $defaults['site_tagline_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_site_tagline_control', + array( + 'label' => __( 'Site Tagline', 'gp-premium' ), + 'section' => 'font_header_section', + 'settings' => array( + 'family' => 'generate_settings[font_site_tagline]', + 'variant' => 'font_site_tagline_variants', + 'category' => 'font_site_tagline_category', + 'weight' => 'generate_settings[site_tagline_font_weight]', + 'transform' => 'generate_settings[site_tagline_font_transform]', + ), + 'priority' => 80, + ) + ) + ); + + // Font size + $wp_customize->add_setting( + 'generate_settings[site_tagline_font_size]', + array( + 'default' => $defaults['site_tagline_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[site_tagline_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_header_section', + 'priority' => 105, + 'settings' => array( + 'desktop' => 'generate_settings[site_tagline_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 50, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + // Primary navigation section + $wp_customize->add_section( + 'font_navigation_section', + array( + 'title' => __( 'Primary Navigation', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 50, + 'panel' => 'generate_typography_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_primary_navigation_typography_shortcuts', + array( + 'section' => 'font_navigation_section', + 'element' => __( 'Primary Navigation', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'generate_layout_navigation', + 'colors' => 'navigation_color_section', + 'backgrounds' => 'generate_backgrounds_navigation', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + // Font family + $wp_customize->add_setting( + 'generate_settings[font_navigation]', + array( + 'default' => $defaults['font_navigation'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Category + $wp_customize->add_setting( + 'font_navigation_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Variants + $wp_customize->add_setting( + 'font_navigation_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + // Font weight + $wp_customize->add_setting( + 'generate_settings[navigation_font_weight]', + array( + 'default' => $defaults['navigation_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + // Text transform + $wp_customize->add_setting( + 'generate_settings[navigation_font_transform]', + array( + 'default' => $defaults['navigation_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'google_font_site_navigation_control', + array( + 'section' => 'font_navigation_section', + 'settings' => array( + 'family' => 'generate_settings[font_navigation]', + 'variant' => 'font_navigation_variants', + 'category' => 'font_navigation_category', + 'weight' => 'generate_settings[navigation_font_weight]', + 'transform' => 'generate_settings[navigation_font_transform]', + ), + 'priority' => 120, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[navigation_font_size]', + array( + 'default' => $defaults['navigation_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[tablet_navigation_font_size]', + array( + 'default' => $defaults['tablet_navigation_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[mobile_navigation_font_size]', + array( + 'default' => $defaults['mobile_navigation_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[navigation_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_navigation_section', + 'priority' => 165, + 'settings' => array( + 'desktop' => 'generate_settings[navigation_font_size]', + 'tablet' => 'generate_settings[tablet_navigation_font_size]', + 'mobile' => 'generate_settings[mobile_navigation_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 30, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'tablet' => array( + 'min' => 6, + 'max' => 30, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 6, + 'max' => 30, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + // Buttons section + $wp_customize->add_section( + 'font_buttons_section', + array( + 'title' => __( 'Buttons', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 55, + 'panel' => 'generate_typography_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_buttons_typography_shortcuts', + array( + 'section' => 'font_buttons_section', + 'element' => __( 'Button', 'gp-premium' ), + 'shortcuts' => array( + 'colors' => 'buttons_color_section', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + if ( isset( $defaults['font_buttons'] ) ) { + $wp_customize->add_setting( + 'generate_settings[font_buttons]', + array( + 'default' => $defaults['font_buttons'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_buttons_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_buttons_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[buttons_font_weight]', + array( + 'default' => $defaults['buttons_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[buttons_font_transform]', + array( + 'default' => $defaults['buttons_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_buttons_control', + array( + 'section' => 'font_buttons_section', + 'settings' => array( + 'family' => 'generate_settings[font_buttons]', + 'variant' => 'font_buttons_variants', + 'category' => 'font_buttons_category', + 'weight' => 'generate_settings[buttons_font_weight]', + 'transform' => 'generate_settings[buttons_font_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[buttons_font_size]', + array( + 'default' => $defaults['buttons_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'buttons_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_buttons_section', + 'settings' => array( + 'desktop' => 'generate_settings[buttons_font_size]' + ), + 'choices' => array( + 'desktop' => array( + 'min' => 5, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } + + // Headings section + $wp_customize->add_section( + 'font_content_section', + array( + 'title' => __( 'Headings', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 60, + 'panel' => 'generate_typography_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_headings_typography_shortcuts', + array( + 'section' => 'font_content_section', + 'element' => __( 'Content', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'generate_layout_container', + 'colors' => 'content_color_section', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[font_heading_1]', + array( + 'default' => $defaults['font_heading_1'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_1_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_1_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_1_weight]', + array( + 'default' => $defaults['heading_1_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_1_transform]', + array( + 'default' => $defaults['heading_1_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_heading_1_control', + array( + 'label' => __( 'Heading 1 (H1)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_1]', + 'variant' => 'font_heading_1_variants', + 'category' => 'font_heading_1_category', + 'weight' => 'generate_settings[heading_1_weight]', + 'transform' => 'generate_settings[heading_1_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_1_font_size]', + array( + 'default' => $defaults['heading_1_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[mobile_heading_1_font_size]', + array( + 'default' => $defaults['mobile_heading_1_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'h1_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_1_font_size]', + 'mobile' => 'generate_settings[mobile_heading_1_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 15, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 15, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + if ( isset( $defaults['heading_1_line_height'] ) ) { + // Line height + $wp_customize->add_setting( + 'generate_settings[heading_1_line_height]', + array( + 'default' => $defaults['heading_1_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_1_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_1_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + } + + if ( isset( $defaults['heading_1_margin_bottom'] ) ) { + // Line height + $wp_customize->add_setting( + 'generate_settings[heading_1_margin_bottom]', + array( + 'default' => $defaults['heading_1_margin_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_1_margin_bottom]', + array( + 'description' => __( 'Bottom margin', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_1_margin_bottom]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } + + $wp_customize->add_setting( + 'generate_settings[single_post_title_weight]', + array( + 'default' => $defaults['single_post_title_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[single_post_title_transform]', + array( + 'default' => $defaults['single_post_title_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'single_content_title_control', + array( + 'label' => __( 'Single Content Title (H1)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'weight' => 'generate_settings[single_post_title_weight]', + 'transform' => 'generate_settings[single_post_title_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[single_post_title_font_size]', + array( + 'default' => $defaults['single_post_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[single_post_title_font_size_mobile]', + array( + 'default' => $defaults['single_post_title_font_size_mobile'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'single_post_title_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[single_post_title_font_size]', + 'mobile' => 'generate_settings[single_post_title_font_size_mobile]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 15, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 15, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[single_post_title_line_height]', + array( + 'default' => $defaults['single_post_title_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[single_post_title_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[single_post_title_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + + // H2 + $wp_customize->add_setting( + 'generate_settings[font_heading_2]', + array( + 'default' => $defaults['font_heading_2'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_2_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_2_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_2_weight]', + array( + 'default' => $defaults['heading_2_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_2_transform]', + array( + 'default' => $defaults['heading_2_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_heading_2_control', + array( + 'label' => __( 'Heading 2 (H2)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_2]', + 'variant' => 'font_heading_2_variants', + 'category' => 'font_heading_2_category', + 'weight' => 'generate_settings[heading_2_weight]', + 'transform' => 'generate_settings[heading_2_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_2_font_size]', + array( + 'default' => $defaults['heading_2_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[mobile_heading_2_font_size]', + array( + 'default' => $defaults['mobile_heading_2_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'h2_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_2_font_size]', + 'mobile' => 'generate_settings[mobile_heading_2_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + if ( isset( $defaults['heading_2_line_height'] ) ) { + // Line height + $wp_customize->add_setting( + 'generate_settings[heading_2_line_height]', + array( + 'default' => $defaults['heading_2_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_2_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_2_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + } + + if ( isset( $defaults['heading_2_margin_bottom'] ) ) { + // Line height + $wp_customize->add_setting( + 'generate_settings[heading_2_margin_bottom]', + array( + 'default' => $defaults['heading_2_margin_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_2_margin_bottom]', + array( + 'description' => __( 'Bottom margin', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_2_margin_bottom]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } + + $wp_customize->add_setting( + 'generate_settings[archive_post_title_weight]', + array( + 'default' => $defaults['archive_post_title_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[archive_post_title_transform]', + array( + 'default' => $defaults['archive_post_title_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'archive_content_title_control', + array( + 'label' => __( 'Archive Content Title (H2)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'weight' => 'generate_settings[archive_post_title_weight]', + 'transform' => 'generate_settings[archive_post_title_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[archive_post_title_font_size]', + array( + 'default' => $defaults['archive_post_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[archive_post_title_font_size_mobile]', + array( + 'default' => $defaults['archive_post_title_font_size_mobile'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'archive_post_title_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[archive_post_title_font_size]', + 'mobile' => 'generate_settings[archive_post_title_font_size_mobile]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 15, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 15, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[archive_post_title_line_height]', + array( + 'default' => $defaults['archive_post_title_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[archive_post_title_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[archive_post_title_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + + // H3 + $wp_customize->add_setting( + 'generate_settings[font_heading_3]', + array( + 'default' => $defaults['font_heading_3'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_3_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_3_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_3_weight]', + array( + 'default' => $defaults['heading_3_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_3_transform]', + array( + 'default' => $defaults['heading_3_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_heading_3_control', + array( + 'label' => __( 'Heading 3 (H3)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_3]', + 'variant' => 'font_heading_3_variants', + 'category' => 'font_heading_3_category', + 'weight' => 'generate_settings[heading_3_weight]', + 'transform' => 'generate_settings[heading_3_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_3_font_size]', + array( + 'default' => $defaults['heading_3_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'h3_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_3_font_size]' + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + if ( isset( $defaults['heading_3_line_height'] ) ) { + // Line height + $wp_customize->add_setting( + 'generate_settings[heading_3_line_height]', + array( + 'default' => $defaults['heading_3_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_3_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_3_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + } + + if ( isset( $defaults['heading_3_margin_bottom'] ) ) { + // Line height + $wp_customize->add_setting( + 'generate_settings[heading_3_margin_bottom]', + array( + 'default' => $defaults['heading_3_margin_bottom'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_3_margin_bottom]', + array( + 'description' => __( 'Bottom margin', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_3_margin_bottom]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } + + if ( isset( $defaults['font_heading_4'] ) ) { + // H4 + $wp_customize->add_setting( + 'generate_settings[font_heading_4]', + array( + 'default' => $defaults['font_heading_4'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_4_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_4_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_4_weight]', + array( + 'default' => $defaults['heading_4_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_4_transform]', + array( + 'default' => $defaults['heading_4_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_heading_4_control', + array( + 'label' => __( 'Heading 4 (H4)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_4]', + 'variant' => 'font_heading_4_variants', + 'category' => 'font_heading_4_category', + 'weight' => 'generate_settings[heading_4_weight]', + 'transform' => 'generate_settings[heading_4_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_4_font_size]', + array( + 'default' => $defaults['heading_4_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'h4_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_4_font_size]' + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + // Line height + $wp_customize->add_setting( + 'generate_settings[heading_4_line_height]', + array( + 'default' => $defaults['heading_4_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_4_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_4_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + } + + if ( isset( $defaults['font_heading_5'] ) ) { + // H5 + $wp_customize->add_setting( + 'generate_settings[font_heading_5]', + array( + 'default' => $defaults['font_heading_5'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_5_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_5_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_5_weight]', + array( + 'default' => $defaults['heading_5_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_5_transform]', + array( + 'default' => $defaults['heading_5_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_heading_5_control', + array( + 'label' => __( 'Heading 5 (H5)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_5]', + 'variant' => 'font_heading_5_variants', + 'category' => 'font_heading_5_category', + 'weight' => 'generate_settings[heading_5_weight]', + 'transform' => 'generate_settings[heading_5_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_5_font_size]', + array( + 'default' => $defaults['heading_5_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'h5_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_5_font_size]' + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + // Line height + $wp_customize->add_setting( + 'generate_settings[heading_5_line_height]', + array( + 'default' => $defaults['heading_5_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_5_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_5_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + } + + if ( isset( $defaults['font_heading_6'] ) ) { + // H5 + $wp_customize->add_setting( + 'generate_settings[font_heading_6]', + array( + 'default' => $defaults['font_heading_6'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_6_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_6_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_6_weight]', + array( + 'default' => $defaults['heading_6_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_6_transform]', + array( + 'default' => $defaults['heading_6_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_heading_6_control', + array( + 'label' => __( 'Heading 6 (H6)', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_6]', + 'variant' => 'font_heading_6_variants', + 'category' => 'font_heading_6_category', + 'weight' => 'generate_settings[heading_6_weight]', + 'transform' => 'generate_settings[heading_6_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_6_font_size]', + array( + 'default' => $defaults['heading_6_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'h6_font_sizes', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_6_font_size]' + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + // Line height + $wp_customize->add_setting( + 'generate_settings[heading_6_line_height]', + array( + 'default' => $defaults['heading_6_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_decimal_integer_empty', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_6_line_height]', + array( + 'description' => __( 'Line height', 'gp-premium' ), + 'section' => 'font_content_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_6_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + } + + // Widgets section + $wp_customize->add_section( + 'font_widget_section', + array( + 'title' => __( 'Widgets', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 60, + 'panel' => 'generate_typography_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_widgets_typography_shortcuts', + array( + 'section' => 'font_widget_section', + 'element' => __( 'Widgets', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'generate_layout_sidebars', + 'colors' => 'sidebar_widget_color_section', + 'backgrounds' => 'generate_backgrounds_sidebars', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + // Font family + $wp_customize->add_setting( + 'generate_settings[font_widget_title]', + array( + 'default' => $defaults['font_widget_title'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Category + $wp_customize->add_setting( + 'font_widget_title_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Variants + $wp_customize->add_setting( + 'font_widget_title_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + // Font weight + $wp_customize->add_setting( + 'generate_settings[widget_title_font_weight]', + array( + 'default' => $defaults['widget_title_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + // Text transform + $wp_customize->add_setting( + 'generate_settings[widget_title_font_transform]', + array( + 'default' => $defaults['widget_title_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'google_font_widget_title_control', + array( + 'label' => __( 'Widget Titles', 'gp-premium' ), + 'section' => 'font_widget_section', + 'settings' => array( + 'family' => 'generate_settings[font_widget_title]', + 'variant' => 'font_widget_title_variants', + 'category' => 'font_widget_title_category', + 'weight' => 'generate_settings[widget_title_font_weight]', + 'transform' => 'generate_settings[widget_title_font_transform]', + ), + ) + ) + ); + + // Font size + $wp_customize->add_setting( + 'generate_settings[widget_title_font_size]', + array( + 'default' => $defaults['widget_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[widget_title_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_widget_section', + 'settings' => array( + 'desktop' => 'generate_settings[widget_title_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 30, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + if ( isset( $defaults['widget_title_separator'] ) ) { + $wp_customize->add_setting( + 'generate_settings[widget_title_separator]', + array( + 'default' => $defaults['widget_title_separator'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[widget_title_separator]', + array( + 'description' => __( 'Bottom margin', 'gp-premium' ), + 'section' => 'font_widget_section', + 'settings' => array( + 'desktop' => 'generate_settings[widget_title_separator]' + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } + + // Widget content font size + $wp_customize->add_setting( + 'generate_settings[widget_content_font_size]', + array( + 'default' => $defaults['widget_content_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[widget_content_font_size]', + array( + 'description' => __( 'Content font size', 'gp-premium' ), + 'section' => 'font_widget_section', + 'priority' => 240, + 'settings' => array( + 'desktop' => 'generate_settings[widget_content_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 30, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + // Footer section + $wp_customize->add_section( + 'font_footer_section', + array( + 'title' => __( 'Footer', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 70, + 'panel' => 'generate_typography_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_footer_typography_shortcuts', + array( + 'section' => 'font_footer_section', + 'element' => __( 'Footer', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'generate_layout_footer', + 'colors' => 'footer_color_section', + 'backgrounds' => 'generate_backgrounds_footer', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + if ( isset( $defaults['font_footer'] ) ) { + // H5 + $wp_customize->add_setting( + 'generate_settings[font_footer]', + array( + 'default' => $defaults['font_footer'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_footer_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_footer_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[footer_weight]', + array( + 'default' => $defaults['footer_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[footer_transform]', + array( + 'default' => $defaults['footer_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'font_footer_control', + array( + 'section' => 'font_footer_section', + 'settings' => array( + 'family' => 'generate_settings[font_footer]', + 'variant' => 'font_footer_variants', + 'category' => 'font_footer_category', + 'weight' => 'generate_settings[footer_weight]', + 'transform' => 'generate_settings[footer_transform]', + ), + ) + ) + ); + } + + // Font size + $wp_customize->add_setting( + 'generate_settings[footer_font_size]', + array( + 'default' => $defaults['footer_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[footer_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'font_footer_section', + 'settings' => array( + 'desktop' => 'generate_settings[footer_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 30, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } +} + +if ( ! function_exists( 'generate_enqueue_google_fonts' ) ) { + add_action( 'wp_enqueue_scripts', 'generate_enqueue_google_fonts', 0 ); + /** + * Enqueue Google Fonts. + * + * @since 0.1 + */ + function generate_enqueue_google_fonts() { + // Bail if we don't have our defaults function + if ( ! function_exists( 'generate_get_default_fonts' ) ) { + return; + } + + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_default_fonts() + ); + + // List our non-Google fonts + $not_google = str_replace( ' ', '+', generate_typography_default_fonts() ); + + // Grab our font family settings + $font_settings = array( + 'font_body', + 'font_top_bar', + 'font_site_title', + 'font_site_tagline', + 'font_navigation', + 'font_widget_title', + 'font_buttons', + 'font_heading_1', + 'font_heading_2', + 'font_heading_3', + 'font_heading_4', + 'font_heading_5', + 'font_heading_6', + 'font_footer', + ); + + // Create our Google Fonts array + $google_fonts = array(); + if ( ! empty( $font_settings ) ) { + + foreach ( $font_settings as $key ) { + + // If the key isn't set, move on + if ( ! isset( $generate_settings[$key] ) ) { + continue; + } + + // If our value is still using the old format, fix it + if ( strpos( $generate_settings[$key], ':' ) !== false ) { + $generate_settings[$key] = current( explode( ':', $generate_settings[$key] ) ); + } + + // Replace the spaces in the names with a plus + $value = str_replace( ' ', '+', $generate_settings[$key] ); + + // Grab the variants using the plain name + $variants = generate_get_google_font_variants( $generate_settings[$key], $key, generate_get_default_fonts() ); + + // If we have variants, add them to our value + $value = ! empty( $variants ) ? $value . ':' . $variants : $value; + + // Make sure we don't add the same font twice + if ( ! in_array( $value, $google_fonts ) ) { + $google_fonts[] = $value; + } + + } + + } + + // Ignore any non-Google fonts + $google_fonts = array_diff($google_fonts, $not_google); + + // Separate each different font with a bar + $google_fonts = implode('|', $google_fonts); + + // Apply a filter to the output + $google_fonts = apply_filters( 'generate_typography_google_fonts', $google_fonts ); + + // Get the subset + $subset = apply_filters( 'generate_fonts_subset','' ); + + // Set up our arguments + $font_args = array(); + $font_args[ 'family' ] = $google_fonts; + if ( '' !== $subset ) { + $font_args[ 'subset' ] = urlencode( $subset ); + } + + $display = apply_filters( 'generate_google_font_display', '' ); + + if ( $display ) { + $font_args['display'] = $display; + } + + // Create our URL using the arguments + $fonts_url = add_query_arg( $font_args, '//fonts.googleapis.com/css' ); + + // Enqueue our fonts + if ( $google_fonts ) { + wp_enqueue_style('generate-fonts', $fonts_url, array(), null, 'all' ); + } + } +} + +if ( ! function_exists( 'generate_get_all_google_fonts' ) ) { + /** + * Return an array of all of our Google Fonts + * @since 1.3.0 + */ + function generate_get_all_google_fonts( $amount = 'all' ) { + ob_start(); + include wp_normalize_path( dirname( __FILE__ ) . '/google-fonts.json' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude + $fonts_json = ob_get_clean(); + $google_fonts = json_decode( $fonts_json ); + + // Loop through them and put what we need into our fonts array + $fonts = array(); + foreach ( (array) $google_fonts as $item ) { + + // Grab what we need from our big list + $atts = array( + 'name' => $item->family, + 'category' => $item->category, + 'variants' => $item->variants + ); + + // Create an ID using our font family name + $id = strtolower( str_replace( ' ', '_', $item->family ) ); + + // Add our attributes to our new array + $fonts[ $id ] = $atts; + } + + if ( 'all' !== $amount ) { + $fonts = array_slice( $fonts, 0, $amount ); + } + + // Alphabetize our fonts + if ( apply_filters( 'generate_alphabetize_google_fonts', true ) ) { + asort( $fonts ); + } + + // Filter to allow us to modify the fonts array + return apply_filters( 'generate_google_fonts_array', $fonts ); + } +} + +if ( ! function_exists( 'generate_get_all_google_fonts_ajax' ) ) { + add_action( 'wp_ajax_generate_get_all_google_fonts_ajax', 'generate_get_all_google_fonts_ajax' ); + /** + * Return an array of all of our Google Fonts. + * + * @since 1.3.0 + */ + function generate_get_all_google_fonts_ajax() { + // Bail if the nonce doesn't check out + if ( ! isset( $_POST[ 'gp_customize_nonce' ] ) || ! wp_verify_nonce( $_POST[ 'gp_customize_nonce' ], 'gp_customize_nonce' ) ) { + wp_die(); + } + + // Do another nonce check + check_ajax_referer( 'gp_customize_nonce', 'gp_customize_nonce' ); + + // Bail if user can't edit theme options + if ( ! current_user_can( 'edit_theme_options' ) ) { + wp_die(); + } + + // Get all of our fonts + $fonts = apply_filters( 'generate_typography_customize_list', generate_get_all_google_fonts() ); + + // Send all of our fonts in JSON format + echo wp_json_encode( $fonts ); + + // Exit + die(); + } +} + +if ( ! function_exists( 'generate_get_google_font_variants' ) ) { + /** + * Wrapper function to find variants for chosen Google Fonts + * Example: generate_get_google_font_variation( 'Open Sans' ) + * + * @since 1.3.0 + */ + function generate_get_google_font_variants( $font, $key = '', $default = '' ) { + // Bail if we don't have our defaults function + if ( ! function_exists( 'generate_get_default_fonts' ) ) { + return; + } + + // Don't need variants if we're using a system font + if ( in_array( $font, generate_typography_default_fonts() ) ) { + return; + } + + // Return if we have our variants saved + if ( '' !== $key && get_theme_mod( $key . '_variants' ) ) { + return get_theme_mod( $key . '_variants' ); + } + + // Make sure we have defaults + if ( '' == $default ) { + $default = generate_get_default_fonts(); + } + + // If our default font is selected and the category isn't saved, we already know the category + if ( $default[ $key ] == $font ) { + return $default[ $key . '_variants' ]; + } + + // Grab all of our fonts + // It's a big list, so hopefully we're not even still reading + $fonts = generate_get_all_google_fonts(); + + // Get the ID from our font + $id = strtolower( str_replace( ' ', '_', $font ) ); + + // If the ID doesn't exist within our fonts, we can bail + if ( ! array_key_exists( $id, $fonts ) ) { + return; + } + + // Grab all of the variants associated with our font + $variants = $fonts[$id]['variants']; + + // Loop through them and put them into an array, then turn them into a comma separated list + $output = array(); + if ( $variants ) { + foreach ( $variants as $variant ) { + $output[] = $variant; + } + + return implode(',', apply_filters( 'generate_typography_variants', $output )); + } + } +} + +if ( ! function_exists( 'generate_get_google_font_category' ) ) { + /** + * Wrapper function to find the category for chosen Google Font + * Example: generate_get_google_font_category( 'Open Sans' ) + * + * @since 1.3.0 + */ + function generate_get_google_font_category( $font, $key = '', $default = '' ) { + // Bail if we don't have our defaults function + if ( ! function_exists( 'generate_get_default_fonts' ) ) { + return; + } + + // Don't need a category if we're using a system font + if ( in_array( $font, generate_typography_default_fonts() ) ) { + return; + } + + // Return if we have our variants saved + if ( '' !== $key && get_theme_mod( $key . '_category' ) ) { + return ', ' . get_theme_mod( $key . '_category' ); + } + + // Make sure we have defaults + if ( '' == $default ) { + $default = generate_get_default_fonts(); + } + + // If our default font is selected and the category isn't saved, we already know the category + if ( $default[ $key ] == $font ) { + return ', ' . $default[ $key . '_category' ]; + } + + // Get all of our fonts + // It's a big list, so hopefully we're not even still reading + $fonts = generate_get_all_google_fonts(); + + // Get the ID from our font + $id = strtolower( str_replace( ' ', '_', $font ) ); + + // If the ID doesn't exist within our fonts, we can bail + if ( ! array_key_exists( $id, $fonts ) ) { + return; + } + + // Let's grab our category to go with our font + $category = ! empty( $fonts[$id]['category'] ) ? ', ' . $fonts[$id]['category'] : ''; + + // Return it to be used by our function + return $category; + + } +} + +if ( ! function_exists( 'generate_get_font_family_css' ) ) { + /** + * Wrapper function to create font-family value for CSS. + * + * @since 1.3.0 + */ + function generate_get_font_family_css( $font, $settings, $default ) { + $generate_settings = wp_parse_args( + get_option( $settings, array() ), + $default + ); + + // We don't want to wrap quotes around these values + $no_quotes = array( + 'inherit', + 'Arial, Helvetica, sans-serif', + 'Georgia, Times New Roman, Times, serif', + 'Helvetica', + 'Impact', + 'Segoe UI, Helvetica Neue, Helvetica, sans-serif', + 'Tahoma, Geneva, sans-serif', + 'Trebuchet MS, Helvetica, sans-serif', + 'Verdana, Geneva, sans-serif', + apply_filters( 'generate_typography_system_stack', '-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"' ) + ); + + // Get our font + $font_family = $generate_settings[ $font ]; + + if ( 'System Stack' == $font_family ) { + $font_family = apply_filters( 'generate_typography_system_stack', '-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"' ); + } + + // If our value is still using the old format, fix it + if ( strpos( $font_family, ':' ) !== false ) { + $font_family = current( explode( ':', $font_family ) ); + } + + // Set up our wrapper + if ( in_array( $font_family, $no_quotes ) ) { + $wrapper_start = null; + $wrapper_end = null; + } else { + $wrapper_start = '"'; + $wrapper_end = '"' . generate_get_google_font_category( $font_family, $font, $default ); + } + + // Output the CSS + $output = ( 'inherit' == $font_family ) ? 'inherit' : $wrapper_start . $font_family . $wrapper_end; + return $output; + } +} + +if ( ! function_exists( 'generate_typography_customizer_live_preview' ) ) { + add_action( 'customize_preview_init', 'generate_typography_customizer_live_preview' ); + /** + * Add our live preview JS + */ + function generate_typography_customizer_live_preview() { + wp_enqueue_script( + 'generate-typography-customizer', + trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/customizer.js', + array( 'jquery','customize-preview' ), + GENERATE_FONT_VERSION, + true + ); + + wp_localize_script( 'generate-typography-customizer', 'gp_typography', array( + 'mobile' => generate_premium_get_media_query( 'mobile' ), + 'tablet' => generate_premium_get_media_query( 'tablet' ), + 'desktop' => generate_premium_get_media_query( 'desktop' ), + ) ); + } +} + +if ( ! function_exists( 'generate_typography_default_fonts' ) ) { + /** + * Get our system fonts + */ + function generate_typography_default_fonts() { + $fonts = array( + 'inherit', + 'System Stack', + 'Arial, Helvetica, sans-serif', + 'Century Gothic', + 'Comic Sans MS', + 'Courier New', + 'Georgia, Times New Roman, Times, serif', + 'Helvetica', + 'Impact', + 'Lucida Console', + 'Lucida Sans Unicode', + 'Palatino Linotype', + 'Segoe UI, Helvetica Neue, Helvetica, sans-serif', + 'Tahoma, Geneva, sans-serif', + 'Trebuchet MS, Helvetica, sans-serif', + 'Verdana, Geneva, sans-serif' + ); + + return apply_filters( 'generate_typography_default_fonts', $fonts ); + } +} + +if ( ! function_exists( 'generate_include_typography_defaults' ) ) { + /** + * Check if we should include our default.css file + * @since 1.3.42 + */ + function generate_include_typography_defaults() { + return true; + } +} + +if ( ! function_exists( 'generate_typography_premium_css_defaults' ) ) { + add_filter( 'generate_font_option_defaults', 'generate_typography_premium_css_defaults' ); + /** + * Add premium control defaults + * + * @since 1.3 + */ + function generate_typography_premium_css_defaults( $defaults ) { + $defaults['tablet_site_title_font_size'] = ''; + $defaults['tablet_navigation_font_size'] = ''; + $defaults['mobile_navigation_font_size'] = ''; + + $defaults['single_post_title_weight'] = ''; + $defaults['single_post_title_transform'] = ''; + $defaults['single_post_title_font_size'] = ''; + $defaults['single_post_title_font_size_mobile'] = ''; + $defaults['single_post_title_line_height'] = ''; + + $defaults['archive_post_title_weight'] = ''; + $defaults['archive_post_title_transform'] = ''; + $defaults['archive_post_title_font_size'] = ''; + $defaults['archive_post_title_font_size_mobile'] = ''; + $defaults['archive_post_title_line_height'] = ''; + + return $defaults; + } +} + +if ( ! function_exists( 'generate_typography_premium_css' ) ) { + add_action( 'wp_enqueue_scripts', 'generate_typography_premium_css', 100 ); + /** + * Add premium control CSS + * + * @since 1.3 + */ + function generate_typography_premium_css() { + if ( ! function_exists( 'generate_get_default_fonts' ) ) { + return; + } + + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_default_fonts() + ); + + // Initiate our CSS class + require_once GP_LIBRARY_DIRECTORY . 'class-make-css.php'; + $premium_css = new GeneratePress_Pro_CSS; + + $site_title_family = false; + if ( function_exists( 'generate_get_font_family_css' ) ) { + $site_title_family = generate_get_font_family_css( 'font_site_title', 'generate_settings', generate_get_default_fonts() ); + } + + $premium_css->set_selector( 'h1.entry-title' ); + $premium_css->add_property( 'font-weight', esc_attr( $generate_settings['single_post_title_weight'] ) ); + $premium_css->add_property( 'text-transform', esc_attr( $generate_settings['single_post_title_transform'] ) ); + + if ( '' !== $generate_settings['single_post_title_font_size'] ) { + $premium_css->add_property( 'font-size', absint( $generate_settings['single_post_title_font_size'] ), false, 'px' ); + } + + if ( '' !== $generate_settings['single_post_title_line_height'] ) { + $premium_css->add_property( 'line-height', floatval( $generate_settings['single_post_title_line_height'] ), false, 'em' ); + } + + $premium_css->set_selector( 'h2.entry-title' ); + $premium_css->add_property( 'font-weight', esc_attr( $generate_settings['archive_post_title_weight'] ) ); + $premium_css->add_property( 'text-transform', esc_attr( $generate_settings['archive_post_title_transform'] ) ); + + if ( '' !== $generate_settings['archive_post_title_font_size'] ) { + $premium_css->add_property( 'font-size', absint( $generate_settings['archive_post_title_font_size'] ), false, 'px' ); + } + + if ( '' !== $generate_settings['archive_post_title_line_height'] ) { + $premium_css->add_property( 'line-height', floatval( $generate_settings['archive_post_title_line_height'] ), false, 'em' ); + } + + $premium_css->set_selector( '.navigation-branding .main-title' ); + $premium_css->add_property( 'font-weight', esc_attr( $generate_settings['site_title_font_weight'] ) ); + $premium_css->add_property( 'text-transform', esc_attr( $generate_settings['site_title_font_transform'] ) ); + $premium_css->add_property( 'font-size', absint( $generate_settings['site_title_font_size'] ), false, 'px' ); + + if ( $site_title_family ) { + $premium_css->add_property( 'font-family', 'inherit' !== $generate_settings['font_site_title'] ? $site_title_family : null ); + } + + $premium_css->start_media_query( generate_premium_get_media_query( 'tablet' ) ); + if ( '' !== $generate_settings[ 'tablet_navigation_font_size' ] ) { + $premium_css->set_selector( '.main-navigation:not(.slideout-navigation) a, .menu-toggle' ); + $premium_css->add_property( 'font-size', absint( $generate_settings[ 'tablet_navigation_font_size' ] ), false, 'px' ); + + $tablet_subnav_font_size = $generate_settings['tablet_navigation_font_size'] - 1; + + if ( $generate_settings['tablet_navigation_font_size'] >= 17 ) { + $tablet_subnav_font_size = $generate_settings['tablet_navigation_font_size'] - 3; + } + + $premium_css->set_selector( '.main-navigation:not(.slideout-navigation) .main-nav ul ul li a' ); + $premium_css->add_property( 'font-size', absint( $tablet_subnav_font_size ), false, 'px' ); + } + + if ( '' !== $generate_settings['tablet_site_title_font_size'] ) { + $premium_css->set_selector( '.main-title, .navigation-branding .main-title' ); + $premium_css->add_property( 'font-size', absint( $generate_settings['tablet_site_title_font_size'] ), false, 'px' ); + } + $premium_css->stop_media_query(); + + $premium_css->start_media_query( generate_premium_get_media_query( 'mobile' ) ); + $premium_css->set_selector( 'h1.entry-title' ); + + if ( '' !== $generate_settings['single_post_title_font_size_mobile'] ) { + $premium_css->add_property( 'font-size', absint( $generate_settings['single_post_title_font_size_mobile'] ), false, 'px' ); + } + + $premium_css->set_selector( 'h2.entry-title' ); + + if ( '' !== $generate_settings['archive_post_title_font_size_mobile'] ) { + $premium_css->add_property( 'font-size', absint( $generate_settings['archive_post_title_font_size_mobile'] ), false, 'px' ); + } + $premium_css->stop_media_query(); + + $premium_css->start_media_query( generate_premium_get_media_query( 'mobile-menu' ) ); + if ( '' !== $generate_settings[ 'mobile_navigation_font_size' ] ) { + $premium_css->set_selector( '.main-navigation:not(.slideout-navigation) a, .menu-toggle' ); + $premium_css->add_property( 'font-size', absint( $generate_settings[ 'mobile_navigation_font_size' ] ), false, 'px' ); + + $mobile_subnav_font_size = $generate_settings['mobile_navigation_font_size'] - 1; + + if ( $generate_settings['mobile_navigation_font_size'] >= 17 ) { + $mobile_subnav_font_size = $generate_settings['mobile_navigation_font_size'] - 3; + } + + $premium_css->set_selector( '.main-navigation:not(.slideout-navigation) .main-nav ul ul li a' ); + $premium_css->add_property( 'font-size', absint( $mobile_subnav_font_size ), false, 'px' ); + } + + if ( '' !== $generate_settings['mobile_site_title_font_size'] ) { + $premium_css->set_selector( '.navigation-branding .main-title' ); + $premium_css->add_property( 'font-size', absint( $generate_settings['mobile_site_title_font_size'] ), false, 'px' ); + } + $premium_css->stop_media_query(); + + wp_add_inline_style( 'generate-style', $premium_css->css_output() ); + } +} diff --git a/wp-content/plugins/gp-premium/typography/functions/google-fonts.json b/wp-content/plugins/gp-premium/typography/functions/google-fonts.json new file mode 100644 index 0000000..a574abc --- /dev/null +++ b/wp-content/plugins/gp-premium/typography/functions/google-fonts.json @@ -0,0 +1,6835 @@ +[ + { + "family": "Roboto", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Open Sans", + "category": "sans-serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic" + ] + }, + { + "family": "Lato", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "300", + "300italic", + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Slabo 27px", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Oswald", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Roboto Condensed", + "category": "sans-serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Source Sans Pro", + "category": "sans-serif", + "variants": [ + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Montserrat", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Raleway", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "PT Sans", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Roboto Slab", + "category": "serif", + "variants": [ + "100", + "300", + "regular", + "700" + ] + }, + { + "family": "Merriweather", + "category": "serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Open Sans Condensed", + "category": "sans-serif", + "variants": [ + "300", + "300italic", + "700" + ] + }, + { + "family": "Droid Sans", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Lora", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Ubuntu", + "category": "sans-serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "700", + "700italic" + ] + }, + { + "family": "Droid Serif", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Playfair Display", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Arimo", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Noto Sans", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "PT Serif", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Titillium Web", + "category": "sans-serif", + "variants": [ + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic", + "900" + ] + }, + { + "family": "PT Sans Narrow", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Muli", + "category": "sans-serif", + "variants": [ + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Indie Flower", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Bitter", + "category": "serif", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Poppins", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Inconsolata", + "category": "monospace", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Dosis", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Fjalla One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Oxygen", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "700" + ] + }, + { + "family": "Hind", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Cabin", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Anton", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Arvo", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Noto Serif", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Crimson Text", + "category": "serif", + "variants": [ + "regular", + "italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Lobster", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Yanone Kaffeesatz", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "700" + ] + }, + { + "family": "Nunito", + "category": "sans-serif", + "variants": [ + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Bree Serif", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Catamaran", + "category": "sans-serif", + "variants": [ + "100", + "200", + "300", + "regular", + "500", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Libre Baskerville", + "category": "serif", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Abel", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Josefin Sans", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Fira Sans", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Gloria Hallelujah", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Abril Fatface", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Exo 2", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Merriweather Sans", + "category": "sans-serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "700", + "700italic", + "800", + "800italic" + ] + }, + { + "family": "Pacifico", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Roboto Mono", + "category": "monospace", + "variants": [ + "100", + "100italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "700", + "700italic" + ] + }, + { + "family": "Varela Round", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Asap", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "500", + "500italic", + "700", + "700italic" + ] + }, + { + "family": "Amatic SC", + "category": "handwriting", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Quicksand", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "700" + ] + }, + { + "family": "Karla", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Ubuntu Condensed", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Signika", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "600", + "700" + ] + }, + { + "family": "Alegreya", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Questrial", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Rubik", + "category": "sans-serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Shadows Into Light", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "PT Sans Caption", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Archivo Narrow", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Play", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Cuprum", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Dancing Script", + "category": "handwriting", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Rokkitt", + "category": "serif", + "variants": [ + "100", + "200", + "300", + "regular", + "500", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Work Sans", + "category": "sans-serif", + "variants": [ + "100", + "200", + "300", + "regular", + "500", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Francois One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Vollkorn", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Source Code Pro", + "category": "monospace", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700", + "900" + ] + }, + { + "family": "Exo", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Maven Pro", + "category": "sans-serif", + "variants": [ + "regular", + "500", + "700", + "900" + ] + }, + { + "family": "Architects Daughter", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Orbitron", + "category": "sans-serif", + "variants": [ + "regular", + "500", + "700", + "900" + ] + }, + { + "family": "Pathway Gothic One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Acme", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Ropa Sans", + "category": "sans-serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Patua One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "EB Garamond", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Lobster Two", + "category": "display", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Crete Round", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Cinzel", + "category": "serif", + "variants": [ + "regular", + "700", + "900" + ] + }, + { + "family": "Josefin Slab", + "category": "serif", + "variants": [ + "100", + "100italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Source Serif Pro", + "category": "serif", + "variants": [ + "regular", + "600", + "700" + ] + }, + { + "family": "Alegreya Sans", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Comfortaa", + "category": "display", + "variants": [ + "300", + "regular", + "700" + ] + }, + { + "family": "Russo One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "News Cycle", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "ABeeZee", + "category": "sans-serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Yellowtail", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Noticia Text", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Monda", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Quattrocento Sans", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Hammersmith One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Libre Franklin", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Satisfy", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Pontano Sans", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Righteous", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Poiret One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "BenchNine", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "700" + ] + }, + { + "family": "Arapey", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Kaushan Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Economica", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Kanit", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Old Standard TT", + "category": "serif", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Sanchez", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Courgette", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Quattrocento", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Domine", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Gudea", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Permanent Marker", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Armata", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Cantarell", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Archivo Black", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Istok Web", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Cardo", + "category": "serif", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Playfair Display SC", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Passion One", + "category": "display", + "variants": [ + "regular", + "700", + "900" + ] + }, + { + "family": "Tinos", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Cookie", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Cormorant Garamond", + "category": "serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Philosopher", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Yantramanav", + "category": "sans-serif", + "variants": [ + "100", + "300", + "regular", + "500", + "700", + "900" + ] + }, + { + "family": "Chewy", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Antic Slab", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Handlee", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Teko", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Boogaloo", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Vidaloka", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Audiowide", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Coming Soon", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Alfa Slab One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Cabin Condensed", + "category": "sans-serif", + "variants": [ + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Ruda", + "category": "sans-serif", + "variants": [ + "regular", + "700", + "900" + ] + }, + { + "family": "Ek Mukta", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Changa One", + "category": "display", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Tangerine", + "category": "handwriting", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Great Vibes", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Sintony", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Khand", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Bevan", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Kalam", + "category": "handwriting", + "variants": [ + "300", + "regular", + "700" + ] + }, + { + "family": "Days One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Bangers", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rajdhani", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Droid Sans Mono", + "category": "monospace", + "variants": [ + "regular" + ] + }, + { + "family": "Kreon", + "category": "serif", + "variants": [ + "300", + "regular", + "700" + ] + }, + { + "family": "Rambla", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Shrikhand", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fredoka One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Shadows Into Light Two", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Playball", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Neuton", + "category": "serif", + "variants": [ + "200", + "300", + "regular", + "italic", + "700", + "800" + ] + }, + { + "family": "Copse", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Didact Gothic", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Signika Negative", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "600", + "700" + ] + }, + { + "family": "Amiri", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Gentium Book Basic", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Glegoo", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Oleo Script", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Voltaire", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Actor", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Amaranth", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Paytone One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Volkhov", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Sorts Mill Goudy", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Bad Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Coda", + "category": "display", + "variants": [ + "regular", + "800" + ] + }, + { + "family": "Damion", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Sacramento", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Squada One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rock Salt", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Adamina", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Alice", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Cantata One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Luckiest Guy", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rochester", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Covered By Your Grace", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Heebo", + "category": "sans-serif", + "variants": [ + "100", + "300", + "regular", + "500", + "700", + "800", + "900" + ] + }, + { + "family": "VT323", + "category": "monospace", + "variants": [ + "regular" + ] + }, + { + "family": "Nothing You Could Do", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Patrick Hand", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Gentium Basic", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Nobile", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Rancho", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Marck Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Special Elite", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Julius Sans One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Varela", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "PT Mono", + "category": "monospace", + "variants": [ + "regular" + ] + }, + { + "family": "Alex Brush", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Homemade Apple", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Scada", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Jura", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600" + ] + }, + { + "family": "Antic", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Gochi Hand", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Sarala", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Electrolize", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sigmar One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Candal", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Prata", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Homenaje", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Pinyon Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Unica One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Basic", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Neucha", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Convergence", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Molengo", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Caveat Brush", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Monoton", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Calligraffitti", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Kameron", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Share", + "category": "display", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Alegreya Sans SC", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Enriqueta", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Martel", + "category": "serif", + "variants": [ + "200", + "300", + "regular", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Black Ops One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Just Another Hand", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Caveat", + "category": "handwriting", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "PT Serif Caption", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Ultra", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Ubuntu Mono", + "category": "monospace", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Carme", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Cousine", + "category": "monospace", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Cherry Cream Soda", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Reenie Beanie", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Hind Siliguri", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Bubblegum Sans", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Aldrich", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Lustria", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Alef", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Freckle Face", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fanwood Text", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Advent Pro", + "category": "sans-serif", + "variants": [ + "100", + "200", + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Allura", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Ceviche One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Press Start 2P", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Overlock", + "category": "display", + "variants": [ + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Niconne", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Limelight", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Frank Ruhl Libre", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "700", + "900" + ] + }, + { + "family": "Allerta Stencil", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Marcellus", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Pragati Narrow", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Michroma", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Fauna One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Syncopate", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Telex", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Marvel", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Cabin Sketch", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Hanuman", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Cairo", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "600", + "700", + "900" + ] + }, + { + "family": "Chivo", + "category": "sans-serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Allerta", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Fugaz One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Viga", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Ruslan Display", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Nixie One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Marmelad", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Average", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Spinnaker", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Leckerli One", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Judson", + "category": "serif", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Lusitana", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Montserrat Alternates", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Contrail One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Oranienbaum", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Hind Vadodara", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Rufina", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Quantico", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Concert One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Marcellus SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Jockey One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Parisienne", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Carter One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Arbutus Slab", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Slabo 13px", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Tauri", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Goudy Bookletter 1911", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Carrois Gothic", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sue Ellen Francisco", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Walter Turncoat", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Annie Use Your Telescope", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Puritan", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Grand Hotel", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Yesteryear", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Jaldi", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Khula", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "600", + "700", + "800" + ] + }, + { + "family": "Cinzel Decorative", + "category": "display", + "variants": [ + "regular", + "700", + "900" + ] + }, + { + "family": "Crafty Girls", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Merienda", + "category": "handwriting", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Hind Guntur", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Cutive", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Prompt", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Coustard", + "category": "serif", + "variants": [ + "regular", + "900" + ] + }, + { + "family": "Arima Madurai", + "category": "display", + "variants": [ + "100", + "200", + "300", + "regular", + "500", + "700", + "800", + "900" + ] + }, + { + "family": "Doppio One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Radley", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Fontdiner Swanky", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Iceland", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Alegreya SC", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic", + "900", + "900italic" + ] + }, + { + "family": "Halant", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Schoolbell", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Waiting for the Sunrise", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Italianno", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Fredericka the Great", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Average Sans", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Rosario", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Mr Dafoe", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Port Lligat Slab", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Aclonica", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Graduate", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Racing Sans One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Berkshire Swash", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Forum", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Anonymous Pro", + "category": "monospace", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Love Ya Like A Sister", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Nunito Sans", + "category": "sans-serif", + "variants": [ + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Magra", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Lateef", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Assistant", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "600", + "700", + "800" + ] + }, + { + "family": "Six Caps", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Gilda Display", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Oregano", + "category": "display", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Metrophobic", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Lalezar", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Caudex", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Kelly Slab", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Reem Kufi", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Cambay", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Gruppo", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Give You Glory", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "GFS Didot", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Duru Sans", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Andika", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Tenor Sans", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Knewave", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Averia Serif Libre", + "category": "display", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Eczar", + "category": "serif", + "variants": [ + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Inder", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Martel Sans", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Trocchi", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Wire One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Petit Formal Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Mako", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Frijole", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Zeyada", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Slackey", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Karma", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Mate", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Belleza", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Montez", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Quando", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Capriola", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Lilita One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Trirong", + "category": "serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Lekton", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Just Me Again Down Here", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Bowlby One SC", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "The Girl Next Door", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Happy Monkey", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Merienda One", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Alike", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Chelsea Market", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Unkempt", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Anaheim", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Strait", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Brawler", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Clicker Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Delius", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Mouse Memoirs", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "IM Fell Double Pica", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Crushed", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rammetto One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Prosto One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Kranky", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "IM Fell English", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Aladin", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Mr De Haviland", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "NTR", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Londrina Solid", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Skranji", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Allan", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Baumans", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ovo", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Changa", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Lemon", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Federo", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Herr Von Muellerhoff", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Arizonia", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Bowlby One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Orienta", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Short Stack", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Bungee Inline", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Andada", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Baloo Paaji", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Oxygen Mono", + "category": "monospace", + "variants": [ + "regular" + ] + }, + { + "family": "Yeseva One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "UnifrakturMaguntia", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Bentham", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Londrina Outline", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Pompiere", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Gabriela", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Qwigley", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Square", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Poly", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Sniglet", + "category": "display", + "variants": [ + "regular", + "800" + ] + }, + { + "family": "Patrick Hand SC", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Gravitas One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Khmer", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Shojumaru", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Kurale", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Gafata", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Biryani", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Cambo", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Titan One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Carrois Gothic SC", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "La Belle Aurore", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Holtwood One SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Oleo Script Swash Caps", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Headland One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Cherry Swash", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Belgrano", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Norican", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Mountains of Christmas", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Julee", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Ramabhadra", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Mallanna", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Kristi", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Imprima", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Lily Script One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Chau Philomene One", + "category": "sans-serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Bilbo Swash Caps", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Finger Paint", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Voces", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Itim", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Megrim", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Simonetta", + "category": "display", + "variants": [ + "regular", + "italic", + "900", + "900italic" + ] + }, + { + "family": "Cutive Mono", + "category": "monospace", + "variants": [ + "regular" + ] + }, + { + "family": "Stardos Stencil", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "IM Fell DW Pica", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Unna", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Loved by the King", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Prociono", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Corben", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Amiko", + "category": "sans-serif", + "variants": [ + "regular", + "600", + "700" + ] + }, + { + "family": "Denk One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Palanquin", + "category": "sans-serif", + "variants": [ + "100", + "200", + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Baloo", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fondamento", + "category": "handwriting", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Seaweed Script", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Shanti", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Wendy One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Raleway Dots", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Amethysta", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Vast Shadow", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Stalemate", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Fira Mono", + "category": "monospace", + "variants": [ + "regular", + "500", + "700" + ] + }, + { + "family": "Expletus Sans", + "category": "display", + "variants": [ + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Scheherazade", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Fenix", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Delius Swash Caps", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Rouge Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Life Savers", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "IM Fell English SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Meddon", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Tienne", + "category": "serif", + "variants": [ + "regular", + "700", + "900" + ] + }, + { + "family": "Over the Rainbow", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Share Tech Mono", + "category": "monospace", + "variants": [ + "regular" + ] + }, + { + "family": "Abhaya Libre", + "category": "serif", + "variants": [ + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Kotta One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Pridi", + "category": "serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Euphoria Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Engagement", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Podkova", + "category": "serif", + "variants": [ + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Salsa", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Sofia", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Suranna", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Mada", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "900" + ] + }, + { + "family": "Chonburi", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ledger", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Italiana", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Dawning of a New Day", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Nokora", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Angkor", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Medula One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Taviraj", + "category": "serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Vampiro One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Englebert", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Mono", + "category": "monospace", + "variants": [ + "regular" + ] + }, + { + "family": "Dorsa", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Averia Sans Libre", + "category": "display", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Cedarville Cursive", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Geo", + "category": "sans-serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Rationale", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Balthazar", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sunshiney", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Aguafina Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Mystery Quest", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fjord One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Fira Sans Extra Condensed", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Kadwa", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "McLaren", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rye", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Sail", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Athiti", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Rosarivo", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Kite One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Odor Mean Chey", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Numans", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Artifika", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Poller One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Gurajada", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Inika", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Mandali", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Bungee Shade", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Suwannaphum", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Mate SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Creepster", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Arsenal", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Montserrat Subrayada", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Metamorphous", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Palanquin Dark", + "category": "sans-serif", + "variants": [ + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Coda Caption", + "category": "sans-serif", + "variants": [ + "800" + ] + }, + { + "family": "Dynalight", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Maitree", + "category": "serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "IM Fell French Canon", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Amarante", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Quintessential", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Codystar", + "category": "display", + "variants": [ + "300", + "regular" + ] + }, + { + "family": "Cantora One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Aref Ruqaa", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Griffy", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Revalia", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Buenard", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Donegal One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "IM Fell DW Pica SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Habibi", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Share Tech", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Flamenco", + "category": "display", + "variants": [ + "300", + "regular" + ] + }, + { + "family": "Mitr", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Maiden Orange", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Diplomata SC", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Cormorant", + "category": "serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Delius Unicase", + "category": "handwriting", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Stoke", + "category": "serif", + "variants": [ + "300", + "regular" + ] + }, + { + "family": "Vibur", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Sarpanch", + "category": "sans-serif", + "variants": [ + "regular", + "500", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Baloo Bhaina", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Baloo Tamma", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Averia Libre", + "category": "display", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Esteban", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Battambang", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Bokor", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Wallpoet", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "IM Fell Great Primer", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Tulpen One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Proza Libre", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic" + ] + }, + { + "family": "IM Fell French Canon SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Vesper Libre", + "category": "serif", + "variants": [ + "regular", + "500", + "700", + "900" + ] + }, + { + "family": "Rozha One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sansita", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Kavoon", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Della Respira", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Milonga", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Condiment", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Junge", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "New Rocker", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Chicle", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Mrs Saint Delafield", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "League Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Miniver", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Galindo", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Moul", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Amatica SC", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Stint Ultra Expanded", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Yrsa", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Stint Ultra Condensed", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Suez One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Text Me One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Buda", + "category": "display", + "variants": [ + "300" + ] + }, + { + "family": "Ruluko", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sonsie One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Krona One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Elsie", + "category": "display", + "variants": [ + "regular", + "900" + ] + }, + { + "family": "Pangolin", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Linden Hill", + "category": "serif", + "variants": [ + "regular", + "italic" + ] + }, + { + "family": "Secular One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "IM Fell Double Pica SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Alike Angular", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sancreek", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Bilbo", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Antic Didone", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Paprika", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Asul", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "David Libre", + "category": "serif", + "variants": [ + "regular", + "500", + "700" + ] + }, + { + "family": "Almendra", + "category": "serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Sriracha", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Miriam Libre", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Ribeye", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Swanky and Moo Moo", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Trade Winds", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Overlock SC", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Round", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Cagliostro", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Glass Antiqua", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Offside", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "El Messiri", + "category": "sans-serif", + "variants": [ + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Bigshot One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "IM Fell Great Primer SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Akronim", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fira Sans Condensed", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Nosifer", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Autour One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Pirata One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Port Lligat Sans", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Scope One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sumana", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Lemonada", + "category": "display", + "variants": [ + "300", + "regular", + "600", + "700" + ] + }, + { + "family": "Montaga", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Iceberg", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ruthie", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Content", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Henny Penny", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Slim", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Hind Madurai", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Harmattan", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "UnifrakturCook", + "category": "display", + "variants": [ + "700" + ] + }, + { + "family": "Sarina", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Bubbler One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Dekko", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Redressed", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Laila", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Faster One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Arya", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Peralta", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Meie Script", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Overpass", + "category": "sans-serif", + "variants": [ + "100", + "100italic", + "200", + "200italic", + "300", + "300italic", + "regular", + "italic", + "600", + "600italic", + "700", + "700italic", + "800", + "800italic", + "900", + "900italic" + ] + }, + { + "family": "Monsieur La Doulaise", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Bungee", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Snippet", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Emilys Candy", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Trykker", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "MedievalSharp", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Space Mono", + "category": "monospace", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Croissant One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Monofett", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Lovers Quarrel", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Oldenburg", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Galdeano", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Spicy Rice", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Wellfleet", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Germania One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "GFS Neohellenic", + "category": "sans-serif", + "variants": [ + "regular", + "italic", + "700", + "700italic" + ] + }, + { + "family": "Baloo Thambi", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Jolly Lodger", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rubik Mono One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Pattaya", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Joti One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Siemreap", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ranga", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Chango", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Miltonian Tattoo", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Koulen", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Eagle Lake", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Flat", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Petrona", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Jacques Francois", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Amita", + "category": "handwriting", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Plaster", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ramaraja", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Sura", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Kenia", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fresca", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Jomhuria", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Lancelot", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Pavanam", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Rum Raisin", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Almendra SC", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Purple Purse", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Kumar One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Modern Antiqua", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Piedra", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Irish Grover", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Molle", + "category": "handwriting", + "variants": [ + "italic" + ] + }, + { + "family": "Cormorant Infant", + "category": "serif", + "variants": [ + "300", + "300italic", + "regular", + "italic", + "500", + "500italic", + "600", + "600italic", + "700", + "700italic" + ] + }, + { + "family": "Margarine", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Sahitya", + "category": "serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Mukta Vaani", + "category": "sans-serif", + "variants": [ + "200", + "300", + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Astloch", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Snowburst One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rhodium Libre", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Smythe", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Asset", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ewert", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Keania One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ranchers", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Gorditas", + "category": "display", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Sirin Stencil", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Averia Gruesa Libre", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Trochut", + "category": "display", + "variants": [ + "regular", + "italic", + "700" + ] + }, + { + "family": "Baloo Chettan", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Kdam Thmor", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Timmana", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Original Surfer", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Supermercado One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Mirza", + "category": "display", + "variants": [ + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Passero One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Oval", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Caesar Dressing", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Taprom", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fascinate", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Seymour One", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Freehand", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ravi Prakash", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Coiny", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Atomic Age", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Jacques Francois Shadow", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Diplomata", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Dr Sugiyama", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Miltonian", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ribeye Marrow", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Elsie Swash Caps", + "category": "display", + "variants": [ + "regular", + "900" + ] + }, + { + "family": "Felipa", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Galada", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Script", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Bayon", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Underdog", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Devonshire", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Atma", + "category": "display", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Londrina Shadow", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Sofadi One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Tillana", + "category": "handwriting", + "variants": [ + "regular", + "500", + "600", + "700", + "800" + ] + }, + { + "family": "Inknut Antiqua", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700", + "800", + "900" + ] + }, + { + "family": "Goblin One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rakkas", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Metal", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Farsan", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Londrina Sketch", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Nova Cut", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "BioRhyme", + "category": "serif", + "variants": [ + "200", + "300", + "regular", + "700", + "800" + ] + }, + { + "family": "Warnes", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Romanesco", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Fascinate Inline", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Mrs Sheppards", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Princess Sofia", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Modak", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Spirax", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Cormorant Upright", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Geostar Fill", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Cormorant SC", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Baloo Bhai", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Sree Krushnadevaraya", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Smokum", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Arbutus", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fruktur", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Geostar", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Marko One", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Erica One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Yatra One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Uncial Antiqua", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Combo", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Gidugu", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Aubrey", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Jim Nightshade", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Butterfly Kids", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Metal Mania", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Macondo", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Chenla", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Miss Fajardose", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Macondo Swash Caps", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Barrio", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Sevillana", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Bigelow Rules", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Rasa", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Risque", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Federant", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Dangrek", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Chathura", + "category": "sans-serif", + "variants": [ + "100", + "300", + "regular", + "700", + "800" + ] + }, + { + "family": "Almendra Display", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Chela One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Bonbon", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Stalinist One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Mr Bedfort", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Eater", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Fasthand", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Mogra", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Padauk", + "category": "sans-serif", + "variants": [ + "regular", + "700" + ] + }, + { + "family": "Preahvihear", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Flavors", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Ruge Boogie", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Tenali Ramakrishna", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Unlock", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Butcherman", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Baloo Da", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Lakki Reddy", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Cormorant Unicase", + "category": "serif", + "variants": [ + "300", + "regular", + "500", + "600", + "700" + ] + }, + { + "family": "Katibeh", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Asar", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Emblema One", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Moulpali", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Meera Inimai", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Kantumruy", + "category": "sans-serif", + "variants": [ + "300", + "regular", + "700" + ] + }, + { + "family": "Suravaram", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Bungee Hairline", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Overpass Mono", + "category": "monospace", + "variants": [ + "300", + "regular", + "600", + "700" + ] + }, + { + "family": "Peddana", + "category": "serif", + "variants": [ + "regular" + ] + }, + { + "family": "Bahiana", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Kumar One Outline", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Hanalei Fill", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Dhurjati", + "category": "sans-serif", + "variants": [ + "regular" + ] + }, + { + "family": "Hanalei", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "Kavivanar", + "category": "handwriting", + "variants": [ + "regular" + ] + }, + { + "family": "Bungee Outline", + "category": "display", + "variants": [ + "regular" + ] + }, + { + "family": "BioRhyme Expanded", + "category": "serif", + "variants": [ + "200", + "300", + "regular", + "700", + "800" + ] + } +] diff --git a/wp-content/plugins/gp-premium/typography/functions/js/customizer.js b/wp-content/plugins/gp-premium/typography/functions/js/customizer.js new file mode 100644 index 0000000..a396822 --- /dev/null +++ b/wp-content/plugins/gp-premium/typography/functions/js/customizer.js @@ -0,0 +1,247 @@ +function gp_premium_typography_live_update( id, selector, property, unit, media, settings ) { + settings = typeof settings !== 'undefined' ? settings : 'generate_settings'; + wp.customize( settings + '[' + id + ']', function( value ) { + value.bind( function( newval ) { + // Get our unit if applicable + unit = typeof unit !== 'undefined' ? unit : ''; + + var isTablet = ( 'tablet' == id.substring( 0, 6 ) ) ? true : false, + isMobile = ( 'mobile' == id.substring( 0, 6 ) ) ? true : false; + + if ( isTablet ) { + if ( '' == wp.customize(settings + '[' + id + ']').get() ) { + var desktopID = id.replace( 'tablet_', '' ); + newval = wp.customize(settings + '[' + desktopID + ']').get(); + } + } + + if ( isMobile ) { + if ( '' == wp.customize(settings + '[' + id + ']').get() ) { + var desktopID = id.replace( 'mobile_', '' ); + newval = wp.customize(settings + '[' + desktopID + ']').get(); + } + } + + if ( 'buttons_font_size' == id && '' == wp.customize('generate_settings[buttons_font_size]').get() ) { + newval = wp.customize('generate_settings[body_font_size]').get(); + } + + if ( 'single_post_title_weight' == id && '' == wp.customize('generate_settings[single_post_title_weight]').get() ) { + newval = wp.customize('generate_settings[heading_1_weight]').get(); + } + + if ( 'single_post_title_transform' == id && '' == wp.customize('generate_settings[single_post_title_transform]').get() ) { + newval = wp.customize('generate_settings[heading_1_transform]').get(); + } + + if ( 'archive_post_title_weight' == id && '' == wp.customize('generate_settings[archive_post_title_weight]').get() ) { + newval = wp.customize('generate_settings[heading_2_weight]').get(); + } + + if ( 'archive_post_title_transform' == id && '' == wp.customize('generate_settings[archive_post_title_transform]').get() ) { + newval = wp.customize('generate_settings[heading_2_transform]').get(); + } + + // We're using a desktop value + if ( ! isTablet && ! isMobile ) { + + var tabletValue = ( typeof wp.customize(settings + '[tablet_' + id + ']') !== 'undefined' ) ? wp.customize(settings + '[tablet_' + id + ']').get() : '', + mobileValue = ( typeof wp.customize(settings + '[mobile_' + id + ']') !== 'undefined' ) ? wp.customize(settings + '[mobile_' + id + ']').get() : ''; + + // The tablet setting exists, mobile doesn't + if ( '' !== tabletValue && '' == mobileValue ) { + media = gp_typography.desktop + ', ' + gp_typography.mobile; + } + + // The tablet setting doesn't exist, mobile does + if ( '' == tabletValue && '' !== mobileValue ) { + media = gp_typography.desktop + ', ' + gp_typography.tablet; + } + + // The tablet setting doesn't exist, neither does mobile + if ( '' == tabletValue && '' == mobileValue ) { + media = gp_typography.desktop + ', ' + gp_typography.tablet + ', ' + gp_typography.mobile; + } + + } + + // Check if media query + media_query = typeof media !== 'undefined' ? 'media="' + media + '"' : ''; + + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#' + id ).not( ':last' ).remove(); + }, 1000); + + setTimeout("jQuery('body').trigger('generate_spacing_updated');", 1000); + } ); + } ); +} + +/** + * Body font size, weight and transform + */ +gp_premium_typography_live_update( 'body_font_size', 'body, button, input, select, textarea', 'font-size', 'px' ); +gp_premium_typography_live_update( 'body_line_height', 'body', 'line-height', '' ); +gp_premium_typography_live_update( 'paragraph_margin', 'p, .entry-content > [class*="wp-block-"]:not(:last-child)', 'margin-bottom', 'em' ); +gp_premium_typography_live_update( 'body_font_weight', 'body, button, input, select, textarea', 'font-weight' ); +gp_premium_typography_live_update( 'body_font_transform', 'body, button, input, select, textarea', 'text-transform' ); + +/** + * Top bar font size, weight and transform + */ +gp_premium_typography_live_update( 'top_bar_font_size', '.top-bar', 'font-size', 'px' ); +gp_premium_typography_live_update( 'top_bar_font_weight', '.top-bar', 'font-weight' ); +gp_premium_typography_live_update( 'top_bar_font_transform', '.top-bar', 'text-transform' ); + +/** + * Site title font size, weight and transform + */ +gp_premium_typography_live_update( 'site_title_font_size', '.main-title, .navigation-branding .main-title', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'tablet_site_title_font_size', '.main-title, .navigation-branding .main-title', 'font-size', 'px', gp_typography.tablet ); +gp_premium_typography_live_update( 'mobile_site_title_font_size', '.main-title, .navigation-branding .main-title', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'site_title_font_weight', '.main-title, .navigation-branding .main-title', 'font-weight' ); +gp_premium_typography_live_update( 'site_title_font_transform', '.main-title, .navigation-branding .main-title', 'text-transform' ); + +/** + * Site description font size, weight and transform + */ +gp_premium_typography_live_update( 'site_tagline_font_size', '.site-description', 'font-size', 'px' ); +gp_premium_typography_live_update( 'site_tagline_font_weight', '.site-description', 'font-weight' ); +gp_premium_typography_live_update( 'site_tagline_font_transform', '.site-description', 'text-transform' ); + +/** + * Main navigation font size, weight and transform + */ +gp_premium_typography_live_update( 'navigation_font_size', '.main-navigation a, .menu-toggle', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'tablet_navigation_font_size', '.main-navigation a, .menu-toggle', 'font-size', 'px', gp_typography.tablet ); +gp_premium_typography_live_update( 'mobile_navigation_font_size', '.main-navigation:not(.slideout-navigation) a, .menu-toggle', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'navigation_font_weight', '.main-navigation a, .menu-toggle', 'font-weight' ); +gp_premium_typography_live_update( 'navigation_font_transform', '.main-navigation a, .menu-toggle', 'text-transform' ); + +/** + * Site title when in navigation. + */ + gp_premium_typography_live_update( 'navigation_site_title_font_size', '.navigation-branding .main-title', 'font-size', 'px', gp_typography.desktop ); + gp_premium_typography_live_update( 'tablet_navigation_site_title_font_size', '.navigation-branding .main-title', 'font-size', 'px', gp_typography.tablet ); + gp_premium_typography_live_update( 'mobile_navigation_site_title_font_size', '.navigation-branding .main-title', 'font-size', 'px', gp_typography.mobile ); + +/** + * Secondary navigation font size, weight and transform + */ +gp_premium_typography_live_update( 'secondary_navigation_font_size', '.secondary-navigation .main-nav ul li a,.secondary-navigation .menu-toggle, .secondary-navigation .top-bar', 'font-size', 'px', '', 'generate_secondary_nav_settings' ); +gp_premium_typography_live_update( 'secondary_navigation_font_weight', '.secondary-navigation .main-nav ul li a,.secondary-navigation .menu-toggle, .secondary-navigation .top-bar', 'font-weight', '', '', 'generate_secondary_nav_settings' ); +gp_premium_typography_live_update( 'secondary_navigation_font_transform', '.secondary-navigation .main-nav ul li a,.secondary-navigation .menu-toggle, .secondary-navigation .top-bar', 'text-transform', '', '', 'generate_secondary_nav_settings' ); + +/** + * Buttons + */ +gp_premium_typography_live_update( 'buttons_font_size', 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.button:visited,.wp-block-button .wp-block-button__link,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button', 'font-size', 'px' ); +gp_premium_typography_live_update( 'buttons_font_weight', 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.button:visited,.wp-block-button .wp-block-button__link,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button', 'font-weight' ); +gp_premium_typography_live_update( 'buttons_font_transform', 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.button:visited,.wp-block-button .wp-block-button__link,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button', 'text-transform' ); + +/** + * H1 font size, weight and transform + */ +gp_premium_typography_live_update( 'heading_1_font_size', 'h1', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'mobile_heading_1_font_size', 'h1', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'heading_1_weight', 'h1', 'font-weight' ); +gp_premium_typography_live_update( 'heading_1_transform', 'h1', 'text-transform' ); +gp_premium_typography_live_update( 'heading_1_line_height', 'h1', 'line-height', 'em' ); +gp_premium_typography_live_update( 'heading_1_margin_bottom', 'h1', 'margin-bottom', 'px' ); + +/** + * Single content title (h1) + */ +gp_premium_typography_live_update( 'single_post_title_font_size', 'h1.entry-title', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'single_post_title_font_size_mobile', 'h1.entry-title', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'single_post_title_weight', 'h1.entry-title', 'font-weight' ); +gp_premium_typography_live_update( 'single_post_title_transform', 'h1.entry-title', 'text-transform' ); +gp_premium_typography_live_update( 'single_post_title_line_height', 'h1.entry-title', 'line-height', 'em' ); + +/** + * H2 font size, weight and transform + */ +gp_premium_typography_live_update( 'heading_2_font_size', 'h2', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'mobile_heading_2_font_size', 'h2', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'heading_2_weight', 'h2', 'font-weight' ); +gp_premium_typography_live_update( 'heading_2_transform', 'h2', 'text-transform' ); +gp_premium_typography_live_update( 'heading_2_line_height', 'h2', 'line-height', 'em' ); +gp_premium_typography_live_update( 'heading_2_margin_bottom', 'h2', 'margin-bottom', 'px' ); + +/** + * Archive post title (h1) + */ +gp_premium_typography_live_update( 'archive_post_title_font_size', 'h2.entry-title', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'archive_post_title_font_size_mobile', 'h2.entry-title', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'archive_post_title_weight', 'h2.entry-title', 'font-weight' ); +gp_premium_typography_live_update( 'archive_post_title_transform', 'h2.entry-title', 'text-transform' ); +gp_premium_typography_live_update( 'archive_post_title_line_height', 'h2.entry-title', 'line-height', 'em' ); + +/** + * H3 font size, weight and transform + */ +gp_premium_typography_live_update( 'heading_3_font_size', 'h3', 'font-size', 'px' ); +gp_premium_typography_live_update( 'heading_3_weight', 'h3', 'font-weight' ); +gp_premium_typography_live_update( 'heading_3_transform', 'h3', 'text-transform' ); +gp_premium_typography_live_update( 'heading_3_line_height', 'h3', 'line-height', 'em' ); +gp_premium_typography_live_update( 'heading_3_margin_bottom', 'h3', 'margin-bottom', 'px' ); + +/** + * H4 font size, weight and transform + */ +gp_premium_typography_live_update( 'heading_4_font_size', 'h4', 'font-size', 'px' ); +gp_premium_typography_live_update( 'heading_4_weight', 'h4', 'font-weight' ); +gp_premium_typography_live_update( 'heading_4_transform', 'h4', 'text-transform' ); +gp_premium_typography_live_update( 'heading_4_line_height', 'h4', 'line-height', 'em' ); + +/** + * H5 font size, weight and transform + */ +gp_premium_typography_live_update( 'heading_5_font_size', 'h5', 'font-size', 'px' ); +gp_premium_typography_live_update( 'heading_5_weight', 'h5', 'font-weight' ); +gp_premium_typography_live_update( 'heading_5_transform', 'h5', 'text-transform' ); +gp_premium_typography_live_update( 'heading_5_line_height', 'h5', 'line-height', 'em' ); + +/** + * H6 font size, weight and transform + */ +gp_premium_typography_live_update( 'heading_6_font_size', 'h6', 'font-size', 'px' ); +gp_premium_typography_live_update( 'heading_6_weight', 'h6', 'font-weight' ); +gp_premium_typography_live_update( 'heading_6_transform', 'h6', 'text-transform' ); +gp_premium_typography_live_update( 'heading_6_line_height', 'h6', 'line-height', 'em' ); + +/** + * Widget title font size, weight and transform + */ +gp_premium_typography_live_update( 'widget_title_font_size', '.widget-title', 'font-size', 'px' ); +gp_premium_typography_live_update( 'widget_title_font_weight', '.widget-title', 'font-weight' ); +gp_premium_typography_live_update( 'widget_title_font_transform', '.widget-title', 'text-transform' ); +gp_premium_typography_live_update( 'widget_title_separator', '.widget-title', 'margin-bottom', 'px' ); +gp_premium_typography_live_update( 'widget_content_font_size', '.sidebar .widget, .footer-widgets .widget', 'font-size', 'px' ); + +/** + * Footer font size, weight and transform + */ +gp_premium_typography_live_update( 'footer_font_size', '.site-info', 'font-size', 'px' ); +gp_premium_typography_live_update( 'footer_weight', '.site-info', 'font-weight' ); +gp_premium_typography_live_update( 'footer_transform', '.site-info', 'text-transform' ); +gp_premium_typography_live_update( 'footer_line_height', '.site-info', 'line-height', 'em' ); + +/** + * WooCommerce product title + */ +gp_premium_typography_live_update( 'wc_product_title_font_size', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'mobile_wc_product_title_font_size', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'wc_product_title_font_weight', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title', 'font-weight' ); +gp_premium_typography_live_update( 'wc_product_title_font_transform', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title', 'text-transform' ); + +gp_premium_typography_live_update( 'wc_related_product_title_font_size', '.woocommerce .up-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .cross-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .related ul.products li.product .woocommerce-LoopProduct-link h2', 'font-size', 'px' ); + +/** + * Slideout navigation font size, weight and transform + */ +gp_premium_typography_live_update( 'slideout_font_size', '.slideout-navigation.main-navigation .main-nav ul li a', 'font-size', 'px', gp_typography.desktop ); +gp_premium_typography_live_update( 'slideout_mobile_font_size', '.slideout-navigation.main-navigation .main-nav ul li a', 'font-size', 'px', gp_typography.mobile ); +gp_premium_typography_live_update( 'slideout_font_weight', '.slideout-navigation.main-navigation .main-nav ul li a', 'font-weight' ); +gp_premium_typography_live_update( 'slideout_font_transform', '.slideout-navigation.main-navigation .main-nav ul li a', 'text-transform' ); diff --git a/wp-content/plugins/gp-premium/typography/functions/migration.php b/wp-content/plugins/gp-premium/typography/functions/migration.php new file mode 100644 index 0000000..7ec3176 --- /dev/null +++ b/wp-content/plugins/gp-premium/typography/functions/migration.php @@ -0,0 +1,360 @@ + $generate_settings[ $setting ], + 'variants' => $variants, + 'category' => $category ? $category : 'sans-serif', + ); + } + + if ( function_exists( 'generate_secondary_nav_get_defaults' ) ) { + $secondary_nav_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + $secondary_nav_id = strtolower( str_replace( ' ', '_', $secondary_nav_settings[ 'font_secondary_navigation' ] ) ); + + if ( ! array_key_exists( $secondary_nav_id, $select_fonts ) && ! in_array( $secondary_nav_settings[ 'font_secondary_navigation' ], generate_typography_default_fonts() ) ) { + $variants = get_theme_mod( 'font_secondary_navigation_variants', array() ); + $category = get_theme_mod( 'font_secondary_navigation_category' ); + + if ( ! empty( $variants ) && ! is_array( $variants ) ) { + $variants = explode( ',', $variants ); + } + + if ( ! $variants ) { + if ( ! $all_fonts ) { + $all_fonts = generate_get_all_google_fonts(); + } + + if ( array_key_exists( $secondary_nav_id, $all_fonts ) ) { + $variants = $all_fonts[ $secondary_nav_id ]['variants']; + } + } + + if ( ! $category ) { + if ( ! $all_fonts ) { + $all_fonts = generate_get_all_google_fonts(); + } + + if ( array_key_exists( $secondary_nav_id, $all_fonts ) ) { + $category = $all_fonts[ $secondary_nav_id ]['category']; + } + } + + $fonts[ $secondary_nav_id ] = array( + 'name' => $secondary_nav_settings[ 'font_secondary_navigation' ], + 'variants' => $variants, + 'category' => $category ? $category : 'sans-serif', + ); + } + } + + return $fonts; + } +} + +if ( ! function_exists( 'generate_typography_set_font_data' ) ) { + add_action( 'admin_init', 'generate_typography_set_font_data' ); + /** + * This function will check to see if your category and variants are saved + * If not, it will set them for you, and won't run again + * + * @since 1.2.90 + */ + function generate_typography_set_font_data() { + // Bail if we don't have our defaults + if ( ! function_exists( 'generate_get_default_fonts' ) ) { + return; + } + + // Get our defaults + $defaults = generate_get_default_fonts(); + + // Get our settings + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_default_fonts() + ); + + // We need to loop through these settings + $font_settings = array( + 'font_body', + 'font_site_title', + 'font_site_tagline', + 'font_navigation', + 'font_widget_title', + 'font_heading_1', + 'font_heading_2', + 'font_heading_3' + ); + + // Add secondary navigation to the array last if it exists + if ( function_exists( 'generate_secondary_nav_get_defaults' ) ) { + $font_settings[ 'font_secondary_navigation' ] = 'font_secondary_navigation'; + } + + // Start looping + foreach( $font_settings as $setting ) { + + // Change our variables for the secondary navigation - this will run last + if ( function_exists( 'generate_secondary_nav_get_defaults' ) && 'font_secondary_navigation' == $setting ) { + $generate_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + $defaults = generate_secondary_nav_get_defaults(); + } + + // We don't need to do this if we're using the default font, as these values have defaults already + if ( $defaults[ $setting ] == $generate_settings[ $setting ] ) { + continue; + } + + // Don't need to continue if we're using a system font or our default font + if ( in_array( $generate_settings[ $setting ], generate_typography_default_fonts() ) || 'Open Sans' == $generate_settings[ $setting ] ) { + continue; + } + + // Don't continue if our category and variants are already set + if ( get_theme_mod( $setting . '_category' ) && get_theme_mod( $setting . '_variants' ) ) { + continue; + } + + // Get all of our fonts + $fonts = generate_get_all_google_fonts(); + + // Get the ID from our font + $id = strtolower( str_replace( ' ', '_', $generate_settings[ $setting ] ) ); + + // If the ID doesn't exist within our fonts, we can bail + if ( ! array_key_exists( $id, $fonts ) ) { + continue; + } + + // Let's grab our category to go with our font + $category = ! empty( $fonts[$id]['category'] ) ? $fonts[$id]['category'] : ''; + + // Grab all of the variants associated with our font + $variants = $fonts[$id]['variants']; + + // Loop through our variants and put them into an array, then turn them into a comma separated list + $output = array(); + if ( $variants ) { + foreach ( $variants as $variant ) { + $output[] = $variant; + } + + $variants = implode( ',', $output ); + } + + // Set our theme mods with our new settings + if ( '' !== $category ) { + set_theme_mod( $setting . '_category', $category ); + } + + if ( '' !== $variants ) { + set_theme_mod( $setting . '_variants', $variants ); + } + } + } +} diff --git a/wp-content/plugins/gp-premium/typography/functions/secondary-nav-fonts.php b/wp-content/plugins/gp-premium/typography/functions/secondary-nav-fonts.php new file mode 100644 index 0000000..7f18693 --- /dev/null +++ b/wp-content/plugins/gp-premium/typography/functions/secondary-nav-fonts.php @@ -0,0 +1,177 @@ +get_section( 'secondary_nav_section' ) ) { + return; + } + + // Get our controls + require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php'; + + // Get our defaults + $defaults = generate_secondary_nav_get_defaults(); + + // Register our custom controls + if ( method_exists( $wp_customize,'register_control_type' ) ) { + $wp_customize->register_control_type( 'GeneratePress_Pro_Typography_Customize_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); + } + + // Add our section + $wp_customize->add_section( + 'secondary_font_section', + array( + 'title' => __( 'Secondary Navigation', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'description' => '', + 'priority' => 51, + 'panel' => 'generate_typography_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_secondary_navigation_typography_shortcuts', + array( + 'section' => 'secondary_font_section', + 'element' => __( 'Secondary Navigation', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'secondary_nav_section', + 'colors' => 'secondary_navigation_color_section', + 'backgrounds' => 'secondary_bg_images_section', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + // Font family + $wp_customize->add_setting( + 'generate_secondary_nav_settings[font_secondary_navigation]', + array( + 'default' => $defaults['font_secondary_navigation'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Category + $wp_customize->add_setting( + 'font_secondary_navigation_category', + array( + 'default' => $defaults['font_secondary_navigation_category'], + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + // Variants + $wp_customize->add_setting( + 'font_secondary_navigation_variants', + array( + 'default' => $defaults['font_secondary_navigation_variants'], + 'sanitize_callback' => 'generate_premium_sanitize_variants' + ) + ); + + // Font weight + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_navigation_font_weight]', + array( + 'default' => $defaults['secondary_navigation_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + // Font transform + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_navigation_font_transform]', + array( + 'default' => $defaults['secondary_navigation_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'google_font_site_secondary_navigation_control', + array( + 'section' => 'secondary_font_section', + 'settings' => array( + 'family' => 'generate_secondary_nav_settings[font_secondary_navigation]', + 'variant' => 'font_secondary_navigation_variants', + 'category' => 'font_secondary_navigation_category', + 'weight' => 'generate_secondary_nav_settings[secondary_navigation_font_weight]', + 'transform' => 'generate_secondary_nav_settings[secondary_navigation_font_transform]', + ), + ) + ) + ); + + // Font size + $wp_customize->add_setting( + 'generate_secondary_nav_settings[secondary_navigation_font_size]', + array( + 'default' => $defaults['secondary_navigation_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_secondary_nav_settings[secondary_navigation_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'secondary_font_section', + 'priority' => 165, + 'settings' => array( + 'desktop' => 'generate_secondary_nav_settings[secondary_navigation_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 30, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } +} diff --git a/wp-content/plugins/gp-premium/typography/functions/slideout-nav-fonts.php b/wp-content/plugins/gp-premium/typography/functions/slideout-nav-fonts.php new file mode 100644 index 0000000..6de9607 --- /dev/null +++ b/wp-content/plugins/gp-premium/typography/functions/slideout-nav-fonts.php @@ -0,0 +1,150 @@ +register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Pro_Typography_Customize_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); + } + + // Bail if Menu Plus isn't activated + if ( ! $wp_customize->get_section( 'menu_plus_slideout_menu' ) ) { + return; + } + + $wp_customize->add_section( + 'generate_slideout_typography', + array( + 'title' => __( 'Off Canvas Panel', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 52, + 'panel' => 'generate_typography_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_off_canvas_panel_typography_shortcuts', + array( + 'section' => 'generate_slideout_typography', + 'element' => esc_html__( 'Off Canvas Panel', 'gp-premium' ), + 'shortcuts' => array( + 'colors' => 'slideout_color_section', + 'layout' => 'menu_plus_slideout_menu', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 1, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[slideout_font_weight]', + array( + 'default' => $defaults['slideout_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + // Text transform + $wp_customize->add_setting( + 'generate_settings[slideout_font_transform]', + array( + 'default' => $defaults['slideout_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'slideout_navigation_typography', + array( + 'label' => esc_html__( 'Menu Items', 'gp-premium' ), + 'section' => 'generate_slideout_typography', + 'settings' => array( + 'weight' => 'generate_settings[slideout_font_weight]', + 'transform' => 'generate_settings[slideout_font_transform]', + ), + ) + ) + ); + + // Font size + $wp_customize->add_setting( + 'generate_settings[slideout_font_size]', + array( + 'default' => $defaults['slideout_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[slideout_mobile_font_size]', + array( + 'default' => $defaults['slideout_mobile_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[slideout_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'generate_slideout_typography', + 'settings' => array( + 'desktop' => 'generate_settings[slideout_font_size]', + 'mobile' => 'generate_settings[slideout_mobile_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); +} diff --git a/wp-content/plugins/gp-premium/typography/functions/woocommerce-fonts.php b/wp-content/plugins/gp-premium/typography/functions/woocommerce-fonts.php new file mode 100644 index 0000000..e4f9659 --- /dev/null +++ b/wp-content/plugins/gp-premium/typography/functions/woocommerce-fonts.php @@ -0,0 +1,180 @@ +register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Pro_Typography_Customize_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); + } + + // Bail if WooCommerce isn't activated + if ( ! $wp_customize->get_section( 'generate_woocommerce_typography' ) ) { + return; + } + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_woocommerce_typography_shortcuts', + array( + 'section' => 'generate_woocommerce_typography', + 'element' => __( 'WooCommerce', 'gp-premium' ), + 'shortcuts' => array( + 'layout' => 'generate_woocommerce_layout', + 'colors' => 'generate_woocommerce_colors', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 0, + ) + ) + ); + + // WooCommerce + $wp_customize->add_setting( + 'generate_settings[wc_product_title_font_weight]', + array( + 'default' => $defaults['wc_product_title_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + // Text transform + $wp_customize->add_setting( + 'generate_settings[wc_product_title_font_transform]', + array( + 'default' => $defaults['wc_product_title_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Typography_Customize_Control( + $wp_customize, + 'google_wc_product_title_control', + array( + 'label' => __( 'Shop Product Titles', 'gp-premium' ), + 'section' => 'generate_woocommerce_typography', + 'settings' => array( + 'weight' => 'generate_settings[wc_product_title_font_weight]', + 'transform' => 'generate_settings[wc_product_title_font_transform]', + ), + ) + ) + ); + + // Font size + $wp_customize->add_setting( + 'generate_settings[wc_product_title_font_size]', + array( + 'default' => $defaults['wc_product_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[mobile_wc_product_title_font_size]', + array( + 'default' => $defaults['mobile_wc_product_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[wc_product_title_font_size]', + array( + 'description' => __( 'Font size', 'gp-premium' ), + 'section' => 'generate_woocommerce_typography', + 'priority' => 240, + 'settings' => array( + 'desktop' => 'generate_settings[wc_product_title_font_size]', + 'mobile' => 'generate_settings[mobile_wc_product_title_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + // Font size + $wp_customize->add_setting( + 'generate_settings[wc_related_product_title_font_size]', + array( + 'default' => $defaults['wc_related_product_title_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'generate_settings[wc_related_product_title_font_size]', + array( + 'description' => __( 'Related/upsell title font size', 'gp-premium' ), + 'section' => 'generate_woocommerce_typography', + 'priority' => 240, + 'settings' => array( + 'desktop' => 'generate_settings[wc_related_product_title_font_size]', + 'mobile' => 'generate_settings[mobile_wc_product_title_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + } +} diff --git a/wp-content/plugins/gp-premium/typography/generate-fonts.php b/wp-content/plugins/gp-premium/typography/generate-fonts.php new file mode 100644 index 0000000..2efa243 --- /dev/null +++ b/wp-content/plugins/gp-premium/typography/generate-fonts.php @@ -0,0 +1,19 @@ + *:not(:first-child) { + margin-top: 10px; + margin-bottom: 0; +} + +.woocommerce ul.products li.product .woocommerce-LoopProduct-link > .secondary-image + img { + margin-top: 0; +} + +.woocommerce ul.products li.product .onsale, +.woocommerce span.onsale { + position: relative; + border-radius: 0; + min-height: 15px; + min-width: initial; + font-weight: inherit; + font-size: inherit; + padding: 8px 13px; + line-height: 1; + display: inline-block; + top: auto; + left: auto; + font-size: 80%; + text-transform: uppercase; + font-weight: bold; +} + +.woocommerce ul.products li.product.sales-flash-overlay .onsale { + position: absolute; + top: 0; + right: 0; + margin: 0; +} + +.single-product span.onsale { + margin-bottom: 15px; +} + +.woocommerce-product-gallery { + margin-right: 4%; +} + +.rtl .woocommerce-product-gallery { + margin-right: 0; + margin-left: 4%; +} + +.woocommerce div.product div.images .flex-control-thumbs li { + max-width: 100px; + padding-top: 5px; + padding-right: 5px; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +.woocommerce ul.products li.product .woocommerce-loop-product__title { + padding: 0; +} + +.woocommerce .page-header-image-single { + display: none; +} + +.woocommerce .entry-content, +.woocommerce .product .entry-summary { + margin-top: 0; +} + +.related.products { + clear: both; +} + +.checkout-subscribe-prompt.clear { + visibility: visible; + height: initial; + width: initial; +} + +.woocommerce .add_to_cart_button + .added_to_cart { + display: none; +} + +.woocommerce-result-count { + font-size: 14px; + padding: 10px 0; + border: 1px solid transparent; +} + +.woocommerce-ordering select { + font-size: 14px; + font-weight: 500; + padding: 10px 40px 10px 12px; + -webkit-appearance: none; + -moz-appearance: none; + width: 100%; + background: transparent; + border-color: rgba(0,0,0,0.1); + color: inherit; + cursor: pointer; +} + +.woocommerce-ordering select::-ms-expand { + display: none; +} + +.woocommerce-ordering:after { + content: "\e903"; + font-family: "GP Premium"; + display: inline-block; + position: absolute; + pointer-events: none; + color: inherit; + top: 10px; + right: 15px; + font-size: 16px; +} + +.woocommerce-ordering select option { + color: initial; +} + +.woocommerce .woocommerce-ordering, +.woocommerce .woocommerce-result-count { + margin-bottom: 30px; +} + +.woocommerce-variation-add-to-cart { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} + +/* Columns */ + +@supports( display: grid ) { + #wc-column-container .product { + float: none; + width: auto; + margin: 0; + } + + .woocommerce .wc-columns-container .products::after, + .woocommerce .wc-columns-container .products::before, + .woocommerce .related ul.products::after, + .woocommerce .related ul.products::before, + .woocommerce .up-sells ul.products::after, + .woocommerce .up-sells ul.products::before { + display: none; + } + + .wc-columns-container .products, + .woocommerce .related ul.products, + .woocommerce .up-sells ul.products { + display: -ms-grid; + display: grid; + grid-gap: 50px; + width: 100%; + } + + .wc-columns-container.wc-columns-6 .products, + .wc-related-upsell-columns-6 .related ul.products, + .wc-related-upsell-columns-6 .up-sells ul.products { + -ms-grid-columns: 1fr 50px 1fr 50px 1fr 50px 1fr 50px 1fr 50px 1fr; + grid-template-columns: repeat(6, 1fr); + } + + .wc-columns-container.wc-columns-5 .products, + .wc-related-upsell-columns-5 .related ul.products, + .wc-related-upsell-columns-5 .up-sells ul.products { + -ms-grid-columns: 1fr 50px 1fr 50px 1fr 50px 1fr 50px 1fr; + grid-template-columns: repeat(5, 1fr); + } + + .woocommerce .wc-columns-container.wc-columns-4 .products, + .wc-related-upsell-columns-4 .related ul.products, + .wc-related-upsell-columns-4 .up-sells ul.products { + -ms-grid-columns: (1fr)[4]; + grid-template-columns: repeat(4, 1fr); + } + + .woocommerce .wc-columns-container.wc-columns-3 .products, + .wc-related-upsell-columns-3 .related ul.products, + .wc-related-upsell-columns-3 .up-sells ul.products { + -ms-grid-columns: (1fr)[3]; + grid-template-columns: repeat(3, 1fr); + } + + .woocommerce .wc-columns-container.wc-columns-2 .products, + .wc-related-upsell-columns-2 .related ul.products, + .wc-related-upsell-columns-2 .up-sells ul.products { + -ms-grid-columns: (1fr)[2]; + grid-template-columns: repeat(2, 1fr); + } + + .woocommerce .wc-columns-container.wc-columns-1 .products, + .wc-related-upsell-columns-1 .related ul.products, + .wc-related-upsell-columns-1 .up-sells ul.products { + width: 100%; + } + + .woocommerce .wc-columns-1 ul.products li.product, + .woocommerce-page .wc-columns-1 ul.products li.product { + margin-left: 0; + margin-right: 0; + } +} + +/* Mini Cart */ + +#wc-mini-cart ul.woocommerce-mini-cart { + position: relative; + left: auto; + right: auto; + opacity: 1; + pointer-events: auto; + height: auto; + width: auto; + float: none; + background-color: transparent; + box-shadow: 0 0 0; + visibility: visible; +} + +.wc-mini-cart { + position: absolute; + width: 300px; + right: 0; + box-shadow: 0 2px 2px rgba(0,0,0,0.1); + z-index: 99999; + left: -99999px; + opacity: 0; + height: 0; + overflow: hidden; + pointer-events: none; + transition: opacity 80ms linear; + transition-delay: 0s; + visibility: hidden; +} + +.wc-menu-item:hover .wc-mini-cart, +.wc-menu-item.sfHover .wc-mini-cart { + left: auto; + opacity: 1; + transition-delay: 150ms; + pointer-events: auto; + height: auto; + overflow: visible; + visibility: visible; +} + +.sidebar .wc-mini-cart { + right: 100%; + top: 0; +} + +.sidebar .wc-mini-cart .widget { + background: none; +} + +body:not(.using-mouse) .wc-menu-item.sfHover .wc-mini-cart { + display: none; +} + +.wc-menu-item .sub-menu { + left: auto; + right: 0; + width: 300px; +} + +.wc-menu-item .wc-mini-cart .widget_shopping_cart_content li:hover a, +.wc-menu-item .wc-mini-cart .widget_shopping_cart_content li.sfHover a { + background: none; +} + +.wc-menu-item .wc-mini-cart .widget_shopping_cart { + padding: 15px; +} + +.woocommerce.widget_shopping_cart .cart_list li { + padding: 0 0 0 4em; + margin: 0; + -webkit-box-sizing: border-box; + box-sizing: border-box; + min-height: 3em; +} + +.woocommerce.widget_shopping_cart { + font-size: 14px; +} + +.widget_shopping_cart .woocommerce-mini-cart__buttons { + margin-bottom: 0; + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} + +.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a { + margin: 0; + width: calc(50% - 10px); + text-align: center; + padding: 10px 15px; + line-height: inherit; + font-size: 14px; +} + +.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a:first-child { + margin-right: 2px; +} + +.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a:last-child { + margin-left: 2px; +} + +.woocommerce.widget_shopping_cart .cart_list li a.remove { + right: 0; + left: auto; + height: 20px; + width: 20px; + border-width: 1px; + border-style: solid; + border-radius: 50%; + padding: 0; + font-size: 16px; + line-height: 17px; + font-weight: normal; + position: relative; + float: right; +} + +.woocommerce ul.cart_list li img { + position: absolute; + left: 0; + width: 3em; + height: auto; + top: 0; + margin-left: 0; +} + +#wc-mini-cart .woocommerce-mini-cart-item a { + padding: 0; +} + +.woocommerce-mini-cart-item .quantity { + font-size: 12px; + display: block; +} + +.woocommerce.widget_shopping_cart .total { + margin: 15px 0; + padding: 15px; + background: rgba(0,0,0,0.05); + border: 0; + font-size: 14px; +} + +#wc-mini-cart .total { + padding: 15px; + margin: 15px -15px 15px; + text-align: left; +} + +#generate-slideout-menu .total { + padding: 10px 20px; + margin: 20px -20px 20px; +} + +#generate-slideout-menu.do-overlay .total { + margin: 20px 0; +} + +.woocommerce.widget_shopping_cart a.button.wc-forward:after { + display: none; +} + +.woocommerce.widget_shopping_cart .cart_list li.woocommerce-mini-cart-item:not(:last-child) { + margin-bottom: 15px; +} + +.slideout-widget .widget_shopping_cart_content, +.slideout-widget .widget_shopping_cart_content a { + font-size: 14px; +} + +#generate-slideout-menu.do-overlay li.woocommerce-mini-cart-item { + text-align: left; +} + +#wc-mini-cart a:not(.button) { + font-family: inherit; +} + +.wc-menu-item:not(.has-items) .wc-mini-cart { + display: none; +} + +.woocommerce-mini-cart__empty-message { + margin-bottom: 0; +} + +.secondary-nav-aligned-right .secondary-navigation ul.woocommerce-mini-cart, +.secondary-nav-aligned-center .secondary-navigation ul.woocommerce-mini-cart { + font-size: inherit; +} + +#wc-mini-cart .widgettitle { + display: none; +} + +/* Related/Upsell products */ + +@supports (display: grid) { + .woocommerce .related ul.products li.product, + .woocommerce .up-sells ul.products li.product { + width: auto; + margin-left: 0; + margin-right: 0; + } +} + +.woocommerce #respond input#submit, +.woocommerce a.button, +.woocommerce button.button, +.woocommerce input.button { + border-radius: 0px; + font-weight: inherit; + font-size: inherit; + line-height: inherit; + padding: 10px 20px; +} + +ul.products .woocommerce-text-align-center { + text-align: center; +} + +ul.products li.product.woocommerce-text-align-center .price, +ul.products li.product.woocommerce-text-align-center .star-rating { + margin-left: auto; + margin-right: auto; +} + +ul.products li.product.woocommerce-text-align-right .price, +ul.products li.product.woocommerce-text-align-right .star-rating { + margin-left: auto; +} + +.woocommerce .star-rating:before { + color: rgba(0,0,0,0.4); +} + +.woocommerce p.stars a { + color: rgba(0,0,0,0.4); +} + +.woocommerce ul.products li.product .price del { + display: inline; + padding-right: 10px; +} + +ul.products .woocommerce-text-align-right { + text-align: right; +} + +/*-------------------------------------------------------------- +# Single Product +--------------------------------------------------------------*/ + +.woocommerce #content div.product div.images, +.woocommerce div.product div.images, +.woocommerce-page #content div.product div.images, +.woocommerce-page div.product div.images { + width: 50%; +} + +.woocommerce #content div.product div.summary, +.woocommerce div.product div.summary, +.woocommerce-page #content div.product div.summary, +.woocommerce-page div.product div.summary { + width: auto; + float: none; + overflow: hidden; +} + +.product_meta { + font-size: 80%; + border-top: 1px solid rgba( 0,0,0,0.1 ); + padding-top: 30px; +} + +.product_meta > span { + display: block; +} + +.up-sells { + margin-top: 40px; +} + +.woocommerce div.product form.cart, +.add-to-cart-panel form.cart { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} + +.woocommerce div.product form.cart > *:not(.quantity):not(.single_add_to_cart_button) { + width: 100%; +} + +.add-to-cart-panel form.cart { + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.woocommerce .quantity .qty { + height: 100%; + width: auto; + max-width: 80px; + background: transparent; + border: 1px solid rgba(0,0,0,0.1); + padding: 0 10px; + height: 50px; +} + +.do-quantity-buttons .quantity:not(.buttons-added) .qty { + width: 50px; +} + +.do-quantity-buttons div.quantity, +.add-to-cart-panel .cart.do-quantity-buttons div.quantity { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.woocommerce form .quantity.buttons-added .qty, +.woocommerce form .quantity.buttons-added .minus, +.woocommerce form .quantity.buttons-added .plus, +.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before, +.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after { + display: block; + width: 50px; + height: 100%; + min-height: 50px; + background-color: transparent; + border: 1px solid rgba(0,0,0,0.1); + margin: 0; + padding: 0; + text-align: center; + vertical-align: middle; + -moz-appearance: textfield !important; + -webkit-appearance: none; + border-radius: 0; + color: inherit; + box-sizing: border-box; +} + +.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before, +.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after, +.woocommerce form .quantity.buttons-added .minus, +.woocommerce form .quantity.buttons-added .plus { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; +} + +.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before { + content: "-"; + border-right: 0; +} + +.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after { + content: "+"; + border-left: 0; +} + +.woocommerce form .quantity.buttons-added .qty:focus { + border-color: rgba(0,0,0,0.1); +} + +.do-quantity-buttons form .quantity input[type=number]::-webkit-inner-spin-button, +.do-quantity-buttons form .quantity input[type=number]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} + +.woocommerce form .quantity.buttons-added .minus, +.do-quantity-buttons form .quantity:not(.buttons-added):before { + border-right-width: 0; +} + +.woocommerce form .quantity.buttons-added .plus, +.do-quantity-buttons form .quantity:not(.buttons-added):after { + border-left-width: 0; +} + +.do-quantity-buttons .elementor-add-to-cart form .quantity:not(.buttons-added):before, +.do-quantity-buttons .elementor-add-to-cart form .quantity:not(.buttons-added):after, +.do-quantity-buttons form .quantity.hidden { + display: none; +} + +.woocommerce div.product form.cart div.quantity.hidden { + margin: 0; +} + +/*-------------------------------------------------------------- +## Tabs +--------------------------------------------------------------*/ + +.woocommerce div.product .woocommerce-tabs ul.tabs li::after, +.woocommerce div.product .woocommerce-tabs ul.tabs li::before, +.woocommerce div.product .woocommerce-tabs ul.tabs::before { + display: none; + border: 0; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + margin-left: 0; + padding-left: 0; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li { + background-color: rgba(0,0,0,0.02); + margin: 0; + border-radius: 0; + border-width: 1px 1px 0 0; + border-color: rgba(0,0,0,0.08); +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li:first-child { + border-left-width: 1px; +} + +.woocommerce-ordering { + float: left; + margin-right: 1em; + margin-bottom: 0; + position: relative; + padding: 0; +} + +/*-------------------------------------------------------------- +# Menu Item +--------------------------------------------------------------*/ + +nav li.wc-menu-item { + float: right; +} + +.cart-contents > span { + line-height: 0; +} + +.cart-contents > span:not(:empty) { + margin-left: 10px; +} + +nav span.count { + font-size: 0.8em; + opacity: 0.5; +} + +/*-------------------------------------------------------------- +# Cart +--------------------------------------------------------------*/ + +.woocommerce a.remove { + color: inherit !important; + background: transparent !important; + border: 1px solid !important; + border-color: inherit; + font-weight: normal; + font-size: 16px; + width: 20px; + height: 20px; + line-height: 17px; + font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important; +} + +.woocommerce a.remove:hover { + color: inherit!important; + background: transparent !important; + opacity: 0.7; +} + +.woocommerce .star-rating:before { + opacity: 0.25; + content: "SSSSS"; +} + +.woocommerce div.product .woocommerce-product-rating { + margin: 1em 0; +} + +.woocommerce div.product p.price, +.woocommerce div.product span.price { + color: inherit; +} + +.wc-has-gallery .secondary-image { + position: absolute; + opacity: 0; + transition: opacity 100ms ease-in-out; + left:50%; + -webkit-transform: translate(-50%,0px); + -ms-transform: translate(-50%,0px); + transform: translate(-50%,0px); +} + +.woocommerce ul.products li.product a img { + margin-bottom: 0; +} + +.woocommerce div.product .woocommerce-tabs ul.tabs li a, +.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { + color: initial; +} + +.woocommerce ul.products li.product .price, .woocommerce div.product p.price { + font-weight: bold; +} + +div.woocommerce-message a.button, +div.woocommerce-message a.button:hover, +div.woocommerce-message a.button:focus, +div.woocommerce-info a.button, +div.woocommerce-info a.button:hover, +div.woocommerce-info a.button:focus, +div.woocommerce-error a.button, +div.woocommerce-error a.button:hover, +div.woocommerce-error a.button:focus { + background: transparent; + padding: 0; +} + +.woocommerce-error a, +.woocommerce-info a, +.woocommerce-message a { + font-weight: bold; +} + +.woocommerce-error, +.woocommerce-info, +.woocommerce-message { + padding: 20px 30px; + border: 0; + border-left: 10px solid rgba(0,0,0,0.3); +} + +.woocommerce-message::before, +.woocommerce-info::before, +.woocommerce-error::before { + display: none; +} + +a.button.wc-forward:after { + content: "\e901"; + font-family: "GP Premium"; + line-height: 1em; + speak: none; + padding-left: 10px; + position: relative; + top: 2px; +} + +.rtl a.button.wc-forward:after { + display: none; +} + +.woocommerce-checkout .col2-set .col-2, +.woocommerce-checkout .col2-set .col-1 { + float: none; + width: 100%; + margin: 0; +} + +.woocommerce-checkout .col2-set { + width: 52.9411764706%; + float: left; + margin-right: 5.8823529412%; +} + +.rtl.woocommerce-checkout .col2-set { + float: right; + margin-right: 0; + margin-left: 5.8823529412%; +} + +#customer_details+#wc_checkout_add_ons, +#order_review, +#order_review_heading { + width: 41.1764705882%; + float: right; + margin-right: 0; +} + +.woocommerce-additional-fields > h3 { + margin-top: 20px; +} + +.woocommerce table.shop_table, +.woocommerce table.shop_table tfoot th, +.woocommerce table.shop_table tfoot td { + border: 0; + border-radius: 0; +} + +.woocommerce table.shop_table th { + background-color: rgba( 0,0,0,0.03 ) +} + +.woocommerce table.shop_table th, +.woocommerce table.shop_table td { + padding: 20px; + border: 0; +} + +.woocommerce table.shop_table td { + background-color: rgba( 0,0,0,0.005 ); + border-bottom: 1px solid rgba(0,0,0,0.1); +} + +#add_payment_method .cart-collaterals .cart_totals tr td, +#add_payment_method .cart-collaterals .cart_totals tr th, +.woocommerce-cart .cart-collaterals .cart_totals tr td, +.woocommerce-cart .cart-collaterals .cart_totals tr th, +.woocommerce-checkout .cart-collaterals .cart_totals tr td, +.woocommerce-checkout .cart-collaterals .cart_totals tr th { + border-top: 0; +} + +#add_payment_method #payment, +.woocommerce-cart #payment, +.woocommerce-checkout #payment, +#add_payment_method #payment div.payment_box, +.woocommerce-cart #payment div.payment_box, +.woocommerce-checkout #payment div.payment_box { + background-color: transparent; + color: inherit; +} + +#add_payment_method #payment div.payment_box:before, +.woocommerce-cart #payment div.payment_box:before, +.woocommerce-checkout #payment div.payment_box:before { + display: none; +} + +#payment .payment_methods>.wc_payment_method>label { + padding: 20px; + background-color:rgba(0,0,0,0.04); + display:block; + cursor: pointer; +} + +#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child:checked+label { + font-weight: bold; + background-color: rgba(0,0,0,0.07); +} + +#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child { + clip: rect(1px,1px,1px,1px); + position: absolute!important; +} + +#payment .payment_methods>.wc_payment_method>label:before { + display: inline-block; + font-size: inherit; + -webkit-font-smoothing: antialiased; + content: "\e902"; + margin-right: .5407911001em; + -webkit-transition: color,ease,.2s; + -moz-transition: color,ease,.2s; + transition: color,ease,.2s; + font-family: "GP Premium"; +} + +#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child:checked+label:before { + content: "\e904"; +} + +#add_payment_method #payment ul.payment_methods, +.woocommerce-cart #payment ul.payment_methods, +.woocommerce-checkout #payment ul.payment_methods { + padding: 0; + border: 0; +} + +.woocommerce #payment #place_order, +.woocommerce-page #payment #place_order { + float: none; + width: 100%; + padding-top:20px; + padding-bottom: 20px; + font-weight: bold; + font-size: 150%; +} + +#add_payment_method #payment div.form-row, +.woocommerce-cart #payment div.form-row, +.woocommerce-checkout #payment div.form-row { + padding-left:0; + padding-right: 0; + padding-top: 0; +} + +#add_payment_method #payment ul.payment_methods li img, +.woocommerce-cart #payment ul.payment_methods li img, +.woocommerce-checkout #payment ul.payment_methods li img { + float: right; +} + +#add_payment_method #payment .payment_method_paypal .about_paypal, +.woocommerce-cart #payment .payment_method_paypal .about_paypal, +.woocommerce-checkout #payment .payment_method_paypal .about_paypal { + float: none; + display: inline-block; + line-height: 1; +} + +a.checkout-button:after { + display: none; +} + +.woocommerce #content table.cart td.actions .input-text, +.woocommerce table.cart td.actions .input-text, +.woocommerce-page #content table.cart td.actions .input-text, +.woocommerce-page table.cart td.actions .input-text { + width: 150px; + padding: 10px 15px; +} + +.woocommerce .coupon .button { + border: 1px solid transparent; +} + +.woocommerce ul.products li.product .woocommerce-product-details__short-description p:last-child { + margin-bottom: 0; +} + +.wc-product-image { + text-align: center; +} + +.woocommerce-text-align-left .wc-product-image { + text-align: left; +} + +.woocommerce-text-align-right .wc-product-image { + text-align: right; +} + +.inside-wc-product-image { + position: relative; + display: inline-block; +} + +.woocommerce ul.products li.product.woocommerce-image-align-left .wc-product-image { + float: left; + margin-right: 2em; +} + +.woocommerce ul.products li.product.woocommerce-image-align-right .wc-product-image { + float: right; + margin-left: 2em; +} + +.woocommerce ul.products li.product.woocommerce-image-align-left a .wc-product-image img, +.woocommerce ul.products li.product.woocommerce-image-align-right a .wc-product-image img { + width: auto; +} + +.woocommerce-cart ul.products li.product.woocommerce-image-align-left .wc-product-image, +.woocommerce-cart ul.products li.product.woocommerce-image-align-right .wc-product-image { + float: none; + margin: 0; +} + +.woocommerce-cart ul.products li.product.woocommerce-image-align-left a .wc-product-image img, +.woocommerce-cart ul.products li.product.woocommerce-image-align-right a .wc-product-image img { + width: 100%; +} + +.woocommerce .widget_price_filter .price_slider_amount .button { + font-size: 1em; + line-height: normal; +} + +.woocommerce .related ul.products li.product a img, +.woocommerce .up-sells ul.products li.product a img { + margin-bottom: 0; +} + +.woocommerce-review-link { + font-size: 80%; +} + +.woocommerce-Reviews .comment-reply-title { + font-size: 120%; + font-weight: bold; + display: block; + margin-bottom: 10px; +} + +.woocommerce-MyAccount-navigation ul { + margin: 0; + border-top: 1px solid rgba(0,0,0,0.1); +} + +.site-main .woocommerce-MyAccount-navigation li { + margin: 0; + padding: 0; +} + +.woocommerce-MyAccount-navigation li a { + display: block; + padding: 20px 0; + border-bottom: 1px solid rgba(0,0,0,0.1); + font-size: 85%; +} + +.woocommerce-MyAccount-navigation li.is-active a { + font-weight: bold; +} + +.woocommerce-MyAccount-navigation li a:hover { + border-bottom: 1px solid rgba(0,0,0,0.2); +} + +.woocommerce-MyAccount-navigation li.is-active a:after { + font-family: "GP Premium"; + content: "\e901"; + float: right; + font-weight:bold; + font-size: 115%; +} + +.woocommerce-account .woocommerce-MyAccount-navigation { + width: 25%; +} + +.woocommerce #payment .terms { + padding: 20px; +} + +h2.woocommerce-loop-category__title mark { + background: none; + font-size: 80%; + opacity: 0.5; +} + +.woocommerce form.checkout_coupon, +.woocommerce form.login, +.woocommerce form.register { + padding: 0; + margin: 0 0 1.5em; + border: 0; +} + +#ship-to-different-address { + padding: 3px; + font-size: inherit; +} + +.woocommerce-image-align-left .products ul, +.woocommerce-image-align-left ul.products, +.woocommerce-image-align-left .products ul:after, +.woocommerce-image-align-left ul.products:after, +.woocommerce-image-align-right .products ul, +.woocommerce-image-align-right ul.products, +.woocommerce-image-align-right .products ul:after, +.woocommerce-image-align-right ul.products:after { + clear: none; +} + +.woocommerce nav.woocommerce-pagination { + margin-top: 60px; + clear: both; +} + +.woocommerce input.button:disabled, +.woocommerce input.button:disabled[disabled], +.woocommerce input.button:disabled:hover, +.woocommerce input.button:disabled[disabled]:hover { + background-color: transparent; + color: initial; + opacity: 0.3; +} + +.entry-summary + .up-sells { + clear: both; +} + +.woocommerce form .form-row input.input-text, +.woocommerce form .form-row textarea { + line-height: 1.5; +} + +.main-navigation a.cart-contents:not(.has-svg-icon):before, +.secondary-navigation a.cart-contents:not(.has-svg-icon):before { + content: "\f07a"; + display: inline-block; + font-family: "GP Premium"; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.main-navigation a.cart-contents:not(.has-svg-icon).shopping-bag:before, +.secondary-navigation a.cart-contents:not(.has-svg-icon).shopping-bag:before { + content: "\f290"; +} + +.main-navigation a.cart-contents:not(.has-svg-icon).shopping-basket:before, +.secondary-navigation a.cart-contents:not(.has-svg-icon).shopping-basket:before { + content: "\f291"; +} + +.cart-contents > span.number-of-items { + font-size: 11px; + display: inline-block; + background: rgba(255,255,255,0.1); + line-height: 1.7em; + height: 1.7em; + width: 1.7em; + text-align: center; + border-radius: 50%; + margin-left: 5px; + position: relative; + top: -5px; + display: none; +} + +.cart-contents > span.number-of-items.no-items { + display: none; +} + +.woocommerce-MyAccount-navigation ul { + list-style-type: none; +} + + +/* Fix BlockUI */ +form.checkout:after, +form.checkout:before { + content: ''; + display: table; +} + +form.checkout:after { + clear: both; +} + +/* Add to Cart panel */ + +.add-to-cart-panel { + position: fixed; + top: 0; + left: 0; + right: 0; + background: #fff; + padding: 20px; + opacity: 0; + transition: opacity 500ms ease-in-out, transform 500ms ease-in-out; + box-shadow: 0 2px 2px -2px rgba(0,0,0,.2); + z-index: 50; + font-size: 90%; + box-sizing: border-box; + -webkit-transform: translateY(-100%); + -ms-transform: translateY(-100%); + transform: translateY(-100%); +} + +.add-to-cart-panel.item-added, +.add-to-cart-panel.show-sticky-add-to-cart { + opacity: 1; +} + +.add-to-cart-panel > div { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.add-to-cart-panel .continue-shopping { + margin-right: auto; +} + +.add-to-cart-panel .continue-shopping .gp-icon { + display: none; +} + +.add-to-cart-panel .cart-info { + margin-right: 20px; +} + +.add-to-cart-panel img { + height: 50px; + width: auto; + vertical-align: middle; +} + +.add-to-cart-panel .product-title { + margin-left: 20px; + margin-right: auto; + font-weight: 600; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.add-to-cart-panel .product-price { + margin-right: 20px; +} + +.add-to-cart-panel div.quantity { + margin-right: 4px; +} + +.add-to-cart-panel .cart-data { + font-size: 12px; +} + +.add-to-cart-panel del { + opacity: 0.4; +} + +.do-quantity-buttons input.qty::-webkit-outer-spin-button, +.do-quantity-buttons input.qty::-webkit-inner-spin-button { + -webkit-appearance: none; +} diff --git a/wp-content/plugins/gp-premium/woocommerce/functions/css/woocommerce.min.css b/wp-content/plugins/gp-premium/woocommerce/functions/css/woocommerce.min.css new file mode 100644 index 0000000..c0454d9 --- /dev/null +++ b/wp-content/plugins/gp-premium/woocommerce/functions/css/woocommerce.min.css @@ -0,0 +1 @@ +@supports (display:grid){.woocommerce ul.products li.product{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}}.product_meta>span,.woocommerce ul.products li.product.woocommerce-image-align-left,.woocommerce ul.products li.product.woocommerce-image-align-right{display:block}.woocommerce ul.products li.product .woocommerce-LoopProduct-link{display:block;margin-bottom:auto}.woocommerce ul.products li.product .button{margin-left:auto;margin-right:auto}.woocommerce ul.products li.product.woocommerce-text-align-left .button{margin-left:0}.woocommerce ul.products li.product.woocommerce-text-align-right .button{margin-right:0}.woocommerce ul.products li.product .woocommerce-LoopProduct-link>:not(:first-child){margin-top:10px;margin-bottom:0}.woocommerce ul.products li.product .woocommerce-LoopProduct-link>.secondary-image+img{margin-top:0}.woocommerce span.onsale,.woocommerce ul.products li.product .onsale{position:relative;border-radius:0;min-height:15px;min-width:initial;padding:8px 13px;line-height:1;display:inline-block;top:auto;left:auto;font-size:80%;text-transform:uppercase;font-weight:700}.woocommerce ul.products li.product.sales-flash-overlay .onsale{position:absolute;top:0;right:0;margin:0}.single-product span.onsale{margin-bottom:15px}.woocommerce-product-gallery{margin-right:4%}.rtl .woocommerce-product-gallery{margin-right:0;margin-left:4%}.woocommerce div.product div.images .flex-control-thumbs li{max-width:100px;padding-top:5px;padding-right:5px;-webkit-box-sizing:border-box;box-sizing:border-box}#wc-mini-cart .woocommerce-mini-cart-item a,.woocommerce ul.products li.product .woocommerce-loop-product__title{padding:0}.woocommerce .page-header-image-single{display:none}.woocommerce .entry-content,.woocommerce .product .entry-summary{margin-top:0}.related.products{clear:both}.checkout-subscribe-prompt.clear{visibility:visible;height:initial;width:initial}.woocommerce .add_to_cart_button+.added_to_cart{display:none}.woocommerce-result-count{font-size:14px;padding:10px 0;border:1px solid transparent}.woocommerce-ordering select{font-size:14px;font-weight:500;padding:10px 40px 10px 12px;-webkit-appearance:none;-moz-appearance:none;width:100%;background:0 0;border-color:rgba(0,0,0,.1);color:inherit;cursor:pointer}.woocommerce-ordering select::-ms-expand{display:none}.woocommerce-ordering:after{content:"\e903";font-family:"GP Premium";display:inline-block;position:absolute;pointer-events:none;color:inherit;top:10px;right:15px;font-size:16px}.woocommerce div.product .woocommerce-tabs ul.tabs li a,.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,.woocommerce-ordering select option{color:initial}.woocommerce .woocommerce-ordering,.woocommerce .woocommerce-result-count{margin-bottom:30px}.add-to-cart-panel form.cart,.woocommerce div.product form.cart,.woocommerce-variation-add-to-cart{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}@supports (display:grid){#wc-column-container .product{float:none;width:auto;margin:0}.woocommerce .related ul.products::after,.woocommerce .related ul.products::before,.woocommerce .up-sells ul.products::after,.woocommerce .up-sells ul.products::before,.woocommerce .wc-columns-container .products::after,.woocommerce .wc-columns-container .products::before{display:none}.wc-columns-container .products,.woocommerce .related ul.products,.woocommerce .up-sells ul.products{display:-ms-grid;display:grid;grid-gap:50px;width:100%}.wc-columns-container.wc-columns-6 .products,.wc-related-upsell-columns-6 .related ul.products,.wc-related-upsell-columns-6 .up-sells ul.products{-ms-grid-columns:1fr 50px 1fr 50px 1fr 50px 1fr 50px 1fr 50px 1fr;grid-template-columns:repeat(6,1fr)}.wc-columns-container.wc-columns-5 .products,.wc-related-upsell-columns-5 .related ul.products,.wc-related-upsell-columns-5 .up-sells ul.products{-ms-grid-columns:1fr 50px 1fr 50px 1fr 50px 1fr 50px 1fr;grid-template-columns:repeat(5,1fr)}.wc-related-upsell-columns-4 .related ul.products,.wc-related-upsell-columns-4 .up-sells ul.products,.woocommerce .wc-columns-container.wc-columns-4 .products{-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}.wc-related-upsell-columns-3 .related ul.products,.wc-related-upsell-columns-3 .up-sells ul.products,.woocommerce .wc-columns-container.wc-columns-3 .products{-ms-grid-columns:(1fr)[3];grid-template-columns:repeat(3,1fr)}.wc-related-upsell-columns-2 .related ul.products,.wc-related-upsell-columns-2 .up-sells ul.products,.woocommerce .wc-columns-container.wc-columns-2 .products{-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr)}.wc-related-upsell-columns-1 .related ul.products,.wc-related-upsell-columns-1 .up-sells ul.products,.woocommerce .wc-columns-container.wc-columns-1 .products{width:100%}.woocommerce .wc-columns-1 ul.products li.product,.woocommerce-page .wc-columns-1 ul.products li.product{margin-left:0;margin-right:0}}#wc-mini-cart ul.woocommerce-mini-cart{position:relative;left:auto;right:auto;opacity:1;pointer-events:auto;height:auto;width:auto;float:none;background-color:transparent;box-shadow:0 0 0;visibility:visible}.wc-mini-cart{position:absolute;width:300px;right:0;box-shadow:0 2px 2px rgba(0,0,0,.1);z-index:99999;left:-99999px;opacity:0;height:0;overflow:hidden;pointer-events:none;transition:opacity 80ms linear;transition-delay:0s;visibility:hidden}.wc-menu-item.sfHover .wc-mini-cart,.wc-menu-item:hover .wc-mini-cart{left:auto;opacity:1;transition-delay:150ms;pointer-events:auto;height:auto;overflow:visible;visibility:visible}.sidebar .wc-mini-cart{right:100%;top:0}.sidebar .wc-mini-cart .widget,.wc-menu-item .wc-mini-cart .widget_shopping_cart_content li.sfHover a,.wc-menu-item .wc-mini-cart .widget_shopping_cart_content li:hover a{background:0 0}body:not(.using-mouse) .wc-menu-item.sfHover .wc-mini-cart{display:none}.wc-menu-item .sub-menu{left:auto;right:0;width:300px}.wc-menu-item .wc-mini-cart .widget_shopping_cart{padding:15px}.woocommerce.widget_shopping_cart .cart_list li{padding:0 0 0 4em;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:3em}.woocommerce.widget_shopping_cart{font-size:14px}.widget_shopping_cart .woocommerce-mini-cart__buttons{margin-bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex}.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a{margin:0;width:calc(50% - 10px);text-align:center;padding:10px 15px;line-height:inherit;font-size:14px}.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a:first-child{margin-right:2px}.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a:last-child{margin-left:2px}.woocommerce.widget_shopping_cart .cart_list li a.remove{right:0;left:auto;height:20px;width:20px;border-width:1px;border-style:solid;border-radius:50%;padding:0;font-size:16px;line-height:17px;font-weight:400;position:relative;float:right}.woocommerce ul.cart_list li img{position:absolute;left:0;width:3em;height:auto;top:0;margin-left:0}.woocommerce-mini-cart-item .quantity{font-size:12px;display:block}.woocommerce.widget_shopping_cart .total{margin:15px 0;padding:15px;background:rgba(0,0,0,.05);border:0;font-size:14px}#wc-mini-cart .total{padding:15px;margin:15px -15px;text-align:left}#generate-slideout-menu .total{padding:10px 20px;margin:20px -20px}#generate-slideout-menu.do-overlay .total{margin:20px 0}#wc-mini-cart .widgettitle,.woocommerce-error::before,.woocommerce-info::before,.woocommerce-message::before,.woocommerce.widget_shopping_cart a.button.wc-forward:after{display:none}.woocommerce.widget_shopping_cart .cart_list li.woocommerce-mini-cart-item:not(:last-child){margin-bottom:15px}.slideout-widget .widget_shopping_cart_content,.slideout-widget .widget_shopping_cart_content a{font-size:14px}#generate-slideout-menu.do-overlay li.woocommerce-mini-cart-item{text-align:left}#wc-mini-cart a:not(.button){font-family:inherit}.wc-menu-item:not(.has-items) .wc-mini-cart{display:none}.woocommerce .related ul.products li.product a img,.woocommerce .up-sells ul.products li.product a img,.woocommerce ul.products li.product a img,.woocommerce-mini-cart__empty-message{margin-bottom:0}.secondary-nav-aligned-center .secondary-navigation ul.woocommerce-mini-cart,.secondary-nav-aligned-right .secondary-navigation ul.woocommerce-mini-cart{font-size:inherit}@supports (display:grid){.woocommerce .related ul.products li.product,.woocommerce .up-sells ul.products li.product{width:auto;margin-left:0;margin-right:0}}.woocommerce #respond input#submit,.woocommerce a.button,.woocommerce button.button,.woocommerce input.button{border-radius:0;font-weight:inherit;font-size:inherit;line-height:inherit;padding:10px 20px}ul.products .woocommerce-text-align-center{text-align:center}ul.products li.product.woocommerce-text-align-center .price,ul.products li.product.woocommerce-text-align-center .star-rating{margin-left:auto;margin-right:auto}ul.products li.product.woocommerce-text-align-right .price,ul.products li.product.woocommerce-text-align-right .star-rating{margin-left:auto}.woocommerce .star-rating:before,.woocommerce p.stars a{color:rgba(0,0,0,.4)}.woocommerce ul.products li.product .price del{display:inline;padding-right:10px}ul.products .woocommerce-text-align-right{text-align:right}.woocommerce #content div.product div.images,.woocommerce div.product div.images,.woocommerce-page #content div.product div.images,.woocommerce-page div.product div.images{width:50%}.woocommerce #content div.product div.summary,.woocommerce div.product div.summary,.woocommerce-page #content div.product div.summary,.woocommerce-page div.product div.summary{width:auto;float:none;overflow:hidden}.product_meta{font-size:80%;border-top:1px solid rgba(0,0,0,.1);padding-top:30px}.up-sells{margin-top:40px}.woocommerce div.product form.cart>:not(.quantity):not(.single_add_to_cart_button){width:100%}.add-to-cart-panel form.cart{-ms-flex-negative:0;flex-shrink:0}.woocommerce .quantity .qty{width:auto;max-width:80px;background:0 0;border:1px solid rgba(0,0,0,.1);padding:0 10px;height:50px}.do-quantity-buttons .quantity:not(.buttons-added) .qty{width:50px}.add-to-cart-panel .cart.do-quantity-buttons div.quantity,.add-to-cart-panel>div,.do-quantity-buttons div.quantity{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after,.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before,.woocommerce form .quantity.buttons-added .minus,.woocommerce form .quantity.buttons-added .plus,.woocommerce form .quantity.buttons-added .qty{display:block;width:50px;height:100%;min-height:50px;background-color:transparent;border:1px solid rgba(0,0,0,.1);margin:0;padding:0;text-align:center;vertical-align:middle;-moz-appearance:textfield!important;-webkit-appearance:none;border-radius:0;color:inherit;box-sizing:border-box}.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after,.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before,.woocommerce form .quantity.buttons-added .minus,.woocommerce form .quantity.buttons-added .plus{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):before{content:"-";border-right:0}.do-quantity-buttons form .quantity:not(.buttons-added):not(.hidden):after{content:"+";border-left:0}.woocommerce form .quantity.buttons-added .qty:focus{border-color:rgba(0,0,0,.1)}.do-quantity-buttons form .quantity input[type=number]::-webkit-inner-spin-button,.do-quantity-buttons form .quantity input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.do-quantity-buttons form .quantity:not(.buttons-added):before,.woocommerce form .quantity.buttons-added .minus{border-right-width:0}.do-quantity-buttons form .quantity:not(.buttons-added):after,.woocommerce form .quantity.buttons-added .plus{border-left-width:0}.do-quantity-buttons .elementor-add-to-cart form .quantity:not(.buttons-added):after,.do-quantity-buttons .elementor-add-to-cart form .quantity:not(.buttons-added):before,.do-quantity-buttons form .quantity.hidden{display:none}.woocommerce div.product form.cart div.quantity.hidden{margin:0}.woocommerce div.product .woocommerce-tabs ul.tabs li::after,.woocommerce div.product .woocommerce-tabs ul.tabs li::before,.woocommerce div.product .woocommerce-tabs ul.tabs::before{display:none;border:0}.woocommerce div.product .woocommerce-tabs ul.tabs{display:-webkit-box;display:-ms-flexbox;display:flex;margin-left:0;padding-left:0}.woocommerce div.product .woocommerce-tabs ul.tabs li{background-color:rgba(0,0,0,.02);margin:0;border-radius:0;border-width:1px 1px 0 0;border-color:rgba(0,0,0,.08)}.woocommerce div.product .woocommerce-tabs ul.tabs li:first-child{border-left-width:1px}.woocommerce-ordering{float:left;margin-right:1em;margin-bottom:0;position:relative;padding:0}#add_payment_method #payment ul.payment_methods li img,.woocommerce-cart #payment ul.payment_methods li img,.woocommerce-checkout #payment ul.payment_methods li img,nav li.wc-menu-item{float:right}.cart-contents>span{line-height:0}.cart-contents>span:not(:empty){margin-left:10px}nav span.count{font-size:.8em;opacity:.5}.woocommerce a.remove{color:inherit!important;background:0 0!important;border:1px solid!important;border-color:inherit;font-weight:400;font-size:16px;width:20px;height:20px;line-height:17px;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"!important}.woocommerce a.remove:hover{color:inherit!important;background:0 0!important;opacity:.7}.woocommerce .star-rating:before{opacity:.25;content:"SSSSS"}.woocommerce div.product .woocommerce-product-rating{margin:1em 0}.woocommerce div.product p.price,.woocommerce div.product span.price{color:inherit}.wc-has-gallery .secondary-image{position:absolute;opacity:0;transition:opacity 100ms ease-in-out;left:50%;-webkit-transform:translate(-50%,0);-ms-transform:translate(-50%,0);transform:translate(-50%,0)}.woocommerce div.product p.price,.woocommerce ul.products li.product .price,.woocommerce-error a,.woocommerce-info a,.woocommerce-message a{font-weight:700}div.woocommerce-error a.button,div.woocommerce-error a.button:focus,div.woocommerce-error a.button:hover,div.woocommerce-info a.button,div.woocommerce-info a.button:focus,div.woocommerce-info a.button:hover,div.woocommerce-message a.button,div.woocommerce-message a.button:focus,div.woocommerce-message a.button:hover{background:0 0;padding:0}.woocommerce-error,.woocommerce-info,.woocommerce-message{padding:20px 30px;border:0;border-left:10px solid rgba(0,0,0,.3)}a.button.wc-forward:after{content:"\e901";font-family:"GP Premium";line-height:1em;speak:none;padding-left:10px;position:relative;top:2px}#add_payment_method #payment div.payment_box:before,.cart-contents>span.number-of-items.no-items,.rtl a.button.wc-forward:after,.woocommerce-cart #payment div.payment_box:before,.woocommerce-checkout #payment div.payment_box:before,a.checkout-button:after{display:none}.woocommerce-checkout .col2-set .col-1,.woocommerce-checkout .col2-set .col-2{float:none;width:100%;margin:0}.woocommerce-checkout .col2-set{width:52.9411764706%;float:left;margin-right:5.8823529412%}.rtl.woocommerce-checkout .col2-set{float:right;margin-right:0;margin-left:5.8823529412%}#customer_details+#wc_checkout_add_ons,#order_review,#order_review_heading{width:41.1764705882%;float:right;margin-right:0}.woocommerce-additional-fields>h3{margin-top:20px}.woocommerce table.shop_table,.woocommerce table.shop_table tfoot td,.woocommerce table.shop_table tfoot th{border:0;border-radius:0}.woocommerce table.shop_table th{background-color:rgba(0,0,0,.03);padding:20px;border:0}.woocommerce table.shop_table td{padding:20px;border:0;background-color:rgba(0,0,0,.005);border-bottom:1px solid rgba(0,0,0,.1)}#add_payment_method .cart-collaterals .cart_totals tr td,#add_payment_method .cart-collaterals .cart_totals tr th,.woocommerce-cart .cart-collaterals .cart_totals tr td,.woocommerce-cart .cart-collaterals .cart_totals tr th,.woocommerce-checkout .cart-collaterals .cart_totals tr td,.woocommerce-checkout .cart-collaterals .cart_totals tr th{border-top:0}#add_payment_method #payment,#add_payment_method #payment div.payment_box,.woocommerce-cart #payment,.woocommerce-cart #payment div.payment_box,.woocommerce-checkout #payment,.woocommerce-checkout #payment div.payment_box{background-color:transparent;color:inherit}#payment .payment_methods>.wc_payment_method>label{padding:20px;background-color:rgba(0,0,0,.04);display:block;cursor:pointer}#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child:checked+label{font-weight:700;background-color:rgba(0,0,0,.07)}#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child{clip:rect(1px,1px,1px,1px);position:absolute!important}#payment .payment_methods>.wc_payment_method>label:before{display:inline-block;font-size:inherit;-webkit-font-smoothing:antialiased;content:"\e902";margin-right:.5407911001em;-webkit-transition:color,ease,.2s;-moz-transition:color,ease,.2s;transition:color,ease,.2s;font-family:"GP Premium"}#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child:checked+label:before{content:"\e904"}#add_payment_method #payment ul.payment_methods,.woocommerce-cart #payment ul.payment_methods,.woocommerce-checkout #payment ul.payment_methods{padding:0;border:0}.woocommerce #payment #place_order,.woocommerce-page #payment #place_order{float:none;width:100%;padding-top:20px;padding-bottom:20px;font-weight:700;font-size:150%}#add_payment_method #payment div.form-row,.woocommerce-cart #payment div.form-row,.woocommerce-checkout #payment div.form-row{padding-left:0;padding-right:0;padding-top:0}#add_payment_method #payment .payment_method_paypal .about_paypal,.woocommerce-cart #payment .payment_method_paypal .about_paypal,.woocommerce-checkout #payment .payment_method_paypal .about_paypal{float:none;display:inline-block;line-height:1}.woocommerce #content table.cart td.actions .input-text,.woocommerce table.cart td.actions .input-text,.woocommerce-page #content table.cart td.actions .input-text,.woocommerce-page table.cart td.actions .input-text{width:150px;padding:10px 15px}.woocommerce .coupon .button{border:1px solid transparent}.woocommerce ul.products li.product .woocommerce-product-details__short-description p:last-child{margin-bottom:0}.wc-product-image{text-align:center}.woocommerce-text-align-left .wc-product-image{text-align:left}.woocommerce-text-align-right .wc-product-image{text-align:right}.inside-wc-product-image{position:relative;display:inline-block}.woocommerce ul.products li.product.woocommerce-image-align-left .wc-product-image{float:left;margin-right:2em}.woocommerce ul.products li.product.woocommerce-image-align-right .wc-product-image{float:right;margin-left:2em}.woocommerce ul.products li.product.woocommerce-image-align-left a .wc-product-image img,.woocommerce ul.products li.product.woocommerce-image-align-right a .wc-product-image img{width:auto}.woocommerce-cart ul.products li.product.woocommerce-image-align-left .wc-product-image,.woocommerce-cart ul.products li.product.woocommerce-image-align-right .wc-product-image{float:none;margin:0}.woocommerce-cart ul.products li.product.woocommerce-image-align-left a .wc-product-image img,.woocommerce-cart ul.products li.product.woocommerce-image-align-right a .wc-product-image img{width:100%}.woocommerce .widget_price_filter .price_slider_amount .button{font-size:1em;line-height:normal}.woocommerce-review-link{font-size:80%}.woocommerce-Reviews .comment-reply-title{font-size:120%;font-weight:700;display:block;margin-bottom:10px}.woocommerce-MyAccount-navigation ul{margin:0;border-top:1px solid rgba(0,0,0,.1);list-style-type:none}.site-main .woocommerce-MyAccount-navigation li{margin:0;padding:0}.woocommerce-MyAccount-navigation li a{display:block;padding:20px 0;border-bottom:1px solid rgba(0,0,0,.1);font-size:85%}.woocommerce-MyAccount-navigation li.is-active a{font-weight:700}.woocommerce-MyAccount-navigation li a:hover{border-bottom:1px solid rgba(0,0,0,.2)}.woocommerce-MyAccount-navigation li.is-active a:after{font-family:"GP Premium";content:"\e901";float:right;font-weight:700;font-size:115%}.woocommerce-account .woocommerce-MyAccount-navigation{width:25%}.woocommerce #payment .terms{padding:20px}h2.woocommerce-loop-category__title mark{background:0 0;font-size:80%;opacity:.5}.woocommerce form.checkout_coupon,.woocommerce form.login,.woocommerce form.register{padding:0;margin:0 0 1.5em;border:0}#ship-to-different-address{padding:3px;font-size:inherit}.woocommerce-image-align-left .products ul,.woocommerce-image-align-left .products ul:after,.woocommerce-image-align-left ul.products,.woocommerce-image-align-left ul.products:after,.woocommerce-image-align-right .products ul,.woocommerce-image-align-right .products ul:after,.woocommerce-image-align-right ul.products,.woocommerce-image-align-right ul.products:after{clear:none}.woocommerce nav.woocommerce-pagination{margin-top:60px;clear:both}.woocommerce input.button:disabled,.woocommerce input.button:disabled:hover,.woocommerce input.button:disabled[disabled],.woocommerce input.button:disabled[disabled]:hover{background-color:transparent;color:initial;opacity:.3}.entry-summary+.up-sells{clear:both}.woocommerce form .form-row input.input-text,.woocommerce form .form-row textarea{line-height:1.5}.main-navigation a.cart-contents:not(.has-svg-icon):before,.secondary-navigation a.cart-contents:not(.has-svg-icon):before{content:"\f07a";display:inline-block;font-family:"GP Premium";speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.main-navigation a.cart-contents:not(.has-svg-icon).shopping-bag:before,.secondary-navigation a.cart-contents:not(.has-svg-icon).shopping-bag:before{content:"\f290"}.main-navigation a.cart-contents:not(.has-svg-icon).shopping-basket:before,.secondary-navigation a.cart-contents:not(.has-svg-icon).shopping-basket:before{content:"\f291"}.cart-contents>span.number-of-items{font-size:11px;background:rgba(255,255,255,.1);line-height:1.7em;height:1.7em;width:1.7em;text-align:center;border-radius:50%;margin-left:5px;position:relative;top:-5px;display:none}form.checkout:after,form.checkout:before{content:'';display:table}form.checkout:after{clear:both}.add-to-cart-panel{position:fixed;top:0;left:0;right:0;background:#fff;padding:20px;opacity:0;transition:opacity 500ms ease-in-out,transform 500ms ease-in-out;box-shadow:0 2px 2px -2px rgba(0,0,0,.2);z-index:50;font-size:90%;box-sizing:border-box;-webkit-transform:translateY(-100%);-ms-transform:translateY(-100%);transform:translateY(-100%)}.add-to-cart-panel.item-added,.add-to-cart-panel.show-sticky-add-to-cart{opacity:1}.add-to-cart-panel .continue-shopping{margin-right:auto}.add-to-cart-panel .continue-shopping .gp-icon{display:none}.add-to-cart-panel .cart-info{margin-right:20px}.add-to-cart-panel img{height:50px;width:auto;vertical-align:middle}.add-to-cart-panel .product-title{margin-left:20px;margin-right:auto;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.add-to-cart-panel .product-price{margin-right:20px}.add-to-cart-panel div.quantity{margin-right:4px}.add-to-cart-panel .cart-data{font-size:12px}.add-to-cart-panel del{opacity:.4}.do-quantity-buttons input.qty::-webkit-inner-spin-button,.do-quantity-buttons input.qty::-webkit-outer-spin-button{-webkit-appearance:none} diff --git a/wp-content/plugins/gp-premium/woocommerce/functions/customizer/customizer.php b/wp-content/plugins/gp-premium/woocommerce/functions/customizer/customizer.php new file mode 100644 index 0000000..8897d67 --- /dev/null +++ b/wp-content/plugins/gp-premium/woocommerce/functions/customizer/customizer.php @@ -0,0 +1,1031 @@ +register_control_type( 'GeneratePress_Title_Customize_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Pro_Range_Slider_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Information_Customize_Control' ); + $wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' ); + } + + $wp_customize->add_section( + 'generate_woocommerce_layout', + array( + 'title' => __( 'WooCommerce', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 100, + 'panel' => 'generate_layout_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Section_Shortcut_Control( + $wp_customize, + 'generate_woocommerce_layout_shortcuts', + array( + 'section' => 'generate_woocommerce_layout', + 'element' => __( 'WooCommerce', 'gp-premium' ), + 'shortcuts' => array( + 'colors' => 'generate_woocommerce_colors', + 'typography' => 'generate_woocommerce_typography', + ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + 'priority' => 0, + ) + ) + ); + + $wp_customize->add_control( + new GeneratePress_Title_Customize_Control( + $wp_customize, + 'generate_woocommerce_general_title', + array( + 'section' => 'generate_woocommerce_layout', + 'type' => 'generatepress-customizer-title', + 'title' => __( 'General','generate-woocommerce' ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname' + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[cart_menu_item]', + array( + 'default' => $defaults['cart_menu_item'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[cart_menu_item]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display cart in menu', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[cart_menu_item]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[menu_mini_cart]', + array( + 'default' => $defaults['menu_mini_cart'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[menu_mini_cart]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display mini cart sub-menu', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[menu_mini_cart]', + 'active_callback' => 'generate_premium_wc_menu_item_active', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[cart_menu_item_icon]', + array( + 'default' => $defaults['cart_menu_item_icon'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[cart_menu_item_icon]', + array( + 'type' => 'select', + 'label' => __( 'Menu Item Icon', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'choices' => array( + 'shopping-cart' => __( 'Shopping Cart', 'gp-premium' ), + 'shopping-bag' => __( 'Shopping Bag', 'gp-premium' ), + 'shopping-basket' => __( 'Shopping Basket', 'gp-premium' ), + ), + 'settings' => 'generate_woocommerce_settings[cart_menu_item_icon]', + 'active_callback' => 'generatepress_wc_menu_cart_active', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[cart_menu_item_content]', + array( + 'default' => $defaults['cart_menu_item_content'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[cart_menu_item_content]', + array( + 'type' => 'select', + 'label' => __( 'Menu Item Content', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'choices' => array( + 'amount' => __( 'Amount', 'gp-premium' ), + 'number' => __( 'Number of Items', 'gp-premium' ), + ), + 'settings' => 'generate_woocommerce_settings[cart_menu_item_content]', + 'active_callback' => 'generatepress_wc_menu_cart_active', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[breadcrumbs]', + array( + 'default' => $defaults['breadcrumbs'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[breadcrumbs]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display breadcrumbs', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[breadcrumbs]', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Title_Customize_Control( + $wp_customize, + 'generate_woocommerce_shop_page_title', + array( + 'section' => 'generate_woocommerce_layout', + 'type' => 'generatepress-customizer-title', + 'title' => __( 'Shop','generate-woocommerce' ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname' + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[sidebar_layout]', + array( + 'default' => $defaults['sidebar_layout'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[sidebar_layout]', + array( + 'type' => 'select', + 'label' => __( 'Sidebar Layout', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'choices' => array( + 'left-sidebar' => __( 'Sidebar / Content', 'gp-premium' ), + 'right-sidebar' => __( 'Content / Sidebar', 'gp-premium' ), + 'no-sidebar' => __( 'Content (no sidebars)', 'gp-premium' ), + 'both-sidebars' => __( 'Sidebar / Content / Sidebar', 'gp-premium' ), + 'both-left' => __( 'Sidebar / Sidebar / Content', 'gp-premium' ), + 'both-right' => __( 'Content / Sidebar / Sidebar', 'gp-premium' ) + ), + 'settings' => 'generate_woocommerce_settings[sidebar_layout]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[columns]', array( + 'default' => $defaults['columns'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[tablet_columns]', array( + 'default' => $defaults['tablet_columns'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[mobile_columns]', array( + 'default' => $defaults['mobile_columns'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'gp_woocommerce_columns', + array( + 'label' => __( 'Product Columns', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => array( + 'desktop' => 'generate_woocommerce_settings[columns]', + 'tablet' => 'generate_woocommerce_settings[tablet_columns]', + 'mobile' => 'generate_woocommerce_settings[mobile_columns]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 1, + 'max' => 6, + 'step' => 1, + 'edit' => false, + 'unit' => 'Col', + ), + 'tablet' => array( + 'min' => 1, + 'max' => 3, + 'step' => 1, + 'edit' => false, + 'unit' => 'Col', + ), + 'mobile' => array( + 'min' => 1, + 'max' => 3, + 'step' => 1, + 'edit' => false, + 'unit' => 'Col', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[columns_gap]', array( + 'default' => $defaults['columns_gap'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[tablet_columns_gap]', array( + 'default' => $defaults['tablet_columns_gap'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint' + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[mobile_columns_gap]', array( + 'default' => $defaults['mobile_columns_gap'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'generate_premium_sanitize_empty_absint' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'gp_woocommerce_column_gap', + array( + 'label' => __( 'Column Gap', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => array( + 'desktop' => 'generate_woocommerce_settings[columns_gap]', + 'tablet' => 'generate_woocommerce_settings[tablet_columns_gap]', + 'mobile' => 'generate_woocommerce_settings[mobile_columns_gap]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 100, + 'step' => 5, + 'edit' => true, + 'unit' => 'px', + ), + 'tablet' => array( + 'min' => 0, + 'max' => 100, + 'step' => 5, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 0, + 'max' => 100, + 'step' => 5, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_image_alignment]', + array( + 'default' => $defaults['product_archive_image_alignment'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_image_alignment]', + array( + 'type' => 'radio', + 'label' => __( 'Image Alignment', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'choices' => array( + 'left' => __( 'Left', 'gp-premium' ), + 'center' => __( 'Center', 'gp-premium' ), + 'right' => __( 'Right', 'gp-premium' ), + ), + 'settings' => 'generate_woocommerce_settings[product_archive_image_alignment]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[products_per_page]', + array( + 'default' => $defaults['products_per_page'], + 'type' => 'option', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[products_per_page]', + array( + 'type' => 'text', + 'label' => __( 'Products Per Page', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[products_per_page]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_alignment]', + array( + 'default' => $defaults['product_archive_alignment'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_alignment]', + array( + 'type' => 'radio', + 'label' => __( 'Text Alignment', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'choices' => array( + 'left' => __( 'Left', 'gp-premium' ), + 'center' => __( 'Center', 'gp-premium' ), + 'right' => __( 'Right', 'gp-premium' ), + ), + 'settings' => 'generate_woocommerce_settings[product_archive_alignment]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[off_canvas_panel_on_add_to_cart]', + array( + 'default' => $defaults['off_canvas_panel_on_add_to_cart'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[off_canvas_panel_on_add_to_cart]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display cart panel on add to cart', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[off_canvas_panel_on_add_to_cart]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[shop_page_title]', + array( + 'default' => $defaults['shop_page_title'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[shop_page_title]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display page title', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[shop_page_title]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_results_count]', + array( + 'default' => $defaults['product_results_count'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_results_count]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display product results count', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_results_count]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_sorting]', + array( + 'default' => $defaults['product_sorting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_sorting]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display product sorting', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_sorting]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_image]', + array( + 'default' => $defaults['product_archive_image'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_image]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display product image', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_image]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_secondary_image]', + array( + 'default' => $defaults['product_secondary_image'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_secondary_image]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display secondary image on hover', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_secondary_image]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_title]', + array( + 'default' => $defaults['product_archive_title'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_title]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display product title', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_title]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_sale_flash]', + array( + 'default' => $defaults['product_archive_sale_flash'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_sale_flash]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display sale flash', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_sale_flash]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_sale_flash_overlay]', + array( + 'default' => $defaults['product_archive_sale_flash_overlay'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_sale_flash_overlay]', + array( + 'type' => 'checkbox', + 'label' => __( 'Sale flash over image', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_sale_flash_overlay]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_rating]', + array( + 'default' => $defaults['product_archive_rating'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_rating]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display rating', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_rating]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_price]', + array( + 'default' => $defaults['product_archive_price'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_price]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display price', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_price]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_add_to_cart]', + array( + 'default' => $defaults['product_archive_add_to_cart'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_add_to_cart]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display add to cart button', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_add_to_cart]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_archive_description]', + array( + 'default' => $defaults['product_archive_description'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_archive_description]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display short description', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_archive_description]', + ) + ); + + $wp_customize->add_control( + new GeneratePress_Title_Customize_Control( + $wp_customize, + 'generate_woocommerce_single_product_title', + array( + 'section' => 'generate_woocommerce_layout', + 'type' => 'generatepress-customizer-title', + 'title' => __( 'Single Product','generate-woocommerce' ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname' + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[single_sidebar_layout]', + array( + 'default' => $defaults['single_sidebar_layout'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_choices' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[single_sidebar_layout]', + array( + 'type' => 'select', + 'label' => __( 'Sidebar Layout', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'choices' => array( + 'inherit' => __( 'Inherit','generate-woocommerce' ), + 'left-sidebar' => __( 'Sidebar / Content', 'gp-premium' ), + 'right-sidebar' => __( 'Content / Sidebar', 'gp-premium' ), + 'no-sidebar' => __( 'Content (no sidebars)', 'gp-premium' ), + 'both-sidebars' => __( 'Sidebar / Content / Sidebar', 'gp-premium' ), + 'both-left' => __( 'Sidebar / Sidebar / Content', 'gp-premium' ), + 'both-right' => __( 'Content / Sidebar / Sidebar', 'gp-premium' ) + ), + 'settings' => 'generate_woocommerce_settings[single_sidebar_layout]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[single_product_image_width]', array( + 'default' => $defaults['single_product_image_width'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'gp_woocommerce_single_product_image_width', + array( + 'label' => __( 'Product Image Area Width', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => array( + 'desktop' => 'generate_woocommerce_settings[single_product_image_width]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 100, + 'step' => 5, + 'edit' => true, + 'unit' => '%', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[sticky_add_to_cart_panel]', + array( + 'default' => $defaults['sticky_add_to_cart_panel'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[sticky_add_to_cart_panel]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display add to cart panel on scroll', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[sticky_add_to_cart_panel]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[quantity_buttons]', + array( + 'default' => $defaults['quantity_buttons'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[quantity_buttons]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display quantity buttons', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[quantity_buttons]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[single_product_sale_flash]', + array( + 'default' => $defaults['single_product_sale_flash'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[single_product_sale_flash]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display sale flash', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[single_product_sale_flash]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_tabs]', + array( + 'default' => $defaults['product_tabs'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_tabs]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display product tabs', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_tabs]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_related]', + array( + 'default' => $defaults['product_related'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_related]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display related products', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_related]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_upsells]', + array( + 'default' => $defaults['product_upsells'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_upsells]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display upsell products', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_upsells]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[related_upsell_columns]', array( + 'default' => $defaults['related_upsell_columns'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[tablet_related_upsell_columns]', array( + 'default' => $defaults['tablet_related_upsell_columns'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[mobile_related_upsell_columns]', array( + 'default' => $defaults['mobile_related_upsell_columns'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'sanitize_callback' => 'absint' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Pro_Range_Slider_Control( + $wp_customize, + 'gp_woocommerce_related_upsell_columns', + array( + 'label' => __( 'Related/Upsell Columns', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => array( + 'desktop' => 'generate_woocommerce_settings[related_upsell_columns]', + 'tablet' => 'generate_woocommerce_settings[tablet_related_upsell_columns]', + 'mobile' => 'generate_woocommerce_settings[mobile_related_upsell_columns]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 1, + 'max' => 6, + 'step' => 1, + 'edit' => false, + 'unit' => 'Col', + ), + 'tablet' => array( + 'min' => 1, + 'max' => 3, + 'step' => 1, + 'edit' => false, + 'unit' => 'Col', + ), + 'mobile' => array( + 'min' => 1, + 'max' => 3, + 'step' => 1, + 'edit' => false, + 'unit' => 'Col', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_meta]', + array( + 'default' => $defaults['product_meta'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_meta]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display product meta data', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_meta]', + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[product_description]', + array( + 'default' => $defaults['product_description'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[product_description]', + array( + 'type' => 'checkbox', + 'label' => __( 'Display short description', 'gp-premium' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[product_description]', + ) + ); + + $wp_customize->add_section( + 'generate_woocommerce_colors', + array( + 'title' => __( 'WooCommerce', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 200, + 'panel' => 'generate_colors_panel' + ) + ); + + $wp_customize->add_section( + 'generate_woocommerce_typography', + array( + 'title' => __( 'WooCommerce', 'gp-premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 200, + 'panel' => 'generate_typography_panel' + ) + ); + + $wp_customize->add_control( + new GeneratePress_Title_Customize_Control( + $wp_customize, + 'generate_woocommerce_checkout_title', + array( + 'section' => 'generate_woocommerce_layout', + 'type' => 'generatepress-customizer-title', + 'title' => __( 'Checkout','generate-woocommerce' ), + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname' + ) + ) + ); + + $wp_customize->add_setting( + 'generate_woocommerce_settings[distraction_free]', + array( + 'default' => $defaults['distraction_free'], + 'type' => 'option', + 'sanitize_callback' => 'generate_premium_sanitize_checkbox' + ) + ); + + $wp_customize->add_control( + 'generate_woocommerce_settings[distraction_free]', + array( + 'type' => 'checkbox', + 'label' => __( 'Distraction-free mode', 'gp-premium' ), + 'description' => __( 'Remove unnecessary distractions like sidebars, footer widgets and sticky menus.','generate-woocommerce' ), + 'section' => 'generate_woocommerce_layout', + 'settings' => 'generate_woocommerce_settings[distraction_free]', + ) + ); + +} diff --git a/wp-content/plugins/gp-premium/woocommerce/functions/customizer/js/customizer.js b/wp-content/plugins/gp-premium/woocommerce/functions/customizer/js/customizer.js new file mode 100644 index 0000000..5b63e24 --- /dev/null +++ b/wp-content/plugins/gp-premium/woocommerce/functions/customizer/js/customizer.js @@ -0,0 +1,6 @@ +jQuery( document ).ready( function($) { + $( '#customize-control-generate_woocommerce_primary_button_message a' ).on( 'click', function( e ) { + e.preventDefault(); + wp.customize.control( 'generate_settings[form_button_background_color]' ).focus(); + }); +}); \ No newline at end of file diff --git a/wp-content/plugins/gp-premium/woocommerce/functions/functions.php b/wp-content/plugins/gp-premium/woocommerce/functions/functions.php new file mode 100644 index 0000000..a43ffa0 --- /dev/null +++ b/wp-content/plugins/gp-premium/woocommerce/functions/functions.php @@ -0,0 +1,1229 @@ + true, + 'cart_menu_item_icon' => 'shopping-cart', + 'cart_menu_item_content' => 'amount', + 'menu_mini_cart' => false, + 'off_canvas_panel_on_add_to_cart' => false, + 'sticky_add_to_cart_panel' => false, + 'sidebar_layout' => 'right-sidebar', + 'single_sidebar_layout' => 'inherit', + 'products_per_page' => 9, + 'columns' => 4, + 'tablet_columns' => 2, + 'mobile_columns' => 1, + 'columns_gap' => 50, + 'tablet_columns_gap' => '', + 'mobile_columns_gap' => '', + 'related_upsell_columns' => 4, + 'tablet_related_upsell_columns' => 2, + 'mobile_related_upsell_columns' => 1, + 'product_archive_image_alignment' => 'center', + 'product_archive_alignment' => 'center', + 'shop_page_title' => true, + 'product_results_count' => true, + 'product_sorting' => true, + 'product_archive_image' => true, + 'product_secondary_image' => true, + 'product_archive_title' => true, + 'product_archive_sale_flash' => true, + 'product_archive_sale_flash_overlay' => true, + 'product_archive_rating' => true, + 'product_archive_price' => true, + 'product_archive_add_to_cart' => true, + 'single_product_sale_flash' => true, + 'single_product_image_width' => '50', + 'product_tabs' => true, + 'product_related' => true, + 'product_upsells' => true, + 'product_meta' => true, + 'product_description' => true, + 'quantity_buttons' => true, + 'breadcrumbs' => true, + 'distraction_free' => true, + 'product_archive_description' => false, + ) ); +} + +add_filter( 'generate_color_option_defaults', 'generatepress_wc_color_defaults' ); +/** + * Set the WC color option defaults. + * + * @since 1.3 + */ +function generatepress_wc_color_defaults( $defaults ) { + $defaults[ 'wc_alt_button_background' ] = '#1e73be'; + $defaults[ 'wc_alt_button_background_hover' ] = '#377fbf'; + $defaults[ 'wc_alt_button_text' ] = '#ffffff'; + $defaults[ 'wc_alt_button_text_hover' ] = '#ffffff'; + $defaults[ 'wc_rating_stars' ] = '#ffa200'; + $defaults[ 'wc_sale_sticker_background' ] = '#222222'; + $defaults[ 'wc_sale_sticker_text' ] = '#ffffff'; + $defaults[ 'wc_price_color' ] = '#222222'; + $defaults[ 'wc_product_tab' ] = '#222222'; + $defaults[ 'wc_product_tab_highlight' ] = '#1e73be'; + $defaults[ 'wc_success_message_background' ] = '#0b9444'; + $defaults[ 'wc_success_message_text' ] = '#ffffff'; + $defaults[ 'wc_info_message_background' ] = '#1e73be'; + $defaults[ 'wc_info_message_text' ] = '#ffffff'; + $defaults[ 'wc_error_message_background' ] = '#e8626d'; + $defaults[ 'wc_error_message_text' ] = '#ffffff'; + $defaults[ 'wc_product_title_color' ] = ''; + $defaults[ 'wc_product_title_color_hover' ] = ''; + + $defaults['wc_mini_cart_background_color'] = '#ffffff'; + $defaults['wc_mini_cart_text_color'] = '#000000'; + $defaults['wc_mini_cart_button_background'] = ''; + $defaults['wc_mini_cart_button_text'] = ''; + $defaults['wc_mini_cart_button_background_hover'] = ''; + $defaults['wc_mini_cart_button_text_hover'] = ''; + + $defaults['wc_panel_cart_background_color'] = '#ffffff'; + $defaults['wc_panel_cart_text_color'] = '#000000'; + $defaults['wc_panel_cart_button_background'] = ''; + $defaults['wc_panel_cart_button_text'] = ''; + $defaults['wc_panel_cart_button_background_hover'] = ''; + $defaults['wc_panel_cart_button_text_hover'] = ''; + + $defaults['wc_price_slider_background_color'] = '#dddddd'; + $defaults['wc_price_slider_bar_color'] = '#666666'; + + return $defaults; +} + +add_filter( 'generate_font_option_defaults', 'generatepress_wc_typography_defaults' ); +/** + * Set the WC typography option defaults. + * + * @since 1.3 + */ +function generatepress_wc_typography_defaults( $defaults ) { + $defaults[ 'wc_product_title_font_weight' ] = 'normal'; + $defaults[ 'wc_product_title_font_transform' ] = 'none'; + $defaults[ 'wc_product_title_font_size' ] = '20'; + $defaults[ 'mobile_wc_product_title_font_size' ] = ''; + $defaults[ 'wc_related_product_title_font_size' ] = '20'; + return $defaults; +} + +add_filter( 'generate_navigation_class', 'generatepress_wc_navigation_class' ); +/** + * Add navigation class when the menu icon is enabled. + * + * @since 1.3 + */ +function generatepress_wc_navigation_class( $classes ) { + $classes[] = ( generatepress_wc_get_setting( 'cart_menu_item' ) ) ? 'wc-menu-cart-activated' : ''; + return $classes; +} + +add_filter( 'post_class', 'generatepress_wc_post_class' ); +add_filter( 'product_cat_class', 'generatepress_wc_post_class' ); +/** + * Add post classes to the products. + * + * @since 1.3 + * + * @param array $classes Existing product classes. + * @return array + */ +function generatepress_wc_post_class( $classes ) { + if ( 'product' == get_post_type() ) { + $classes[] = ( generatepress_wc_get_setting( 'product_archive_sale_flash_overlay' ) && generatepress_wc_get_setting( 'product_archive_image' ) ) ? 'sales-flash-overlay' : ''; + $classes[] = 'woocommerce-text-align-' . generatepress_wc_get_setting( 'product_archive_alignment' ); + + if ( is_single() ) { + $classes[] = 'wc-related-upsell-columns-' . generatepress_wc_get_setting( 'related_upsell_columns' ); + $classes[] = 'wc-related-upsell-tablet-columns-' . generatepress_wc_get_setting( 'tablet_related_upsell_columns' ); + $classes[] = 'wc-related-upsell-mobile-columns-' . generatepress_wc_get_setting( 'mobile_related_upsell_columns' ); + } else { + $classes[] = 'woocommerce-image-align-' . generatepress_wc_get_setting( 'product_archive_image_alignment' ); + } + } + + if ( 'product' === get_post_type() || is_cart() ) { + if ( generatepress_wc_get_setting( 'quantity_buttons' ) ) { + $classes[] = 'do-quantity-buttons'; + } + } + + return $classes; +} + +add_action( 'woocommerce_before_shop_loop', 'generatepress_wc_before_shop_loop' ); +/** + * Add opening element inside shop page. + * + * @since 1.3 + */ +function generatepress_wc_before_shop_loop() { + $classes = apply_filters( 'generate_woocommerce_container_classes', array( + 'wc-columns-container', + 'wc-columns-' . generatepress_wc_get_setting( 'columns' ), + 'wc-tablet-columns-' . generatepress_wc_get_setting( 'tablet_columns' ), + 'wc-mobile-columns-' . generatepress_wc_get_setting( 'mobile_columns' ), + ) ); + + $classes = array_map('esc_attr', $classes); + echo '
        '; +} + +add_action( 'woocommerce_after_shop_loop', 'generatepress_wc_after_shop_loop' ); +/** + * Add closing element inside shop page. + * + * @since 1.3 + */ +function generatepress_wc_after_shop_loop() { + echo '
        '; +} + +add_action( 'wp_enqueue_scripts', 'generatepress_wc_scripts', 100 ); +/** + * Add scripts and styles. + * + * @since 1.3 + */ +function generatepress_wc_scripts() { + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + wp_enqueue_style( 'generate-woocommerce', plugin_dir_url( __FILE__ ) . "css/woocommerce{$suffix}.css", array(), GENERATE_WOOCOMMERCE_VERSION ); + wp_enqueue_style( 'generate-woocommerce-mobile', plugin_dir_url( __FILE__ ) . "css/woocommerce-mobile{$suffix}.css", array(), GENERATE_WOOCOMMERCE_VERSION, generate_premium_get_media_query( 'mobile' ) ); + //wp_enqueue_style( 'generate-woocommerce-tablet', plugin_dir_url( __FILE__ ) . "css/woocommerce-tablet{$suffix}.css", array(), GENERATE_WOOCOMMERCE_VERSION, apply_filters( 'generate_tablet_media_query', '(min-width: 769px) and (max-width: 1024px)' ) ); + + wp_enqueue_script( 'generate-woocommerce', plugin_dir_url( __FILE__ ) . "js/woocommerce{$suffix}.js", array( 'jquery' ), GENERATE_WOOCOMMERCE_VERSION, true ); + + wp_localize_script( + 'generate-woocommerce', + 'generateWooCommerce', + array( + 'quantityButtons' => generatepress_wc_get_setting( 'quantity_buttons' ), + 'stickyAddToCart' => generatepress_wc_show_sticky_add_to_cart(), + 'addToCartPanel' => ! is_singular() && generatepress_wc_get_setting( 'off_canvas_panel_on_add_to_cart' ), + ) + ); + + if ( generatepress_wc_get_setting( 'distraction_free' ) && is_checkout() ) { + wp_dequeue_script( 'generate-advanced-sticky' ); + wp_dequeue_script( 'generate-sticky' ); + } + + $font_icons = true; + + if ( function_exists( 'generate_get_option' ) ) { + if ( 'font' !== generate_get_option( 'icons' ) ) { + $font_icons = false; + } + } + + if ( $font_icons ) { + wp_enqueue_style( 'gp-premium-icons' ); + } +} + +/** + * Wrapper class to get the options. + * + * @since 1.3 + * + * @return string $setting The option name. + * @return string The value. + */ +function generatepress_wc_get_setting( $setting ) { + $settings = wp_parse_args( + get_option( 'generate_woocommerce_settings', array() ), + generatepress_wc_defaults() + ); + + return $settings[ $setting ]; +} + +add_filter( 'generate_sidebar_layout', 'generatepress_wc_sidebar_layout' ); +/** + * Set the WC sidebars. + * + * @since 1.3 + * + * @param string Existing layout + * @return string New layout + */ +function generatepress_wc_sidebar_layout( $layout ) { + if ( is_woocommerce() ) { + $layout = generatepress_wc_get_setting( 'sidebar_layout' ); + + if ( is_single() ) { + if ( 'inherit' !== generatepress_wc_get_setting( 'single_sidebar_layout' ) ) { + $layout = generatepress_wc_get_setting( 'single_sidebar_layout' ); + } + + if ( get_post_meta( get_the_ID(), '_generate-sidebar-layout-meta', true ) ) { + $layout = get_post_meta( get_the_ID(), '_generate-sidebar-layout-meta', true ); + } + } + } + + return $layout; +} + +add_filter( 'loop_shop_columns', 'generatepress_wc_product_columns', 999 ); +/** + * Set the WC column number. + * + * @since 1.3 + */ +function generatepress_wc_product_columns() { + return generatepress_wc_get_setting( 'columns' ); +} + +add_filter( 'loop_shop_per_page', 'generatepress_wc_products_per_page', 20 ); +/** + * Set the WC products per page. + * + * @since 1.3 + */ +function generatepress_wc_products_per_page() { + return generatepress_wc_get_setting( 'products_per_page' ); +} + +add_action( 'wp', 'generatepress_wc_setup' ); +/** + * Set up WC. + * + * @since 1.3 + */ +function generatepress_wc_setup() { + + // Add support for WC features + add_theme_support( 'wc-product-gallery-zoom' ); + add_theme_support( 'wc-product-gallery-lightbox' ); + add_theme_support( 'wc-product-gallery-slider' ); + + remove_action( 'wp_enqueue_scripts','generate_woocommerce_css', 100 ); + + remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); + add_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 ); + + add_action( 'woocommerce_before_shop_loop_item_title' , 'generatepress_wc_image_wrapper_open', 8 ); + add_action( 'woocommerce_before_subcategory_title' , 'generatepress_wc_image_wrapper_open', 8 ); + add_action( 'woocommerce_shop_loop_item_title' , 'generatepress_wc_image_wrapper_close', 8 ); + add_action( 'woocommerce_before_subcategory_title' , 'generatepress_wc_image_wrapper_close', 20 ); + + $archive_results_count = generatepress_wc_get_setting( 'product_results_count' ); + $archive_sorting = generatepress_wc_get_setting( 'product_sorting' ); + $archive_image = generatepress_wc_get_setting( 'product_archive_image' ); + $archive_sale_flash = generatepress_wc_get_setting( 'product_archive_sale_flash' ); + $archive_sale_flash_overlay = generatepress_wc_get_setting( 'product_archive_sale_flash_overlay' ); + $archive_rating = generatepress_wc_get_setting( 'product_archive_rating' ); + $archive_price = generatepress_wc_get_setting( 'product_archive_price' ); + $archive_add_to_cart = generatepress_wc_get_setting( 'product_archive_add_to_cart' ); + $archive_title = generatepress_wc_get_setting( 'product_archive_title' ); + $single_product_sale_flash = generatepress_wc_get_setting( 'single_product_sale_flash' ); + $product_tabs = generatepress_wc_get_setting( 'product_tabs' ); + $product_related = generatepress_wc_get_setting( 'product_related' ); + $product_upsells = generatepress_wc_get_setting( 'product_upsells' ); + $product_meta = generatepress_wc_get_setting( 'product_meta' ); + $product_description = generatepress_wc_get_setting( 'product_description' ); + $breadcrumbs = generatepress_wc_get_setting( 'breadcrumbs' ); + $page_title = generatepress_wc_get_setting( 'shop_page_title' ); + $distraction_free = generatepress_wc_get_setting( 'distraction_free' ); + $archive_description = generatepress_wc_get_setting( 'product_archive_description' ); + + if ( false === $page_title ) { + add_filter( 'woocommerce_show_page_title' , '__return_false' ); + } + + if ( false === $archive_results_count ) { + remove_action( 'woocommerce_after_shop_loop', 'woocommerce_result_count', 20 ); + remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 ); + } + + if ( false === $archive_sorting ) { + remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 ); + } + + if ( false === $archive_image ) { + remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); + } + + if ( false === $archive_sale_flash_overlay ) { + remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 ); + add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 6 ); + } + + if ( false === $archive_sale_flash ) { + if ( false === $archive_sale_flash_overlay ) { + remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 6 ); + } else { + remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 ); + } + } + + if ( false === $single_product_sale_flash ) { + remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 ); + } + + if ( false === $archive_rating ) { + remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 ); + } + + if ( false === $archive_price ) { + remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); + } + + if ( false === $archive_add_to_cart ) { + remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); + } + + if ( false === $archive_title ) { + remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 ); + } + + if ( false === $product_tabs ) { + remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 ); + } + + if ( false === $product_related ) { + remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); + } + + if ( false === $product_upsells ) { + remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 ); + } + + if ( false === $product_meta ) { + remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 ); + } + + if ( false === $product_description ) { + remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 ); + } + + if ( false === $breadcrumbs ) { + remove_action( 'woocommerce_before_main_content','woocommerce_breadcrumb', 20, 0); + } + + if ( true === $distraction_free ) { + add_filter( 'generate_sidebar_layout','generatepress_wc_checkout_sidebar_layout' ); + add_filter( 'generate_footer_widgets','generatepress_wc_checkout_footer_widgets' ); + } + + if ( true === $archive_description && ! is_single() && ! is_cart() ) { + add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_single_excerpt', 5 ); + add_action( 'woocommerce_after_subcategory_title', 'generatepress_wc_category_description', 12 ); + } +} + +/** + * Set the WC checkout sidebar layout. + * + * @since 1.3 + * + * @param string $sidebar Existing sidebar layout. + * @return string New sidebar layout. + */ +function generatepress_wc_checkout_sidebar_layout( $layout ) { + if ( is_checkout() ) { + return 'no-sidebar'; + } + + return $layout; +} + +/** + * Set the WC checkout footer widgets. + * + * @since 1.3 + * + * @param int $widgets Existing number of widgets. + * @return int New number of widgets. + */ +function generatepress_wc_checkout_footer_widgets( $widgets ) { + if ( is_checkout() ) { + return '0'; + } + + return $widgets; +} + +add_filter( 'wp_nav_menu_items', 'generatepress_wc_menu_cart', 10, 2 ); +/** + * Add the WC cart menu item. + * + * @since 1.3 + * + * @param string $nav The HTML list content for the menu items. + * @param stdClass $args An object containing wp_nav_menu() arguments. + * @return string The search icon menu item. + */ +function generatepress_wc_menu_cart( $nav, $args ) { + // If our primary menu is set, add the search icon + if ( $args->theme_location == apply_filters( 'generate_woocommerce_menu_item_location', 'primary' ) && generatepress_wc_get_setting( 'cart_menu_item' ) ) { + $has_items = false; + + if ( ! WC()->cart->is_empty() ) { + $has_items = 'has-items'; + } + + return sprintf( + '%1$s + ', + $nav, + generatepress_wc_cart_link(), + is_cart() ? 'current-menu-item' : '', + $has_items + ); + } + + // Our primary menu isn't set, return the regular nav + return $nav; +} + +/** + * Build the menu cart link. + * + * @since 1.3 + */ +function generatepress_wc_cart_link() { + // Kept for backward compatibility. + $legacy_icon = apply_filters( 'generate_woocommerce_menu_cart_icon', '' ); + + // Get the icon type. + $icon_type = generatepress_wc_get_setting( 'cart_menu_item_icon' ); + + $icon = ''; + + if ( function_exists( 'generate_get_svg_icon' ) ) { + $icon = generate_get_svg_icon( $icon_type ); + } + + ob_start(); + + $no_items = ''; + + if ( ! WC()->cart->get_cart_contents_count() > 0 ) { + $no_items = 'no-items'; + } + + printf( + '%5$s%6$s%7$s%8$s', + esc_url( wc_get_cart_url() ), + esc_attr( $icon_type ), + $icon ? 'has-svg-icon' : '', + esc_attr__( 'View your shopping cart', 'gp-premium' ), + $icon, + sprintf ( + _n( + '%d', + '%d', + WC()->cart->get_cart_contents_count() + ), + WC()->cart->get_cart_contents_count() + ), + $legacy_icon, + WC()->cart->subtotal > 0 ? wp_kses_data( WC()->cart->get_cart_subtotal() ) : '' + ); + + if ( generatepress_wc_get_setting( 'menu_mini_cart' ) && ! is_cart() ) : ?> + + cart->subtotal > 0 ) ? '' . wp_kses_data( WC()->cart->get_cart_subtotal() ) . '' : ''; + $fragments['.cart-contents span.number-of-items'] = ( WC()->cart->get_cart_contents_count() > 0 ) ? '' . wp_kses_data( WC()->cart->get_cart_contents_count() ) . '' : ''; + + return $fragments; +} + +add_action( 'generate_inside_navigation', 'generatepress_wc_mobile_cart_link' ); +add_action( 'generate_inside_mobile_header', 'generatepress_wc_mobile_cart_link' ); +/** + * Add the cart icon in the mobile menu. + * + * @since 1.3 + */ +function generatepress_wc_mobile_cart_link() { + if ( ! generatepress_wc_get_setting( 'cart_menu_item' ) || 'primary' !== apply_filters( 'generate_woocommerce_menu_item_location', 'primary' ) ) { + return; + } + + $has_items = false; + + if ( ! WC()->cart->is_empty() ) { + $has_items = ' has-items'; + } + ?> +
        + + +
        + set_selector( '.woocommerce ul.products li.product .woocommerce-LoopProduct-link' ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_product_title_color' ] ) ); + + // Product title color hover + $css->set_selector( '.woocommerce ul.products li.product .woocommerce-LoopProduct-link:hover' ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_product_title_color_hover' ] ) ); + + // Product title font size + $css->set_selector( '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title' ); + $css->add_property( 'font-weight', esc_attr( $settings[ 'wc_product_title_font_weight' ] ) ); + $css->add_property( 'text-transform', esc_attr( $settings[ 'wc_product_title_font_transform' ] ) ); + $css->add_property( 'font-size', esc_attr( $settings[ 'wc_product_title_font_size' ] ), false, 'px' ); + + $css->set_selector( '.woocommerce .up-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .cross-sells ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce .related ul.products li.product .woocommerce-LoopProduct-link h2' ); + if ( '' !== $settings[ 'wc_related_product_title_font_size' ] ) { + $css->add_property( 'font-size', esc_attr( $settings[ 'wc_related_product_title_font_size' ] ), false, 'px' ); + } + + // Primary button + $css->set_selector( '.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button' ); + $css->add_property( 'color', esc_attr( $settings[ 'form_button_text_color' ] ) ); + $css->add_property( 'background-color', esc_attr( $settings[ 'form_button_background_color' ] ) ); + + if ( isset( $settings[ 'buttons_font_size' ] ) ) { + $css->add_property( 'font-weight', esc_attr( $settings[ 'buttons_font_weight' ] ) ); + $css->add_property( 'text-transform', esc_attr( $settings[ 'buttons_font_transform' ] ) ); + + if ( '' !== $settings[ 'buttons_font_size' ] ) { + $css->add_property( 'font-size', absint( $settings[ 'buttons_font_size' ] ), false, 'px' ); + } + } + + // Primary button hover + $css->set_selector( '.woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover' ); + $css->add_property( 'color', esc_attr( $settings[ 'form_button_text_color_hover' ] ) ); + $css->add_property( 'background-color', esc_attr( $settings[ 'form_button_background_color_hover' ] ) ); + + // Alt button + $css->set_selector( '.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce #respond input#submit.alt.disabled, .woocommerce #respond input#submit.alt.disabled:hover, .woocommerce #respond input#submit.alt:disabled, .woocommerce #respond input#submit.alt:disabled:hover, .woocommerce #respond input#submit.alt:disabled[disabled], .woocommerce #respond input#submit.alt:disabled[disabled]:hover, .woocommerce a.button.alt.disabled, .woocommerce a.button.alt.disabled:hover, .woocommerce a.button.alt:disabled, .woocommerce a.button.alt:disabled:hover, .woocommerce a.button.alt:disabled[disabled], .woocommerce a.button.alt:disabled[disabled]:hover, .woocommerce button.button.alt.disabled, .woocommerce button.button.alt.disabled:hover, .woocommerce button.button.alt:disabled, .woocommerce button.button.alt:disabled:hover, .woocommerce button.button.alt:disabled[disabled], .woocommerce button.button.alt:disabled[disabled]:hover, .woocommerce input.button.alt.disabled, .woocommerce input.button.alt.disabled:hover, .woocommerce input.button.alt:disabled, .woocommerce input.button.alt:disabled:hover, .woocommerce input.button.alt:disabled[disabled], .woocommerce input.button.alt:disabled[disabled]:hover' ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_alt_button_text' ] ) ); + $css->add_property( 'background-color', esc_attr( $settings[ 'wc_alt_button_background' ] ) ); + + // Alt button hover + $css->set_selector( '.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover' ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_alt_button_text_hover' ] ) ); + $css->add_property( 'background-color', esc_attr( $settings[ 'wc_alt_button_background_hover' ] ) ); + + // Star rating + $css->set_selector( '.woocommerce .star-rating span:before, .woocommerce p.stars:hover a::before' ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_rating_stars' ] ) ); + + // Sale sticker + $css->set_selector( '.woocommerce span.onsale' ); + $css->add_property( 'background-color', esc_attr( $settings[ 'wc_sale_sticker_background' ] ) ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_sale_sticker_text' ] ) ); + + // Price + $css->set_selector( '.woocommerce ul.products li.product .price, .woocommerce div.product p.price' ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_price_color' ] ) ); + + // Product tab + $css->set_selector( '.woocommerce div.product .woocommerce-tabs ul.tabs li a' ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_product_tab' ] ) ); + + // Highlight product tab + $css->set_selector( '.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover, .woocommerce div.product .woocommerce-tabs ul.tabs li.active a' ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_product_tab_highlight' ] ) ); + + // Success message + $css->set_selector( '.woocommerce-message' ); + $css->add_property( 'background-color', esc_attr( $settings[ 'wc_success_message_background' ] ) ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_success_message_text' ] ) ); + + $css->set_selector( 'div.woocommerce-message a.button, div.woocommerce-message a.button:focus, div.woocommerce-message a.button:hover, div.woocommerce-message a, div.woocommerce-message a:focus, div.woocommerce-message a:hover' ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_success_message_text' ] ) ); + + // Info message + $css->set_selector( '.woocommerce-info' ); + $css->add_property( 'background-color', esc_attr( $settings[ 'wc_info_message_background' ] ) ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_info_message_text' ] ) ); + + $css->set_selector( 'div.woocommerce-info a.button, div.woocommerce-info a.button:focus, div.woocommerce-info a.button:hover, div.woocommerce-info a, div.woocommerce-info a:focus, div.woocommerce-info a:hover' ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_info_message_text' ] ) ); + + // Info message + $css->set_selector( '.woocommerce-error' ); + $css->add_property( 'background-color', esc_attr( $settings[ 'wc_error_message_background' ] ) ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_error_message_text' ] ) ); + + $css->set_selector( 'div.woocommerce-error a.button, div.woocommerce-error a.button:focus, div.woocommerce-error a.button:hover, div.woocommerce-error a, div.woocommerce-error a:focus, div.woocommerce-error a:hover' ); + $css->add_property( 'color', esc_attr( $settings[ 'wc_error_message_text' ] ) ); + + // Archive short description + $css->set_selector( '.woocommerce-product-details__short-description' ); + if ( '' !== $settings[ 'content_text_color' ] ) { + $css->add_property( 'color', esc_attr( $settings[ 'content_text_color' ] ) ); + } else { + $css->add_property( 'color', esc_attr( $settings[ 'text_color' ] ) ); + } + + $css->set_selector( '#wc-mini-cart' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_mini_cart_background_color'] ) ); + $css->add_property( 'color', esc_attr( $settings['wc_mini_cart_text_color'] ) ); + + $css->set_selector( '#wc-mini-cart a:not(.button), #wc-mini-cart a.remove' ); + $css->add_property( 'color', esc_attr( $settings['wc_mini_cart_text_color'] ) ); + + $css->set_selector( '#wc-mini-cart .button' ); + if ( $settings['wc_mini_cart_button_background'] ) { + $css->add_property( 'background-color', esc_attr( $settings['wc_mini_cart_button_background'] ) ); + } + + if ( $settings['wc_mini_cart_button_text'] ) { + $css->add_property( 'color', esc_attr( $settings['wc_mini_cart_button_text'] ) ); + } else { + $css->add_property( 'color', esc_attr( $settings['form_button_text_color'] ) ); + } + + $css->set_selector( '#wc-mini-cart .button:hover, #wc-mini-cart .button:focus, #wc-mini-cart .button:active' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_mini_cart_button_background_hover'] ) ); + + if ( $settings['wc_mini_cart_button_text_hover'] ) { + $css->add_property( 'color', esc_attr( $settings['wc_mini_cart_button_text_hover'] ) ); + } else { + $css->add_property( 'color', esc_attr( $settings['form_button_text_color_hover'] ) ); + } + + $css->set_selector( '.woocommerce #content div.product div.images, .woocommerce div.product div.images, .woocommerce-page #content div.product div.images, .woocommerce-page div.product div.images' ); + $css->add_property( 'width', absint( generatepress_wc_get_setting( 'single_product_image_width' ) ), false, '%' ); + + if ( function_exists( 'generate_get_font_family_css' ) ) { + $buttons_family = generate_get_font_family_css( 'font_buttons', 'generate_settings', generate_get_default_fonts() ); + $css->set_selector( '.woocommerce.widget_shopping_cart .woocommerce-mini-cart__buttons a' ); + $css->add_property( 'font-family', $buttons_family ); + } + + $css->set_selector( '.add-to-cart-panel' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_panel_cart_background_color'] ) ); + $css->add_property( 'color', esc_attr( $settings['wc_panel_cart_text_color'] ) ); + + $css->set_selector( '.add-to-cart-panel a:not(.button)' ); + $css->add_property( 'color', esc_attr( $settings['wc_panel_cart_text_color'] ) ); + + $css->set_selector( '#wc-sticky-cart-panel .button' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_panel_cart_button_background'] ) ); + $css->add_property( 'color', esc_attr( $settings['wc_panel_cart_button_text'] ) ); + + $css->set_selector( '#wc-sticky-cart-panel .button:hover, #wc-sticky-cart-panel .button:focus, #wc-sticky-cart-panel .button:active' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_panel_cart_button_background_hover'] ) ); + $css->add_property( 'color', esc_attr( $settings['wc_panel_cart_button_text_hover'] ) ); + + $transparent_border_color = $settings['text_color']; + + if ( $settings['content_text_color'] ) { + $transparent_border_color = $settings['content_text_color']; + } + + $transparent_border_color = generate_premium_check_text_color( $transparent_border_color ); + + if ( 'light' === $transparent_border_color ) { + $transparent_border_elements = '.woocommerce-ordering select, .variations .value select'; + + if ( generatepress_wc_get_setting( 'quantity_buttons' ) ) { + $transparent_border_elements = '.woocommerce form .quantity.buttons-added .qty, .woocommerce form .quantity.buttons-added .minus, .woocommerce form .quantity.buttons-added .plus, .do-quantity-buttons form .quantity:not(.buttons-added):before, .do-quantity-buttons form .quantity:not(.buttons-added):after, .woocommerce-ordering select, .variations .value select'; + } + + $css->set_selector( $transparent_border_elements ); + $css->add_property( 'border-color', 'rgba(255,255,255,0.1)' ); + + if ( generatepress_wc_get_setting( 'sticky_add_to_cart_panel' ) ) { + $css->set_selector( '#wc-sticky-cart-panel .quantity.buttons-added .qty, #wc-sticky-cart-panel .quantity.buttons-added .minus, #wc-sticky-cart-panel .quantity.buttons-added .plus' ); + $css->add_property( 'border-color', 'rgba(255,255,255,0.1)' ); + } + } + + $css->set_selector( '.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_price_slider_background_color'] ) ); + + $css->set_selector( '.woocommerce .widget_price_filter .ui-slider .ui-slider-range, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_price_slider_bar_color'] ) ); + + if ( 'number' === generatepress_wc_get_setting( 'cart_menu_item_content' ) ) { + $nav_text_color = generate_premium_check_text_color( $settings['navigation_text_color'] ); + + $css->set_selector( '.cart-contents > span.number-of-items' ); + if ( 'light' === $nav_text_color ) { + $css->add_property( 'background-color', 'rgba(255,255,255,0.1)' ); + } else { + $css->add_property( 'background-color', 'rgba(0,0,0,0.05)' ); + } + + $css->set_selector( '.cart-contents .amount' ); + $css->add_property( 'display', 'none' ); + + $css->set_selector( '.cart-contents > span.number-of-items' ); + $css->add_property( 'display', 'inline-block' ); + } + + $font_icons = true; + + if ( function_exists( 'generate_get_option' ) ) { + if ( 'font' !== generate_get_option( 'icons' ) ) { + $font_icons = false; + } + } + + if ( ! $font_icons ) { + $css->set_selector( '.woocommerce-MyAccount-navigation li.is-active a:after, a.button.wc-forward:after' ); + $css->add_property( 'display', 'none' ); + + $css->set_selector( '#payment .payment_methods>.wc_payment_method>label:before' ); + $css->add_property( 'font-family', 'WooCommerce' ); + $css->add_property( 'content', '"\e039"' ); + + $css->set_selector( '#payment .payment_methods li.wc_payment_method>input[type=radio]:first-child:checked+label:before' ); + $css->add_property( 'content', '"\e03c"' ); + + $css->set_selector( '.woocommerce-ordering:after' ); + $css->add_property( 'font-family', 'WooCommerce' ); + $css->add_property( 'content', '"\e00f"' ); + } + + $css->set_selector( '.wc-columns-container .products, .woocommerce .related ul.products, .woocommerce .up-sells ul.products' ); + + if ( '' !== generatepress_wc_get_setting( 'columns_gap' ) ) { + $css->add_property( 'grid-gap', generatepress_wc_get_setting( 'columns_gap' ), false, 'px' ); + } + + $css->start_media_query( generate_premium_get_media_query( 'tablet' ) ); + $css->set_selector( '.wc-columns-container .products, .woocommerce .related ul.products, .woocommerce .up-sells ul.products' ); + + if ( '' !== generatepress_wc_get_setting( 'tablet_columns_gap' ) ) { + $css->add_property( 'grid-gap', generatepress_wc_get_setting( 'tablet_columns_gap' ), false, 'px' ); + } + + if ( 3 === generatepress_wc_get_setting( 'tablet_columns' ) ) { + $css->set_selector( '.woocommerce .wc-columns-container.wc-tablet-columns-3 .products' ); + $css->add_property( '-ms-grid-columns', '(1fr)[3]' ); + $css->add_property( 'grid-template-columns', 'repeat(3, 1fr)' ); + } + + if ( 2 === generatepress_wc_get_setting( 'tablet_columns' ) ) { + $css->set_selector( '.woocommerce .wc-columns-container.wc-tablet-columns-2 .products' ); + $css->add_property( '-ms-grid-columns', '(1fr)[2]' ); + $css->add_property( 'grid-template-columns', 'repeat(2, 1fr)' ); + } + + if ( 1 === generatepress_wc_get_setting( 'tablet_columns' ) ) { + $css->set_selector( '.woocommerce .wc-columns-container.wc-tablet-columns-1 .products' ); + $css->add_property( 'width', '100%' ); + $css->add_property( '-ms-grid-columns', '1fr' ); + $css->add_property( 'grid-template-columns', '1fr' ); + } + + if ( 3 === generatepress_wc_get_setting( 'tablet_related_upsell_columns' ) ) { + $css->set_selector( '.wc-related-upsell-tablet-columns-3 .related ul.products, .wc-related-upsell-tablet-columns-3 .up-sells ul.products' ); + $css->add_property( '-ms-grid-columns', '(1fr)[3]' ); + $css->add_property( 'grid-template-columns', 'repeat(3, 1fr)' ); + } + + if ( 2 === generatepress_wc_get_setting( 'tablet_related_upsell_columns' ) ) { + $css->set_selector( '.wc-related-upsell-tablet-columns-2 .related ul.products, .wc-related-upsell-tablet-columns-2 .up-sells ul.products' ); + $css->add_property( '-ms-grid-columns', '(1fr)[2]' ); + $css->add_property( 'grid-template-columns', 'repeat(2, 1fr)' ); + } + + if ( 1 === generatepress_wc_get_setting( 'tablet_related_upsell_columns' ) ) { + $css->set_selector( '.wc-related-upsell-tablet-columns-1 .related ul.products, .wc-related-upsell-tablet-columns-1 .up-sells ul.products' ); + $css->add_property( 'width', '100%' ); + $css->add_property( '-ms-grid-columns', '1fr' ); + $css->add_property( 'grid-template-columns', '1fr' ); + } + $css->stop_media_query(); + + $css->start_media_query( generate_premium_get_media_query( 'mobile' ) ); + $css->set_selector( '.woocommerce ul.products li.product .woocommerce-LoopProduct-link h2, .woocommerce ul.products li.product .woocommerce-loop-category__title' ); + if ( '' !== $settings[ 'mobile_wc_product_title_font_size' ] ) { + $css->add_property( 'font-size', esc_attr( $settings[ 'mobile_wc_product_title_font_size' ] ), false, 'px' ); + } + + $css->set_selector( '.add-to-cart-panel .continue-shopping' ); + $css->add_property( 'background-color', esc_attr( $settings['wc_panel_cart_background_color'] ) ); + + $css->set_selector( '.wc-columns-container .products, .woocommerce .related ul.products, .woocommerce .up-sells ul.products' ); + + if ( '' !== generatepress_wc_get_setting( 'mobile_columns_gap' ) ) { + $css->add_property( 'grid-gap', generatepress_wc_get_setting( 'mobile_columns_gap' ), false, 'px' ); + } + $css->stop_media_query(); + + $css->start_media_query( generate_premium_get_media_query( 'mobile-menu' ) ); + $css->set_selector( '.mobile-bar-items + .menu-toggle' ); + $css->add_property( 'text-align', 'left' ); + + $css->set_selector( 'nav.toggled .main-nav li.wc-menu-item' ); + $css->add_property( 'display', 'none !important' ); + + $css->set_selector( 'body.nav-search-enabled .wc-menu-cart-activated:not(#mobile-header) .mobile-bar-items' ); + $css->add_property( 'float', 'right' ); + $css->add_property( 'position', 'relative' ); + + $css->set_selector( '.nav-search-enabled .wc-menu-cart-activated:not(#mobile-header) .menu-toggle' ); + $css->add_property( 'float', 'left' ); + $css->add_property( 'width', 'auto' ); + + $css->set_selector( '.mobile-bar-items.wc-mobile-cart-items' ); + $css->add_property( 'z-index', '1' ); + $css->stop_media_query(); + + return $css->css_output(); +} + +add_action( 'wp_enqueue_scripts', 'generatepress_wc_enqueue_css', 100 ); +/** + * Enqueue our dynamic CSS. + * + * @since 1.3 + */ +function generatepress_wc_enqueue_css() { + wp_add_inline_style( 'generate-woocommerce', generatepress_wc_css() ); +} + +/** + * Open WC image wrapper. + * + * @since 1.3 + */ +function generatepress_wc_image_wrapper_open() { + if ( generatepress_wc_get_setting( 'product_archive_image' ) ) { + echo '
        '; + } +} + +/** + * Close WC image wrapper. + * + * @since 1.3 + */ +function generatepress_wc_image_wrapper_close() { + if ( generatepress_wc_get_setting( 'product_archive_image' ) ) { + echo '
        '; + } +} + +add_filter( 'post_class', 'generatepress_wc_product_has_gallery' ); +add_filter( 'product_cat_class', 'generatepress_wc_product_has_gallery' ); +/** + * Add product image post classes to products. + * + * @since 1.3 + * + * @param array $classes Existing classes. + * @return array New classes. + */ +function generatepress_wc_product_has_gallery( $classes ) { + + $post_type = get_post_type( get_the_ID() ); + + if ( 'product' == $post_type && method_exists( 'WC_Product', 'get_gallery_image_ids' ) ) { + + $product = new WC_Product( get_the_ID() ); + $attachment_ids = $product->get_gallery_image_ids(); + + if ( $attachment_ids && generatepress_wc_get_setting( 'product_secondary_image' ) && generatepress_wc_get_setting( 'product_archive_image' ) && has_post_thumbnail() ) { + $classes[] = 'wc-has-gallery'; + } + } + + return $classes; +} + +add_action( 'woocommerce_before_shop_loop_item_title', 'generatepress_wc_secondary_product_image' ); +/** + * Add secondary product image. + * + * @since 1.3 + */ +function generatepress_wc_secondary_product_image() { + $post_type = get_post_type( get_the_ID() ); + + if ( 'product' == $post_type && method_exists( 'WC_Product', 'get_gallery_image_ids' ) ) { + $product = new WC_Product( get_the_ID() ); + $attachment_ids = $product->get_gallery_image_ids(); + + if ( $attachment_ids && generatepress_wc_get_setting( 'product_secondary_image' ) && generatepress_wc_get_setting( 'product_archive_image' ) && has_post_thumbnail() ) { + $secondary_image_id = $attachment_ids['0']; + echo wp_get_attachment_image( $secondary_image_id, 'shop_catalog', '', $attr = array( 'class' => 'secondary-image attachment-shop-catalog' ) ); + } + } +} + +add_filter('woocommerce_product_get_rating_html', 'generatepress_wc_rating_html', 10, 2); +/** + * Always show ratings area to make sure products are similar heights. + * + * @since 1.3.1 + * + * @param string $rating_html + * @param int $rating + * @return string + */ +function generatepress_wc_rating_html( $rating_html, $rating ) { + if ( $rating > 0 ) { + $title = sprintf( __( 'Rated %s out of 5', 'gp-premium' ), $rating ); + } else { + $title = __( 'Not yet rated','generate-woocommerce' ); + $rating = 0; + } + + $rating_html = '
        '; + $rating_html .= '' . $rating . ' ' . __( 'out of 5', 'gp-premium' ) . ''; + $rating_html .= '
        '; + return $rating_html; +} + +/** + * Add WC category description. + * + * @since 1.3 + * + * @param array $category + * @return string + */ +function generatepress_wc_category_description( $category ) { + $prod_term = get_term( $category->term_id, 'product_cat' ); + $description = $prod_term->description; + echo '
        ' . $description . '
        '; +} + +add_action( 'generate_after_footer', 'generatepress_wc_add_to_cart_helper' ); +/** + * Adds a sticky/slide down navigation with add to cart details. + * + * @since 1.8 + */ +function generatepress_wc_add_to_cart_helper() { + if ( ! generatepress_wc_get_setting( 'off_canvas_panel_on_add_to_cart' ) && ! generatepress_wc_get_setting( 'sticky_add_to_cart_panel' ) ) { + return; + } + + $outer_classes = array( + 'add-to-cart-panel', + ); + + $inner_classes = array( + 'inside-add-to-cart-panel', + ); + + if ( function_exists( 'generate_get_option' ) ) { + if ( 'contained-nav' === generate_get_option( 'nav_layout_setting' ) ) { + $outer_classes[] = 'grid-container grid-parent'; + } + + if ( 'contained' === generate_get_option( 'nav_inner_width' ) ) { + $inner_classes[] = 'grid-container grid-parent'; + } + } + ?> +
        +
        + + +
        + + +
        + +
        +
        + +
        + +
        + cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - cart->get_cart_total(); ?> +
        +
        + +
        + +
        + +
        + +
        + +
        + +
        + + get_price() ) : ?> +
        + get_price_html(); ?> +
        + + + is_type( 'simple' ) ) : ?> +
        + apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ), + 'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ), + ); + + echo woocommerce_quantity_input( $args, $product, false ); + ?> + +
        + is_type( 'variable' ) ) : ?> + + is_type( 'external' ) ) : ?> +
        + +
        + + +
        +
        + ' . sprintf ( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'gp-premium' ), WC()->cart->get_cart_contents_count() ) . ' - ' . WC()->cart->get_cart_total() . ''; + + return $fragments; +} + +/** + * If we should display the sticky add to cart panel. + * + * @since 1.8 + */ +function generatepress_wc_show_sticky_add_to_cart() { + $product = wc_get_product( get_the_ID() ); + $show = false; + + if ( ! $product || ! generatepress_wc_get_setting( 'sticky_add_to_cart_panel' ) || ! is_singular( 'product' ) ) { + return false; + } + + if ( ( $product->is_type( 'simple' ) || $product->is_type( 'variable' ) ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) { + $show = true; + } + + if ( $product->is_type( 'external' ) ) { + $show = true; + } + + return $show; +} + +/** + * Checks if a color is light or dark. + * + * @since 1.8 + * + * @param string $color + * @return string + */ +function generate_premium_check_text_color( $color ) { + $r = hexdec( substr( $color, 1, 2 ) ); + $g = hexdec( substr( $color, 3, 2 ) ); + $b = hexdec( substr( $color, 5, 2 ) ); + $yiq = ( ( $r * 299 ) + ( $g * 587 ) + ( $b * 114 ) ) / 1000; + + return ( $yiq >= 128 ) ? 'light' : 'dark'; +} diff --git a/wp-content/plugins/gp-premium/woocommerce/functions/js/woocommerce.js b/wp-content/plugins/gp-premium/woocommerce/functions/js/woocommerce.js new file mode 100644 index 0000000..d7298b5 --- /dev/null +++ b/wp-content/plugins/gp-premium/woocommerce/functions/js/woocommerce.js @@ -0,0 +1,285 @@ +jQuery( document ).ready( function( $ ) { + var throttle = function(fn, threshhold, scope) { + threshhold || (threshhold = 250); + var last, + deferTimer; + + return function () { + var context = scope || this; + + var now = +new Date, + args = arguments; + + if (last && now < last + threshhold) { + // hold on to it + clearTimeout(deferTimer); + deferTimer = setTimeout(function () { + last = now; + fn.apply(context, args); + }, threshhold); + } else { + last = now; + fn.apply(context, args); + } + }; + }; + + $( '.wc-has-gallery .wc-product-image' ).hover( + function() { + $( this ).find( '.secondary-image' ).css( 'opacity','1' ); + }, function() { + $( this ).find( '.secondary-image' ).css( 'opacity','0' ); + } + ); + + $( 'body' ).on( 'added_to_cart', function() { + if ( ! $( '.wc-menu-item' ).hasClass( 'has-items' ) ) { + $( '.wc-menu-item' ).addClass( 'has-items' ); + } + + if ( ! $( '.wc-mobile-cart-items' ).hasClass( 'has-items' ) ) { + $( '.wc-mobile-cart-items' ).addClass( 'has-items' ); + } + } ); + + $( 'body' ).on( 'removed_from_cart', function() { + var numberOfItems = $( '.number-of-items' ); + + if ( numberOfItems.length ) { + if ( numberOfItems.hasClass( 'no-items' ) ) { + $( '.wc-menu-item' ).removeClass( 'has-items' ); + $( '.wc-mobile-cart-items' ).removeClass( 'has-items' ); + } + } + } ); + + if ( generateWooCommerce.addToCartPanel ) { + $( document.body ).on( "added_to_cart", function() { + var adminBar = $( '#wpadminbar' ), + stickyNav = $( '.navigation-stick' ), + top = 0; + + if ( adminBar.length ) { + top = adminBar.outerHeight(); + } + + if ( stickyNav.length && '0px' === stickyNav.css( 'top' ) ) { + top = top + stickyNav.outerHeight(); + } + + $( '.add-to-cart-panel' ).addClass( 'item-added' ).css( { + '-webkit-transform': 'translateY(' + top + 'px)', + '-ms-transform': 'translateY(' + top + 'px)', + 'transform': 'translateY(' + top + 'px)' + } ); + } ); + + $( '.add-to-cart-panel .continue-shopping' ).on( 'click', function( e ) { + e.preventDefault(); + + $( '.add-to-cart-panel' ).removeClass( 'item-added' ).css( { + '-webkit-transform': 'translateY(-100%)', + '-ms-transform': 'translateY(-100%)', + 'transform': 'translateY(-100%)' + } ); + } ); + + $( window ).on( 'scroll', throttle( function() { + var panel = $( '.add-to-cart-panel' ); + + if ( panel.hasClass( 'item-added' ) ) { + panel.removeClass( 'item-added' ).css( { + '-webkit-transform': 'translateY(-100%)', + '-ms-transform': 'translateY(-100%)', + 'transform': 'translateY(-100%)' + } ); + } + }, 250 ) ); + } + + if ( generateWooCommerce.stickyAddToCart ) { + var lastScroll = 0; + $( window ).on( 'scroll', throttle( function() { + var adminBar = $( '#wpadminbar' ), + stickyNav = $( '.navigation-stick' ), + top = 0, + scrollTop = $( window ).scrollTop(), + panel = $( '.add-to-cart-panel' ), + panelPosition = panel.offset().top + panel.outerHeight(), + button = $( '.single_add_to_cart_button' ), + buttonTop = button.offset().top, + buttonHeight = button.outerHeight(), + footerTop = $( '.site-footer' ).offset().top; + + if ( adminBar.length ) { + top = adminBar.outerHeight(); + } + + if ( stickyNav.length ) { + if ( stickyNav.hasClass( 'auto-hide-sticky' ) ) { + if ( scrollTop < lastScroll && '0px' === stickyNav.css( 'top' ) ) { + top = top + stickyNav.outerHeight(); + } else { + top = top; + } + + lastScroll = scrollTop; + } else { + top = top + stickyNav.outerHeight(); + } + } + + if ( scrollTop > ( buttonTop + buttonHeight ) && panelPosition < footerTop ) { + panel.addClass( 'show-sticky-add-to-cart' ).css( { + '-webkit-transform': 'translateY(' + top + 'px)', + '-ms-transform': 'translateY(' + top + 'px)', + 'transform': 'translateY(' + top + 'px)' + } ); + } else { + panel.removeClass( 'show-sticky-add-to-cart' ).css( { + '-webkit-transform': '', + '-ms-transform': '', + 'transform': '' + } ); + } + }, 250 ) ); + + $( '.go-to-variables' ).on( 'click', function( e ) { + e.preventDefault(); + + var offset = 0, + stickyNav = $( '.navigation-stick' ), + adminBar = $( '#wpadminbar' ); + + if ( stickyNav.length ) { + offset = stickyNav.outerHeight(); + } + + if ( adminBar.length ) { + offset = offset + adminBar.outerHeight(); + } + + $( 'html, body' ).animate({ + scrollTop: $( '.variations' ).offset().top - offset + }, 250 ); + } ); + } + + $( document ).on( 'ready', function() { + "use strict"; + + if ( generateWooCommerce.quantityButtons ) { + generateQuantityButtons(); + } + } ); + + $( document ).ajaxComplete( function() { + "use strict"; + + if ( generateWooCommerce.quantityButtons ) { + generateQuantityButtons(); + } + } ); + + function generateQuantityButtons( quantitySelector ) { + var quantityBoxes, + cart = $( '.woocommerce div.product form.cart' ); + + if ( cart.closest( '.elementor-add-to-cart' ).length ) { + $( '.elementor.product' ).removeClass( 'do-quantity-buttons' ); + return; + } + + if ( ! quantitySelector ) { + quantitySelector = '.qty'; + } + + quantityBoxes = $( 'div.quantity:not(.buttons-added), td.quantity:not(.buttons-added)' ).find( quantitySelector ); + + if ( quantityBoxes && 'date' !== quantityBoxes.prop( 'type' ) && 'hidden' !== quantityBoxes.prop( 'type' ) ) { + + // Add plus and minus icons + quantityBoxes.parent().addClass( 'buttons-added' ).prepend('-'); + quantityBoxes.after('+'); + + // Target quantity inputs on product pages + $( 'input' + quantitySelector + ':not(.product-quantity input' + quantitySelector + ')' ).each( function() { + var min = parseFloat( $( this ).attr( 'min' ) ); + + if ( min && min > 0 && parseFloat( $( this ).val() ) < min ) { + $( this ).val( min ); + } + }); + + // Quantity input + if ( $( 'body' ).hasClass( 'single-product' ) && ! cart.hasClass( 'grouped_form' ) ) { + var quantityInput = $( '.woocommerce form input[type=number].qty' ); + quantityInput.on( 'keyup', function() { + var qty_val = $( this ).val(); + quantityInput.val( qty_val ); + }); + } + + $( '.plus, .minus' ).unbind( 'click' ); + + $( '.plus, .minus' ).on( 'click', function() { + + // Quantity + var quantityBox; + + // If floating bar is enabled + if ( $( 'body' ).hasClass( 'single-product' ) && ! cart.hasClass( 'grouped_form' ) && ! cart.hasClass( 'cart_group' ) ) { + quantityBox = $( '.plus, .minus' ).closest( '.quantity' ).find( quantitySelector ); + } else { + quantityBox = $( this ).closest( '.quantity' ).find( quantitySelector ); + } + + // Get values + var currentQuantity = parseFloat( quantityBox.val() ), + maxQuantity = parseFloat( quantityBox.attr( 'max' ) ), + minQuantity = parseFloat( quantityBox.attr( 'min' ) ), + step = quantityBox.attr( 'step' ); + + // Fallback default values + if ( ! currentQuantity || '' === currentQuantity || 'NaN' === currentQuantity ) { + currentQuantity = 0; + } + + if ( '' === maxQuantity || 'NaN' === maxQuantity ) { + maxQuantity = ''; + } + + if ( '' === minQuantity || 'NaN' === minQuantity ) { + minQuantity = 0; + } + + if ( 'any' === step || '' === step || undefined === step || 'NaN' === parseFloat( step ) ) { + step = 1; + } + + // Change the value + if ( $( this ).is( '.plus' ) ) { + + if ( maxQuantity && ( maxQuantity == currentQuantity || currentQuantity > maxQuantity ) ) { + quantityBox.val( maxQuantity ); + } else { + quantityBox.val( currentQuantity + parseFloat( step ) ); + } + + } else { + + if ( minQuantity && ( minQuantity == currentQuantity || currentQuantity < minQuantity ) ) { + quantityBox.val( minQuantity ); + } else if ( currentQuantity > 0 ) { + quantityBox.val( currentQuantity - parseFloat( step ) ); + } + + } + + // Trigger change event + quantityBox.trigger( 'change' ); + + } ); + } + } +}); diff --git a/wp-content/plugins/gp-premium/woocommerce/functions/js/woocommerce.min.js b/wp-content/plugins/gp-premium/woocommerce/functions/js/woocommerce.min.js new file mode 100644 index 0000000..349992e --- /dev/null +++ b/wp-content/plugins/gp-premium/woocommerce/functions/js/woocommerce.min.js @@ -0,0 +1 @@ +jQuery(document).ready(function(l){var t=function(s,o,n){var r,i;return o||(o=250),function(){var t=n||this,a=+new Date,e=arguments;r&&a-'),t.after('+'),l("input"+n+":not(.product-quantity input"+n+")").each(function(){var t=parseFloat(l(this).attr("min"));t&&0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gp_elements + + + _generate_element_content + _generate_element_type + _generate_element_display_conditions + _generate_element_exclude_conditions + _generate_element_user_conditions + _generate_hook + _generate_hook_execute_shortcodes + _generate_hook_execute_php + _generate_hook_priority + _generate_hook_disable_site_header + _generate_hook_disable_site_footer + _generate_hero_custom_classes + _generate_hero_container + _generate_hero_inner_container + _generate_hero_horizontal_alignment + _generate_hero_padding_top + _generate_hero_padding_right + _generate_hero_padding_bottom + _generate_hero_padding_left + _generate_hero_padding_top_unit + _generate_hero_padding_right_unit + _generate_hero_padding_bottom_unit + _generate_hero_padding_left_unit + _generate_hero_padding_top_mobile + _generate_hero_padding_right_mobile + _generate_hero_padding_bottom_mobile + _generate_hero_padding_left_mobile + _generate_hero_padding_top_unit_mobile + _generate_hero_padding_right_unit_mobile + _generate_hero_padding_bottom_unit_mobile + _generate_hero_padding_left_unit_mobile + _generate_hero_background_image + _generate_hero_background_position + _generate_hero_background_parallax + _generate_hero_disable_featured_image + _generate_hero_background_overlay + _generate_hero_background_color + _generate_hero_text_color + _generate_hero_link_color + _generate_hero_background_link_color_hover + _generate_site_header_merge + _generate_site_header_height + _generate_site_header_height_mobile + _generate_site_header_background_color + _generate_site_header_title_color + _generate_site_header_tagline_color + _generate_site_logo + _generate_retina_logo + _generate_navigation_logo + _generate_mobile_logo + _generate_navigation_location + _generate_navigation_colors + _generate_navigation_background_color + _generate_navigation_text_color + _generate_navigation_background_color_hover + _generate_navigation_text_color_hover + _generate_navigation_background_color_current + _generate_navigation_text_color_current + _generate_sidebar_layout + _generate_footer_widgets + _generate_disable_site_header + _generate_disable_top_bar + _generate_disable_primary_navigation + _generate_disable_secondary_navigation + _generate_disable_featured_image + _generate_disable_content_title + _generate_disable_footer + _generate_content_area + _generate_content_width + + diff --git a/wp-content/plugins/index.php b/wp-content/plugins/index.php new file mode 100644 index 0000000..6220032 --- /dev/null +++ b/wp-content/plugins/index.php @@ -0,0 +1,2 @@ + + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) 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 +this service 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 make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. 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. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +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 +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE 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. + + 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 +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + 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 2 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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision 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, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + {signature of Ty Coon}, 1 April 1989 + Ty Coon, President of Vice + +This 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. diff --git a/wp-content/plugins/menu-icons/assets/banner-1544x500.jpg b/wp-content/plugins/menu-icons/assets/banner-1544x500.jpg new file mode 100644 index 0000000..3a10b5c Binary files /dev/null and b/wp-content/plugins/menu-icons/assets/banner-1544x500.jpg differ diff --git a/wp-content/plugins/menu-icons/assets/banner-772x250.jpg b/wp-content/plugins/menu-icons/assets/banner-772x250.jpg new file mode 100644 index 0000000..3a10b5c Binary files /dev/null and b/wp-content/plugins/menu-icons/assets/banner-772x250.jpg differ diff --git a/wp-content/plugins/menu-icons/assets/screenshot-1.png b/wp-content/plugins/menu-icons/assets/screenshot-1.png new file mode 100644 index 0000000..94c255d Binary files /dev/null and b/wp-content/plugins/menu-icons/assets/screenshot-1.png differ diff --git a/wp-content/plugins/menu-icons/assets/screenshot-2.png b/wp-content/plugins/menu-icons/assets/screenshot-2.png new file mode 100644 index 0000000..9e1d6b7 Binary files /dev/null and b/wp-content/plugins/menu-icons/assets/screenshot-2.png differ diff --git a/wp-content/plugins/menu-icons/assets/screenshot-3.png b/wp-content/plugins/menu-icons/assets/screenshot-3.png new file mode 100644 index 0000000..0adbd96 Binary files /dev/null and b/wp-content/plugins/menu-icons/assets/screenshot-3.png differ diff --git a/wp-content/plugins/menu-icons/assets/screenshot-4.png b/wp-content/plugins/menu-icons/assets/screenshot-4.png new file mode 100644 index 0000000..e3baa44 Binary files /dev/null and b/wp-content/plugins/menu-icons/assets/screenshot-4.png differ diff --git a/wp-content/plugins/menu-icons/assets/screenshot-5.png b/wp-content/plugins/menu-icons/assets/screenshot-5.png new file mode 100644 index 0000000..2c899ac Binary files /dev/null and b/wp-content/plugins/menu-icons/assets/screenshot-5.png differ diff --git a/wp-content/plugins/menu-icons/assets/screenshot-6.png b/wp-content/plugins/menu-icons/assets/screenshot-6.png new file mode 100644 index 0000000..1dc1760 Binary files /dev/null and b/wp-content/plugins/menu-icons/assets/screenshot-6.png differ diff --git a/wp-content/plugins/menu-icons/assets/screenshot-7.png b/wp-content/plugins/menu-icons/assets/screenshot-7.png new file mode 100644 index 0000000..2e4565d Binary files /dev/null and b/wp-content/plugins/menu-icons/assets/screenshot-7.png differ diff --git a/wp-content/plugins/menu-icons/assets/screenshot-8.png b/wp-content/plugins/menu-icons/assets/screenshot-8.png new file mode 100644 index 0000000..165b1a1 Binary files /dev/null and b/wp-content/plugins/menu-icons/assets/screenshot-8.png differ diff --git a/wp-content/plugins/menu-icons/css/admin.css b/wp-content/plugins/menu-icons/css/admin.css new file mode 100644 index 0000000..87301d4 --- /dev/null +++ b/wp-content/plugins/menu-icons/css/admin.css @@ -0,0 +1,185 @@ +.menu-icons-wrap { + margin-top: 5px; + margin-bottom: 5px; +} + +.menu-icons-wrap p { + min-height: 2.2em; + margin-bottom: 0; +} + +.menu-icons-wrap p a, +.menu-icons-wrap p label { + display: inline-block; + height: 100%; + line-height: 2.2em; + vertical-align: middle; +} + +.menu-icons-wrap a { + text-decoration: none; + cursor: pointer; +} + +.menu-icons-wrap .submitdelete { + display: inline-block; + float: none; + height: 100%; + margin: 0; + padding: 0; + line-height: 2.2em; +} + +.menu-icons-wrap .hidden { + display: none; +} + +.menu-icons-wrap ._icon { + width: auto; + height: auto; + margin: -0.1em 0.2em 0 0.2em; + color: #666; + font-size: 1.9em; + vertical-align: middle; +} + +.menu-icons-wrap img._icon { + max-width: 24px; +} + +.menu-icons-wrap a._select:focus ._icon, +.menu-icons-wrap a._select:hover ._icon { + color: #101010; +} + +.mi-preview.menu-item { + min-height: 0; + font-size: 1.2em; +} + +.mi-preview.menu-item a { + text-decoration: none; +} + +.mi-preview.menu-item a > * { + display: inline-block; + height: 100%; + line-height: 100%; + vertical-align: middle; +} + +.mi-preview.menu-item ._icon { + margin-right: 0.25em; +} + +.rtl .mi-preview.menu-item ._icon { + margin-right: 0; +} + +.media-sidebar .mi-settings .setting input[type="number"], +.menu-icons-settings input[type="number"] { + float: none; + width: auto; + max-width: 5em; +} + +.media-sidebar .mi-settings .setting input, +.media-sidebar .mi-settings span.description { + float: none; +} + +/** Settings Meta Box **/ +.menu-icons-settings ._field { + padding: 0.5em 0; +} + +.menu-icons-settings ._field ._main { + display: block; + margin-bottom: 0.25em; + font-weight: bold; +} + +#menu-settings-column .menu-icons-settings .inside { + margin-top: 0; +} + +.menu-icons-settings .taxonomydiv .tabs-panel { + max-height: none; + margin-bottom: 0.75em; + padding-top: 0.3em; + padding-bottom: 0.4em; +} + +.js .menu-icons-settings .taxonomydiv .tabs-panel { + margin-bottom: 0; +} + +.menu-icons-settings h4 { + margin: 0; +} + +.menu-icons-settings ._menu span.description { + margin-left: 0.5em; +} + +.menu-icons-settings ._extensions ul { + margin-top: 0.75em; + padding-left: 1.5em; + list-style: disc; +} + +.menu-icons-settings ._extensions ul a { + text-decoration: none; +} + +.menu-icons-settings .spinner { + float: none; + margin: 0 5px 0 0; + vertical-align: middle; +} + +.attachment .svg-icon img { + max-width: 100%; +} + +.menu-icons-upgrade-hestia { + width: 90%; + margin-top: 0; + padding: 15px; +} + + +#menu-icons-sidebar div.new-card { + width: auto; + min-width: initial; + max-width: initial; + margin: 10px auto; +} + +.menu-icons-subscribe { + padding: 15px; +} + +.menu-icons-submit-mail { + width: auto; +} + +#success{ + display: none; +} + +#failure{ + display: none; +} + +.attachments-browser.iconpicker-fonts-browser .media-toolbar { + width: 62%; +} + +.attachments-browser.iconpicker-fonts-browser .attachments.iconpicker-items { + width: 64%; +} + +.attachments-browser.iconpicker-fonts-browser .media-sidebar { + width: 32%; +} \ No newline at end of file diff --git a/wp-content/plugins/menu-icons/css/admin.min.css b/wp-content/plugins/menu-icons/css/admin.min.css new file mode 100644 index 0000000..53eaa98 --- /dev/null +++ b/wp-content/plugins/menu-icons/css/admin.min.css @@ -0,0 +1 @@ +.menu-icons-settings ._extensions ul a,.menu-icons-wrap a,.mi-preview.menu-item a{text-decoration:none}.menu-icons-wrap{margin-top:5px;margin-bottom:5px}.menu-icons-wrap p{min-height:2.2em;margin-bottom:0}.menu-icons-wrap p a,.menu-icons-wrap p label{display:inline-block;height:100%;line-height:2.2em;vertical-align:middle}.menu-icons-wrap a{cursor:pointer}.menu-icons-wrap .submitdelete{display:inline-block;float:none;height:100%;margin:0;padding:0;line-height:2.2em}.menu-icons-wrap .hidden{display:none}.menu-icons-wrap ._icon{width:auto;height:auto;margin:-.1em .2em 0;color:#666;font-size:1.9em;vertical-align:middle}.menu-icons-wrap img._icon{max-width:24px}.menu-icons-wrap a._select:focus ._icon,.menu-icons-wrap a._select:hover ._icon{color:#101010}.mi-preview.menu-item{min-height:0;font-size:1.2em}.mi-preview.menu-item a>*{display:inline-block;height:100%;line-height:100%;vertical-align:middle}.mi-preview.menu-item ._icon{margin-right:.25em}.rtl .mi-preview.menu-item ._icon{margin-right:0}.media-sidebar .mi-settings .setting input[type=number],.menu-icons-settings input[type=number]{float:none;width:auto;max-width:5em}.media-sidebar .mi-settings .setting input,.media-sidebar .mi-settings span.description{float:none}.menu-icons-settings ._field{padding:.5em 0}.menu-icons-settings ._field ._main{display:block;margin-bottom:.25em;font-weight:700}#menu-settings-column .menu-icons-settings .inside{margin-top:0}.menu-icons-settings .taxonomydiv .tabs-panel{max-height:none;margin-bottom:.75em;padding-top:.3em;padding-bottom:.4em}.js .menu-icons-settings .taxonomydiv .tabs-panel{margin-bottom:0}.menu-icons-settings h4{margin:0}.menu-icons-settings ._menu span.description{margin-left:.5em}.menu-icons-settings ._extensions ul{margin-top:.75em;padding-left:1.5em;list-style:disc}.menu-icons-settings .spinner{float:none;margin:0 5px 0 0;vertical-align:middle}.attachment .svg-icon img{max-width:100%}.menu-icons-upgrade-hestia{width:90%;margin-top:0;padding:15px}#menu-icons-sidebar div.new-card{width:auto;min-width:initial;max-width:initial;margin:10px auto}.menu-icons-subscribe{padding:15px}.menu-icons-submit-mail{width:auto}#failure,#success{display:none}.attachments-browser.iconpicker-fonts-browser .media-toolbar{width:62%}.attachments-browser.iconpicker-fonts-browser .attachments.iconpicker-items{width:64%}.attachments-browser.iconpicker-fonts-browser .media-sidebar{width:32%} \ No newline at end of file diff --git a/wp-content/plugins/menu-icons/css/extra.css b/wp-content/plugins/menu-icons/css/extra.css new file mode 100644 index 0000000..ec8b2a6 --- /dev/null +++ b/wp-content/plugins/menu-icons/css/extra.css @@ -0,0 +1,74 @@ +.menu-item i._mi, +.menu-item img._mi { + display: inline-block; + vertical-align: middle; +} + +.menu-item i._mi { + width: auto; + height: auto; + margin-top: -0.265em; + font-size: 1.2em; + line-height: 1; +} + +.menu-item i._before, +.rtl .menu-item i._after { + margin-right: 0.25em; +} + +.menu-item i._after, +.rtl .menu-item i._before { + margin-left: 0.25em; +} + +.menu-item img._before, +.rtl .menu-item img._after { + margin-right: 0.5em; +} + +.menu-item img._after, +.rtl .menu-item img._before { + margin-left: 0.5em; +} + +.menu-item ._svg { + width: 1em; +} + +.rtl .menu-item i._before { + margin-right: 0; +} + +.rtl .menu-item i._after { + margin-left: 0; +} + +.visuallyhidden { + overflow: hidden; + clip: rect(0 0 0 0); + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + border: 0; +} + +.menu-item i.elusive { + margin-top: -0.3em; +} + +/** + * Force the icons' styles + * + * Some themes -- notably 2014 -- has nasty rules that + * could override the icons' styles so we need to force them here. + */ +.dashicons-admin-site:before { + content: "\f319" !important; +} + +.dashicons-welcome-view-site:before { + content: "\f115" !important; +} diff --git a/wp-content/plugins/menu-icons/css/extra.min.css b/wp-content/plugins/menu-icons/css/extra.min.css new file mode 100644 index 0000000..7ff02d8 --- /dev/null +++ b/wp-content/plugins/menu-icons/css/extra.min.css @@ -0,0 +1 @@ +.menu-item i._mi,.menu-item img._mi{display:inline-block;vertical-align:middle}.menu-item i._mi{width:auto;height:auto;margin-top:-.265em;font-size:1.2em;line-height:1}.menu-item i._before,.rtl .menu-item i._after{margin-right:.25em}.menu-item i._after,.rtl .menu-item i._before{margin-left:.25em}.menu-item img._before,.rtl .menu-item img._after{margin-right:.5em}.menu-item img._after,.rtl .menu-item img._before{margin-left:.5em}.menu-item ._svg{width:1em}.rtl .menu-item i._before{margin-right:0}.rtl .menu-item i._after{margin-left:0}.visuallyhidden{overflow:hidden;clip:rect(0 0 0 0);position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0}.menu-item i.elusive{margin-top:-.3em}.dashicons-admin-site:before{content:"\f319"!important}.dashicons-welcome-view-site:before{content:"\f115"!important} \ No newline at end of file diff --git a/wp-content/plugins/menu-icons/includes/front.php b/wp-content/plugins/menu-icons/includes/front.php new file mode 100644 index 0000000..8667ba2 --- /dev/null +++ b/wp-content/plugins/menu-icons/includes/front.php @@ -0,0 +1,430 @@ + + */ +final class Menu_Icons_Front_End { + + /** + * Icon types + * + * @since 0.9.0 + * @access protected + * @var array + */ + protected static $icon_types = array(); + + /** + * Default icon style + * + * @since 0.9.0 + * @access protected + * @var array + */ + protected static $default_style = array( + 'font_size' => array( + 'property' => 'font-size', + 'value' => '1.2', + 'unit' => 'em', + ), + 'vertical_align' => array( + 'property' => 'vertical-align', + 'value' => 'middle', + 'unit' => null, + ), + 'svg_width' => array( + 'property' => 'width', + 'value' => '1', + 'unit' => 'em', + ), + ); + + /** + * Hidden label class + * + * @since 0.9.0 + * @access protected + * @var string + */ + protected static $hidden_label_class = 'visuallyhidden'; + + + /** + * Add hooks for front-end functionalities + * + * @since 0.9.0 + */ + public static function init() { + $active_types = Menu_Icons_Settings::get( 'global', 'icon_types' ); + + if ( empty( $active_types ) ) { + return; + } + + foreach ( Menu_Icons::get( 'types' ) as $type ) { + if ( in_array( $type->id, $active_types, true ) ) { + self::$icon_types[ $type->id ] = $type; + } + } + + /** + * Allow themes/plugins to override the hidden label class + * + * @since 0.8.0 + * @param string $hidden_label_class Hidden label class. + * @return string + */ + self::$hidden_label_class = apply_filters( 'menu_icons_hidden_label_class', self::$hidden_label_class ); + + /** + * Allow themes/plugins to override default inline style + * + * @since 0.9.0 + * @param array $default_style Default inline style. + * @return array + */ + self::$default_style = apply_filters( 'menu_icons_default_style', self::$default_style ); + + add_action( 'wp_enqueue_scripts', array( __CLASS__, '_enqueue_styles' ), 7 ); + add_filter( 'wp_nav_menu_args', array( __CLASS__, '_add_menu_item_title_filter' ) ); + add_filter( 'wp_nav_menu', array( __CLASS__, '_remove_menu_item_title_filter' ) ); + } + + + /** + * Get nav menu ID based on arguments passed to wp_nav_menu() + * + * @since 0.3.0 + * @param array $args wp_nav_menu() Arguments + * @return mixed Nav menu ID or FALSE on failure + */ + public static function get_nav_menu_id( $args ) { + $args = (object) $args; + $menu = wp_get_nav_menu_object( $args->menu ); + + // Get the nav menu based on the theme_location + if ( ! $menu + && $args->theme_location + && ( $locations = get_nav_menu_locations() ) + && isset( $locations[ $args->theme_location ] ) + ) { + $menu = wp_get_nav_menu_object( $locations[ $args->theme_location ] ); + } + + // get the first menu that has items if we still can't find a menu + if ( ! $menu && ! $args->theme_location ) { + $menus = wp_get_nav_menus(); + foreach ( $menus as $menu_maybe ) { + if ( $menu_items = wp_get_nav_menu_items( $menu_maybe->term_id, array( 'update_post_term_cache' => false ) ) ) { + $menu = $menu_maybe; + break; + } + } + } + + if ( is_object( $menu ) && ! is_wp_error( $menu ) ) { + return $menu->term_id; + } else { + return false; + } + } + + + /** + * Enqueue stylesheets + * + * @since 0.1.0 + * @wp_hook action wp_enqueue_scripts + * @link http://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts + */ + public static function _enqueue_styles() { + foreach ( self::$icon_types as $type ) { + if ( wp_style_is( $type->stylesheet_id, 'registered' ) ) { + wp_enqueue_style( $type->stylesheet_id ); + } + } + + /** + * Allow plugins/themes to override the extra stylesheet location + * + * @since 0.9.0 + * @param string $extra_stylesheet_uri Extra stylesheet URI. + */ + $extra_stylesheet_uri = apply_filters( + 'menu_icons_extra_stylesheet_uri', + sprintf( '%scss/extra%s.css', Menu_Icons::get( 'url' ), kucrut_get_script_suffix() ) + ); + + wp_enqueue_style( + 'menu-icons-extra', + $extra_stylesheet_uri, + false, + Menu_Icons::VERSION + ); + } + + + /** + * Add filter to 'the_title' hook + * + * We need to filter the menu item title but **not** regular post titles. + * Thus, we're adding the filter when `wp_nav_menu()` is called. + * + * @since 0.1.0 + * @wp_hook filter wp_nav_menu_args + * @param array $args Not used. + * + * @return array + */ + public static function _add_menu_item_title_filter( $args ) { + add_filter( 'the_title', array( __CLASS__, '_add_icon' ), 999, 2 ); + + return $args; + } + + + /** + * Remove filter from 'the_title' hook + * + * Because we don't want to filter post titles, we need to remove our + * filter when `wp_nav_menu()` exits. + * + * @since 0.1.0 + * @wp_hook filter wp_nav_menu + * @param array $nav_menu Not used. + * @return array + */ + public static function _remove_menu_item_title_filter( $nav_menu ) { + remove_filter( 'the_title', array( __CLASS__, '_add_icon' ), 999, 2 ); + + return $nav_menu; + } + + + /** + * Add icon to menu item title + * + * @since 0.1.0 + * @since 0.9.0 Renamed the method to `add_icon()`. + * @wp_hook filter the_title + * @param string $title Menu item title. + * @param int $id Menu item ID. + * + * @return string + */ + public static function _add_icon( $title, $id ) { + $meta = Menu_Icons_Meta::get( $id ); + $icon = self::get_icon( $meta ); + + if ( empty( $icon ) ) { + return $title; + } + + $title_class = ! empty( $meta['hide_label'] ) ? self::$hidden_label_class : ''; + $title_wrapped = sprintf( + '%s', + ( ! empty( $title_class ) ) ? sprintf( ' class="%s"', esc_attr( $title_class ) ) : '', + $title + ); + + if ( 'after' === $meta['position'] ) { + $title_with_icon = "{$title_wrapped}{$icon}"; + } else { + $title_with_icon = "{$icon}{$title_wrapped}"; + } + + /** + * Allow plugins/themes to override menu item markup + * + * @since 0.8.0 + * + * @param string $title_with_icon Menu item markup after the icon is added. + * @param integer $id Menu item ID. + * @param array $meta Menu item metadata values. + * @param string $title Original menu item title. + * + * @return string + */ + $title_with_icon = apply_filters( 'menu_icons_item_title', $title_with_icon, $id, $meta, $title ); + + return $title_with_icon; + } + + + /** + * Get icon + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @return string + */ + public static function get_icon( $meta ) { + $icon = ''; + + // Icon type is not set. + if ( empty( $meta['type'] ) ) { + return $icon; + } + + // Icon is not set. + if ( empty( $meta['icon'] ) ) { + return $icon; + } + + // Icon type is not registered/enabled. + if ( ! isset( self::$icon_types[ $meta['type'] ] ) ) { + return $icon; + } + + $type = self::$icon_types[ $meta['type'] ]; + + $callbacks = array( + array( $type, 'get_icon' ), + array( __CLASS__, "get_{$type->id}_icon" ), + array( __CLASS__, "get_{$type->template_id}_icon" ), + ); + + foreach ( $callbacks as $callback ) { + if ( is_callable( $callback ) ) { + $icon = call_user_func( $callback, $meta ); + break; + } + } + + return $icon; + } + + + /** + * Get icon style + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @param array $keys Style properties. + * @param bool $as_attribute Optional. Whether to output the style as HTML attribute or value only. + * Defaults to TRUE. + * @return string + */ + public static function get_icon_style( $meta, $keys, $as_attribute = true ) { + $style_a = array(); + $style_s = ''; + + foreach ( $keys as $key ) { + if ( ! isset( self::$default_style[ $key ] ) ) { + continue; + } + + $rule = self::$default_style[ $key ]; + + if ( ! isset( $meta[ $key ] ) || $meta[ $key ] === $rule['value'] ) { + continue; + } + + $value = $meta[ $key ]; + if ( ! empty( $rule['unit'] ) ) { + $value .= $rule['unit']; + } + + $style_a[ $rule['property'] ] = $value; + } + + if ( empty( $style_a ) ) { + return $style_s; + } + + foreach ( $style_a as $key => $value ) { + $style_s .= "{$key}:{$value};"; + } + + $style_s = esc_attr( $style_s ); + + if ( $as_attribute ) { + $style_s = sprintf( ' style="%s"', $style_s ); + } + + return $style_s; + } + + + /** + * Get icon classes + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @param string $output Whether to output the classes as string or array. Defaults to string. + * @return string|array + */ + public static function get_icon_classes( $meta, $output = 'string' ) { + $classes = array( '_mi' ); + + if ( empty( $meta['hide_label'] ) ) { + $classes[] = "_{$meta['position']}"; + } + + if ( 'string' === $output ) { + $classes = implode( ' ', $classes ); + } + + return $classes; + } + + + /** + * Get font icon + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @return string + */ + public static function get_font_icon( $meta ) { + $classes = sprintf( '%s %s %s', self::get_icon_classes( $meta ), $meta['type'], $meta['icon'] ); + $style = self::get_icon_style( $meta, array( 'font_size', 'vertical_align' ) ); + + return sprintf( '', esc_attr( $classes ), $style ); + } + + + /** + * Get image icon + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @return string + */ + public static function get_image_icon( $meta ) { + $args = array( + 'class' => sprintf( '%s _image', self::get_icon_classes( $meta ) ), + 'aria-hidden' => 'true', + ); + + $style = self::get_icon_style( $meta, array( 'vertical_align' ), false ); + if ( ! empty( $style ) ) { + $args['style'] = $style; + } + + return wp_get_attachment_image( $meta['icon'], $meta['image_size'], false, $args ); + } + + + /** + * Get SVG icon + * + * @since 0.9.0 + * @param array $meta Menu item meta value. + * @return string + */ + public static function get_svg_icon( $meta ) { + $classes = sprintf( '%s _svg', self::get_icon_classes( $meta ) ); + $style = self::get_icon_style( $meta, array( 'svg_width', 'vertical_align' ) ); + + return sprintf( + '', + esc_url( wp_get_attachment_url( $meta['icon'] ) ), + esc_attr( $classes ), + $style + ); + } +} diff --git a/wp-content/plugins/menu-icons/includes/library/compat.php b/wp-content/plugins/menu-icons/includes/library/compat.php new file mode 100644 index 0000000..cf7ca6b --- /dev/null +++ b/wp-content/plugins/menu-icons/includes/library/compat.php @@ -0,0 +1,23 @@ + + */ + +/** + * Form Fields + */ +abstract class Kucrut_Form_Field { + + /** + * Holds field & argument defaults + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected static $defaults = array( + 'field' => array( + 'id' => '', + 'type' => 'text', + 'value' => null, + 'default' => null, + 'attributes' => array(), + 'description' => '', + 'choices' => array(), + ), + 'args' => array( + 'keys' => array(), + 'inline_description' => false, + ), + ); + + /** + * Holds field attributes + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected static $types = array( + 'text' => 'Kucrut_Form_Field_Text', + 'number' => 'Kucrut_Form_Field_Text', + 'url' => 'Kucrut_Form_Field_Text', + 'color' => 'Kucrut_Form_Field_Text', + 'date' => 'Kucrut_Form_Field_Text', + 'hidden' => 'Kucrut_Form_Field_Text', + 'checkbox' => 'Kucrut_Form_Field_Checkbox', + 'radio' => 'Kucrut_Form_Field_Radio', + 'textarea' => 'Kucrut_Form_Field_Textarea', + 'select' => 'Kucrut_Form_Field_Select', + 'select_multiple' => 'Kucrut_Form_Field_Select_Multiple', + 'select_pages' => 'Kucrut_Form_Field_Select_Pages', + 'special' => 'Kucrut_Form_Field_Special', + ); + + /** + * Holds forbidden attributes + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected static $forbidden_attributes = array( + 'id', + 'name', + 'value', + 'checked', + 'multiple', + ); + + /** + * Holds allowed html tags + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected $allowed_html = array( + 'a' => array( + 'href' => true, + 'target' => true, + 'title' => true, + ), + 'code' => true, + 'em' => true, + 'p' => array( 'class' => true ), + 'span' => array( 'class' => true ), + 'strong' => true, + ); + + /** + * Holds constructed field + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected $field; + + + /** + * Holds field attributes + * + * @since 0.1.0 + * @var array + * @access protected + */ + protected $attributes = array(); + + + /** + * Loader + * + * @param string URL path to this directory + */ + final public static function load( $url_path = null ) { + // Set URL path for assets + if ( ! is_null( $url_path ) ) { + self::$url_path = $url_path; + } else { + self::$url_path = plugin_dir_url( __FILE__ ); + } + + // Supported field types + self::$types = apply_filters( + 'form_field_types', + self::$types + ); + } + + + /** + * Create field + * + * @param array $field Field array + * @param array $args Extra field arguments + */ + final public static function create( array $field, $args = array() ) { + $field = wp_parse_args( $field, self::$defaults['field'] ); + if ( ! isset( self::$types[ $field['type'] ] ) + || ! is_subclass_of( self::$types[ $field['type'] ], __CLASS__ ) + ) { + trigger_error( + sprintf( + esc_html__( '%1$s: Type %2$s is not supported, reverting to text.', 'menu-icons' ), + __CLASS__, + esc_html( $field['type'] ) + ), + E_USER_WARNING + ); + $field['type'] = 'text'; + } + + if ( is_null( $field['value'] ) && ! is_null( $field['default'] ) ) { + $field['value'] = $field['default']; + } + + foreach ( self::$forbidden_attributes as $key ) { + unset( $field['attributes'][ $key ] ); + } + + $args = (object) wp_parse_args( $args, self::$defaults['args'] ); + $class = self::$types[ $field['type'] ]; + + return new $class( $field, $args ); + } + + + /** + * Constructor + * + * @since 0.1.0 + * @param array $field Field array + * @param object $args Extra field arguments + */ + public function __construct( $field, $args ) { + $this->field = $field; + $this->args = $args; + + if ( ! is_array( $this->args->keys ) ) { + $this->args->keys = array(); + } + $this->args->keys[] = $field['id']; + + $this->attributes['id'] = $this->create_id(); + $this->attributes['name'] = $this->create_name(); + + $this->attributes = wp_parse_args( + $this->attributes, + (array) $field['attributes'] + ); + + $this->set_properties(); + } + + + /** + * Attribute + * + * @since 0.1.0 + * @param string $key Attribute key + * @return mixed NULL if attribute doesn't exist + */ + public function __get( $key ) { + foreach ( array( 'attributes', 'field' ) as $group ) { + if ( isset( $this->{$group}[ $key ] ) ) { + return $this->{$group}[ $key ]; + } + } + + return null; + } + + + /** + * Create id/name attribute + * + * @since 0.1.0 + * @param string $format Attribute format + */ + protected function create_id_name( $format ) { + return call_user_func_array( + 'sprintf', + array_merge( + array( $format ), + $this->args->keys + ) + ); + } + + + /** + * Create id attribute + * + * @since 0.1.0 + * @access protected + * @return string + */ + protected function create_id() { + $format = implode( '-', $this->args->keys ); + + return $this->create_id_name( $format ); + } + + + /** + * Create name attribute + * + * @since 0.1.0 + * @access protected + * @return string + */ + protected function create_name() { + $format = '%s'; + $format .= str_repeat( '[%s]', ( count( $this->args->keys ) - 1 ) ); + + return $this->create_id_name( $format ); + } + + + /** + * Set field properties + * + * @since 0.1.0 + */ + protected function set_properties() {} + + + /** + * Build field attributes + * + * @since 0.1.0 + * @param array $excludes Attributes to be excluded + * @return string + */ + protected function build_attributes( $excludes = array() ) { + $excludes = array_filter( (array) $excludes ); + $attributes = ''; + + foreach ( $this->attributes as $key => $value ) { + if ( in_array( $key, $excludes, true ) ) { + continue; + } + + if ( 'class' === $key ) { + $value = implode( ' ', (array) $value ); + } + + $attributes .= sprintf( + ' %s="%s"', + esc_attr( $key ), + esc_attr( $value ) + ); + } + + return $attributes; + } + + + /** + * Print field + * + * @since 0.1.0 + */ + abstract public function render(); + + + /** + * Print field description + * + * @since 0.1.0 + */ + public function description() { + if ( ! empty( $this->field['description'] ) ) { + $tag = ( ! empty( $this->args->inline_description ) ) ? 'span' : 'p'; + + printf( // WPCS: XSS ok. + '<%1$s class="description">%2$s', + $tag, + wp_kses( $this->field['description'], $this->allowed_html ) + ); + } + } +} + + +/** + * Field: text + */ +class Kucrut_Form_Field_Text extends Kucrut_Form_Field { + + protected $template = ''; + + + protected function set_properties() { + if ( ! is_string( $this->field['value'] ) ) { + $this->field['value'] = ''; + } + + if ( in_array( $this->field['type'], array( 'text', 'url' ), true ) ) { + if ( ! isset( $this->attributes['class'] ) ) { + $this->attributes['class'] = array(); + } + $this->attributes['class'] = array_unique( + array_merge( + array( 'regular-text' ), + $this->attributes['class'] + ) + ); + } + } + + + public function render() { + printf( // WPCS: xss ok + $this->template, + esc_attr( $this->field['type'] ), + esc_attr( $this->field['value'] ), + $this->build_attributes() + ); + $this->description(); + } +} + + +/** + * Field: Textarea + */ +class Kucrut_Form_Field_Textarea extends Kucrut_Form_Field { + + protected $template = '%s'; + + protected $attributes = array( + 'class' => 'widefat', + 'cols' => 50, + 'rows' => 5, + ); + + + public function render() { + printf( // WPCS: XSS ok. + $this->template, + $this->build_attributes(), + esc_textarea( $this->field['value'] ) + ); + } +} + + +/** + * Field: Checkbox + */ +class Kucrut_Form_Field_Checkbox extends Kucrut_Form_Field { + + protected $template = '
        '; + + + protected function set_properties() { + $this->field['value'] = array_filter( (array) $this->field['value'] ); + $this->attributes['name'] .= '[]'; + } + + + protected function checked( $value ) { + return checked( in_array( $value, $this->field['value'], true ), true, false ); + } + + + public function render() { + foreach ( $this->field['choices'] as $value => $label ) { + printf( // WPCS: XSS ok. + $this->template, + $this->field['type'], + esc_attr( $value ), + $this->checked( $value ), + $this->build_attributes( 'id' ), + esc_html( $label ) + ); + } + } +} + + +/** + * Field: Radio + */ +class Kucrut_Form_Field_Radio extends Kucrut_Form_Field_Checkbox { + + protected function set_properties() { + if ( ! is_string( $this->field['value'] ) ) { + $this->field['value'] = ''; + } + } + + + protected function checked( $value ) { + return checked( $value, $this->field['value'], false ); + } +} + + +/** + * Field: Select + */ +class Kucrut_Form_Field_Select extends Kucrut_Form_Field { + + protected $template = ''; + + + protected function set_properties() { + if ( ! is_string( $this->field['value'] ) ) { + $this->field['value'] = ''; + } + } + + + protected function selected( $value ) { + return selected( ( $value === $this->field['value'] ), true, false ); + } + + + public function render() { + ?> + build_attributes() // xss ok ?>> + field['choices'] as $index => $choice ) : ?> + + template, + esc_attr( $value ), + $this->selected( $value ), + esc_html( $label ) + ); + ?> + + + field['value'] = array_filter( (array) $this->field['value'] ); + $this->attributes['name'] .= '[]'; + $this->attributes['multiple'] = 'multiple'; + } + + + protected function selected( $value ) { + return selected( in_array( $value, $this->field['value'], true ), true, false ); + } +} + + +/** + * Field: Select Pages + */ +class Kucrut_Form_Field_Select_Pages extends Kucrut_Form_Field_Select { + + protected $wp_dropdown_pages_args = array( + 'depth' => 0, + 'child_of' => 0, + 'option_none_value' => '', + ); + + + public function __construct( $field, $args ) { + $this->wp_dropdown_pages_args['show_option_none'] = __( '— Select —', 'menu-icons' ); + parent::__construct( $field, $args ); + } + + + public function set_properties() { + parent::set_properties(); + + if ( empty( $this->args->wp_dropdown_pages_args ) ) { + $this->args->wp_dropdown_pages_args = array(); + } + + // Apply defeaults + $this->args->wp_dropdown_pages_args = wp_parse_args( + $this->args->wp_dropdown_pages_args, + $this->wp_dropdown_pages_args + ); + + // Force some args + $this->args->wp_dropdown_pages_args = array_merge( + $this->args->wp_dropdown_pages_args, + array( + 'echo' => true, + 'name' => $this->attributes['name'], + 'id' => $this->attributes['id'], + 'selected' => $this->field['value'], + ) + ); + } + + + public function render() { + wp_dropdown_pages( $this->args->wp_dropdown_pages_args ); // WPCS: XSS ok. + } +} + + +/** + * Field: Special (Callback) + */ +class Kucrut_Form_Field_Special extends Kucrut_Form_Field { + public function render() { + call_user_func_array( + $this->field['render_cb'], + array( $this ) + ); + } +} diff --git a/wp-content/plugins/menu-icons/includes/library/functions.php b/wp-content/plugins/menu-icons/includes/library/functions.php new file mode 100644 index 0000000..7985369 --- /dev/null +++ b/wp-content/plugins/menu-icons/includes/library/functions.php @@ -0,0 +1,111 @@ + + */ + + +if ( ! function_exists( 'kucrut_get_array_value_deep' ) ) { + /** + * Get value of a multidimensional array + * + * @since 0.1.0 + * @param array $array Haystack + * @param array $keys Needles + * @return mixed + */ + function kucrut_get_array_value_deep( array $array, array $keys ) { + if ( empty( $array ) || empty( $keys ) ) { + return $array; + } + + foreach ( $keys as $idx => $key ) { + unset( $keys[ $idx ] ); + + if ( ! isset( $array[ $key ] ) ) { + return null; + } + + if ( ! empty( $keys ) ) { + $array = $array[ $key ]; + } + } + + if ( ! isset( $array[ $key ] ) ) { + return null; + } + + return $array[ $key ]; + } +} + + +if ( ! function_exists( 'kucrut_validate' ) ) { + /** + * Validate settings values + * + * @param array $values Settings values + * @return array + */ + function kucrut_validate( $values, $sanitize_cb = 'wp_kses_data' ) { + foreach ( $values as $key => $value ) { + if ( is_array( $value ) ) { + $values[ $key ] = kucrut_validate( $value ); + } else { + $values[ $key ] = call_user_func_array( + $sanitize_cb, + array( $value ) + ); + } + } + + return $values; + } +} + + +if ( ! function_exists( 'kucrut_get_image_sizes' ) ) { + /** + * Get image sizes + * + * @since 0.9.0 + * @access protected + * @return array + */ + function kucrut_get_image_sizes() { + $_sizes = array( + 'thumbnail' => __( 'Thumbnail', 'menu-icons' ), + 'medium' => __( 'Medium', 'menu-icons' ), + 'large' => __( 'Large', 'menu-icons' ), + 'full' => __( 'Full Size', 'menu-icons' ), + ); + + $_sizes = apply_filters( 'image_size_names_choose', $_sizes ); + + $sizes = array(); + foreach ( $_sizes as $value => $label ) { + $sizes[] = array( + 'value' => $value, + 'label' => $label, + ); + } + + return $sizes; + } +} + + +if ( ! function_exists( 'kucrut_get_script_suffix' ) ) { + /** + * Get script & style suffix + * + * When SCRIPT_DEBUG is defined true, this will return '.min'. + * + * @return string + */ + function kucrut_get_script_suffix() { + return ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; + } +} diff --git a/wp-content/plugins/menu-icons/includes/media-template.php b/wp-content/plugins/menu-icons/includes/media-template.php new file mode 100644 index 0000000..abe7f16 --- /dev/null +++ b/wp-content/plugins/menu-icons/includes/media-template.php @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ +final class Menu_Icons_Meta { + + const KEY = 'menu-icons'; + + /** + * Default meta value + * + * @since 0.9.0 + * @access protected + * @var array + */ + protected static $defaults = array( + 'type' => '', + 'icon' => '', + 'url' => '', + ); + + + /** + * Initialize metadata functionalities + * + * @since 0.9.0 + */ + public static function init() { + add_filter( 'is_protected_meta', array( __CLASS__, '_protect_meta_key' ), 10, 3 ); + } + + + /** + * Protect meta key + * + * This prevents our meta key from showing up on Custom Fields meta box. + * + * @since 0.3.0 + * @wp_hook filter is_protected_meta + * @param bool $protected Protection status. + * @param string $meta_key Meta key. + * @param string $meta_type Meta type. + * @return bool Protection status. + */ + public static function _protect_meta_key( $protected, $meta_key, $meta_type ) { + if ( self::KEY === $meta_key ) { + $protected = true; + } + + return $protected; + } + + + /** + * Get menu item meta value + * + * @since 0.3.0 + * @since 0.9.0 Add $defaults parameter. + * @param int $id Menu item ID. + * @param array $defaults Optional. Default value. + * @return array + */ + public static function get( $id, $defaults = array() ) { + $defaults = wp_parse_args( $defaults, self::$defaults ); + $value = get_post_meta( $id, self::KEY, true ); + $value = wp_parse_args( (array) $value, $defaults ); + + // Backward-compatibility. + if ( empty( $value['icon'] ) && + ! empty( $value['type'] ) && + ! empty( $value[ "{$value['type']}-icon" ] ) + ) { + $value['icon'] = $value[ "{$value['type']}-icon" ]; + } + + if ( ! empty( $value['width'] ) ) { + $value['svg_width'] = $value['width']; + } + unset( $value['width'] ); + + if ( isset( $value['position'] ) && + ! in_array( $value['position'], array( 'before', 'after' ), true ) + ) { + $value['position'] = $defaults['position']; + } + + if ( isset( $value['size'] ) && ! isset( $value['font_size'] ) ) { + $value['font_size'] = $value['size']; + unset( $value['size'] ); + } + + // The values below will NOT be saved + if ( ! empty( $value['icon'] ) && + in_array( $value['type'], array( 'image', 'svg' ), true ) + ) { + $value['url'] = wp_get_attachment_image_url( $value['icon'], 'thumbnail', false ); + } + + return $value; + } + + + /** + * Update menu item metadata + * + * @since 0.9.0 + * + * @param int $id Menu item ID. + * @param mixed $value Metadata value. + * + * @return void + */ + public static function update( $id, $value ) { + /** + * Allow plugins/themes to filter the values + * + * Deprecated. + * + * @since 0.1.0 + * @param array $value Metadata value. + * @param int $id Menu item ID. + */ + $_value = apply_filters( 'menu_icons_values', $value, $id ); + + if ( $_value !== $value && WP_DEBUG ) { + _deprecated_function( 'menu_icons_values', '0.8.0', 'menu_icons_item_meta_values' ); + } + + /** + * Allow plugins/themes to filter the values + * + * @since 0.8.0 + * @param array $value Metadata value. + * @param int $id Menu item ID. + */ + $value = apply_filters( 'menu_icons_item_meta_values', $_value, $id ); + + // Don't bother saving if `type` or `icon` is not set. + if ( empty( $value['type'] ) || empty( $value['icon'] ) ) { + $value = false; + } + + // Update + if ( ! empty( $value ) ) { + update_post_meta( $id, self::KEY, $value ); + } else { + delete_post_meta( $id, self::KEY ); + } + } +} diff --git a/wp-content/plugins/menu-icons/includes/picker.php b/wp-content/plugins/menu-icons/includes/picker.php new file mode 100644 index 0000000..35709be --- /dev/null +++ b/wp-content/plugins/menu-icons/includes/picker.php @@ -0,0 +1,302 @@ + + */ + + +/** + * Nav menu admin + */ +final class Menu_Icons_Picker { + + /** + * Initialize class + * + * @since 0.1.0 + */ + public static function init() { + add_action( 'load-nav-menus.php', array( __CLASS__, '_load_nav_menus' ) ); + add_filter( 'wp_edit_nav_menu_walker', array( __CLASS__, '_filter_wp_edit_nav_menu_walker' ), 99 ); + add_filter( 'wp_nav_menu_item_custom_fields', array( __CLASS__, '_fields' ), 10, 4 ); + add_filter( 'manage_nav-menus_columns', array( __CLASS__, '_columns' ), 99 ); + add_action( 'wp_update_nav_menu_item', array( __CLASS__, '_save' ), 10, 3 ); + add_filter( 'icon_picker_type_props', array( __CLASS__, '_add_extra_type_props_data' ), 10, 3 ); + } + + + /** + * Load Icon Picker + * + * @since 0.9.0 + * @wp_hook action load-nav-menus.php + */ + public static function _load_nav_menus() { + Icon_Picker::instance()->load(); + + add_action( 'print_media_templates', array( __CLASS__, '_media_templates' ) ); + } + + + + /** + * Custom walker + * + * @since 0.3.0 + * @access protected + * @wp_hook filter wp_edit_nav_menu_walker + */ + public static function _filter_wp_edit_nav_menu_walker( $walker ) { + // Load menu item custom fields plugin + if ( ! class_exists( 'Menu_Item_Custom_Fields_Walker' ) ) { + require_once Menu_Icons::get( 'dir' ) . 'includes/library/menu-item-custom-fields/walker-nav-menu-edit.php'; + } + $walker = 'Menu_Item_Custom_Fields_Walker'; + + return $walker; + } + + + /** + * Get menu item setting fields + * + * @since 0.9.0 + * @access protected + * @param array $meta Menu item meta value. + * @return array + */ + protected static function _get_menu_item_fields( $meta ) { + $fields = array_merge( + array( + array( + 'id' => 'type', + 'label' => __( 'Type', 'menu-icons' ), + 'value' => $meta['type'], + ), + array( + 'id' => 'icon', + 'label' => __( 'Icon', 'menu-icons' ), + 'value' => $meta['icon'], + ), + ), + Menu_Icons_Settings::get_settings_fields( $meta ) + ); + + return $fields; + } + + + /** + * Print fields + * + * @since 0.1.0 + * @access protected + * @uses add_action() Calls 'menu_icons_before_fields' hook + * @uses add_action() Calls 'menu_icons_after_fields' hook + * @wp_hook action menu_item_custom_fields + * + * @param object $item Menu item data object. + * @param int $depth Nav menu depth. + * @param array $args Menu item args. + * @param int $id Nav menu ID. + * + * @return string Form fields + */ + public static function _fields( $id, $item, $depth, $args ) { + $input_id = sprintf( 'menu-icons-%d', $item->ID ); + $input_name = sprintf( 'menu-icons[%d]', $item->ID ); + $menu_settings = Menu_Icons_Settings::get_menu_settings( Menu_Icons_Settings::get_current_menu_id() ); + $meta = Menu_Icons_Meta::get( $item->ID, $menu_settings ); + $fields = self::_get_menu_item_fields( $meta ); + ?> + + id ) { + return; + } + + check_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' ); + + // Sanitize + if ( ! empty( $_POST['menu-icons'][ $menu_item_db_id ] ) ) { + $value = array_map( + 'sanitize_text_field', + wp_unslash( (array) $_POST['menu-icons'][ $menu_item_db_id ] ) + ); + } else { + $value = array(); + } + + Menu_Icons_Meta::update( $menu_item_db_id, $value ); + } + + + /** + * Get and print media templates from all types + * + * @since 0.2.0 + * @since 0.9.0 Deprecate menu_icons_media_templates filter. + * @wp_hook action print_media_templates + */ + public static function _media_templates() { + $id_prefix = 'tmpl-menu-icons'; + + // Deprecated. + $templates = apply_filters( 'menu_icons_media_templates', array() ); + + if ( ! empty( $templates ) ) { + if ( WP_DEBUG ) { + _deprecated_function( 'menu_icons_media_templates', '0.9.0', 'menu_icons_js_templates' ); + } + + foreach ( $templates as $key => $template ) { + $id = sprintf( '%s-%s', $id_prefix, $key ); + self::_print_tempate( $id, $template ); + } + } + + require_once dirname( __FILE__ ) . '/media-template.php'; + } + + + /** + * Print media template + * + * @since 0.2.0 + * @param string $id Template ID. + * @param string $template Media template HTML. + */ + protected static function _print_tempate( $id, $template ) { + ?> + + + */ + +/** + * Menu Icons Settings module + */ +final class Menu_Icons_Settings { + + const UPDATE_KEY = 'menu-icons-settings-update'; + + const RESET_KEY = 'menu-icons-settings-reset'; + + const TRANSIENT_KEY = 'menu_icons_message'; + + /** + * Default setting values + * + * @since 0.3.0 + * @var array + * @access protected + */ + protected static $defaults = array( + 'global' => array( + 'icon_types' => array( 'dashicons' ), + ), + ); + + /** + * Setting values + * + * @since 0.3.0 + * @var array + * @access protected + */ + protected static $settings = array(); + + /** + * Script dependencies + * + * @since 0.9.0 + * @access protected + * @var array + */ + protected static $script_deps = array( 'jquery' ); + + /** + * Settings init + * + * @since 0.3.0 + */ + public static function init() { + /** + * Allow themes/plugins to override the default settings + * + * @since 0.9.0 + * + * @param array $default_settings Default settings. + */ + self::$defaults = apply_filters( 'menu_icons_settings_defaults', self::$defaults ); + + self::$settings = get_option( 'menu-icons', self::$defaults ); + + foreach ( self::$settings as $key => &$value ) { + if ( 'global' === $key ) { + // Remove unregistered icon types. + $value['icon_types'] = array_values( + array_intersect( + array_keys( Menu_Icons::get( 'types' ) ), + array_filter( (array) $value['icon_types'] ) + ) + ); + } else { + // Backward-compatibility. + if ( isset( $value['width'] ) && ! isset( $value['svg_width'] ) ) { + $value['svg_width'] = $value['width']; + } + + unset( $value['width'] ); + } + } + + unset( $value ); + + /** + * Allow themes/plugins to override the settings + * + * @since 0.9.0 + * + * @param array $settings Menu Icons settings. + */ + self::$settings = apply_filters( 'menu_icons_settings', self::$settings ); + + if ( self::is_menu_icons_disabled_for_menu() ) { + return; + } + + if ( ! empty( self::$settings['global']['icon_types'] ) ) { + require_once Menu_Icons::get( 'dir' ) . 'includes/picker.php'; + Menu_Icons_Picker::init(); + self::$script_deps[] = 'icon-picker'; + } + + add_action( 'load-nav-menus.php', array( __CLASS__, '_load_nav_menus' ), 1 ); + add_action( 'wp_ajax_menu_icons_update_settings', array( __CLASS__, '_ajax_menu_icons_update_settings' ) ); + } + + /** + * Check if menu icons is disabled for a menu + * + * @since 0.8.0 + * + * @param int $menu_id Menu ID. Defaults to current menu being edited. + * + * @return bool + */ + public static function is_menu_icons_disabled_for_menu( $menu_id = 0 ) { + if ( empty( $menu_id ) ) { + $menu_id = self::get_current_menu_id(); + } + + // When we're creating a new menu or the recently edited menu + // could not be found. + if ( empty( $menu_id ) ) { + return true; + } + + $menu_settings = self::get_menu_settings( $menu_id ); + $is_disabled = ! empty( $menu_settings['disabled'] ); + + return $is_disabled; + } + + /** + * Get ID of menu being edited + * + * @since 0.7.0 + * @since 0.8.0 Get the recently edited menu from user option. + * + * @return int + */ + public static function get_current_menu_id() { + global $nav_menu_selected_id; + + if ( ! empty( $nav_menu_selected_id ) ) { + return $nav_menu_selected_id; + } + + if ( is_admin() && isset( $_REQUEST['menu'] ) ) { + $menu_id = absint( $_REQUEST['menu'] ); + } else { + $menu_id = absint( get_user_option( 'nav_menu_recently_edited' ) ); + } + + return $menu_id; + } + + /** + * Get menu settings + * + * @since 0.3.0 + * + * @param int $menu_id + * + * @return array + */ + public static function get_menu_settings( $menu_id ) { + $menu_settings = self::get( sprintf( 'menu_%d', $menu_id ) ); + $menu_settings = apply_filters( 'menu_icons_menu_settings', $menu_settings, $menu_id ); + + if ( ! is_array( $menu_settings ) ) { + $menu_settings = array(); + } + + return $menu_settings; + } + + /** + * Get setting value + * + * @since 0.3.0 + * @return mixed + */ + public static function get() { + $args = func_get_args(); + + return kucrut_get_array_value_deep( self::$settings, $args ); + } + + /** + * Prepare wp-admin/nav-menus.php page + * + * @since 0.3.0 + * @wp_hook action load-nav-menus.php + */ + public static function _load_nav_menus() { + add_action( 'admin_enqueue_scripts', array( __CLASS__, '_enqueue_assets' ), 99 ); + + /** + * Allow settings meta box to be disabled. + * + * @since 0.4.0 + * + * @param bool $disabled Defaults to FALSE. + */ + $settings_disabled = apply_filters( 'menu_icons_disable_settings', false ); + if ( true === $settings_disabled ) { + return; + } + + self::_maybe_update_settings(); + self::_add_settings_meta_box(); + + add_action( 'admin_notices', array( __CLASS__, '_admin_notices' ) ); + } + + /** + * Update settings + * + * @since 0.3.0 + */ + public static function _maybe_update_settings() { + if ( ! empty( $_POST['menu-icons']['settings'] ) ) { + check_admin_referer( self::UPDATE_KEY, self::UPDATE_KEY ); + + $redirect_url = self::_update_settings( $_POST['menu-icons']['settings'] ); // Input var okay. + wp_redirect( $redirect_url ); + } elseif ( ! empty( $_REQUEST[ self::RESET_KEY ] ) ) { + check_admin_referer( self::RESET_KEY, self::RESET_KEY ); + wp_redirect( self::_reset_settings() ); + } + } + + /** + * Update settings + * + * @since 0.7.0 + * @access protected + * + * @param array $values Settings values. + * + * @return string Redirect URL. + */ + protected static function _update_settings( $values ) { + update_option( + 'menu-icons', + wp_parse_args( + kucrut_validate( $values ), + self::$settings + ) + ); + set_transient( self::TRANSIENT_KEY, 'updated', 30 ); + + $redirect_url = remove_query_arg( + array( 'menu-icons-reset' ), + wp_get_referer() + ); + + return $redirect_url; + } + + /** + * Reset settings + * + * @since 0.7.0 + * @access protected + * @return string Redirect URL. + */ + protected static function _reset_settings() { + delete_option( 'menu-icons' ); + set_transient( self::TRANSIENT_KEY, 'reset', 30 ); + + $redirect_url = remove_query_arg( + array( self::RESET_KEY, 'menu-icons-updated' ), + wp_get_referer() + ); + + return $redirect_url; + } + + /** + * Settings meta box + * + * @since 0.3.0 + * @access private + */ + private static function _add_settings_meta_box() { + add_meta_box( + 'menu-icons-settings', + __( 'Menu Icons Settings', 'menu-icons' ), + array( __CLASS__, '_meta_box' ), + 'nav-menus', + 'side', + 'low', + array() + ); + } + + /** + * Update settings via ajax + * + * @since 0.7.0 + * @wp_hook action wp_ajax_menu_icons_update_settings + */ + public static function _ajax_menu_icons_update_settings() { + check_ajax_referer( self::UPDATE_KEY, self::UPDATE_KEY ); + + if ( empty( $_POST['menu-icons']['settings'] ) ) { + wp_send_json_error(); + } + + $redirect_url = self::_update_settings( $_POST['menu-icons']['settings'] ); // Input var okay. + wp_send_json_success( array( 'redirectUrl' => $redirect_url ) ); + } + + /** + * Print admin notices + * + * @since 0.3.0 + * @wp_hook action admin_notices + */ + public static function _admin_notices() { + $messages = array( + 'updated' => __( 'Menu Icons Settings have been successfully updated.', 'menu-icons' ), + 'reset' => __( 'Menu Icons Settings have been successfully reset.', 'menu-icons' ), + ); + + $message_type = get_transient( self::TRANSIENT_KEY ); + + if ( ! empty( $message_type ) && ! empty( $messages[ $message_type ] ) ) { + printf( + '

        %s

        ', + wp_kses( $messages[ $message_type ], array( 'strong' => true ) ) + ); + } + + delete_transient( self::TRANSIENT_KEY ); + } + + /** + * Settings meta box + * + * @since 0.3.0 + */ + public static function _meta_box() { + ?> +
        + + $section ) : ?> + + + +
        +

        + + + %s', + esc_url( + wp_nonce_url( + admin_url( '/nav-menus.php' ), + self::RESET_KEY, + self::RESET_KEY + ) + ), + esc_attr__( 'Discard all changes and reset to default state', 'menu-icons' ), + esc_html__( 'Reset', 'menu-icons' ) + ); + ?> + + + + + + +

        + array( + 'id' => 'global', + 'title' => __( 'Global', 'menu-icons' ), + 'description' => __( 'Global settings', 'menu-icons' ), + 'fields' => array( + array( + 'id' => 'icon_types', + 'type' => 'checkbox', + 'label' => __( 'Icon Types', 'menu-icons' ), + 'choices' => $icon_types, + 'value' => self::get( 'global', 'icon_types' ), + ), + ), + 'args' => array(), + ), + ); + + if ( ! empty( $menu_id ) ) { + $menu_term = get_term( $menu_id, 'nav_menu' ); + $menu_key = sprintf( 'menu_%d', $menu_id ); + $menu_settings = self::get_menu_settings( $menu_id ); + + $sections['menu'] = array( + 'id' => $menu_key, + 'title' => __( 'Current Menu', 'menu-icons' ), + 'description' => sprintf( + __( '"%s" menu settings', 'menu-icons' ), + apply_filters( 'single_term_title', $menu_term->name ) + ), + 'fields' => self::get_settings_fields( $menu_settings ), + 'args' => array( 'inline_description' => true ), + ); + } + + return apply_filters( 'menu_icons_settings_sections', $sections, $menu_id ); + } + + /** + * Get settings fields + * + * @since 0.4.0 + * + * @param array $values Values to be applied to each field. + * + * @uses apply_filters() Calls 'menu_icons_settings_fields'. + * @return array + */ + public static function get_settings_fields( array $values = array() ) { + $fields = array( + 'hide_label' => array( + 'id' => 'hide_label', + 'type' => 'select', + 'label' => __( 'Hide Label', 'menu-icons' ), + 'default' => '', + 'choices' => array( + array( + 'value' => '', + 'label' => __( 'No', 'menu-icons' ), + ), + array( + 'value' => '1', + 'label' => __( 'Yes', 'menu-icons' ), + ), + ), + ), + 'position' => array( + 'id' => 'position', + 'type' => 'select', + 'label' => __( 'Position', 'menu-icons' ), + 'default' => 'before', + 'choices' => array( + array( + 'value' => 'before', + 'label' => __( 'Before', 'menu-icons' ), + ), + array( + 'value' => 'after', + 'label' => __( 'After', 'menu-icons' ), + ), + ), + ), + 'vertical_align' => array( + 'id' => 'vertical_align', + 'type' => 'select', + 'label' => __( 'Vertical Align', 'menu-icons' ), + 'default' => 'middle', + 'choices' => array( + array( + 'value' => 'super', + 'label' => __( 'Super', 'menu-icons' ), + ), + array( + 'value' => 'top', + 'label' => __( 'Top', 'menu-icons' ), + ), + array( + 'value' => 'text-top', + 'label' => __( 'Text Top', 'menu-icons' ), + ), + array( + 'value' => 'middle', + 'label' => __( 'Middle', 'menu-icons' ), + ), + array( + 'value' => 'baseline', + 'label' => __( 'Baseline', 'menu-icons' ), + ), + array( + 'value' => 'text-bottom', + 'label' => __( 'Text Bottom', 'menu-icons' ), + ), + array( + 'value' => 'bottom', + 'label' => __( 'Bottom', 'menu-icons' ), + ), + array( + 'value' => 'sub', + 'label' => __( 'Sub', 'menu-icons' ), + ), + ), + ), + 'font_size' => array( + 'id' => 'font_size', + 'type' => 'number', + 'label' => __( 'Font Size', 'menu-icons' ), + 'default' => '1.2', + 'description' => 'em', + 'attributes' => array( + 'min' => '0.1', + 'step' => '0.1', + ), + ), + 'svg_width' => array( + 'id' => 'svg_width', + 'type' => 'number', + 'label' => __( 'SVG Width', 'menu-icons' ), + 'default' => '1', + 'description' => 'em', + 'attributes' => array( + 'min' => '.5', + 'step' => '.1', + ), + ), + 'image_size' => array( + 'id' => 'image_size', + 'type' => 'select', + 'label' => __( 'Image Size', 'menu-icons' ), + 'default' => 'thumbnail', + 'choices' => kucrut_get_image_sizes(), + ), + ); + + $fields = apply_filters( 'menu_icons_settings_fields', $fields ); + + foreach ( $fields as &$field ) { + if ( isset( $values[ $field['id'] ] ) ) { + $field['value'] = $values[ $field['id'] ]; + } + + if ( ! isset( $field['value'] ) && isset( $field['default'] ) ) { + $field['value'] = $field['default']; + } + } + + unset( $field ); + + return $fields; + } + + /** + * Get processed settings fields + * + * @since 0.3.0 + * @access private + * @return array + */ + private static function _get_fields() { + if ( ! class_exists( 'Kucrut_Form_Field' ) ) { + require_once Menu_Icons::get( 'dir' ) . 'includes/library/form-fields.php'; + } + + $keys = array( 'menu-icons', 'settings' ); + $sections = self::get_fields(); + + foreach ( $sections as &$section ) { + $_keys = array_merge( $keys, array( $section['id'] ) ); + $_args = array_merge( array( 'keys' => $_keys ), $section['args'] ); + + foreach ( $section['fields'] as &$field ) { + $field = Kucrut_Form_Field::create( $field, $_args ); + } + + unset( $field ); + } + + unset( $section ); + + return $sections; + } + + /** + * Enqueue scripts & styles for Appearance > Menus page + * + * @since 0.3.0 + * @wp_hook action admin_enqueue_scripts + */ + public static function _enqueue_assets() { + $url = Menu_Icons::get( 'url' ); + $suffix = kucrut_get_script_suffix(); + + if ( defined( 'MENU_ICONS_SCRIPT_DEBUG' ) && MENU_ICONS_SCRIPT_DEBUG ) { + $script_url = '//localhost:8081/'; + } else { + $script_url = $url; + } + + wp_enqueue_style( + 'menu-icons', + "{$url}css/admin{$suffix}.css", + false, + Menu_Icons::VERSION + ); + + wp_enqueue_script( + 'menu-icons', + "{$script_url}js/admin{$suffix}.js", + self::$script_deps, + Menu_Icons::VERSION, + true + ); + + $customizer_url = add_query_arg( + array( + 'autofocus[section]' => 'custom_css', + 'return' => admin_url( 'nav-menus.php' ), + ), + admin_url( 'customize.php' ) + ); + + /** + * Allow plugins/themes to filter the settings' JS data + * + * @since 0.9.0 + * + * @param array $js_data JS Data. + */ + $menu_current_theme = ''; + $theme = wp_get_theme(); + if ( ! empty( $theme ) ) { + if ( is_child_theme() ) { + $menu_current_theme = $theme->parent()->get( 'Name' ); + } else { + $menu_current_theme = $theme->get( 'Name' ); + } + } + $box_data = ' + + + + diff --git a/wp-content/plugins/static-html-output-plugin/views/s3_settings_block.phtml b/wp-content/plugins/static-html-output-plugin/views/s3_settings_block.phtml new file mode 100644 index 0000000..a2c1312 --- /dev/null +++ b/wp-content/plugins/static-html-output-plugin/views/s3_settings_block.phtml @@ -0,0 +1,112 @@ + diff --git a/wp-content/plugins/static-html-output-plugin/views/tab_advanced.phtml b/wp-content/plugins/static-html-output-plugin/views/tab_advanced.phtml new file mode 100644 index 0000000..f362479 --- /dev/null +++ b/wp-content/plugins/static-html-output-plugin/views/tab_advanced.phtml @@ -0,0 +1,139 @@ + + diff --git a/wp-content/plugins/static-html-output-plugin/views/tab_crawling.phtml b/wp-content/plugins/static-html-output-plugin/views/tab_crawling.phtml new file mode 100644 index 0000000..43a5600 --- /dev/null +++ b/wp-content/plugins/static-html-output-plugin/views/tab_crawling.phtml @@ -0,0 +1,138 @@ + diff --git a/wp-content/plugins/static-html-output-plugin/views/tab_export.phtml b/wp-content/plugins/static-html-output-plugin/views/tab_export.phtml new file mode 100644 index 0000000..3a8e1ee --- /dev/null +++ b/wp-content/plugins/static-html-output-plugin/views/tab_export.phtml @@ -0,0 +1,47 @@ +
        + + + + + + + + + +
        + + + +
        + + + + + + + + + +
        + diff --git a/wp-content/plugins/static-html-output-plugin/views/tab_help.phtml b/wp-content/plugins/static-html-output-plugin/views/tab_help.phtml new file mode 100644 index 0000000..ce3c89e --- /dev/null +++ b/wp-content/plugins/static-html-output-plugin/views/tab_help.phtml @@ -0,0 +1,67 @@ + + diff --git a/wp-content/plugins/static-html-output-plugin/views/tab_logs.phtml b/wp-content/plugins/static-html-output-plugin/views/tab_logs.phtml new file mode 100644 index 0000000..20ebe18 --- /dev/null +++ b/wp-content/plugins/static-html-output-plugin/views/tab_logs.phtml @@ -0,0 +1,30 @@ + + diff --git a/wp-content/plugins/static-html-output-plugin/views/tab_love.phtml b/wp-content/plugins/static-html-output-plugin/views/tab_love.phtml new file mode 100644 index 0000000..3a700dc --- /dev/null +++ b/wp-content/plugins/static-html-output-plugin/views/tab_love.phtml @@ -0,0 +1,81 @@ + + diff --git a/wp-content/plugins/static-html-output-plugin/views/tab_processing.phtml b/wp-content/plugins/static-html-output-plugin/views/tab_processing.phtml new file mode 100644 index 0000000..8246ebd --- /dev/null +++ b/wp-content/plugins/static-html-output-plugin/views/tab_processing.phtml @@ -0,0 +1,109 @@ + diff --git a/wp-content/plugins/static-html-output-plugin/views/zip_settings_block.phtml b/wp-content/plugins/static-html-output-plugin/views/zip_settings_block.phtml new file mode 100644 index 0000000..e5a4bb4 --- /dev/null +++ b/wp-content/plugins/static-html-output-plugin/views/zip_settings_block.phtml @@ -0,0 +1,46 @@ + diff --git a/wp-content/plugins/static-html-output-plugin/wp2static.css b/wp-content/plugins/static-html-output-plugin/wp2static.css new file mode 100644 index 0000000..f216c2c --- /dev/null +++ b/wp-content/plugins/static-html-output-plugin/wp2static.css @@ -0,0 +1,164 @@ +@CHARSET "UTF-8"; + +.postbox p, li { + font-size: 1em; + line-height: 1.375em; + + +} + +#downloadZIP { + display: none; +} + +.intro-text { + font-size: large; +} + +div.postbox-container { + float: none; + padding: 0; + min-width: 650px; + width: 100%; +} + +div.postbox div.inside { + margin: 14px 18px 18px; + position: relative; +} + +.wpsho-report ul { + list-style: disc; + list-style-position: inside; +} + +.wpsho-report ul li { + padding-left: 2em; +} + +.wpsho-export-log { + height: 200px; + overflow: auto; + border: 1px solid #DFDFDF; + color: #000; + background: #fff; + margin: 0 0 15px; + padding: 3px 4px; + width: 95%; +} + +#exportStatus { + width: 100%; +} + +#progress { + display: none; +} + +#progress-container { + min-height: 40px; + position: absolute; + top: 0; + left: 0; + z-index: 99999; + width: 100%; +} + +.error-help-text { + display: none; + padding-bottom: 25px; +} + +.warning { + background-color: #ffe7b7; +} + + +@-webkit-keyframes pulsate { + 0% {-webkit-transform: scale(0.1, 0.1); opacity: 0.0;} + 50% {opacity: 1.0;} + 100% {-webkit-transform: scale(1.2, 1.2); opacity: 0.0;} +} + +.pulsate-css { + animation: pulsate 1s ease-out; + animation-iteration-count: infinite; + opacity: 0.0; + + border: 3px solid #999; + border-radius: 30px; + height: 18px; + width: 18px; + position: relative; + display: inline-block; + margin-top: 0px; + margin-right: 10px; + text-align: center; + float: left; +} + +#current_action { + padding-top: 3px; + font-size: 14px; + +} + +.button-call-to-action { + background-color: greenyellow !important; +} + +.cancelExportButton{ + background-color: orange !important; +} + +p.submit{ + margin-top: 0px !important; +} + +#netlify_test_results { + line-height: 28px; + margin-left: 10px; +} + +.spinner { + float:none;width:auto;height:auto;padding:10px 0 10px 50px; +} + +/* 86% when full sidebar, needs to grow otherwise */ +#wp2static-footer { + background: rgba(255, 255, 255, 0.9); + width: 100%; + position: fixed; + bottom: 0; + border-top: 1px solid black; + min-height: 110px; + margin-left: -20px; + padding-left: 20px; + +} + +.wrap.wp2static { + padding-bottom: 100px; +} + +#wpfooter { + display: none; +} + +#pbar-container { + background-color: #F7F7F7; + width: 100%; + display: block; + min-height: 30px; + margin-bottom: 20px; + position: relative; +} + +#pbar-fill { + background-color: #C1C1C1; + width: 0%; + min-height: 30px; + position: absolute; + top: 0; + left: 0; +} diff --git a/wp-content/plugins/static-html-output-plugin/wp2static.php b/wp-content/plugins/static-html-output-plugin/wp2static.php new file mode 100644 index 0000000..a1fe31a --- /dev/null +++ b/wp-content/plugins/static-html-output-plugin/wp2static.php @@ -0,0 +1,98 @@ +' . __( 'Settings', 'static-html-output-plugin' ) . ''; + array_unshift( $links, $settings_link ); + + return $links; +} + + +function wp_static_html_output_server_side_export() { + $plugin = WP2Static_Controller::getInstance(); + $plugin->doExportWithoutGUI(); + wp_die(); + return null; +} + +add_action( 'wp_static_html_output_server_side_export_hook', 'wp_static_html_output_server_side_export', 10, 0 ); + + +function plugins_have_been_loaded() { + load_plugin_textdomain( 'static-html-output-plugin', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); + return null; +} + +add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'plugin_action_links' ); +add_action( 'plugins_loaded', 'plugins_have_been_loaded' ); +add_action( 'wp_ajax_wp_static_html_output_ajax', 'wp_static_html_output_ajax' ); + +function wp_static_html_output_ajax() { + check_ajax_referer( 'wpstatichtmloutput', 'nonce' ); + $instance_method = filter_input( INPUT_POST, 'ajax_action' ); + + if ( '' !== $instance_method && is_string( $instance_method ) ) { + $plugin_instance = WP2Static_Controller::getInstance(); + call_user_func( array( $plugin_instance, $instance_method ) ); + } + + wp_die(); + return null; +} + +remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); +remove_action( 'wp_print_styles', 'print_emoji_styles' ); + +function wp_static_html_output_add_dashboard_widgets() { + + wp_add_dashboard_widget( + 'wp_static_html_output_dashboard_widget', + 'Static HTML Output', + 'wp_static_html_output_dashboard_widget_function' + ); +} +// add_action( 'wp_dashboard_setup', 'wp_static_html_output_add_dashboard_widgets' ); +function wp_static_html_output_dashboard_widget_function() { + + echo '

        Publish whole site as static HTML

        '; + echo ""; +} + +function wp_static_html_output_deregister_scripts() { + wp_deregister_script( 'wp-embed' ); + wp_deregister_script( 'comment-reply' ); +} +add_action( 'wp_footer', 'wp_static_html_output_deregister_scripts' ); +remove_action( 'wp_head', 'wlwmanifest_link' ); + +// WP CLI support +if ( defined( 'WP_CLI' ) ) { + require_once dirname( __FILE__ ) . '/plugin/wp2static-wp-cli-commands.php'; +} diff --git a/wp-content/plugins/wp-mail-smtp/assets/css/smtp-about.min.css b/wp-content/plugins/wp-mail-smtp/assets/css/smtp-about.min.css new file mode 100644 index 0000000..533a17d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/css/smtp-about.min.css @@ -0,0 +1,3 @@ +.wp-mail-smtp-page-about{padding:0 !important}.wp-mail-smtp-page-about *,.wp-mail-smtp-page-about *::before,.wp-mail-smtp-page-about *::after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins{padding:0 10px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container{margin-left:-20px;margin-right:-20px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-container{padding:0 10px;float:left;width:33.333333%;margin-bottom:20px}@media (max-width: 1249px){.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-container{width:50%}}@media (max-width: 781px){.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-container{width:100%;margin-bottom:20px}}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container h5{font-size:17px;font-weight:700}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item{background-color:#fff;border:1px solid #ddd;border-radius:3px;margin:0}@media (max-width: 781px){.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item{margin:0 0}}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item img{border:1px solid #eee;float:left;max-width:75px;padding:10px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item img[src*="-mi"]{padding:13px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item h5{margin:0 0 10px 100px;font-size:16px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item p{margin:0 0 0 100px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .details{padding:20px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .actions{background-color:#f7f7f7;border-top:1px solid #ddd;padding:20px;position:relative}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .actions .msg{background-color:#f7f7f7;position:absolute;text-align:center;font-weight:600;top:0;left:0;height:100%;width:100%;z-index:99;padding:20px;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-align-items:center;-ms-align-items:center;align-items:center;justify-content:center}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .actions .msg.success{color:#2a9b39}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .actions .msg.error{color:red}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .status{float:left;padding-top:8px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .status .status-inactive{color:red}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .status .status-download{color:#666}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .status .status-active{color:#2a9b39}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button{float:right}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button{background:none;cursor:pointer;width:140px;text-align:center;display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;-webkit-appearance:none;border-radius:3px;border:1px solid #cccccc;background:#f7f7f7;box-shadow:0 1px 0 #cccccc;font-weight:normal}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button:hover,.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button:focus,.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.loading{background:#fafafa;border-color:#999;color:#23282d}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button .fa{margin-right:8px}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button .fa.fa-spinner{margin-right:0}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-primary{background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-shadow:0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-primary:hover,.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-primary:focus{background:#008ec2;border-color:#006799;color:#fff}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-primary .fa-spinner{color:#fff}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-secondary{color:#555;border-color:#cccccc;background:#f7f7f7;box-shadow:0 1px 0 #cccccc}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-secondary:hover,.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.button-secondary:focus{background:#fafafa;border-color:#999;color:#23282d}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.status-active .fa{color:#2a9b39}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.status-inactive .fa{color:red}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.status-download .fa{color:#999}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.loading .fa{color:#666}.wp-mail-smtp-page-about.wp-mail-smtp-tab-about-about .wp-mail-smtp-admin-about-plugins .plugins-container .plugin-item .action-button button.disabled{cursor:default}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section{margin:0 0 20px;padding:30px;background:#fff;border:1px solid #E5E6E6;line-height:2}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h1,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h2,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h3,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h4,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h5{margin-top:0;padding-top:0;line-height:1.6}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h2{font-size:24px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section h3{font-size:18px;margin-bottom:30px;color:#23282C}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section ul,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p{font-size:16px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p{margin-bottom:20px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p.bigger{font-size:18px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p.smaller{font-size:14px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section p:last-child{margin-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section hr{margin:30px 0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section figure{margin:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section figure img{width:100%}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section figure figcaption{font-size:14px;color:#888888;margin-top:5px;text-align:center;line-height:initial}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .wp-mail-smtp-admin-column-40{padding-left:15px}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .wp-mail-smtp-admin-column-40{width:100%;padding-left:0;padding-top:20px}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .wp-mail-smtp-admin-column-60{padding-right:15px}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .wp-mail-smtp-admin-column-60{width:100%;padding-right:0}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section ul.list-plain{margin-top:0;margin-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section ul.list-plain li{margin-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section ul.list-features li .fa{color:#2a9b39;margin:0 8px 0 0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .fa-star{color:gold}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .no-margin{margin:0 !important}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .no-padding{padding:0 !important}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section .centered{text-align:center !important}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero{padding:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-main,.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-extra{padding:30px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-extra table{width:100%}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-extra .wp-mail-smtp-admin-column-50{float:none;width:100%}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-main{background-color:#FAFAFA;border-bottom:1px solid #E5E6E6}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-main.no-border{border-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero .wp-mail-smtp-admin-about-section-hero-main p{color:#666}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero h3.call-to-action{margin-bottom:-10px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-hero span.price-off{color:#6AB255}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-squashed{margin-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-squashed:not(:last-of-type){border-bottom:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post h2{margin-bottom:-10px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post h3{margin-bottom:15px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post p:last-of-type{margin-bottom:30px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-20{padding-right:20px;width:auto}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-20 img{width:270px}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-20{width:20%}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-20 img{width:auto;max-width:100%}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-80{padding-left:20px;width:calc(100% - 20px - 270px)}@media (max-width: 781px){.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-column-80{width:80%}}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-about-section-post-link{padding:10px 15px;background-color:#DF7739;color:#fff;border-radius:3px;text-decoration:none;margin-top:15px;font-size:14px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-about-section-post-link:hover{background-color:#B85A1B}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-post .wp-mail-smtp-admin-about-section-post-link .fa{color:#EDBA9E;vertical-align:middle;margin-left:8px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table{border-collapse:collapse}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table tr td{border-bottom:1px solid #E5E6E6;border-right:1px solid #E5E6E6;padding:30px;vertical-align:top}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table tr td:last-of-type{border-right:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table tr:last-child td{border-bottom:none}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table p{background-repeat:no-repeat;background-size:15px auto;background-position:0 6px;margin:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table p.features-full{padding-left:30px;background-image:url(../images/about/icon-full.svg)}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table p.features-none{padding-left:30px;background-image:url(../images/about/icon-none.svg)}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table table p.features-partial{padding-left:30px;background-position:-3px 0;background-size:23px auto;background-image:url(../images/about/icon-partial.svg)}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table .wp-mail-smtp-admin-about-section-hero-main{padding:0}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table .wp-mail-smtp-admin-about-section-hero-main h3{padding:30px 30px 30px 60px}.wp-mail-smtp-page-about .wp-mail-smtp-admin-about-section-table .wp-mail-smtp-admin-about-section-hero-main .wp-mail-smtp-admin-column-33:first-child h3{padding:30px} + +/*# sourceMappingURL=smtp-about.min.css.map */ diff --git a/wp-content/plugins/wp-mail-smtp/assets/css/smtp-admin.min.css b/wp-content/plugins/wp-mail-smtp/assets/css/smtp-admin.min.css new file mode 100644 index 0000000..9b905a4 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/css/smtp-admin.min.css @@ -0,0 +1,3 @@ +#wpcontent{padding-left:0 !important;position:relative}@media (max-width: 600px){#wpcontent{padding-top:46px}}@media (max-width: 600px){#wpbody{padding-top:0}}body.toplevel_page_wp-mail-smtp div.jconfirm *,body.toplevel_page_wp-mail-smtp div.jconfirm *::before,body.toplevel_page_wp-mail-smtp div.jconfirm *::after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box-container div.jconfirm-box{border-radius:0;box-shadow:0 2px 6px rgba(0,0,0,0.2)}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box-container div.jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.4);top:8px;right:8px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box-container div.jconfirm-box div.jconfirm-closeIcon:hover{color:rgba(0,0,0,0.8)}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c{margin:0 0 26px 0 !important;padding:0 !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{margin:0 !important;color:#c4c4c4 !important;-webkit-transition:none !important;transition:none !important;-webkit-transform:none !important;-ms-transform:none !important;transform:none !important;font-size:45px !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-icon-c i:empty{display:none}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-icon-c svg{height:35px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-title{display:block;color:#333}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-title-c .jconfirm-icon-c+span.jconfirm-title{margin-top:20px !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content-pane{margin-bottom:0;display:block}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content-pane .jconfirm-content{overflow:inherit}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content{font-size:16px;color:#555;line-height:1.4}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content.lite-upgrade p{font-size:18px;padding:0 20px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content p{margin:0 0 16px;font-size:18px;line-height:1.5}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content p:last-of-type{margin:0}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content p.large{font-size:18px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content p.small{font-size:14px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content .already-purchased{font-size:12px;color:#ccc;text-decoration:none}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-content .already-purchased:hover{text-decoration:underline}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-buttons .already-purchased{display:block;font-size:12px;color:#aaa;text-decoration:none;padding-top:20px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box div.jconfirm-buttons .already-purchased:hover{color:#999;text-decoration:underline}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note{text-align:center;margin:30px 0 0}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note p{background-color:#faffac;margin:0 -30px;padding:24px 60px 20px;font-size:15px;color:#4d4d4d;position:relative}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note p:after{content:'\f058';display:inline-block;font:normal normal normal 14px/1 FontAwesome;background-color:#fff;font-size:26px;border-radius:50%;padding:5px 6px;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;top:-20px;right:50%;margin-right:-18px;color:#3abc01}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note span{font-weight:700;color:#3abc01}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .discount-note a{color:#aaa;display:block;margin-top:12px}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box input[type=text]{display:block;width:99%;border:1px solid #d6d6d6;padding:10px;box-shadow:none;margin:20px auto 0 auto}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-confirm{background-color:#FF982D;color:#fff;outline:none}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-confirm:hover{background-color:#f97f00;border-color:#f97f00}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button,body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-default{color:#666}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-block{display:block;text-align:center;width:100%;margin:0 0 10px 0 !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box button.btn-normal-case{text-transform:none !important}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .error{display:none;color:red}body.toplevel_page_wp-mail-smtp div.jconfirm div.jconfirm-box .wpforms-error{border:1px solid #ebccd1 !important}#screen-meta-links,#screen-meta{display:none}#wp-mail-smtp-header-temp{position:absolute;margin:0;top:-1px;left:20px;right:20px;z-index:99}#wp-mail-smtp-header{border-top:3px solid #FF982D;padding:20px}#wp-mail-smtp-header img{display:block;margin:0;max-width:242px}@media (max-width: 782px){#wp-mail-smtp-header img{max-width:200px}}#wp-mail-smtp{margin:0}#wp-mail-smtp .wp-mail-smtp-hide{display:none}#wp-mail-smtp .wp-mail-smtp-page-title{background-color:#fff;font-size:14px;margin:0 0 20px 0;padding:0 20px}#wp-mail-smtp .wp-mail-smtp-page-title a.tab{border-bottom:2px solid #fff;box-shadow:none;color:#666;display:inline-block;margin-right:30px;padding:20px 0 18px 0;text-decoration:none}#wp-mail-smtp .wp-mail-smtp-page-title a.tab.active{border-bottom:2px solid #FF982D}#wp-mail-smtp .wp-mail-smtp-page-title a.tab:hover{border-color:#999}#wp-mail-smtp .wp-mail-smtp-page-title a.action{padding:5px;border:0;min-height:auto;color:#fff;margin:-10px 0 0 20px}#wp-mail-smtp .wp-mail-smtp-page-title .page-title{background-color:#fff;display:inline-block;font-size:23px;margin:0;padding:15px 20px 15px 0}#wp-mail-smtp .wp-mail-smtp-page-content{padding:0 20px}#wp-mail-smtp .wp-mail-smtp-page-content *,#wp-mail-smtp .wp-mail-smtp-page-content *::before,#wp-mail-smtp .wp-mail-smtp-page-content *::after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-clear:before{content:" ";display:table}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-clear:after{clear:both;content:" ";display:table}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row{border-bottom:1px solid #e4e4e4;padding:30px 0;font-size:14px;line-height:1.3}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row:first-of-type{padding-top:10px !important}@media (max-width: 781px){#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row{padding:20px 0}}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.inactive{display:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row .wp-mail-smtp-setting-mid-row-sep{background:#e4e4e4;height:1px;border:0;margin:15px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.section-heading{padding:20px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.section-heading.no-desc h2,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.section-heading.no-desc h4{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.section-heading .wp-mail-smtp-setting-field{margin:0;max-width:1005px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox input[type=checkbox]{float:left;margin:1px 0 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox input[type=checkbox]+label{margin:0 0 0 8px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox .desc{margin:0 0 0 30px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox input[type=checkbox]+label+.desc{margin:8px 0 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-text .wp-mail-smtp-setting-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-password .wp-mail-smtp-setting-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-number .wp-mail-smtp-setting-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-email .wp-mail-smtp-setting-label{padding-top:8px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-select .wp-mail-smtp-setting-label{padding-top:8px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-radio .wp-mail-smtp-setting-field input[type=radio]{margin:-3px 10px 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-radio .wp-mail-smtp-setting-field label{margin-right:30px;display:inline-block}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field label{vertical-align:middle;display:inline-block}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field label:hover .wp-mail-smtp-setting-toggle-switch{background-color:#999}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]{display:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:checked+.wp-mail-smtp-setting-toggle-switch{background-color:#46B450}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:checked+.wp-mail-smtp-setting-toggle-switch:before{-webkit-transform:translateX(19px);-ms-transform:translateX(19px);transform:translateX(19px)}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:disabled+.wp-mail-smtp-setting-toggle-switch{background-color:#69c471;cursor:default}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:checked+.wp-mail-smtp-setting-toggle-switch+.wp-mail-smtp-setting-toggle-checked-label{display:inline-block}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:checked+.wp-mail-smtp-setting-toggle-switch+.wp-mail-smtp-setting-toggle-checked-label+.wp-mail-smtp-setting-toggle-unchecked-label{display:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:disabled+.wp-mail-smtp-setting-toggle-switch+.wp-mail-smtp-setting-toggle-checked-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field input[type=checkbox]:disabled+.wp-mail-smtp-setting-toggle-switch+.wp-mail-smtp-setting-toggle-unchecked-label{color:#aaa}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-unchecked-label,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-checked-label{text-transform:uppercase;font-weight:400;color:#777;font-size:13px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-checked-label{display:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-switch{position:relative;cursor:pointer;background-color:#ccc;border-radius:15px;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;vertical-align:middle;position:relative;display:inline-block;margin:0 5px 0 0;width:40px;height:20px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-checkbox-toggle .wp-mail-smtp-setting-field .wp-mail-smtp-setting-toggle-switch:before{position:absolute;content:"";height:14px;width:14px;left:3px;top:3px;background-color:#fff;border-radius:50%;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer{padding-bottom:20px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer{display:inline-block;width:140px;margin-right:12px;margin-bottom:12px;position:relative}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer .wp-mail-smtp-mailer-image{background:#fff;text-align:center;border:2px solid #E5E5E5;border-radius:4px;cursor:pointer;height:76px;position:relative;margin-bottom:10px;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer .wp-mail-smtp-mailer-image.is-recommended{background-image:url(../images/recommended.svg);background-repeat:no-repeat;background-size:60%;background-position:top right -2px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer .wp-mail-smtp-mailer-image img{max-width:90%;max-height:40px;display:block;position:relative;top:50%;left:50%;transform:translate(-50%, -50%);opacity:0.6;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.wp-mail-smtp-mailer-smtp .wp-mail-smtp-mailer-image img{max-height:30px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.suggest-new a.wp-mail-smtp-mailer-image{min-width:140px;display:table-cell;color:#777777;text-decoration:underline;vertical-align:middle;bottom:10px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.suggest-new .wp-mail-smtp-mailer-text{visibility:hidden}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.active .wp-mail-smtp-mailer-image{border-color:#FF982D}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer.active .wp-mail-smtp-mailer-image img{opacity:1}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer:hover .wp-mail-smtp-mailer-image{border-color:#ccc}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row.wp-mail-smtp-setting-row-mailer .wp-mail-smtp-mailers .wp-mail-smtp-mailer:hover .wp-mail-smtp-mailer-image img{opacity:1}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row h2,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row h4{color:#444;font-size:20px;font-weight:700;margin:0 0 6px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row h2{margin-bottom:15px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row h3{color:#444;font-size:24px;font-weight:600;margin:0 0 20px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p{margin:12px 0 0;font-size:14px;line-height:1.5em}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p:first-of-type{margin:8px 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.desc{font-style:italic;color:#777}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.buttonned{margin-top:30px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice{margin:5px 0 15px;box-sizing:border-box;background:#fff;border-left:4px solid transparent;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1)}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice.inline-error{border-color:#dc3232;margin-bottom:5px;padding:10px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice.inline-edu-notice{border-color:#809EB0;line-height:1.5em;padding:10px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice a.wp-mail-smtp-mailer-notice-dismiss{float:right;color:#999DA1;margin:0 0 10px 10px;text-decoration:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row p.inline-notice a.wp-mail-smtp-mailer-notice-dismiss:hover{color:#666a6e}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row ul{margin:8px 0 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row ul.list li{margin-left:20px;list-style-type:disc}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list th{padding:5px 5px 5px 0;text-align:left}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.email{padding-right:2em}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.status{width:100px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a{border-bottom:1px solid;display:inline-block;margin-right:5px;text-decoration:none}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a[class*=delete]{color:#a00}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a[class*=delete]:hover,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a[class*=delete]:active,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row table.actions-list td.actions a[class*=delete]:focus{color:#400}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password]{background-color:#fff;border:1px solid #ddd;border-radius:3px;box-shadow:none;color:#333;display:inline-block;vertical-align:middle;padding:7px 12px;margin:0 10px 0 0;width:400px;min-height:35px;line-height:1.3}@media (max-width: 959px){#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password]{width:300px}}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text][readonly],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email][readonly],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number][readonly],#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password][readonly]{background-color:#f9f9f9}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text].small-text,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email].small-text,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number].small-text,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password].small-text{width:75px}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text]:focus,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email]:focus,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number]:focus,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password]:focus{border-color:#bbb}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=text]:disabled,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=email]:disabled,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=number]:disabled,#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-row input[type=password]:disabled{opacity:0.6}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-label{display:block;float:left;width:205px;padding:0 20px 0 0}@media (max-width: 781px){#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-label{float:none;width:100%;padding-bottom:15px}}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-label label{display:block;font-weight:600;font-size:1.1em}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-field{display:block;margin:0 0 0 205px;max-width:800px}@media (max-width: 781px){#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-setting-field{margin:0}}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-submit{margin:0;padding:25px 0}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-submit .help-text{margin-left:10px;vertical-align:middle}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-mailer-options .wp-mail-smtp-mailer-option .wp-mail-smtp-setting-row.section-heading{padding:20px 0 !important}#wp-mail-smtp .wp-mail-smtp-page-content .wp-mail-smtp-mailer-options .wp-mail-smtp-mailer-option blockquote{background:#E5E5E5;border-radius:4px;color:#666;font-size:14px;margin:20px 0;padding:15px;width:1005px}#wp-mail-smtp .wp-mail-smtp-page-content.wp-mail-smtp-page-general p{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline{background:#fff;border-left:4px solid #fff;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);margin:5px 0 15px;padding:1px 12px}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline.notice-success{border-left-color:#46b450}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline.notice-warning{border-left-color:#ffb900}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline.notice-error{border-left-color:#dc3232}#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline.notice-info{border-left-color:#00a0d2}#wp-mail-smtp .wp-mail-smtp-page-content .notice p,#wp-mail-smtp .wp-mail-smtp-page-content .notice-inline p{margin:0.5em 0;padding:2px}#wp-mail-smtp .wp-mail-smtp-page-content pre{white-space:pre-line}#wp-mail-smtp .wp-mail-smtp-page-content.active{display:block}#wp-mail-smtp .wp-mail-smtp-page-content .connected-as{margin-left:30px}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug{background-color:#fff;padding:25px 20px 1px 25px}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug h2{color:#444;margin:1.4em 0 0.8em;font-size:16px;font-weight:700}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug p{font-size:14px;color:#555;margin-bottom:1.1em}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ul,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ol{font-size:14px;color:#555;margin:0 0 1.1em 1.8em}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ul li,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ol li{margin:0 0 8px 0;line-height:1.5}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ul li:last-of-type,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ol li:last-of-type{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ul li ul,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug ol li ul{list-style-type:disc}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug a{color:#FF982D}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug a:hover{color:#f97f00}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .dashicons-star-filled{color:#FF982D;width:16px;height:16px;font-size:16px;vertical-align:text-top}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .price-off{color:green;font-weight:bold}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log-toggle{text-decoration:none;color:#444}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log-toggle:hover{color:#FF982D}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log-toggle .dashicons{font-size:15px;height:15px;width:15px;padding-top:3px;border:0;outline:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log{border-left:3px solid #ffb900;padding:0 0 0 20px;margin:0 0 10px 0;font-size:12px;display:none}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log pre{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-debug .error-log-note{display:none}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner{background-color:#fff;padding:25px 20px;border:1px solid #dadada;margin:10px 0 0 0;position:relative}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .wp-mail-smtp-pro-banner-dismiss{position:absolute;right:10px;top:10px}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .wp-mail-smtp-pro-banner-dismiss button{background:none;border:none;color:#a9a9a9;cursor:pointer;margin:0;padding:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner h2{color:#444;margin-top:0;font-size:16px;font-weight:700}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner p{font-size:14px;color:#555;margin-bottom:1.1em}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner p:last-of-type{margin:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits{margin:0 0 16px 0;overflow:auto;max-width:1000px}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul{margin:0;padding:0;width:50%;float:left}@media (max-width: 600px){#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul{width:100%;float:none}}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul li{margin:0;padding:0 0 2px 16px;color:#555;font-size:14px;position:relative}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul li:before{content:'+';position:absolute;top:-1px;left:0}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .benefits ul li.arrow-right:before{content:'→'}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner a{color:#FF982D}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner a:hover,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner a:active,#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner a:focus{color:#f97f00}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .stars{text-decoration:none}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .stars .dashicons{width:16px;height:16px;font-size:16px;vertical-align:text-top}#wp-mail-smtp .wp-mail-smtp-page-content #wp-mail-smtp-pro-banner .price-off{color:green;font-weight:bold}#wp-mail-smtp .wp-mail-smtp-admin-columns>div[class*="-column-"]{float:left}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-20{width:20%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-33{width:33.33333%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-40{width:40%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-50{width:50%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-60{width:60%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-80{width:80%}#wp-mail-smtp .wp-mail-smtp-admin-columns .wp-mail-smtp-admin-column-last{float:right !important}#wp-mail-smtp .wp-mail-smtp-admin-columns:after{content:"";display:table;clear:both}#wp-mail-smtp .wp-mail-smtp-page-upsell{display:flex;align-items:center;justify-content:center;height:auto;flex-direction:column}#wp-mail-smtp .wp-mail-smtp-page-upsell>*{width:800px}#wp-mail-smtp .wp-mail-smtp-page-upsell *,#wp-mail-smtp .wp-mail-smtp-page-upsell *::before,#wp-mail-smtp .wp-mail-smtp-page-upsell *::after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#wp-mail-smtp .wp-mail-smtp-page-upsell h2{font-size:24px;color:#444444;text-align:center}#wp-mail-smtp .wp-mail-smtp-page-upsell h3{font-size:16px;font-weight:normal;color:#72777C;line-height:1.5em;margin-top:0;margin-bottom:25px;text-align:center}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features{margin-bottom:40px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:stretch;align-content:flex-start}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature{display:flex;flex-direction:row;width:360px;align-items:flex-start;align-content:flex-start;margin-right:60px;margin-top:40px}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature:nth-of-type(1){margin-top:20px}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature:nth-of-type(2){margin-top:20px}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature:nth-of-type(even){margin-right:0}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-image{width:65px;text-align:center}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-image img{display:block;margin:5px auto 0}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-content{margin-left:20px}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-content h4{font-size:15px;margin:0 0 0.5em}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-content .wp-mail-smtp-page-upsell-features .wp-mail-smtp-page-upsell-feature .wp-mail-smtp-page-upsell-feature-content p{color:#72777C;margin:0}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-images{margin-bottom:20px;text-align:center}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-images img{width:380px;height:auto;margin-right:20px;border:5px solid #fff;border-radius:5px;box-shadow:0 0 10px 5px rgba(0,0,0,0.15)}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-images img:last-child{margin-right:0}#wp-mail-smtp .wp-mail-smtp-page-upsell .wp-mail-smtp-page-upsell-button{text-align:center}.wp-mail-smtp-btn{border:0;border-radius:3px;cursor:pointer;display:inline-block;margin:0;text-decoration:none;text-align:center;vertical-align:middle;white-space:nowrap;text-shadow:none;box-shadow:none;outline:none}.wp-mail-smtp-btn .dashicons{font-size:16px;width:16px;height:16px}.wp-mail-smtp-btn:disabled{opacity:0.5;cursor:not-allowed}.wp-mail-smtp-btn.wp-mail-smtp-btn-md{font-size:13px;font-weight:600;padding:8px 12px;min-height:35px}.wp-mail-smtp-btn.wp-mail-smtp-btn-lg{font-size:16px;font-weight:600;padding:16px 28px}.wp-mail-smtp-btn.wp-mail-smtp-btn-orange{background-color:#FF982D;border-color:#FF982D;color:#fff}.wp-mail-smtp-btn.wp-mail-smtp-btn-orange:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-orange:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-orange:focus{background-color:#f97f00;border-color:#f97f00}.wp-mail-smtp-btn.wp-mail-smtp-btn-red{background-color:#DC3232;border-color:#DC3232;color:#fff}.wp-mail-smtp-btn.wp-mail-smtp-btn-red:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-red:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-red:focus{background-color:darkred;border-color:darkred}.wp-mail-smtp-btn.wp-mail-smtp-btn-grey{background-color:#f5f5f5;border:1px solid #ccc;color:#666}.wp-mail-smtp-btn.wp-mail-smtp-btn-grey:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-grey:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-grey:focus{background-color:#d7d7d7;border-color:#ccc;color:#444}.wp-mail-smtp-btn.wp-mail-smtp-btn-light-grey{background-color:#f5f5f5;border:1px solid #ccc;color:#666}.wp-mail-smtp-btn.wp-mail-smtp-btn-light-grey:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-light-grey:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-light-grey:focus{background-color:#eee;color:#444}.wp-mail-smtp-btn.wp-mail-smtp-btn-blueish{background-color:#738e9e;border:1px solid #738e9e;color:#fff}.wp-mail-smtp-btn.wp-mail-smtp-btn-blueish:hover,.wp-mail-smtp-btn.wp-mail-smtp-btn-blueish:active,.wp-mail-smtp-btn.wp-mail-smtp-btn-blueish:focus{background-color:#395360;border-color:#395360;color:#fff} + +/*# sourceMappingURL=smtp-admin.min.css.map */ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/about/icon-full.svg b/wp-content/plugins/wp-mail-smtp/assets/images/about/icon-full.svg new file mode 100644 index 0000000..db99774 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/images/about/icon-full.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/about/icon-none.svg b/wp-content/plugins/wp-mail-smtp/assets/images/about/icon-none.svg new file mode 100644 index 0000000..4f874e4 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/images/about/icon-none.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/about/icon-partial.svg b/wp-content/plugins/wp-mail-smtp/assets/images/about/icon-partial.svg new file mode 100644 index 0000000..8901e8f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/images/about/icon-partial.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/about/plugin-mi.png b/wp-content/plugins/wp-mail-smtp/assets/images/about/plugin-mi.png new file mode 100644 index 0000000..31ea261 Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/about/plugin-mi.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/about/plugin-om.png b/wp-content/plugins/wp-mail-smtp/assets/images/about/plugin-om.png new file mode 100644 index 0000000..4c1232e Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/about/plugin-om.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/about/plugin-rp.png b/wp-content/plugins/wp-mail-smtp/assets/images/about/plugin-rp.png new file mode 100644 index 0000000..2c85a21 Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/about/plugin-rp.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/about/plugin-wpf.png b/wp-content/plugins/wp-mail-smtp/assets/images/about/plugin-wpf.png new file mode 100644 index 0000000..b1a3d12 Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/about/plugin-wpf.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/about/team.jpg b/wp-content/plugins/wp-mail-smtp/assets/images/about/team.jpg new file mode 100644 index 0000000..fae1b31 Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/about/team.jpg differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/control/admin.png b/wp-content/plugins/wp-mail-smtp/assets/images/control/admin.png new file mode 100644 index 0000000..243b3d0 Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/control/admin.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/control/comments.png b/wp-content/plugins/wp-mail-smtp/assets/images/control/comments.png new file mode 100644 index 0000000..3e9eaf0 Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/control/comments.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/control/personal.png b/wp-content/plugins/wp-mail-smtp/assets/images/control/personal.png new file mode 100644 index 0000000..08ce029 Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/control/personal.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/control/update.png b/wp-content/plugins/wp-mail-smtp/assets/images/control/update.png new file mode 100644 index 0000000..4e20269 Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/control/update.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/control/user_new.png b/wp-content/plugins/wp-mail-smtp/assets/images/control/user_new.png new file mode 100644 index 0000000..f63bffc Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/control/user_new.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/control/users.png b/wp-content/plugins/wp-mail-smtp/assets/images/control/users.png new file mode 100644 index 0000000..c547d3f Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/control/users.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/email/icon-check.png b/wp-content/plugins/wp-mail-smtp/assets/images/email/icon-check.png new file mode 100644 index 0000000..aeeec4c Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/email/icon-check.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/email/signature.png b/wp-content/plugins/wp-mail-smtp/assets/images/email/signature.png new file mode 100644 index 0000000..2cc8db0 Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/email/signature.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/email/wp-mail-smtp.png b/wp-content/plugins/wp-mail-smtp/assets/images/email/wp-mail-smtp.png new file mode 100644 index 0000000..3571ba0 Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/email/wp-mail-smtp.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/email/wpforms-pro.png b/wp-content/plugins/wp-mail-smtp/assets/images/email/wpforms-pro.png new file mode 100644 index 0000000..923ce79 Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/email/wpforms-pro.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/logo.svg b/wp-content/plugins/wp-mail-smtp/assets/images/logo.svg new file mode 100644 index 0000000..b5a376c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/images/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/logs/archive.png b/wp-content/plugins/wp-mail-smtp/assets/images/logs/archive.png new file mode 100644 index 0000000..0ee3254 Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/logs/archive.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/logs/single.png b/wp-content/plugins/wp-mail-smtp/assets/images/logs/single.png new file mode 100644 index 0000000..d9846ba Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/logs/single.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/menu-icon.svg b/wp-content/plugins/wp-mail-smtp/assets/images/menu-icon.svg new file mode 100644 index 0000000..a646b1a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/images/menu-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/providers/aws.svg b/wp-content/plugins/wp-mail-smtp/assets/images/providers/aws.svg new file mode 100644 index 0000000..0cdc80e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/images/providers/aws.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/providers/google.svg b/wp-content/plugins/wp-mail-smtp/assets/images/providers/google.svg new file mode 100644 index 0000000..756c3c3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/images/providers/google.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/providers/mailgun.svg b/wp-content/plugins/wp-mail-smtp/assets/images/providers/mailgun.svg new file mode 100644 index 0000000..566c4da --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/images/providers/mailgun.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/providers/microsoft.svg b/wp-content/plugins/wp-mail-smtp/assets/images/providers/microsoft.svg new file mode 100644 index 0000000..a26688b --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/images/providers/microsoft.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/providers/pepipost-smtp.png b/wp-content/plugins/wp-mail-smtp/assets/images/providers/pepipost-smtp.png new file mode 100644 index 0000000..6f67bcd Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/providers/pepipost-smtp.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/providers/pepipost.png b/wp-content/plugins/wp-mail-smtp/assets/images/providers/pepipost.png new file mode 100644 index 0000000..2ef2002 Binary files /dev/null and b/wp-content/plugins/wp-mail-smtp/assets/images/providers/pepipost.png differ diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/providers/php.svg b/wp-content/plugins/wp-mail-smtp/assets/images/providers/php.svg new file mode 100644 index 0000000..415c3b4 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/images/providers/php.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/providers/sendgrid.svg b/wp-content/plugins/wp-mail-smtp/assets/images/providers/sendgrid.svg new file mode 100644 index 0000000..a0693d8 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/images/providers/sendgrid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/providers/sendinblue.svg b/wp-content/plugins/wp-mail-smtp/assets/images/providers/sendinblue.svg new file mode 100644 index 0000000..7bfa3e7 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/images/providers/sendinblue.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/providers/smtp.svg b/wp-content/plugins/wp-mail-smtp/assets/images/providers/smtp.svg new file mode 100644 index 0000000..acde0ef --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/images/providers/smtp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/images/recommended.svg b/wp-content/plugins/wp-mail-smtp/assets/images/recommended.svg new file mode 100644 index 0000000..de58b1f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/images/recommended.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/js/jquery.matchHeight.js b/wp-content/plugins/wp-mail-smtp/assets/js/jquery.matchHeight.js new file mode 100644 index 0000000..993aa94 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/js/jquery.matchHeight.js @@ -0,0 +1,388 @@ +/** +* jquery-match-height 0.7.2 by @liabru +* http://brm.io/jquery-match-height/ +* License: MIT +*/ + +;(function(factory) { // eslint-disable-line no-extra-semi + 'use strict'; + if (typeof define === 'function' && define.amd) { + // AMD + define(['jquery'], factory); + } else if (typeof module !== 'undefined' && module.exports) { + // CommonJS + module.exports = factory(require('jquery')); + } else { + // Global + factory(jQuery); + } +})(function($) { + /* + * internal + */ + + var _previousResizeWidth = -1, + _updateTimeout = -1; + + /* + * _parse + * value parse utility function + */ + + var _parse = function(value) { + // parse value and convert NaN to 0 + return parseFloat(value) || 0; + }; + + /* + * _rows + * utility function returns array of jQuery selections representing each row + * (as displayed after float wrapping applied by browser) + */ + + var _rows = function(elements) { + var tolerance = 1, + $elements = $(elements), + lastTop = null, + rows = []; + + // group elements by their top position + $elements.each(function(){ + var $that = $(this), + top = $that.offset().top - _parse($that.css('margin-top')), + lastRow = rows.length > 0 ? rows[rows.length - 1] : null; + + if (lastRow === null) { + // first item on the row, so just push it + rows.push($that); + } else { + // if the row top is the same, add to the row group + if (Math.floor(Math.abs(lastTop - top)) <= tolerance) { + rows[rows.length - 1] = lastRow.add($that); + } else { + // otherwise start a new row group + rows.push($that); + } + } + + // keep track of the last row top + lastTop = top; + }); + + return rows; + }; + + /* + * _parseOptions + * handle plugin options + */ + + var _parseOptions = function(options) { + var opts = { + byRow: true, + property: 'height', + target: null, + remove: false + }; + + if (typeof options === 'object') { + return $.extend(opts, options); + } + + if (typeof options === 'boolean') { + opts.byRow = options; + } else if (options === 'remove') { + opts.remove = true; + } + + return opts; + }; + + /* + * matchHeight + * plugin definition + */ + + var matchHeight = $.fn.matchHeight = function(options) { + var opts = _parseOptions(options); + + // handle remove + if (opts.remove) { + var that = this; + + // remove fixed height from all selected elements + this.css(opts.property, ''); + + // remove selected elements from all groups + $.each(matchHeight._groups, function(key, group) { + group.elements = group.elements.not(that); + }); + + // TODO: cleanup empty groups + + return this; + } + + if (this.length <= 1 && !opts.target) { + return this; + } + + // keep track of this group so we can re-apply later on load and resize events + matchHeight._groups.push({ + elements: this, + options: opts + }); + + // match each element's height to the tallest element in the selection + matchHeight._apply(this, opts); + + return this; + }; + + /* + * plugin global options + */ + + matchHeight.version = '0.7.2'; + matchHeight._groups = []; + matchHeight._throttle = 80; + matchHeight._maintainScroll = false; + matchHeight._beforeUpdate = null; + matchHeight._afterUpdate = null; + matchHeight._rows = _rows; + matchHeight._parse = _parse; + matchHeight._parseOptions = _parseOptions; + + /* + * matchHeight._apply + * apply matchHeight to given elements + */ + + matchHeight._apply = function(elements, options) { + var opts = _parseOptions(options), + $elements = $(elements), + rows = [$elements]; + + // take note of scroll position + var scrollTop = $(window).scrollTop(), + htmlHeight = $('html').outerHeight(true); + + // get hidden parents + var $hiddenParents = $elements.parents().filter(':hidden'); + + // cache the original inline style + $hiddenParents.each(function() { + var $that = $(this); + $that.data('style-cache', $that.attr('style')); + }); + + // temporarily must force hidden parents visible + $hiddenParents.css('display', 'block'); + + // get rows if using byRow, otherwise assume one row + if (opts.byRow && !opts.target) { + + // must first force an arbitrary equal height so floating elements break evenly + $elements.each(function() { + var $that = $(this), + display = $that.css('display'); + + // temporarily force a usable display value + if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') { + display = 'block'; + } + + // cache the original inline style + $that.data('style-cache', $that.attr('style')); + + $that.css({ + 'display': display, + 'padding-top': '0', + 'padding-bottom': '0', + 'margin-top': '0', + 'margin-bottom': '0', + 'border-top-width': '0', + 'border-bottom-width': '0', + 'height': '100px', + 'overflow': 'hidden' + }); + }); + + // get the array of rows (based on element top position) + rows = _rows($elements); + + // revert original inline styles + $elements.each(function() { + var $that = $(this); + $that.attr('style', $that.data('style-cache') || ''); + }); + } + + $.each(rows, function(key, row) { + var $row = $(row), + targetHeight = 0; + + if (!opts.target) { + // skip apply to rows with only one item + if (opts.byRow && $row.length <= 1) { + $row.css(opts.property, ''); + return; + } + + // iterate the row and find the max height + $row.each(function(){ + var $that = $(this), + style = $that.attr('style'), + display = $that.css('display'); + + // temporarily force a usable display value + if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') { + display = 'block'; + } + + // ensure we get the correct actual height (and not a previously set height value) + var css = { 'display': display }; + css[opts.property] = ''; + $that.css(css); + + // find the max height (including padding, but not margin) + if ($that.outerHeight(false) > targetHeight) { + targetHeight = $that.outerHeight(false); + } + + // revert styles + if (style) { + $that.attr('style', style); + } else { + $that.css('display', ''); + } + }); + } else { + // if target set, use the height of the target element + targetHeight = opts.target.outerHeight(false); + } + + // iterate the row and apply the height to all elements + $row.each(function(){ + var $that = $(this), + verticalPadding = 0; + + // don't apply to a target + if (opts.target && $that.is(opts.target)) { + return; + } + + // handle padding and border correctly (required when not using border-box) + if ($that.css('box-sizing') !== 'border-box') { + verticalPadding += _parse($that.css('border-top-width')) + _parse($that.css('border-bottom-width')); + verticalPadding += _parse($that.css('padding-top')) + _parse($that.css('padding-bottom')); + } + + // set the height (accounting for padding and border) + $that.css(opts.property, (targetHeight - verticalPadding) + 'px'); + }); + }); + + // revert hidden parents + $hiddenParents.each(function() { + var $that = $(this); + $that.attr('style', $that.data('style-cache') || null); + }); + + // restore scroll position if enabled + if (matchHeight._maintainScroll) { + $(window).scrollTop((scrollTop / htmlHeight) * $('html').outerHeight(true)); + } + + return this; + }; + + /* + * matchHeight._applyDataApi + * applies matchHeight to all elements with a data-match-height attribute + */ + + matchHeight._applyDataApi = function() { + var groups = {}; + + // generate groups by their groupId set by elements using data-match-height + $('[data-match-height], [data-mh]').each(function() { + var $this = $(this), + groupId = $this.attr('data-mh') || $this.attr('data-match-height'); + + if (groupId in groups) { + groups[groupId] = groups[groupId].add($this); + } else { + groups[groupId] = $this; + } + }); + + // apply matchHeight to each group + $.each(groups, function() { + this.matchHeight(true); + }); + }; + + /* + * matchHeight._update + * updates matchHeight on all current groups with their correct options + */ + + var _update = function(event) { + if (matchHeight._beforeUpdate) { + matchHeight._beforeUpdate(event, matchHeight._groups); + } + + $.each(matchHeight._groups, function() { + matchHeight._apply(this.elements, this.options); + }); + + if (matchHeight._afterUpdate) { + matchHeight._afterUpdate(event, matchHeight._groups); + } + }; + + matchHeight._update = function(throttle, event) { + // prevent update if fired from a resize event + // where the viewport width hasn't actually changed + // fixes an event looping bug in IE8 + if (event && event.type === 'resize') { + var windowWidth = $(window).width(); + if (windowWidth === _previousResizeWidth) { + return; + } + _previousResizeWidth = windowWidth; + } + + // throttle updates + if (!throttle) { + _update(event); + } else if (_updateTimeout === -1) { + _updateTimeout = setTimeout(function() { + _update(event); + _updateTimeout = -1; + }, matchHeight._throttle); + } + }; + + /* + * bind events + */ + + // apply on DOM ready event + $(matchHeight._applyDataApi); + + // use on or bind where supported + var on = $.fn.on ? 'on' : 'bind'; + + // update heights on load and resize events + $(window)[on]('load', function(event) { + matchHeight._update(false, event); + }); + + // throttled update heights on resize events + $(window)[on]('resize orientationchange', function(event) { + matchHeight._update(true, event); + }); + +}); diff --git a/wp-content/plugins/wp-mail-smtp/assets/js/jquery.matchHeight.min.js b/wp-content/plugins/wp-mail-smtp/assets/js/jquery.matchHeight.min.js new file mode 100644 index 0000000..ed8b0a6 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/js/jquery.matchHeight.min.js @@ -0,0 +1 @@ +!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(l){function h(t){return parseFloat(t)||0}function c(t){var e=l(t),n=null,a=[];return e.each(function(){var t=l(this),e=t.offset().top-h(t.css("margin-top")),o=0a&&(a=t.outerHeight(!1)),e?t.attr("style",e):t.css("display","")})}o.each(function(){var t=l(this),e=0;i.target&&t.is(i.target)||("border-box"!==t.css("box-sizing")&&(e+=h(t.css("border-top-width"))+h(t.css("border-bottom-width")),e+=h(t.css("padding-top"))+h(t.css("padding-bottom"))),t.css(i.property,a-e+"px"))})}),s.each(function(){var t=l(this);t.attr("style",t.data("style-cache")||null)}),u._maintainScroll&&l(window).scrollTop(a/r*l("html").outerHeight(!0)),this},u._applyDataApi=function(){var o={};l("[data-match-height], [data-mh]").each(function(){var t=l(this),e=t.attr("data-mh")||t.attr("data-match-height");o[e]=e in o?o[e].add(t):t}),l.each(o,function(){this.matchHeight(!0)})};function i(t){u._beforeUpdate&&u._beforeUpdate(t,u._groups),l.each(u._groups,function(){u._apply(this.elements,this.options)}),u._afterUpdate&&u._afterUpdate(t,u._groups)}u._update=function(t,e){if(e&&"resize"===e.type){var o=l(window).width();if(o===n)return;n=o}t?-1===a&&(a=setTimeout(function(){i(e),a=-1},u._throttle)):i(e)},l(u._applyDataApi);var t=l.fn.on?"on":"bind";l(window)[t]("load",function(t){u._update(!1,t)}),l(window)[t]("resize orientationchange",function(t){u._update(!0,t)})}); \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/js/smtp-about.js b/wp-content/plugins/wp-mail-smtp/assets/js/smtp-about.js new file mode 100644 index 0000000..f1e12d4 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/js/smtp-about.js @@ -0,0 +1,190 @@ +/* global WPMailSMTP, jQuery, wp_mail_smtp_about */ + +var WPMailSMTP = window.WPMailSMTP || {}; +WPMailSMTP.Admin = WPMailSMTP.Admin || {}; + +/** + * WP Mail SMTP Admin area About module. + * + * @since 1.5.0 + */ +WPMailSMTP.Admin.About = WPMailSMTP.Admin.About || (function ( document, window, $ ) { + + 'use strict'; + + /** + * Private functions and properties. + * + * @since 1.5.0 + * + * @type {Object} + */ + var __private = {}; + + /** + * Public functions and properties. + * + * @since 1.5.0 + * + * @type {Object} + */ + var app = { + + /** + * Start the engine. DOM is not ready yet, use only to init something. + * + * @since 1.5.0 + */ + init: function () { + + // Do that when DOM is ready. + $( document ).ready( app.ready ); + }, + + /** + * DOM is fully loaded. + * + * @since 1.5.0 + */ + ready: function () { + + app.pageHolder = $( '.wp-mail-smtp-page-about' ); + + app.bindActions(); + + $( '.wp-mail-smtp-page' ).trigger( 'WPMailSMTP.Admin.About.ready' ); + }, + + /** + * Process all generic actions/events, mostly custom that were fired by our API. + * + * @since 1.5.0 + */ + bindActions: function () { + + /* + * Make plugins description the same height. + */ + jQuery('.wp-mail-smtp-admin-about-plugins .plugin-item .details').matchHeight(); + + /* + * Install/Active the plugins. + */ + $( document ).on( 'click', '.wp-mail-smtp-admin-about-plugins .plugin-item .action-button .button', function( e ) { + e.preventDefault(); + + var $btn = $( this ); + + if ( $btn.hasClass( 'disabled' ) || $btn.hasClass( 'loading' ) ) { + return false; + } + + var $plugin = $btn.closest( '.plugin-item' ), + plugin = $btn.attr( 'data-plugin' ), + task, + cssClass, + statusText, + buttonText, + errorText, + successText; + + $btn.addClass( 'loading disabled' ); + $btn.text( wp_mail_smtp_about.plugin_processing ); + + if ( $btn.hasClass( 'status-inactive' ) ) { + // Activate. + task = 'about_plugin_activate'; + cssClass = 'status-active button button-secondary disabled'; + statusText = wp_mail_smtp_about.plugin_active; + buttonText = wp_mail_smtp_about.plugin_activated; + errorText = wp_mail_smtp_about.plugin_activate; + + } else if ( $btn.hasClass( 'status-download' ) ) { + // Install & Activate. + task = 'about_plugin_install'; + cssClass = 'status-active button disabled'; + statusText = wp_mail_smtp_about.plugin_active; + buttonText = wp_mail_smtp_about.plugin_activated; + errorText = wp_mail_smtp_about.plugin_activate; + + } else { + return; + } + + // Setup ajax POST data. + var data = { + action: 'wp_mail_smtp_ajax', + task: task, + nonce : wp_mail_smtp_about.nonce, + plugin: plugin + }; + + $.post( wp_mail_smtp_about.ajax_url, data, function( res ) { + var is_install_successful; + + if ( res.success ) { + is_install_successful = true; + if ( 'about_plugin_install' === task ) { + $btn.attr( 'data-plugin', res.data.basename ); + successText = res.data.msg; + if ( ! res.data.is_activated ) { + cssClass = 'button'; + statusText = wp_mail_smtp_about.plugin_inactive; + buttonText = wp_mail_smtp_about.plugin_activate; + } + } else { + successText = res.data; + } + $plugin.find( '.actions' ).append( '
        '+successText+'
        ' ); + $plugin.find( 'span.status-label' ) + .removeClass( 'status-active status-inactive status-download' ) + .addClass( cssClass ) + .removeClass( 'button button-primary button-secondary disabled' ) + .text( statusText ); + $btn + .removeClass( 'status-active status-inactive status-download' ) + .removeClass( 'button button-primary button-secondary disabled' ) + .addClass( cssClass ).html( buttonText ); + } else { + is_install_successful = false; + + if ( + res.hasOwnProperty( 'data' ) && + res.data.hasOwnProperty( 0 ) && + res.data[ 0 ].hasOwnProperty( 'code' ) && + res.data[ 0 ].code === 'download_failed' + ) { + // Specific server-returned error. + $plugin.find( '.actions' ).append( '
        ' + wp_mail_smtp_about.plugin_install_error + '
        ' ); + } + else { + // Generic error. + $plugin.find( '.actions' ).append( '
        ' + res.data + '
        ' ); + } + + $btn.html( wp_mail_smtp_about.plugin_download_btn ); + } + + if ( ! is_install_successful ) { + $btn.removeClass( 'disabled' ); + } + $btn.removeClass( 'loading' ); + + // Automatically clear plugin messages after 3 seconds. + setTimeout( function () { + $( '.plugin-item .msg' ).remove(); + }, 3000 ); + + }).fail( function( xhr ) { + console.log( xhr.responseText ); + }); + }); + } + }; + + // Provide access to public functions/properties. + return app; +})( document, window, jQuery ); + +// Initialize. +WPMailSMTP.Admin.About.init(); diff --git a/wp-content/plugins/wp-mail-smtp/assets/js/smtp-about.min.js b/wp-content/plugins/wp-mail-smtp/assets/js/smtp-about.min.js new file mode 100644 index 0000000..611e373 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/js/smtp-about.min.js @@ -0,0 +1 @@ +var WPMailSMTP=window.WPMailSMTP||{};WPMailSMTP.Admin=WPMailSMTP.Admin||{},WPMailSMTP.Admin.About=WPMailSMTP.Admin.About||function(a,t,p){"use strict";var i={init:function(){p(a).ready(i.ready)},ready:function(){i.pageHolder=p(".wp-mail-smtp-page-about"),i.bindActions(),p(".wp-mail-smtp-page").trigger("WPMailSMTP.Admin.About.ready")},bindActions:function(){jQuery(".wp-mail-smtp-admin-about-plugins .plugin-item .details").matchHeight(),p(a).on("click",".wp-mail-smtp-admin-about-plugins .plugin-item .action-button .button",function(a){a.preventDefault();var i=p(this);if(i.hasClass("disabled")||i.hasClass("loading"))return!1;var s,n,l,e,o,u=i.closest(".plugin-item"),t=i.attr("data-plugin");if(i.addClass("loading disabled"),i.text(wp_mail_smtp_about.plugin_processing),i.hasClass("status-inactive"))s="about_plugin_activate",n="status-active button button-secondary disabled",l=wp_mail_smtp_about.plugin_active,e=wp_mail_smtp_about.plugin_activated,wp_mail_smtp_about.plugin_activate;else{if(!i.hasClass("status-download"))return;s="about_plugin_install",n="status-active button disabled",l=wp_mail_smtp_about.plugin_active,e=wp_mail_smtp_about.plugin_activated,wp_mail_smtp_about.plugin_activate}var d={action:"wp_mail_smtp_ajax",task:s,nonce:wp_mail_smtp_about.nonce,plugin:t};p.post(wp_mail_smtp_about.ajax_url,d,function(a){var t;a.success?(t=!0,"about_plugin_install"===s?(i.attr("data-plugin",a.data.basename),o=a.data.msg,a.data.is_activated||(n="button",l=wp_mail_smtp_about.plugin_inactive,e=wp_mail_smtp_about.plugin_activate)):o=a.data,u.find(".actions").append('
        '+o+"
        "),u.find("span.status-label").removeClass("status-active status-inactive status-download").addClass(n).removeClass("button button-primary button-secondary disabled").text(l),i.removeClass("status-active status-inactive status-download").removeClass("button button-primary button-secondary disabled").addClass(n).html(e)):(t=!1,a.hasOwnProperty("data")&&a.data.hasOwnProperty(0)&&a.data[0].hasOwnProperty("code")&&"download_failed"===a.data[0].code?u.find(".actions").append('
        '+wp_mail_smtp_about.plugin_install_error+"
        "):u.find(".actions").append('
        '+a.data+"
        "),i.html(wp_mail_smtp_about.plugin_download_btn)),t||i.removeClass("disabled"),i.removeClass("loading"),setTimeout(function(){p(".plugin-item .msg").remove()},3e3)}).fail(function(a){console.log(a.responseText)})})}};return i}(document,window,jQuery),WPMailSMTP.Admin.About.init(); \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/js/smtp-admin.js b/wp-content/plugins/wp-mail-smtp/assets/js/smtp-admin.js new file mode 100644 index 0000000..b9ecb0a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/js/smtp-admin.js @@ -0,0 +1,282 @@ +/* globals jQuery, wp_mail_smtp */ +var WPMailSMTP = window.WPMailSMTP || {}; +WPMailSMTP.Admin = WPMailSMTP.Admin || {}; + +/** + * WP Mail SMTP Admin area module. + * + * @since 1.6.0 + */ +WPMailSMTP.Admin.Settings = WPMailSMTP.Admin.Settings || (function ( document, window, $ ) { + + 'use strict'; + + /** + * Private functions and properties. + * + * @since 1.6.0 + * + * @type {Object} + */ + var __private = {}; + + /** + * Public functions and properties. + * + * @since 1.6.0 + * + * @type {Object} + */ + var app = { + /** + * State attribute showing if one of the plugin settings + * changed and was not yet saved. + * + * @since {VERSION} + * + * @type {boolean} + */ + pluginSettingsChanged: false, + + /** + * Start the engine. DOM is not ready yet, use only to init something. + * + * @since 1.6.0 + */ + init: function () { + + // Do that when DOM is ready. + $( document ).ready( app.ready ); + }, + + /** + * DOM is fully loaded. + * + * @since 1.6.0 + */ + ready: function () { + + app.pageHolder = $( '.wp-mail-smtp-tab-settings' ); + + // If there are screen options we have to move them. + $( '#screen-meta-links, #screen-meta' ).prependTo( '#wp-mail-smtp-header-temp' ).show(); + + app.bindActions(); + }, + + /** + * Process all generic actions/events, mostly custom that were fired by our API. + * + * @since 1.6.0 + */ + bindActions: function () { + + // Mailer selection. + $( '.wp-mail-smtp-mailer-image', app.pageHolder ).click( function () { + $( this ).parents( '.wp-mail-smtp-mailer' ).find( 'input' ).trigger( 'click' ); + } ); + + $( '.wp-mail-smtp-mailer input', app.pageHolder ).click( function () { + var $input = $( this ); + + if ( $input.prop( 'disabled' ) ) { + // Educational Popup. + if ( $input.hasClass( 'educate' ) ) { + app.education.upgradeMailer( $input ); + } + + return false; + } + + // Deselect the current mailer. + $( '.wp-mail-smtp-mailer', app.pageHolder ).removeClass( 'active' ); + // Select the correct one. + $( this ).parents( '.wp-mail-smtp-mailer' ).addClass( 'active' ); + + // Hide all mailers options and display for a currently clicked one. + $( '.wp-mail-smtp-mailer-option', app.pageHolder ).addClass( 'hidden' ).removeClass( 'active' ); + $( '.wp-mail-smtp-mailer-option-' + $( this ).val(), app.pageHolder ).addClass( 'active' ).removeClass( 'hidden' ); + } ); + + app.mailers.smtp.bindActions(); + + // Dismiss Pro banner at the bottom of the page. + $( '#wp-mail-smtp-pro-banner-dismiss', app.pageHolder ).on( 'click', function () { + $.ajax( { + url: ajaxurl, + dataType: 'json', + type: 'POST', + data: { + action: 'wp_mail_smtp_ajax', + task: 'pro_banner_dismiss' + } + } ) + .always( function () { + $( '#wp-mail-smtp-pro-banner', app.pageHolder ).fadeOut( 'fast' ); + } ); + } ); + + // Dismis educational notices for certain mailers. + $( '.js-wp-mail-smtp-mailer-notice-dismiss', app.pageHolder ).on( 'click', function ( e ) { + e.preventDefault(); + + var $btn = $( this ), + $notice = $btn.parents( '.inline-notice' ); + + if ( $btn.hasClass( 'disabled' ) ) { + return false; + } + + $.ajax( { + url: ajaxurl, + dataType: 'json', + type: 'POST', + data: { + action: 'wp_mail_smtp_ajax', + task: 'notice_dismiss', + notice: $notice.data( 'notice' ), + mailer: $notice.data( 'mailer' ) + }, + beforeSend: function () { + $btn.addClass( 'disabled' ); + } + } ) + .always( function () { + $notice.fadeOut( 'fast', function () { + $btn.removeClass( 'disabled' ); + } ); + } ); + } ); + + // Show/hide debug output. + $( '#wp-mail-smtp-debug .error-log-toggle' ).on( 'click', function ( e ) { + e.preventDefault(); + + $( '#wp-mail-smtp-debug .error-log-toggle' ).find( '.dashicons' ).toggleClass( 'dashicons-arrow-right-alt2 dashicons-arrow-down-alt2' ); + $( '#wp-mail-smtp-debug .error-log' ).slideToggle(); + $( '#wp-mail-smtp-debug .error-log-note' ).toggle(); + } ); + + // Remove mailer connection. + $( '.js-wp-mail-smtp-provider-remove', app.pageHolder ).on( 'click', function () { + return confirm( wp_mail_smtp.text_provider_remove ); + } ); + + // Copy input text to clipboard. + $( '.wp-mail-smtp-setting-copy', app.pageHolder ).click( function ( e ) { + e.preventDefault(); + + var target = $( '#' + $( this ).data( 'source_id' ) ).get( 0 ); + + target.select(); + + document.execCommand( 'Copy' ); + } ); + + app.triggerExitNotice(); + }, + + education: { + upgradeMailer: function ( $input ) { + + $.alert( { + backgroundDismiss: true, + escapeKey: true, + animationBounce: 1, + theme: 'modern', + animateFromElement: false, + draggable: false, + closeIcon: true, + useBootstrap: false, + title: wp_mail_smtp.education.upgrade_title.replace( /%name%/g, $input.siblings( 'label' ).text().trim() ), + icon: '">' + wp_mail_smtp.education.upgrade_icon_lock + '' + wp_mail_smtp.education.upgrade_bonus + wp_mail_smtp.education.upgrade_doc + '' ); + }, + buttons: { + confirm: { + text: wp_mail_smtp.education.upgrade_button, + btnClass: 'btn-confirm', + keys: [ 'enter' ], + action: function () { + window.open( wp_mail_smtp.education.upgrade_url + '&utm_content=' + encodeURI( $input.val() ), '_blank' ); + } + } + } + } ); + } + }, + + /** + * Individual mailers specific js code. + * + * @since 1.6.0 + */ + mailers: { + smtp: { + bindActions: function () { + + // Hide SMTP-specific user/pass when Auth disabled. + $( '#wp-mail-smtp-setting-smtp-auth' ).change( function () { + $( '#wp-mail-smtp-setting-row-smtp-user, #wp-mail-smtp-setting-row-smtp-pass' ).toggleClass( 'inactive' ); + } ); + + // Port default values based on encryption type. + $( '#wp-mail-smtp-setting-row-smtp-encryption input' ).change( function () { + + var $input = $( this ), + $smtpPort = $( '#wp-mail-smtp-setting-smtp-port', app.pageHolder ); + + if ( 'tls' === $input.val() ) { + $smtpPort.val( '587' ); + $( '#wp-mail-smtp-setting-row-smtp-autotls' ).addClass( 'inactive' ); + } + else if ( 'ssl' === $input.val() ) { + $smtpPort.val( '465' ); + $( '#wp-mail-smtp-setting-row-smtp-autotls' ).removeClass( 'inactive' ); + } + else { + $smtpPort.val( '25' ); + $( '#wp-mail-smtp-setting-row-smtp-autotls' ).removeClass( 'inactive' ); + } + } ); + } + } + }, + + /** + * Exit notice JS code when plugin settings are not saved. + * + * @since {VERSION} + */ + triggerExitNotice: function () { + + var $settingPages = $( '.wp-mail-smtp-page-general:not( .wp-mail-smtp-tab-test )' ); + + // Display an exit notice, if settings are not saved. + $( window ).on( 'beforeunload', function () { + if ( app.pluginSettingsChanged ) { + return wp_mail_smtp.text_settings_not_saved; + } + } ); + + // Set settings changed attribute, if any input was changed. + $( ':input:not( #wp-mail-smtp-setting-license-key )', $settingPages ).on( 'change', function () { + app.pluginSettingsChanged = true; + } ); + + // Clear the settings changed attribute, if the settings are about to be saved. + $( 'form', $settingPages ).on( 'submit', function () { + app.pluginSettingsChanged = false; + } ); + } + }; + + // Provide access to public functions/properties. + return app; +})( document, window, jQuery ); + +// Initialize. +WPMailSMTP.Admin.Settings.init(); diff --git a/wp-content/plugins/wp-mail-smtp/assets/js/smtp-admin.min.js b/wp-content/plugins/wp-mail-smtp/assets/js/smtp-admin.min.js new file mode 100644 index 0000000..83979f4 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/js/smtp-admin.min.js @@ -0,0 +1 @@ +var WPMailSMTP=window.WPMailSMTP||{};WPMailSMTP.Admin=WPMailSMTP.Admin||{},WPMailSMTP.Admin.Settings=WPMailSMTP.Admin.Settings||function(i,e,a){"use strict";var n={pluginSettingsChanged:!1,init:function(){a(i).ready(n.ready)},ready:function(){n.pageHolder=a(".wp-mail-smtp-tab-settings"),a("#screen-meta-links, #screen-meta").prependTo("#wp-mail-smtp-header-temp").show(),n.bindActions()},bindActions:function(){a(".wp-mail-smtp-mailer-image",n.pageHolder).click(function(){a(this).parents(".wp-mail-smtp-mailer").find("input").trigger("click")}),a(".wp-mail-smtp-mailer input",n.pageHolder).click(function(){var t=a(this);if(t.prop("disabled"))return t.hasClass("educate")&&n.education.upgradeMailer(t),!1;a(".wp-mail-smtp-mailer",n.pageHolder).removeClass("active"),a(this).parents(".wp-mail-smtp-mailer").addClass("active"),a(".wp-mail-smtp-mailer-option",n.pageHolder).addClass("hidden").removeClass("active"),a(".wp-mail-smtp-mailer-option-"+a(this).val(),n.pageHolder).addClass("active").removeClass("hidden")}),n.mailers.smtp.bindActions(),a("#wp-mail-smtp-pro-banner-dismiss",n.pageHolder).on("click",function(){a.ajax({url:ajaxurl,dataType:"json",type:"POST",data:{action:"wp_mail_smtp_ajax",task:"pro_banner_dismiss"}}).always(function(){a("#wp-mail-smtp-pro-banner",n.pageHolder).fadeOut("fast")})}),a(".js-wp-mail-smtp-mailer-notice-dismiss",n.pageHolder).on("click",function(t){t.preventDefault();var i=a(this),e=i.parents(".inline-notice");if(i.hasClass("disabled"))return!1;a.ajax({url:ajaxurl,dataType:"json",type:"POST",data:{action:"wp_mail_smtp_ajax",task:"notice_dismiss",notice:e.data("notice"),mailer:e.data("mailer")},beforeSend:function(){i.addClass("disabled")}}).always(function(){e.fadeOut("fast",function(){i.removeClass("disabled")})})}),a("#wp-mail-smtp-debug .error-log-toggle").on("click",function(t){t.preventDefault(),a("#wp-mail-smtp-debug .error-log-toggle").find(".dashicons").toggleClass("dashicons-arrow-right-alt2 dashicons-arrow-down-alt2"),a("#wp-mail-smtp-debug .error-log").slideToggle(),a("#wp-mail-smtp-debug .error-log-note").toggle()}),a(".js-wp-mail-smtp-provider-remove",n.pageHolder).on("click",function(){return confirm(wp_mail_smtp.text_provider_remove)}),a(".wp-mail-smtp-setting-copy",n.pageHolder).click(function(t){t.preventDefault(),a("#"+a(this).data("source_id")).get(0).select(),i.execCommand("Copy")}),n.triggerExitNotice()},education:{upgradeMailer:function(t){a.alert({backgroundDismiss:!0,escapeKey:!0,animationBounce:1,theme:"modern",animateFromElement:!1,draggable:!1,closeIcon:!0,useBootstrap:!1,title:wp_mail_smtp.education.upgrade_title.replace(/%name%/g,t.siblings("label").text().trim()),icon:'">'+wp_mail_smtp.education.upgrade_icon_lock+''+wp_mail_smtp.education.upgrade_bonus+wp_mail_smtp.education.upgrade_doc+"")},buttons:{confirm:{text:wp_mail_smtp.education.upgrade_button,btnClass:"btn-confirm",keys:["enter"],action:function(){e.open(wp_mail_smtp.education.upgrade_url+"&utm_content="+encodeURI(t.val()),"_blank")}}}})}},mailers:{smtp:{bindActions:function(){a("#wp-mail-smtp-setting-smtp-auth").change(function(){a("#wp-mail-smtp-setting-row-smtp-user, #wp-mail-smtp-setting-row-smtp-pass").toggleClass("inactive")}),a("#wp-mail-smtp-setting-row-smtp-encryption input").change(function(){var t=a(this),i=a("#wp-mail-smtp-setting-smtp-port",n.pageHolder);"tls"===t.val()?(i.val("587"),a("#wp-mail-smtp-setting-row-smtp-autotls").addClass("inactive")):("ssl"===t.val()?i.val("465"):i.val("25"),a("#wp-mail-smtp-setting-row-smtp-autotls").removeClass("inactive"))})}}},triggerExitNotice:function(){var t=a(".wp-mail-smtp-page-general:not( .wp-mail-smtp-tab-test )");a(e).on("beforeunload",function(){if(n.pluginSettingsChanged)return wp_mail_smtp.text_settings_not_saved}),a(":input:not( #wp-mail-smtp-setting-license-key )",t).on("change",function(){n.pluginSettingsChanged=!0}),a("form",t).on("submit",function(){n.pluginSettingsChanged=!1})}};return n}(document,window,jQuery),WPMailSMTP.Admin.Settings.init(); \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/languages/wp-mail-smtp.pot b/wp-content/plugins/wp-mail-smtp/assets/languages/wp-mail-smtp.pot new file mode 100644 index 0000000..4fb462c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/languages/wp-mail-smtp.pot @@ -0,0 +1,1771 @@ +msgid "" +msgstr "" +"Project-Id-Version: WP Mail SMTP 1.9.0\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-mail-smtp\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2020-03-23T16:26:08+02:00\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"X-Generator: WP-CLI 2.4.0\n" +"X-Domain: wp-mail-smtp\n" + +#. Plugin Name of the plugin +msgid "WP Mail SMTP Pro" +msgstr "" + +#. Plugin URI of the plugin +msgid "https://wpmailsmtp.com/" +msgstr "" + +#. Description of the plugin +msgid "Reconfigures the wp_mail() function to use Gmail/Mailgun/SendGrid/SMTP instead of the default mail() and creates an options page to manage the settings." +msgstr "" + +#. Author of the plugin +msgid "WPForms" +msgstr "" + +#. Author URI of the plugin +msgid "https://wpforms.com/" +msgstr "" + +#. translators: %s - error code, returned by Google API. +#: src/Admin/Area.php:112 +msgid "There was an error while processing the authentication request: %s. Please try again." +msgstr "" + +#: src/Admin/Area.php:120 +msgid "There was an error while processing the authentication request. Please try again." +msgstr "" + +#: src/Admin/Area.php:127 +msgid "There was an error while processing the authentication request. Please make sure that you have Client ID and Client Secret both valid and saved." +msgstr "" + +#: src/Admin/Area.php:136 +msgid "You have successfully linked the current site with your Google API project. Now you can start sending emails through Gmail." +msgstr "" + +#: src/Admin/Area.php:142 +msgid "You have successfully linked the current site with your Microsoft API project. Now you can start sending emails through Outlook." +msgstr "" + +#. translators: %s - Mailer anchor link. +#: src/Admin/Area.php:174 +msgid "Thanks for using WP Mail SMTP! To complete the plugin setup and start sending emails, please select and configure your Mailer." +msgstr "" + +#: src/Admin/Area.php:197 +#: src/Admin/Area.php:198 +#: src/SiteHealth.php:40 +#: wp-mail-smtp-0.11.2.php:582 +msgid "WP Mail SMTP" +msgstr "" + +#: src/Admin/Area.php:208 +#: src/Admin/Area.php:209 +#: src/Admin/Area.php:795 +#: wp-mail-smtp-0.11.2.php:688 +msgid "Settings" +msgstr "" + +#: src/Admin/Area.php:216 +#: src/Admin/Area.php:217 +#: src/Admin/Area.php:796 +#: src/Admin/Pages/About.php:627 +#: src/Admin/Pages/Logs.php:40 +#: src/Admin/Pages/LogsTab.php:31 +msgid "Email Log" +msgstr "" + +#: src/Admin/Area.php:224 +#: src/Admin/Area.php:225 +#: src/Admin/Pages/About.php:105 +msgid "About Us" +msgstr "" + +#: src/Admin/Area.php:267 +msgid "Are you sure you want to reset the current provider connection? You will need to immediately create a new one to be able to send emails." +msgstr "" + +#: src/Admin/Area.php:268 +msgid "Changes that you made to the settings are not saved!" +msgstr "" + +#: src/Admin/Area.php:271 +msgid "%name% is a PRO Feature" +msgstr "" + +#: src/Admin/Area.php:272 +msgid "Upgrade to Pro" +msgstr "" + +#: src/Admin/Area.php:276 +msgid "Bonus: WP Mail SMTP users get 20% off regular price,
        applied at checkout." +msgstr "" + +#: src/Admin/Area.php:285 +msgid "Already purchased?" +msgstr "" + +#: src/Admin/Area.php:352 +#: src/Admin/Area.php:359 +#: src/Admin/Pages/About.php:308 +msgid "Activate" +msgstr "" + +#: src/Admin/Area.php:353 +#: src/Admin/Pages/About.php:300 +msgid "Activated" +msgstr "" + +#: src/Admin/Area.php:354 +#: src/Admin/Pages/About.php:297 +msgid "Active" +msgstr "" + +#: src/Admin/Area.php:355 +#: src/Admin/Pages/About.php:305 +msgid "Inactive" +msgstr "" + +#: src/Admin/Area.php:356 +msgid "Processing..." +msgstr "" + +#: src/Admin/Area.php:357 +msgid "Could not install a plugin. Please download from WordPress.org and install manually." +msgstr "" + +#: src/Admin/Area.php:358 +msgid "Install and Activate" +msgstr "" + +#: src/Admin/Area.php:360 +msgid "Download" +msgstr "" + +#. translators: %1$s - WP.org link; %2$s - same WP.org link. +#: src/Admin/Area.php:420 +msgid "Please rate WP Mail SMTP ★★★★★ on WordPress.org to help us spread the word. Thank you from the WP Mail SMTP team!" +msgstr "" + +#: src/Admin/Area.php:740 +msgid "WP Mail SMTP Pro related message was successfully dismissed." +msgstr "" + +#: src/Admin/Area.php:759 +msgid "Educational notice for this mailer was successfully dismissed." +msgstr "" + +#: src/Admin/PageAbstract.php:81 +msgid "Save Settings" +msgstr "" + +#. translators: %s - plugin current license type. +#: src/Admin/Pages/About.php:98 +#: src/Admin/Pages/About.php:526 +msgid "%s vs Pro" +msgstr "" + +#: src/Admin/Pages/About.php:170 +msgid "Hello and welcome to WP Mail SMTP, the easiest and most popular WordPress SMTP plugin. We build software that helps your site reliably deliver emails every time." +msgstr "" + +#: src/Admin/Pages/About.php:174 +msgid "Email deliverability has been a well-documented problem for all WordPress websites. However as WPForms grew, we became more aware of this painful issue that affects our users and the larger WordPress community. So we decided to solve this problem and make a solution that's beginner friendly." +msgstr "" + +#: src/Admin/Pages/About.php:177 +msgid "Our goal is to make reliable email deliverability easy for WordPress." +msgstr "" + +#. translators: %1$s - WPForms URL, %2$s - WPBeginner URL, %3$s - OptinMonster URL, %4$s - MonsterInsights URL, %5$s - RafflePress URL +#: src/Admin/Pages/About.php:184 +msgid "WP Mail SMTP is brought to you by the same team that's behind the most user friendly WordPress forms, WPForms, the largest WordPress resource site, WPBeginner, the most popular lead-generation software, OptinMonster, the best WordPress analytics plugin, MonsterInsights, and the most powerful WordPress contest plugin, RafflePress." +msgstr "" + +#: src/Admin/Pages/About.php:202 +msgid "Yup, we know a thing or two about building awesome products that customers love." +msgstr "" + +#: src/Admin/Pages/About.php:208 +msgid "The WPForms Team photo" +msgstr "" + +#: src/Admin/Pages/About.php:210 +msgid "The WPForms Team" +msgstr "" + +#. translators: %s - status HTML text. +#: src/Admin/Pages/About.php:250 +msgid "Status: %s" +msgstr "" + +#: src/Admin/Pages/About.php:316 +msgid "Not Installed" +msgstr "" + +#: src/Admin/Pages/About.php:319 +msgid "Install Plugin" +msgstr "" + +#: src/Admin/Pages/About.php:340 +msgid "MonsterInsights" +msgstr "" + +#: src/Admin/Pages/About.php:341 +#: src/Admin/Pages/About.php:347 +msgid "MonsterInsights makes it “effortless” to properly connect your WordPress site with Google Analytics, so you can start making data-driven decisions to grow your business." +msgstr "" + +#: src/Admin/Pages/About.php:346 +msgid "MonsterInsights Pro" +msgstr "" + +#: src/Admin/Pages/About.php:354 +msgid "OptinMonster" +msgstr "" + +#: src/Admin/Pages/About.php:355 +msgid "Our high-converting optin forms like Exit-Intent® popups, Fullscreen Welcome Mats, and Scroll boxes help you dramatically boost conversions and get more email subscribers." +msgstr "" + +#: src/Admin/Pages/About.php:361 +msgid "Contact Forms by WPForms" +msgstr "" + +#: src/Admin/Pages/About.php:362 +#: src/Admin/Pages/About.php:368 +msgid "The best WordPress contact form plugin. Drag & Drop online form builder that helps you create beautiful contact forms with just a few clicks." +msgstr "" + +#: src/Admin/Pages/About.php:367 +msgid "WPForms Pro" +msgstr "" + +#: src/Admin/Pages/About.php:375 +msgid "RafflePress" +msgstr "" + +#: src/Admin/Pages/About.php:376 +#: src/Admin/Pages/About.php:382 +msgid "Turn your visitors into brand ambassadors! Easily grow your email list, website traffic, and social media followers with powerful viral giveaways & contests." +msgstr "" + +#: src/Admin/Pages/About.php:381 +msgid "RafflePress Pro" +msgstr "" + +#: src/Admin/Pages/About.php:401 +msgid "Could not activate the plugin. Please activate it from the Plugins page." +msgstr "" + +#: src/Admin/Pages/About.php:413 +msgid "Plugin activated." +msgstr "" + +#: src/Admin/Pages/About.php:430 +msgid "Could not install the plugin." +msgstr "" + +#: src/Admin/Pages/About.php:491 +msgid "Plugin installed & activated." +msgstr "" + +#: src/Admin/Pages/About.php:499 +msgid "Plugin installed." +msgstr "" + +#: src/Admin/Pages/About.php:534 +msgid "Get the most out of WP Mail SMTP by upgrading to Pro and unlocking all of the powerful features." +msgstr "" + +#: src/Admin/Pages/About.php:543 +msgid "Feature" +msgstr "" + +#: src/Admin/Pages/About.php:553 +msgid "Pro" +msgstr "" + +#: src/Admin/Pages/About.php:594 +msgid "Get WP Mail SMTP Pro Today and Unlock all of these Powerful Features" +msgstr "" + +#: src/Admin/Pages/About.php:601 +msgid "Bonus: WP Mail SMTP Lite users get 20% off regular price, automatically applied at checkout." +msgstr "" + +#: src/Admin/Pages/About.php:628 +#: src/Admin/Pages/ControlTab.php:27 +msgid "Email Controls" +msgstr "" + +#: src/Admin/Pages/About.php:629 +msgid "Additional Mailers" +msgstr "" + +#: src/Admin/Pages/About.php:630 +msgid "Customer Support" +msgstr "" + +#: src/Admin/Pages/About.php:651 +msgid "Emails are not logged" +msgstr "" + +#: src/Admin/Pages/About.php:657 +msgid "Complete Email Log management inside WordPress" +msgstr "" + +#: src/Admin/Pages/About.php:665 +msgid "No controls over whether default WordPress emails are sent" +msgstr "" + +#: src/Admin/Pages/About.php:671 +msgid "Complete Email Controls management for most default WordPress emails" +msgstr "" + +#: src/Admin/Pages/About.php:679 +msgid "Only default list of mailers" +msgstr "" + +#: src/Admin/Pages/About.php:685 +msgid "Additional mailers: Microsoft Outlook (with Office365 support) and Amazon SES" +msgstr "" + +#: src/Admin/Pages/About.php:693 +msgid "Limited Support" +msgstr "" + +#: src/Admin/Pages/About.php:699 +msgid "Priority Support" +msgstr "" + +#: src/Admin/Pages/ControlTab.php:46 +msgid "Comment Notifications" +msgstr "" + +#: src/Admin/Pages/ControlTab.php:47 +msgid "Manage emails sent when comments are published or awaiting moderation." +msgstr "" + +#: src/Admin/Pages/ControlTab.php:51 +msgid "Site Admin Email Change Notifications" +msgstr "" + +#: src/Admin/Pages/ControlTab.php:52 +msgid "Manage emails sent when site admin's account has been changed." +msgstr "" + +#: src/Admin/Pages/ControlTab.php:56 +msgid "User Change Notifications" +msgstr "" + +#: src/Admin/Pages/ControlTab.php:57 +msgid "Limit emails triggered by password changed/reset, email changed, and more." +msgstr "" + +#: src/Admin/Pages/ControlTab.php:61 +msgid "Personal Data Requests Notifications" +msgstr "" + +#: src/Admin/Pages/ControlTab.php:62 +msgid "Control emails for data requests and data removal actions." +msgstr "" + +#: src/Admin/Pages/ControlTab.php:66 +msgid "Automatic Update Notifications" +msgstr "" + +#: src/Admin/Pages/ControlTab.php:67 +msgid "Manage emails sent by the core automatic update process." +msgstr "" + +#: src/Admin/Pages/ControlTab.php:71 +msgid "New User Notifications" +msgstr "" + +#: src/Admin/Pages/ControlTab.php:72 +msgid "Toggle emails sent to both user and site administrator about new user accounts." +msgstr "" + +#: src/Admin/Pages/ControlTab.php:79 +msgid "Unlock Email Controls" +msgstr "" + +#: src/Admin/Pages/ControlTab.php:82 +msgid "Email Controls allows you to granularly manage emails sent by WordPress.
" +msgstr "" + +#: src/Admin/Pages/ControlTab.php:106 +#: src/Admin/Pages/Logs.php:77 +msgid "Upgrade to WP Mail SMTP Pro" +msgstr "" + +#: src/Admin/Pages/Logs.php:63 +msgid "Unlock Email Logging" +msgstr "" + +#: src/Admin/Pages/Logs.php:66 +msgid "Keep track of every email sent from your WordPress site with email logging.
" +msgstr "" + +#: src/Admin/Pages/Logs.php:67 +msgid "Troubleshoot sending issues, recover lost emails, and more!" +msgstr "" + +#: src/Admin/Pages/Logs.php:71 +msgid "Logs Archive Page Screenshot" +msgstr "" + +#: src/Admin/Pages/Logs.php:72 +msgid "Logs Single Page Screenshot" +msgstr "" + +#: src/Admin/Pages/MiscTab.php:24 +msgid "Misc" +msgstr "" + +#: src/Admin/Pages/MiscTab.php:56 +msgid "Do Not Send" +msgstr "" + +#: src/Admin/Pages/MiscTab.php:65 +msgid "Check this if you would like to stop sending all emails." +msgstr "" + +#: src/Admin/Pages/MiscTab.php:71 +msgid "Some plugins, like BuddyPress and Events Manager, are using their own email delivery solutions. By default, this option does not block their emails, as those plugins do not use default wp_mail() function to send emails." +msgstr "" + +#: src/Admin/Pages/MiscTab.php:79 +msgid "You will need to consult with their documentation to switch them to use default WordPress email delivery." +msgstr "" + +#: src/Admin/Pages/MiscTab.php:81 +msgid "Test emails are allowed to be sent, regardless of this option." +msgstr "" + +#. translators: %1$s - constant that was used; %2$s - file where it was used. +#. translators: %1$s - constant name, %2$s - file name. +#: src/Admin/Pages/MiscTab.php:86 +#: src/Providers/OptionsAbstract.php:468 +msgid "The value of this field was set using a constant %1$s most likely inside %2$s of your WordPress installation." +msgstr "" + +#. translators: %1$s - constant to use; %2$s - file to put that constant in. +#: src/Admin/Pages/MiscTab.php:92 +msgid "If you want to disable using a constant, put %1$s in your %2$s file." +msgstr "" + +#: src/Admin/Pages/MiscTab.php:106 +msgid "Hide Announcements" +msgstr "" + +#: src/Admin/Pages/MiscTab.php:115 +msgid "Check this if you would like to hide plugin announcements and update details." +msgstr "" + +#: src/Admin/Pages/MiscTab.php:125 +msgid "Hide Email Delivery Errors" +msgstr "" + +#: src/Admin/Pages/MiscTab.php:141 +msgid "Check this if you would like to hide warnings alerting of email delivery errors." +msgstr "" + +#. translators: %s - filter that was used to disabled. +#: src/Admin/Pages/MiscTab.php:148 +msgid "Email Delivery Errors were disabled using a %s filter." +msgstr "" + +#: src/Admin/Pages/MiscTab.php:157 +msgid "This is not recommended and should only be done for staging or development sites." +msgstr "" + +#: src/Admin/Pages/MiscTab.php:172 +msgid "Uninstall WP Mail SMTP" +msgstr "" + +#: src/Admin/Pages/MiscTab.php:180 +msgid "Check this if you would like to remove ALL WP Mail SMTP data upon plugin deletion. All settings will be unrecoverable." +msgstr "" + +#: src/Admin/Pages/MiscTab.php:215 +#: src/Admin/Pages/SettingsTab.php:542 +msgid "Settings were successfully saved." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:36 +msgid "General" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:64 +msgid "License" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:67 +msgid "Your license key provides access to updates and support." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:75 +msgid "License Key" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:85 +msgid "Mail" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:92 +#: wp-mail-smtp-0.11.2.php:246 +msgid "From Email" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:103 +msgid "The email address which emails are sent from." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:104 +msgid "If you using an email provider (Gmail, Yahoo, Outlook.com, etc) this should be your email address for that account." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:107 +msgid "Please note that other plugins can change this, to prevent this use the setting below." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:119 +msgid "Force From Email" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:124 +msgid "Current provider will automatically force From Email to be the email address that you use to set up the connection below." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:128 +msgid "If checked, the From Email setting above will be used for all emails, ignoring values set by other plugins." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:138 +#: wp-mail-smtp-0.11.2.php:265 +msgid "From Name" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:149 +msgid "The name which emails are sent from." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:161 +msgid "Force From Name" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:166 +msgid "Current provider doesn't support setting and forcing From Name. Emails will be sent on behalf of the account name used to setup the connection below." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:170 +msgid "If checked, the From Name setting above will be used for all emails, ignoring values set by other plugins." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:179 +#: wp-mail-smtp-0.11.2.php:321 +#: wp-mail-smtp-0.11.2.php:326 +msgid "Return Path" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:188 +#: wp-mail-smtp-0.11.2.php:331 +msgid "Set the return-path to match the From Email" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:192 +#: wp-mail-smtp-0.11.2.php:335 +msgid "Return Path indicates where non-delivery receipts - or bounce messages - are to be sent." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:193 +msgid "If unchecked, bounce messages may be lost. Some providers may ignore this option." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:201 +#: wp-mail-smtp-0.11.2.php:280 +#: wp-mail-smtp-0.11.2.php:285 +msgid "Mailer" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:241 +#: src/Admin/Pages/SettingsTab.php:245 +msgid "Suggest a Mailer" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:274 +msgid "Dismiss this notice" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:316 +msgid "You're using WP Mail SMTP Lite - no license needed. Enjoy!" +msgstr "" + +#. translators: %s - WPMailSMTP.com upgrade URL. +#: src/Admin/Pages/SettingsTab.php:322 +msgid "To unlock more features consider upgrading to PRO." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:341 +msgid "As a valued WP Mail SMTP Lite user you receive 20% off, automatically applied at checkout!" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:402 +msgid "Get WP Mail SMTP Pro and Unlock all the Powerful Features" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:406 +msgid "Thanks for being a loyal WP Mail SMTP user. Upgrade to WP Mail SMTP Pro to unlock more awesome features and experience why WP Mail SMTP is the most popular SMTP plugin." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:410 +msgid "We know that you will truly love WP Mail SMTP. It's used by over 1,000,000 websites." +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:413 +msgid "Pro Features:" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:417 +msgid "Manage Notifications - control which emails your site sends" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:418 +msgid "Email Logging - keep track of every email sent from your site" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:419 +msgid "Office 365 - send emails using your Office 365 account" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:420 +msgid "Amazon SES - harness the power of AWS" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:421 +msgid "Outlook.com - send emails using your Outlook.com account" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:422 +msgid "Access to our world class support team" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:425 +msgid "White Glove Setup - sit back and relax while we handle everything for you" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:426 +msgid "Install WP Mail SMTP Pro plugin" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:427 +msgid "Set up domain name verification (DNS)" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:428 +msgid "Configure Mailgun service" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:429 +msgid "Set up WP Mail SMTP Pro plugin" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:430 +msgid "Test and verify email delivery" +msgstr "" + +#. translators: %s - WPMailSMTP.com URL. +#: src/Admin/Pages/SettingsTab.php:438 +msgid "Get WP Mail SMTP Pro Today and Unlock all the Powerful Features »" +msgstr "" + +#: src/Admin/Pages/SettingsTab.php:456 +msgid "Bonus: WP Mail SMTP users get 20% off regular price, automatically applied at checkout." +msgstr "" + +#: src/Admin/Pages/TestTab.php:37 +msgid "Email Test" +msgstr "" + +#: src/Admin/Pages/TestTab.php:59 +#: wp-mail-smtp-0.11.2.php:528 +msgid "Send a Test Email" +msgstr "" + +#: src/Admin/Pages/TestTab.php:66 +msgid "Send To" +msgstr "" + +#: src/Admin/Pages/TestTab.php:72 +msgid "Enter email address where test email will be sent." +msgstr "" + +#: src/Admin/Pages/TestTab.php:80 +msgid "HTML" +msgstr "" + +#: src/Admin/Pages/TestTab.php:86 +#: src/Providers/OptionsAbstract.php:264 +#: src/Providers/OptionsAbstract.php:286 +msgid "On" +msgstr "" + +#: src/Admin/Pages/TestTab.php:87 +#: src/Providers/OptionsAbstract.php:265 +#: src/Providers/OptionsAbstract.php:287 +msgid "Off" +msgstr "" + +#: src/Admin/Pages/TestTab.php:90 +msgid "Send this email in HTML or in plain text format." +msgstr "" + +#: src/Admin/Pages/TestTab.php:110 +msgid "You cannot send an email. Mailer is not properly configured. Please check your settings." +msgstr "" + +#: src/Admin/Pages/TestTab.php:114 +msgid "Send Email" +msgstr "" + +#: src/Admin/Pages/TestTab.php:142 +msgid "Test failed. Please use a valid email address and try to resend the test email." +msgstr "" + +#. translators: %s - email address a test email will be sent to. +#: src/Admin/Pages/TestTab.php:154 +#: src/Admin/Pages/TestTab.php:160 +msgid "Test email to %s" +msgstr "" + +#: src/Admin/Pages/TestTab.php:186 +msgid "Test plain text email was sent successfully!" +msgstr "" + +#. translators: %s - "HTML" in bold. +#: src/Admin/Pages/TestTab.php:190 +msgid "Test %s email was sent successfully! Please check your inbox to make sure it is delivered." +msgstr "" + +#: src/Admin/Pages/TestTab.php:498 +msgid "SSL certificate issue." +msgstr "" + +#: src/Admin/Pages/TestTab.php:499 +msgid "This means your web server cannot reliably make secure connections (make requests to HTTPS sites)." +msgstr "" + +#: src/Admin/Pages/TestTab.php:500 +#: src/Admin/Pages/TestTab.php:551 +msgid "Typically this error is returned when web server is not configured properly." +msgstr "" + +#: src/Admin/Pages/TestTab.php:503 +msgid "Contact your web hosting provider and inform them your site has an issue with SSL certificates." +msgstr "" + +#: src/Admin/Pages/TestTab.php:504 +#: src/Admin/Pages/TestTab.php:555 +msgid "The exact error you can provide them is in the Error log, available at the bottom of this page." +msgstr "" + +#: src/Admin/Pages/TestTab.php:505 +#: src/Admin/Pages/TestTab.php:556 +msgid "Ask them to resolve the issue then try again." +msgstr "" + +#: src/Admin/Pages/TestTab.php:516 +msgid "Could not connect to host." +msgstr "" + +#. translators: %s - SMTP host address. +#: src/Admin/Pages/TestTab.php:520 +#: src/Admin/Pages/TestTab.php:547 +#: src/Admin/Pages/TestTab.php:620 +msgid "This means your web server was unable to connect to %s." +msgstr "" + +#: src/Admin/Pages/TestTab.php:523 +#: src/Admin/Pages/TestTab.php:550 +#: src/Admin/Pages/TestTab.php:623 +msgid "This means your web server was unable to connect to the host server." +msgstr "" + +#: src/Admin/Pages/TestTab.php:524 +msgid "Typically this error is returned your web server is blocking the connections or the SMTP host denying the request." +msgstr "" + +#. translators: %s - SMTP host address. +#: src/Admin/Pages/TestTab.php:529 +msgid "Contact your web hosting provider and ask them to verify your server can connect to %s. Additionally, ask them if a firewall or security policy may be preventing the connection." +msgstr "" + +#: src/Admin/Pages/TestTab.php:532 +msgid "If using \"Other SMTP\" Mailer, triple check your SMTP settings including host address, email, and password." +msgstr "" + +#: src/Admin/Pages/TestTab.php:533 +msgid "If using \"Other SMTP\" Mailer, contact your SMTP host to confirm they are accepting outside connections with the settings you have configured (address, username, port, security, etc)." +msgstr "" + +#: src/Admin/Pages/TestTab.php:543 +msgid "Could not connect to your host." +msgstr "" + +#: src/Admin/Pages/TestTab.php:554 +msgid "Contact your web hosting provider and inform them you are having issues making outbound connections." +msgstr "" + +#: src/Admin/Pages/TestTab.php:566 +msgid "Could not authenticate your SMTP account." +msgstr "" + +#: src/Admin/Pages/TestTab.php:567 +msgid "This means we were able to connect to your SMTP host, but were not able to proceed using the email/password in the settings." +msgstr "" + +#: src/Admin/Pages/TestTab.php:568 +msgid "Typically this error is returned when the email or password is not correct or is not what the SMTP host is expecting." +msgstr "" + +#: src/Admin/Pages/TestTab.php:571 +msgid "Triple check your SMTP settings including host address, email, and password. If you have recently reset your password you will need to update the settings." +msgstr "" + +#: src/Admin/Pages/TestTab.php:572 +#: src/Admin/Pages/TestTab.php:649 +msgid "Contact your SMTP host to confirm you are using the correct username and password." +msgstr "" + +#: src/Admin/Pages/TestTab.php:573 +#: src/Admin/Pages/TestTab.php:650 +msgid "Verify with your SMTP host that your account has permissions to send emails using outside connections." +msgstr "" + +#: src/Admin/Pages/TestTab.php:583 +msgid "Error due to unsolicited and/or bulk e-mail." +msgstr "" + +#: src/Admin/Pages/TestTab.php:584 +msgid "This means the connection to your SMTP host was made successfully, but the host rejected the email." +msgstr "" + +#: src/Admin/Pages/TestTab.php:585 +msgid "Typically this error is returned when you are sending too many e-mails or e-mails that have been identified as spam." +msgstr "" + +#: src/Admin/Pages/TestTab.php:588 +msgid "Check the emails that are sending are sending individually. Example: email is not sending to 30 recipients. You can install any WordPress e-mail logging plugin to do that." +msgstr "" + +#: src/Admin/Pages/TestTab.php:589 +msgid "Contact your SMTP host to ask about sending/rate limits." +msgstr "" + +#: src/Admin/Pages/TestTab.php:590 +msgid "Verify with them your SMTP account is in good standing and your account has not been flagged." +msgstr "" + +#: src/Admin/Pages/TestTab.php:600 +msgid "Unauthenticated senders are not allowed." +msgstr "" + +#: src/Admin/Pages/TestTab.php:601 +msgid "This means the connection to your SMTP host was made successfully, but you should enable Authentication and provide correct Username and Password." +msgstr "" + +#: src/Admin/Pages/TestTab.php:604 +msgid "Go to WP Mail SMTP plugin Settings page." +msgstr "" + +#: src/Admin/Pages/TestTab.php:605 +msgid "Enable Authentication" +msgstr "" + +#: src/Admin/Pages/TestTab.php:606 +msgid "Enter correct SMTP Username (usually this is an email address) and Password in the appropriate fields." +msgstr "" + +#: src/Admin/Pages/TestTab.php:616 +msgid "Could not connect to the SMTP host." +msgstr "" + +#: src/Admin/Pages/TestTab.php:624 +#: src/Admin/Pages/TestTab.php:960 +msgid "Typically this error is returned for one of the following reasons:" +msgstr "" + +#: src/Admin/Pages/TestTab.php:625 +msgid "SMTP settings are incorrect (wrong port, security setting, incorrect host)." +msgstr "" + +#: src/Admin/Pages/TestTab.php:626 +#: src/Admin/Pages/TestTab.php:962 +msgid "Your web server is blocking the connection." +msgstr "" + +#: src/Admin/Pages/TestTab.php:627 +msgid "Your SMTP host is rejecting the connection." +msgstr "" + +#: src/Admin/Pages/TestTab.php:630 +msgid "Triple check your SMTP settings including host address, email, and password, port, and security." +msgstr "" + +#. translators: %1$s - SMTP host address, %2$s - SMTP port, %3$s - SMTP encryption. +#: src/Admin/Pages/TestTab.php:634 +msgid "Contact your web hosting provider and ask them to verify your server can connect to %1$s on port %2$s using %3$s encryption. Additionally, ask them if a firewall or security policy may be preventing the connection - many shared hosts block certain ports.
        Note: this is the most common cause of this issue." +msgstr "" + +#: src/Admin/Pages/TestTab.php:647 +msgid "no" +msgstr "" + +#: src/Admin/Pages/TestTab.php:660 +#: src/Admin/Pages/TestTab.php:675 +#: src/Admin/Pages/TestTab.php:691 +msgid "Mailgun failed." +msgstr "" + +#: src/Admin/Pages/TestTab.php:661 +msgid "It seems that you forgot to activate your Mailgun account." +msgstr "" + +#: src/Admin/Pages/TestTab.php:664 +msgid "Check your inbox you used to create a Mailgun account. Click the activation link in an email from Mailgun." +msgstr "" + +#: src/Admin/Pages/TestTab.php:665 +msgid "If you do not see activation email, go to your Mailgun control panel and resend the activation email." +msgstr "" + +#: src/Admin/Pages/TestTab.php:676 +msgid "Typically this error is because there is an issue with your Mailgun settings, in many cases the API key." +msgstr "" + +#: src/Admin/Pages/TestTab.php:679 +msgid "Verify your API key is correct." +msgstr "" + +#: src/Admin/Pages/TestTab.php:680 +msgid "Go to your Mailgun account and view your API key." +msgstr "" + +#: src/Admin/Pages/TestTab.php:681 +msgid "Note that the API key includes the \"key\" prefix, so make sure that it is in the WP Mail SMTP Mailgun API setting." +msgstr "" + +#: src/Admin/Pages/TestTab.php:692 +msgid "Your Mailgun account does not have access to send emails." +msgstr "" + +#: src/Admin/Pages/TestTab.php:693 +msgid "Typically this error is because you have not set up and/or complete domain name verification for your Mailgun account." +msgstr "" + +#. translators: %s - Mailgun documentation URL. +#: src/Admin/Pages/TestTab.php:699 +msgid "Go to our how-to guide for setting up Mailgun with WP Mail SMTP." +msgstr "" + +#: src/Admin/Pages/TestTab.php:710 +msgid "Complete the steps in section \"2. Verify Your Domain\"." +msgstr "" + +#: src/Admin/Pages/TestTab.php:720 +#: src/Admin/Pages/TestTab.php:771 +#: src/Admin/Pages/TestTab.php:792 +#: src/Admin/Pages/TestTab.php:819 +#: src/Admin/Pages/TestTab.php:835 +#: src/Admin/Pages/TestTab.php:890 +#: src/Admin/Pages/TestTab.php:917 +msgid "Google API Error." +msgstr "" + +#: src/Admin/Pages/TestTab.php:721 +msgid "You have not properly configured Gmail mailer." +msgstr "" + +#: src/Admin/Pages/TestTab.php:722 +msgid "Make sure that you have clicked the \"Allow plugin to send emails using your Google account\" button under Gmail settings." +msgstr "" + +#: src/Admin/Pages/TestTab.php:725 +msgid "Go to plugin Settings page and click the \"Allow plugin to send emails using your Google account\" button." +msgstr "" + +#: src/Admin/Pages/TestTab.php:726 +msgid "After the click you should be redirected to a Gmail authorization screen, where you will be asked a permission to send emails on your behalf." +msgstr "" + +#: src/Admin/Pages/TestTab.php:727 +msgid "Please click \"Agree\", if you see that button. If not - you will need to enable less secure apps first:" +msgstr "" + +#. translators: %s - Google support article URL. +#: src/Admin/Pages/TestTab.php:733 +msgid "if you are using regular Gmail account, please read this article to proceed." +msgstr "" + +#. translators: %s - Google support article URL. +#: src/Admin/Pages/TestTab.php:749 +msgid "if you are using G Suite, please read this article to proceed." +msgstr "" + +#: src/Admin/Pages/TestTab.php:772 +msgid "Typically this error is because address the email was sent to is invalid or was empty." +msgstr "" + +#: src/Admin/Pages/TestTab.php:775 +msgid "Check the \"Send To\" email address used and confirm it is a valid email and was not empty." +msgstr "" + +#. translators: 1 - correct email address example. 2 - incorrect email address example. +#: src/Admin/Pages/TestTab.php:778 +msgid "It should be something like this: %1$s. These are incorrect values: %2$s." +msgstr "" + +#: src/Admin/Pages/TestTab.php:782 +msgid "Make sure that the generated email has a TO header, useful when you are responsible for email creation." +msgstr "" + +#: src/Admin/Pages/TestTab.php:793 +msgid "Unfortunately, this error can be due to many different reasons." +msgstr "" + +#. translators: %s - Blog article URL. +#: src/Admin/Pages/TestTab.php:799 +msgid "Please read this article to learn more about what can cause this error and how it can be resolved." +msgstr "" + +#: src/Admin/Pages/TestTab.php:820 +msgid "Authentication code that Google returned to you has already been used on your previous auth attempt." +msgstr "" + +#: src/Admin/Pages/TestTab.php:823 +msgid "Make sure that you are not trying to manually clean up the plugin options to retry the \"Allow...\" step." +msgstr "" + +#: src/Admin/Pages/TestTab.php:824 +msgid "Reinstall the plugin with clean plugin data turned on on Misc page. This will remove all the plugin options and you will be safe to retry." +msgstr "" + +#: src/Admin/Pages/TestTab.php:825 +msgid "Make sure there is no aggressive caching on site admin area pages or try to clean cache between attempts." +msgstr "" + +#: src/Admin/Pages/TestTab.php:836 +msgid "There are various reasons for that, please review the steps below." +msgstr "" + +#. translators: %s - Google G Suite Admin area URL. +#: src/Admin/Pages/TestTab.php:842 +msgid "Make sure that your G Suite trial period has not expired. You can check the status here." +msgstr "" + +#. translators: %s - Google G Suite Admin area URL. +#: src/Admin/Pages/TestTab.php:856 +msgid "Make sure that Gmail app in your G Suite is actually enabled. You can check that in Apps list in G Suite Admin area." +msgstr "" + +#. translators: %s - Google Developers Console URL. +#: src/Admin/Pages/TestTab.php:870 +msgid "Make sure that you have Gmail API enabled, and you can do that here." +msgstr "" + +#: src/Admin/Pages/TestTab.php:893 +#: src/Admin/Pages/TestTab.php:921 +msgid "Make sure that the used Client ID/Secret correspond to a proper project that has Gmail API enabled." +msgstr "" + +#. translators: %s - WPForms.com tutorial URL. +#: src/Admin/Pages/TestTab.php:897 +msgid "Please follow our Gmail tutorial to be sure that all the correct project and data is applied." +msgstr "" + +#: src/Admin/Pages/TestTab.php:918 +msgid "You may have added a new API to a project" +msgstr "" + +#: src/Admin/Pages/TestTab.php:922 +msgid "Try to use a separate project for your emails, so the project has only 1 Gmail API in it enabled. You will need to remove the old project and create a new one from scratch." +msgstr "" + +#: src/Admin/Pages/TestTab.php:958 +msgid "An issue was detected." +msgstr "" + +#: src/Admin/Pages/TestTab.php:959 +msgid "This means your test email was unable to be sent." +msgstr "" + +#: src/Admin/Pages/TestTab.php:961 +msgid "Plugin settings are incorrect (wrong SMTP settings, invalid Mailer configuration, etc)." +msgstr "" + +#: src/Admin/Pages/TestTab.php:963 +msgid "Your host is rejecting the connection." +msgstr "" + +#: src/Admin/Pages/TestTab.php:966 +msgid "Triple check the plugin settings, consider reconfiguring to make sure everything is correct (eg bad copy and paste)." +msgstr "" + +#: src/Admin/Pages/TestTab.php:968 +msgid "Contact your web hosting provider and ask them to verify your server can make outside connections. Additionally, ask them if a firewall or security policy may be preventing the connection - many shared hosts block certain ports.
        Note: this is the most common cause of this issue." +msgstr "" + +#: src/Admin/Pages/TestTab.php:974 +msgid "Try using a different mailer." +msgstr "" + +#: src/Admin/Pages/TestTab.php:993 +msgid "There was a problem while sending the test email." +msgstr "" + +#: src/Admin/Pages/TestTab.php:1003 +msgid "Recommended next steps:" +msgstr "" + +#: src/Admin/Pages/TestTab.php:1013 +msgid "Need support?" +msgstr "" + +#. translators: %s - WPMailSMTP.com account area link. +#: src/Admin/Pages/TestTab.php:1021 +msgid "As a WP Mail SMTP Pro user you have access to WP Mail SMTP priority support. Please log in to your WPMailSMTP.com account and submit a support ticket." +msgstr "" + +#: src/Admin/Pages/TestTab.php:1038 +msgid "WP Mail SMTP is a free plugin, and the team behind WPForms maintains it to give back to the WordPress community." +msgstr "" + +#. translators: %s - WPMailSMTP.com URL. +#: src/Admin/Pages/TestTab.php:1045 +msgid "To access our world class support, please upgrade to WP Mail SMTP Pro. Along with getting expert support, you will also get Notification controls, Email Logging, and integrations for Amazon SES, Office 365, and Outlook.com." +msgstr "" + +#: src/Admin/Pages/TestTab.php:1060 +msgid "Additionally, you can take advantage of our White Glove Setup. Sit back and relax while we handle everything for you! If you simply don't have time or maybe you feel a bit in over your head - we got you covered." +msgstr "" + +#: src/Admin/Pages/TestTab.php:1066 +msgid "As a valued WP Mail SMTP user, you will get 20% off regular pricing, automatically applied at checkout!" +msgstr "" + +#. translators: %1$s - WP Mail SMTP support policy URL, %2$s - WP Mail SMTP support forum URL, %3$s - WPMailSMTP.com URL. +#: src/Admin/Pages/TestTab.php:1080 +msgid "Alternatively, we also offer limited support on the WordPress.org support forums. You can create a support thread there, but please understand that free support is not guaranteed and is limited to simple issues. If you have an urgent or complex issue, then please consider upgrading to WP Mail SMTP Pro to access our priority support ticket system." +msgstr "" + +#: src/Admin/Pages/TestTab.php:1101 +msgid "Click here to view the full Error Log for debugging" +msgstr "" + +#: src/Admin/Pages/TestTab.php:1110 +msgid "Please copy only the content of the error debug message above, identified with an orange left border, into the support forum topic if you experience any issues." +msgstr "" + +#. translators: %1$s - Plugin name causing conflict; %2$s - Plugin name causing conflict. +#: src/Conflicts.php:159 +msgid "Heads up! WP Mail SMTP has detected %1$s is activated. Please deactivate %2$s to prevent conflicts." +msgstr "" + +#. translators: %1$s - WPBeginner URL for recommended WordPress hosting. +#: src/Core.php:106 +msgid "Your site is running an insecure version of PHP that is no longer supported. Please contact your web hosting provider to update your PHP version or switch to a recommended WordPress hosting company." +msgstr "" + +#. translators: %s - WPForms.com docs URL with more details. +#: src/Core.php:123 +msgid "Note: WP Mail SMTP plugin is disabled on your site until you fix the issue. Read more for additional information." +msgstr "" + +#. translators: %1$s - WP Mail SMTP plugin name; %2$s - WPForms.com URL to a related doc. +#: src/Core.php:399 +msgid "Your site is running an outdated version of PHP that is no longer supported and may cause issues with %1$s. Read more for additional information." +msgstr "" + +#: src/Core.php:413 +msgid "Please Note: Support for PHP 5.3-5.5 will be discontinued in 2020. After this, if no further action is taken, WP Mail SMTP functionality will be disabled." +msgstr "" + +#. translators: %s - plugin name and its version. +#: src/Core.php:447 +msgid "EMAILING DISABLED: The %s is currently blocking all emails from being sent." +msgstr "" + +#. translators: %1$s - constant name; %2$s - constant value. +#: src/Core.php:458 +msgid "To send emails, change the value of the %1$s constant to %2$s." +msgstr "" + +#. translators: %s - plugin Misc settings page URL. +#: src/Core.php:469 +msgid "To send emails, go to plugin Misc settings and disable the \"Do Not Send\" option." +msgstr "" + +#. translators: %s - plugin name and its version. +#: src/Core.php:501 +msgid "EMAIL DELIVERY ERROR: the plugin %s logged this error during the last time it tried to send an email:" +msgstr "" + +#: src/Core.php:531 +msgid "Consider running an email test after fixing it." +msgstr "" + +#: src/Pro/SiteHealth.php:58 +msgid "Is wpmailsmtp.com reachable?" +msgstr "" + +#: src/Providers/AmazonSES/Options.php:25 +msgid "Amazon SES" +msgstr "" + +#: src/Providers/AmazonSES/Options.php:39 +msgid "We're sorry, the Amazon SES mailer is not available on your plan. Please upgrade to the PRO plan to unlock all these awesome features." +msgstr "" + +#: src/Providers/Gmail/Auth.php:170 +msgid "There was an error while processing the Google authentication request. Please make sure that you have Client ID and Client Secret both valid and saved." +msgstr "" + +#: src/Providers/Gmail/Options.php:32 +msgid "Gmail" +msgstr "" + +#. translators: %s - URL to our Gmail doc. +#: src/Providers/Gmail/Options.php:35 +msgid "Send emails using your Gmail or G Suite (formerly Google Apps) account, all while keeping your login credentials safe. Other Google SMTP methods require enabling less secure apps in your account and entering your password. However, this integration uses the Google API to improve email delivery issues while keeping your site secure.

        Read our Gmail documentation to learn how to configure Gmail or G Suite." +msgstr "" + +#: src/Providers/Gmail/Options.php:48 +msgid "The Gmail mailer works well for sites that send low numbers of emails. However, Gmail's API has rate limitations and a number of additional restrictions that can lead to challenges during setup. If you expect to send a high volume of emails, or if you find that your web host is not compatible with the Gmail API restrictions, then we recommend considering a different mailer option." +msgstr "" + +#: src/Providers/Gmail/Options.php:72 +msgid "Client ID" +msgstr "" + +#: src/Providers/Gmail/Options.php:87 +msgid "Client Secret" +msgstr "" + +#: src/Providers/Gmail/Options.php:109 +msgid "Authorized redirect URI" +msgstr "" + +#: src/Providers/Gmail/Options.php:117 +msgid "Copy URL to clipboard" +msgstr "" + +#: src/Providers/Gmail/Options.php:122 +msgid "Please copy this URL into the \"Authorized redirect URIs\" field of your Google web application." +msgstr "" + +#: src/Providers/Gmail/Options.php:131 +msgid "Authorization" +msgstr "" + +#: src/Providers/Gmail/Options.php:159 +msgid "Allow plugin to send emails using your Google account" +msgstr "" + +#: src/Providers/Gmail/Options.php:162 +msgid "Click the button above to confirm authorization." +msgstr "" + +#: src/Providers/Gmail/Options.php:168 +msgid "Remove Connection" +msgstr "" + +#. translators: %s - email address, as received from Google API. +#: src/Providers/Gmail/Options.php:177 +msgid "Connected as %s" +msgstr "" + +#: src/Providers/Gmail/Options.php:184 +msgid "Removing the connection will give you an ability to redo the connection or link to another Google account." +msgstr "" + +#: src/Providers/Gmail/Options.php:192 +msgid "You need to save settings with Client ID and Client Secret before you can proceed." +msgstr "" + +#: src/Providers/Mail/Options.php:25 +msgid "Default (none)" +msgstr "" + +#: src/Providers/Mail/Options.php:37 +msgid "You currently have the native WordPress option selected. Please select any other Mailer option above to continue the setup." +msgstr "" + +#: src/Providers/Mailgun/Options.php:25 +msgid "Mailgun" +msgstr "" + +#. translators: %1$s - opening link tag; %2$s - closing link tag; %3$s - opening link tag; %4$s - closing link tag. +#: src/Providers/Mailgun/Options.php:29 +msgid "%1$sMailgun%2$s is one of the leading transactional email services trusted by over 150,000+ businesses.
        They provide 5,000 free emails per month for 3 months, then $0.80 per 1000 emails.

        Read our %3$sMailgun documentation%4$s to learn how to configure Mailgun and improve your email deliverability." +msgstr "" + +#: src/Providers/Mailgun/Options.php:57 +msgid "Private API Key" +msgstr "" + +#. translators: %s - API key link. +#: src/Providers/Mailgun/Options.php:76 +msgid "Follow this link to get an API Key from Mailgun: %s." +msgstr "" + +#: src/Providers/Mailgun/Options.php:78 +msgid "Get a Private API Key" +msgstr "" + +#: src/Providers/Mailgun/Options.php:89 +msgid "Domain Name" +msgstr "" + +#. translators: %s - Domain Name link. +#: src/Providers/Mailgun/Options.php:101 +msgid "Follow this link to get a Domain Name from Mailgun: %s." +msgstr "" + +#: src/Providers/Mailgun/Options.php:103 +msgid "Get a Domain Name" +msgstr "" + +#: src/Providers/Mailgun/Options.php:114 +msgid "Region" +msgstr "" + +#: src/Providers/Mailgun/Options.php:124 +msgid "US" +msgstr "" + +#: src/Providers/Mailgun/Options.php:133 +msgid "EU" +msgstr "" + +#: src/Providers/Mailgun/Options.php:137 +msgid "Define which endpoint you want to use for sending messages." +msgstr "" + +#: src/Providers/Mailgun/Options.php:138 +msgid "If you are operating under EU laws, you may be required to use EU region." +msgstr "" + +#. translators: %s - URL to Mailgun.com page. +#: src/Providers/Mailgun/Options.php:143 +msgid "More information on Mailgun.com." +msgstr "" + +#: src/Providers/OptionsAbstract.php:186 +#: wp-mail-smtp-0.11.2.php:355 +msgid "SMTP Host" +msgstr "" + +#: src/Providers/OptionsAbstract.php:200 +#: wp-mail-smtp-0.11.2.php:370 +#: wp-mail-smtp-0.11.2.php:374 +#: wp-mail-smtp-0.11.2.php:489 +#: wp-mail-smtp-0.11.2.php:495 +msgid "Encryption" +msgstr "" + +#: src/Providers/OptionsAbstract.php:210 +msgid "None" +msgstr "" + +#: src/Providers/OptionsAbstract.php:219 +msgid "SSL" +msgstr "" + +#: src/Providers/OptionsAbstract.php:228 +msgid "TLS" +msgstr "" + +#: src/Providers/OptionsAbstract.php:232 +msgid "For most servers TLS is the recommended option. If your SMTP provider offers both SSL and TLS options, we recommend using TLS." +msgstr "" + +#: src/Providers/OptionsAbstract.php:240 +#: wp-mail-smtp-0.11.2.php:363 +#: wp-mail-smtp-0.11.2.php:481 +msgid "SMTP Port" +msgstr "" + +#: src/Providers/OptionsAbstract.php:254 +msgid "Auto TLS" +msgstr "" + +#: src/Providers/OptionsAbstract.php:268 +msgid "By default TLS encryption is automatically used if the server supports it, which is recommended. In some cases, due to server misconfigurations, this can cause issues and may need to be disabled." +msgstr "" + +#: src/Providers/OptionsAbstract.php:276 +#: wp-mail-smtp-0.11.2.php:397 +#: wp-mail-smtp-0.11.2.php:401 +msgid "Authentication" +msgstr "" + +#: src/Providers/OptionsAbstract.php:295 +msgid "SMTP Username" +msgstr "" + +#: src/Providers/OptionsAbstract.php:309 +msgid "SMTP Password" +msgstr "" + +#. translators: %s - constant name: WPMS_SMTP_PASS. +#: src/Providers/OptionsAbstract.php:321 +msgid "To change the password you need to change the value of the constant there: %s" +msgstr "" + +#. translators: %1$s - wp-config.php file, %2$s - WPMS_ON constant name. +#: src/Providers/OptionsAbstract.php:329 +msgid "If you want to disable the use of constants, find in %1$s file the constant %2$s and turn if off:" +msgstr "" + +#: src/Providers/OptionsAbstract.php:339 +msgid "All the defined constants will stop working and you will be able to change all the values on this page." +msgstr "" + +#: src/Providers/OptionsAbstract.php:347 +msgid "The password is stored in plain text. We highly recommend you set up your password in your WordPress configuration file for improved security." +msgstr "" + +#. translators: %s - wp-config.php. +#: src/Providers/OptionsAbstract.php:352 +msgid "To do this add the lines below to your %s file:" +msgstr "" + +#. translators: %1$s - Provider name; %2$s - PHP version required by Provider; %3$s - current PHP version. +#: src/Providers/OptionsAbstract.php:418 +msgid "%1$s requires PHP %2$s to work and does not support your current PHP version %3$s. Please contact your host and request a PHP upgrade to the latest one." +msgstr "" + +#: src/Providers/OptionsAbstract.php:425 +#: src/Providers/OptionsAbstract.php:449 +msgid "Meanwhile you can switch to some other mailers." +msgstr "" + +#. translators: %s - Provider name. +#: src/Providers/OptionsAbstract.php:444 +msgid "%s requires a SSL certificate on a site to work and does not support your current installation. Please contact your host and request a SSL certificate or install a free one, like Let's Encrypt." +msgstr "" + +#: src/Providers/Outlook/Options.php:25 +msgid "Outlook" +msgstr "" + +#: src/Providers/Outlook/Options.php:39 +msgid "We're sorry, the Microsoft Outlook mailer is not available on your plan. Please upgrade to the PRO plan to unlock all these awesome features." +msgstr "" + +#: src/Providers/Pepipost/Options.php:25 +msgid "Pepipost SMTP" +msgstr "" + +#. translators: %1$s - URL to pepipost.com site. +#: src/Providers/PepipostAPI/Options.php:31 +msgid "Pepipost is a recommended transactional email service. Every month Pepipost delivers over 8 billion emails from 20,000+ customers. Their mission is to reliably send emails in the most efficient way and at the most disruptive pricing ever. Pepipost provides users 30,000 free emails the first 30 days, then 100 emails per day." +msgstr "" + +#. translators: %1$s - URL to wpmailsmtp.com doc. +#: src/Providers/PepipostAPI/Options.php:34 +msgid "Read our Pepipost documentation to learn how to configure Pepipost and improve your email deliverability." +msgstr "" + +#: src/Providers/PepipostAPI/Options.php:53 +msgid "Get Pepipost Now (Free)" +msgstr "" + +#: src/Providers/PepipostAPI/Options.php:61 +msgid "Pepipost" +msgstr "" + +#: src/Providers/PepipostAPI/Options.php:88 +#: src/Providers/Sendgrid/Options.php:57 +#: src/Providers/Sendinblue/Options.php:88 +msgid "API Key" +msgstr "" + +#. translators: %s - pepipost.com link to get an API Key. +#. translators: %s - sendinblue.com link to get an API Key. +#: src/Providers/PepipostAPI/Options.php:107 +#: src/Providers/Sendinblue/Options.php:107 +msgid "Follow this link to get an API Key: %s." +msgstr "" + +#: src/Providers/PepipostAPI/Options.php:109 +msgid "Get the API Key" +msgstr "" + +#: src/Providers/Sendgrid/Options.php:25 +msgid "SendGrid" +msgstr "" + +#. translators: %1$s - opening link tag; %2$s - closing link tag; %3$s - opening link tag; %4$s - closing link tag. +#: src/Providers/Sendgrid/Options.php:29 +msgid "%1$sSendGrid%2$s is one of the leading transactional email services, sending over 35 billion emails every month. They provide users 100 free emails per day.

        Read our %3$sSendGrid documentation%4$s to learn how to set up SendGrid and improve your email deliverability." +msgstr "" + +#. translators: %s - API key link. +#: src/Providers/Sendgrid/Options.php:76 +msgid "Follow this link to get an API Key from SendGrid: %s." +msgstr "" + +#: src/Providers/Sendgrid/Options.php:78 +msgid "Create API Key" +msgstr "" + +#. translators: %s - SendGrid access level. +#: src/Providers/Sendgrid/Options.php:86 +msgid "To send emails you will need only a %s access level for this API key." +msgstr "" + +#. translators: %1$s - URL to sendinblue.com site. +#: src/Providers/Sendinblue/Options.php:31 +msgid "Sendinblue is a recommended transactional email service. Founded in 2012, they serve 80,000+ growing companies around the world and send over 30 million emails each day. They understand that transactional emails are the heart of your customer relationships. Their email deliverability experts are constantly at work optimizing the reliability and speed of their SMTP infrastructure. Sendinblue provides users 300 free emails per day." +msgstr "" + +#. translators: %2$s - URL to wpmailsmtp.com doc. +#: src/Providers/Sendinblue/Options.php:34 +msgid "Read our Sendinblue documentation to learn how to configure Sendinblue and improve your email deliverability." +msgstr "" + +#: src/Providers/Sendinblue/Options.php:53 +msgid "Get Sendinblue Now (Free)" +msgstr "" + +#: src/Providers/Sendinblue/Options.php:61 +msgid "Sendinblue" +msgstr "" + +#: src/Providers/Sendinblue/Options.php:109 +msgid "Get v3 API Key" +msgstr "" + +#: src/Providers/SMTP/Options.php:25 +msgid "Other SMTP" +msgstr "" + +#. translators: %s - URL to a related article on WPForms.com. +#: src/Providers/SMTP/Options.php:29 +msgid "Use the SMTP details provided by your hosting provider or email service.

        To see recommended settings for the popular services as well as troubleshooting tips, check out our SMTP documentation." +msgstr "" + +#: src/SiteHealth.php:67 +msgid "Is WP Mail SMTP mailer setup complete?" +msgstr "" + +#: src/SiteHealth.php:92 +msgid "Version" +msgstr "" + +#: src/SiteHealth.php:96 +msgid "License key type" +msgstr "" + +#: src/SiteHealth.php:100 +msgid "Debug" +msgstr "" + +#: src/SiteHealth.php:101 +msgid "No debug notices found." +msgstr "" + +#: src/SiteHealth.php:131 +msgid "Current mailer" +msgstr "" + +#: src/SiteHealth.php:136 +msgid "WP Mail SMTP mailer setup is complete" +msgstr "" + +#: src/SiteHealth.php:145 +msgid "The WP Mail SMTP plugin mailer setup is complete. You can send a test email, to make sure it's working properly." +msgstr "" + +#: src/SiteHealth.php:150 +msgid "Test email sending" +msgstr "" + +#: src/SiteHealth.php:158 +msgid "You currently have the default mailer selected, which means that you haven’t set up SMTP yet." +msgstr "" + +#: src/SiteHealth.php:163 +msgid "WP Mail SMTP mailer setup is incomplete" +msgstr "" + +#: src/SiteHealth.php:169 +msgid "The WP Mail SMTP plugin mailer setup is incomplete. Please click on the link below to access plugin settings and configure the mailer." +msgstr "" + +#: src/SiteHealth.php:174 +msgid "Configure mailer" +msgstr "" + +#. translators: %1$s - date, \a\t - specially escaped "at", %2$s - time. +#: src/WP.php:183 +msgid "%1$s \\a\\t %2$s" +msgstr "" + +#: wp-mail-smtp-0.11.2.php:192 +#: wp-mail-smtp-0.11.2.php:546 +msgid "Send Test" +msgstr "" + +#. translators: %s - email address where test mail will be sent to. +#: wp-mail-smtp-0.11.2.php:201 +msgid "Test mail to %s" +msgstr "" + +#: wp-mail-smtp-0.11.2.php:202 +msgid "This is a test email generated by the WP Mail SMTP WordPress plugin." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:218 +msgid "Test Message Sent" +msgstr "" + +#: wp-mail-smtp-0.11.2.php:219 +msgid "The result was:" +msgstr "" + +#: wp-mail-smtp-0.11.2.php:222 +msgid "The full debugging output is shown below:" +msgstr "" + +#: wp-mail-smtp-0.11.2.php:225 +msgid "The SMTP debugging output is shown below:" +msgstr "" + +#: wp-mail-smtp-0.11.2.php:237 +#: wp-mail-smtp-0.11.2.php:582 +msgid "WP Mail SMTP Settings" +msgstr "" + +#: wp-mail-smtp-0.11.2.php:253 +msgid "You can specify the email address that emails should be sent from. If you leave this blank, the default email will be used." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:256 +msgid "Please Note: You appear to be using a version of WordPress prior to 2.3. Please ignore the From Name field and instead enter Name<email@domain.com> in this field." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:271 +msgid "You can specify the name that emails should be sent from. If you leave this blank, the emails will be sent from WordPress." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:290 +msgid "Send all WordPress emails via SMTP." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:294 +msgid "Use the PHP mail() function to send emails." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:300 +msgid "Use Pepipost SMTP to send emails." +msgstr "" + +#. translators: %1$s - link start; %2$s - link end. +#: wp-mail-smtp-0.11.2.php:306 +msgid "Looking for high inbox delivery? Try Pepipost with easy setup and free emails. Learn more %1$shere%2$s." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:343 +#: wp-mail-smtp-0.11.2.php:443 +#: wp-mail-smtp-0.11.2.php:519 +msgid "Save Changes" +msgstr "" + +#: wp-mail-smtp-0.11.2.php:348 +msgid "SMTP Options" +msgstr "" + +#: wp-mail-smtp-0.11.2.php:350 +msgid "These options only apply if you have chosen to send mail by SMTP above." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:379 +#: wp-mail-smtp-0.11.2.php:501 +msgid "No encryption." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:384 +#: wp-mail-smtp-0.11.2.php:506 +msgid "Use SSL encryption." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:389 +#: wp-mail-smtp-0.11.2.php:511 +msgid "Use TLS encryption." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:392 +msgid "TLS is not the same as STARTTLS. For most servers SSL is the recommended option." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:406 +msgid "No: Do not use SMTP authentication." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:411 +msgid "Yes: Use SMTP authentication." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:415 +msgid "If this is set to no, the values below are ignored." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:422 +#: wp-mail-smtp-0.11.2.php:465 +msgid "Username" +msgstr "" + +#: wp-mail-smtp-0.11.2.php:430 +#: wp-mail-smtp-0.11.2.php:473 +msgid "Password" +msgstr "" + +#: wp-mail-smtp-0.11.2.php:436 +msgid "This is in plain text because it must not be stored encrypted." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:450 +msgid "Pepipost SMTP Options" +msgstr "" + +#. translators: %s - Pepipost registration URL. +#: wp-mail-smtp-0.11.2.php:456 +msgid "You need to signup on %s to get the SMTP username/password." +msgstr "" + +#: wp-mail-smtp-0.11.2.php:536 +msgid "To" +msgstr "" + +#: wp-mail-smtp-0.11.2.php:540 +msgid "Type an email address here and then click Send Test to generate a test email." +msgstr "" + +#. translators: %1$s - WP Mail SMTP plugin name; %2$s - opening a link tag; %3$s - closing a link tag. +#: wp-mail-smtp-0.11.2.php:727 +msgid "Your site is running an outdated version of PHP that is no longer supported and may cause issues with %1$s. %2$sRead more%3$s for additional information." +msgstr "" + +#: wp_mail_smtp.php:131 +msgid "Please deactivate the free version of the WP Mail SMTP plugin before activating WP Mail SMTP Pro." +msgstr "" diff --git a/wp-content/plugins/wp-mail-smtp/assets/libs/jquery-confirm.min.css b/wp-content/plugins/wp-mail-smtp/assets/libs/jquery-confirm.min.css new file mode 100644 index 0000000..bd1bc75 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/libs/jquery-confirm.min.css @@ -0,0 +1,9 @@ +/*! + * jquery-confirm v3.3.4 (http://craftpip.github.io/jquery-confirm/) + * Author: boniface pereira + * Website: www.craftpip.com + * Contact: hey@craftpip.com + * + * Copyright 2013-2019 jquery-confirm + * Licensed under MIT (https://github.com/craftpip/jquery-confirm/blob/master/LICENSE) + */@-webkit-keyframes jconfirm-spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes jconfirm-spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}body[class*=jconfirm-no-scroll-]{overflow:hidden!important}.jconfirm{position:fixed;top:0;left:0;right:0;bottom:0;z-index:99999999;font-family:inherit;overflow:hidden}.jconfirm .jconfirm-bg{position:fixed;top:0;left:0;right:0;bottom:0;-webkit-transition:opacity .4s;transition:opacity .4s}.jconfirm .jconfirm-bg.jconfirm-bg-h{opacity:0!important}.jconfirm .jconfirm-scrollpane{-webkit-perspective:500px;perspective:500px;-webkit-perspective-origin:center;perspective-origin:center;display:table;width:100%;height:100%}.jconfirm .jconfirm-row{display:table-row;width:100%}.jconfirm .jconfirm-cell{display:table-cell;vertical-align:middle}.jconfirm .jconfirm-holder{max-height:100%;padding:50px 0}.jconfirm .jconfirm-box-container{-webkit-transition:-webkit-transform;transition:-webkit-transform;transition:transform;transition:transform,-webkit-transform}.jconfirm .jconfirm-box-container.jconfirm-no-transition{-webkit-transition:none!important;transition:none!important}.jconfirm .jconfirm-box{background:white;border-radius:4px;position:relative;outline:0;padding:15px 15px 0;overflow:hidden;margin-left:auto;margin-right:auto}@-webkit-keyframes type-blue{1%,100%{border-color:#3498db}50%{border-color:#5faee3}}@keyframes type-blue{1%,100%{border-color:#3498db}50%{border-color:#5faee3}}@-webkit-keyframes type-green{1%,100%{border-color:#2ecc71}50%{border-color:#54d98c}}@keyframes type-green{1%,100%{border-color:#2ecc71}50%{border-color:#54d98c}}@-webkit-keyframes type-red{1%,100%{border-color:#e74c3c}50%{border-color:#ed7669}}@keyframes type-red{1%,100%{border-color:#e74c3c}50%{border-color:#ed7669}}@-webkit-keyframes type-orange{1%,100%{border-color:#f1c40f}50%{border-color:#f4d03f}}@keyframes type-orange{1%,100%{border-color:#f1c40f}50%{border-color:#f4d03f}}@-webkit-keyframes type-purple{1%,100%{border-color:#9b59b6}50%{border-color:#b07cc6}}@keyframes type-purple{1%,100%{border-color:#9b59b6}50%{border-color:#b07cc6}}@-webkit-keyframes type-dark{1%,100%{border-color:#34495e}50%{border-color:#46627f}}@keyframes type-dark{1%,100%{border-color:#34495e}50%{border-color:#46627f}}.jconfirm .jconfirm-box.jconfirm-type-animated{-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.jconfirm .jconfirm-box.jconfirm-type-blue{border-top:solid 7px #3498db;-webkit-animation-name:type-blue;animation-name:type-blue}.jconfirm .jconfirm-box.jconfirm-type-green{border-top:solid 7px #2ecc71;-webkit-animation-name:type-green;animation-name:type-green}.jconfirm .jconfirm-box.jconfirm-type-red{border-top:solid 7px #e74c3c;-webkit-animation-name:type-red;animation-name:type-red}.jconfirm .jconfirm-box.jconfirm-type-orange{border-top:solid 7px #f1c40f;-webkit-animation-name:type-orange;animation-name:type-orange}.jconfirm .jconfirm-box.jconfirm-type-purple{border-top:solid 7px #9b59b6;-webkit-animation-name:type-purple;animation-name:type-purple}.jconfirm .jconfirm-box.jconfirm-type-dark{border-top:solid 7px #34495e;-webkit-animation-name:type-dark;animation-name:type-dark}.jconfirm .jconfirm-box.loading{height:120px}.jconfirm .jconfirm-box.loading:before{content:'';position:absolute;left:0;background:white;right:0;top:0;bottom:0;border-radius:10px;z-index:1}.jconfirm .jconfirm-box.loading:after{opacity:.6;content:'';height:30px;width:30px;border:solid 3px transparent;position:absolute;left:50%;margin-left:-15px;border-radius:50%;-webkit-animation:jconfirm-spin 1s infinite linear;animation:jconfirm-spin 1s infinite linear;border-bottom-color:dodgerblue;top:50%;margin-top:-15px;z-index:2}.jconfirm .jconfirm-box div.jconfirm-closeIcon{height:20px;width:20px;position:absolute;top:10px;right:10px;cursor:pointer;opacity:.6;text-align:center;font-size:27px!important;line-height:14px!important;display:none;z-index:1}.jconfirm .jconfirm-box div.jconfirm-closeIcon:empty{display:none}.jconfirm .jconfirm-box div.jconfirm-closeIcon .fa{font-size:16px}.jconfirm .jconfirm-box div.jconfirm-closeIcon .glyphicon{font-size:16px}.jconfirm .jconfirm-box div.jconfirm-closeIcon .zmdi{font-size:16px}.jconfirm .jconfirm-box div.jconfirm-closeIcon:hover{opacity:1}.jconfirm .jconfirm-box div.jconfirm-title-c{display:block;font-size:22px;line-height:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default;padding-bottom:15px}.jconfirm .jconfirm-box div.jconfirm-title-c.jconfirm-hand{cursor:move}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{font-size:inherit;display:inline-block;vertical-align:middle}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c i{vertical-align:middle}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c:empty{display:none}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-title{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:inherit;font-family:inherit;display:inline-block;vertical-align:middle}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-title:empty{display:none}.jconfirm .jconfirm-box div.jconfirm-content-pane{margin-bottom:15px;height:auto;-webkit-transition:height .4s ease-in;transition:height .4s ease-in;display:inline-block;width:100%;position:relative;overflow-x:hidden;overflow-y:auto}.jconfirm .jconfirm-box div.jconfirm-content-pane.no-scroll{overflow-y:hidden}.jconfirm .jconfirm-box div.jconfirm-content-pane::-webkit-scrollbar{width:3px}.jconfirm .jconfirm-box div.jconfirm-content-pane::-webkit-scrollbar-track{background:rgba(0,0,0,0.1)}.jconfirm .jconfirm-box div.jconfirm-content-pane::-webkit-scrollbar-thumb{background:#666;border-radius:3px}.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content{overflow:auto}.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content img{max-width:100%;height:auto}.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content:empty{display:none}.jconfirm .jconfirm-box .jconfirm-buttons{padding-bottom:11px}.jconfirm .jconfirm-box .jconfirm-buttons>button{margin-bottom:4px;margin-left:2px;margin-right:2px}.jconfirm .jconfirm-box .jconfirm-buttons button{display:inline-block;padding:6px 12px;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:4px;min-height:1em;-webkit-transition:opacity .1s ease,background-color .1s ease,color .1s ease,background .1s ease,-webkit-box-shadow .1s ease;transition:opacity .1s ease,background-color .1s ease,color .1s ease,background .1s ease,-webkit-box-shadow .1s ease;transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease;transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease,-webkit-box-shadow .1s ease;-webkit-tap-highlight-color:transparent;border:0;background-image:none}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-blue{background-color:#3498db;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-blue:hover{background-color:#2980b9;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-green{background-color:#2ecc71;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-green:hover{background-color:#27ae60;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-red{background-color:#e74c3c;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-red:hover{background-color:#c0392b;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-orange{background-color:#f1c40f;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-orange:hover{background-color:#f39c12;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-default{background-color:#ecf0f1;color:#000;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-default:hover{background-color:#bdc3c7;color:#000}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-purple{background-color:#9b59b6;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-purple:hover{background-color:#8e44ad;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-dark{background-color:#34495e;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-dark:hover{background-color:#2c3e50;color:#FFF}.jconfirm .jconfirm-box.jconfirm-type-red .jconfirm-title-c .jconfirm-icon-c{color:#e74c3c!important}.jconfirm .jconfirm-box.jconfirm-type-blue .jconfirm-title-c .jconfirm-icon-c{color:#3498db!important}.jconfirm .jconfirm-box.jconfirm-type-green .jconfirm-title-c .jconfirm-icon-c{color:#2ecc71!important}.jconfirm .jconfirm-box.jconfirm-type-purple .jconfirm-title-c .jconfirm-icon-c{color:#9b59b6!important}.jconfirm .jconfirm-box.jconfirm-type-orange .jconfirm-title-c .jconfirm-icon-c{color:#f1c40f!important}.jconfirm .jconfirm-box.jconfirm-type-dark .jconfirm-title-c .jconfirm-icon-c{color:#34495e!important}.jconfirm .jconfirm-clear{clear:both}.jconfirm.jconfirm-rtl{direction:rtl}.jconfirm.jconfirm-rtl div.jconfirm-closeIcon{left:5px;right:auto}.jconfirm.jconfirm-white .jconfirm-bg,.jconfirm.jconfirm-light .jconfirm-bg{background-color:#444;opacity:.2}.jconfirm.jconfirm-white .jconfirm-box,.jconfirm.jconfirm-light .jconfirm-box{-webkit-box-shadow:0 2px 6px rgba(0,0,0,0.2);box-shadow:0 2px 6px rgba(0,0,0,0.2);border-radius:5px}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons{float:right}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button{text-transform:uppercase;font-size:14px;font-weight:bold;text-shadow:none}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button.btn-default,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button.btn-default{-webkit-box-shadow:none;box-shadow:none;color:#333}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button.btn-default:hover,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button.btn-default:hover{background:#ddd}.jconfirm.jconfirm-white.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-light.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-black .jconfirm-bg,.jconfirm.jconfirm-dark .jconfirm-bg{background-color:darkslategray;opacity:.4}.jconfirm.jconfirm-black .jconfirm-box,.jconfirm.jconfirm-dark .jconfirm-box{-webkit-box-shadow:0 2px 6px rgba(0,0,0,0.2);box-shadow:0 2px 6px rgba(0,0,0,0.2);background:#444;border-radius:5px;color:white}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons{float:right}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button{border:0;background-image:none;text-transform:uppercase;font-size:14px;font-weight:bold;text-shadow:none;-webkit-transition:background .1s;transition:background .1s;color:white}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button.btn-default,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button.btn-default{-webkit-box-shadow:none;box-shadow:none;color:#fff;background:0}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button.btn-default:hover,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button.btn-default:hover{background:#666}.jconfirm.jconfirm-black.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-dark.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm .jconfirm-box.hilight.jconfirm-hilight-shake{-webkit-animation:shake .82s cubic-bezier(0.36,0.07,0.19,0.97) both;animation:shake .82s cubic-bezier(0.36,0.07,0.19,0.97) both;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.jconfirm .jconfirm-box.hilight.jconfirm-hilight-glow{-webkit-animation:glow .82s cubic-bezier(0.36,0.07,0.19,0.97) both;animation:glow .82s cubic-bezier(0.36,0.07,0.19,0.97) both;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@-webkit-keyframes shake{10%,90%{-webkit-transform:translate3d(-2px,0,0);transform:translate3d(-2px,0,0)}20%,80%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-8px,0,0);transform:translate3d(-8px,0,0)}40%,60%{-webkit-transform:translate3d(8px,0,0);transform:translate3d(8px,0,0)}}@keyframes shake{10%,90%{-webkit-transform:translate3d(-2px,0,0);transform:translate3d(-2px,0,0)}20%,80%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-8px,0,0);transform:translate3d(-8px,0,0)}40%,60%{-webkit-transform:translate3d(8px,0,0);transform:translate3d(8px,0,0)}}@-webkit-keyframes glow{0%,100%{-webkit-box-shadow:0 0 0 red;box-shadow:0 0 0 red}50%{-webkit-box-shadow:0 0 30px red;box-shadow:0 0 30px red}}@keyframes glow{0%,100%{-webkit-box-shadow:0 0 0 red;box-shadow:0 0 0 red}50%{-webkit-box-shadow:0 0 30px red;box-shadow:0 0 30px red}}.jconfirm{-webkit-perspective:400px;perspective:400px}.jconfirm .jconfirm-box{opacity:1;-webkit-transition-property:all;transition-property:all}.jconfirm .jconfirm-box.jconfirm-animation-top,.jconfirm .jconfirm-box.jconfirm-animation-left,.jconfirm .jconfirm-box.jconfirm-animation-right,.jconfirm .jconfirm-box.jconfirm-animation-bottom,.jconfirm .jconfirm-box.jconfirm-animation-opacity,.jconfirm .jconfirm-box.jconfirm-animation-zoom,.jconfirm .jconfirm-box.jconfirm-animation-scale,.jconfirm .jconfirm-box.jconfirm-animation-none,.jconfirm .jconfirm-box.jconfirm-animation-rotate,.jconfirm .jconfirm-box.jconfirm-animation-rotatex,.jconfirm .jconfirm-box.jconfirm-animation-rotatey,.jconfirm .jconfirm-box.jconfirm-animation-scaley,.jconfirm .jconfirm-box.jconfirm-animation-scalex{opacity:0}.jconfirm .jconfirm-box.jconfirm-animation-rotate{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.jconfirm .jconfirm-box.jconfirm-animation-rotatex{-webkit-transform:rotateX(90deg);transform:rotateX(90deg);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-rotatexr{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-rotatey{-webkit-transform:rotatey(90deg);transform:rotatey(90deg);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-rotateyr{-webkit-transform:rotatey(-90deg);transform:rotatey(-90deg);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-scaley{-webkit-transform:scaley(1.5);transform:scaley(1.5);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-scalex{-webkit-transform:scalex(1.5);transform:scalex(1.5);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-top{-webkit-transform:translate(0px,-100px);transform:translate(0px,-100px)}.jconfirm .jconfirm-box.jconfirm-animation-left{-webkit-transform:translate(-100px,0px);transform:translate(-100px,0px)}.jconfirm .jconfirm-box.jconfirm-animation-right{-webkit-transform:translate(100px,0px);transform:translate(100px,0px)}.jconfirm .jconfirm-box.jconfirm-animation-bottom{-webkit-transform:translate(0px,100px);transform:translate(0px,100px)}.jconfirm .jconfirm-box.jconfirm-animation-zoom{-webkit-transform:scale(1.2);transform:scale(1.2)}.jconfirm .jconfirm-box.jconfirm-animation-scale{-webkit-transform:scale(0.5);transform:scale(0.5)}.jconfirm .jconfirm-box.jconfirm-animation-none{visibility:hidden}.jconfirm.jconfirm-supervan .jconfirm-bg{background-color:rgba(54,70,93,0.95)}.jconfirm.jconfirm-supervan .jconfirm-box{background-color:transparent}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-blue{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-green{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-red{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-orange{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-purple{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-dark{border:0}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-closeIcon{color:white}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c{text-align:center;color:white;font-size:28px;font-weight:normal}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c>*{padding-bottom:25px}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-content-pane{margin-bottom:25px}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-content{text-align:center;color:white}.jconfirm.jconfirm-supervan .jconfirm-box .jconfirm-buttons{text-align:center}.jconfirm.jconfirm-supervan .jconfirm-box .jconfirm-buttons button{font-size:16px;border-radius:2px;background:#303f53;text-shadow:none;border:0;color:white;padding:10px;min-width:100px}.jconfirm.jconfirm-supervan.jconfirm-rtl .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-material .jconfirm-bg{background-color:rgba(0,0,0,0.67)}.jconfirm.jconfirm-material .jconfirm-box{background-color:white;-webkit-box-shadow:0 7px 8px -4px rgba(0,0,0,0.2),0 13px 19px 2px rgba(0,0,0,0.14),0 5px 24px 4px rgba(0,0,0,0.12);box-shadow:0 7px 8px -4px rgba(0,0,0,0.2),0 13px 19px 2px rgba(0,0,0,0.14),0 5px 24px 4px rgba(0,0,0,0.12);padding:30px 25px 10px 25px}.jconfirm.jconfirm-material .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.87)}.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-title-c{color:rgba(0,0,0,0.87);font-size:22px;font-weight:bold}.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-content{color:rgba(0,0,0,0.87)}.jconfirm.jconfirm-material .jconfirm-box .jconfirm-buttons{text-align:right}.jconfirm.jconfirm-material .jconfirm-box .jconfirm-buttons button{text-transform:uppercase;font-weight:500}.jconfirm.jconfirm-material.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-bootstrap .jconfirm-bg{background-color:rgba(0,0,0,0.21)}.jconfirm.jconfirm-bootstrap .jconfirm-box{background-color:white;-webkit-box-shadow:0 3px 8px 0 rgba(0,0,0,0.2);box-shadow:0 3px 8px 0 rgba(0,0,0,0.2);border:solid 1px rgba(0,0,0,0.4);padding:15px 0 0}.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.87)}.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-title-c{color:rgba(0,0,0,0.87);font-size:22px;font-weight:bold;padding-left:15px;padding-right:15px}.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-content{color:rgba(0,0,0,0.87);padding:0 15px}.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-buttons{text-align:right;padding:10px;margin:-5px 0 0;border-top:solid 1px #ddd;overflow:hidden;border-radius:0 0 4px 4px}.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-buttons button{font-weight:500}.jconfirm.jconfirm-bootstrap.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-modern .jconfirm-bg{background-color:slategray;opacity:.6}.jconfirm.jconfirm-modern .jconfirm-box{background-color:white;-webkit-box-shadow:0 7px 8px -4px rgba(0,0,0,0.2),0 13px 19px 2px rgba(0,0,0,0.14),0 5px 24px 4px rgba(0,0,0,0.12);box-shadow:0 7px 8px -4px rgba(0,0,0,0.2),0 13px 19px 2px rgba(0,0,0,0.14),0 5px 24px 4px rgba(0,0,0,0.12);padding:30px 30px 15px}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.87);top:15px;right:15px}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-title-c{color:rgba(0,0,0,0.87);font-size:24px;font-weight:bold;text-align:center;margin-bottom:10px}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{-webkit-transition:-webkit-transform .5s;transition:-webkit-transform .5s;transition:transform .5s;transition:transform .5s,-webkit-transform .5s;-webkit-transform:scale(0);transform:scale(0);display:block;margin-right:0;margin-left:0;margin-bottom:10px;font-size:69px;color:#aaa}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-content{text-align:center;font-size:15px;color:#777;margin-bottom:25px}.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons{text-align:center}.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons button{font-weight:bold;text-transform:uppercase;-webkit-transition:background .1s;transition:background .1s;padding:10px 20px}.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons button+button{margin-left:4px}.jconfirm.jconfirm-modern.jconfirm-open .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{-webkit-transform:scale(1);transform:scale(1)} \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/assets/libs/jquery-confirm.min.js b/wp-content/plugins/wp-mail-smtp/assets/libs/jquery-confirm.min.js new file mode 100644 index 0000000..4cf8123 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/assets/libs/jquery-confirm.min.js @@ -0,0 +1,10 @@ +/*! + * jquery-confirm v3.3.4 (http://craftpip.github.io/jquery-confirm/) + * Author: Boniface Pereira + * Website: www.craftpip.com + * Contact: hey@craftpip.com + * + * Copyright 2013-2019 jquery-confirm + * Licensed under MIT (https://github.com/craftpip/jquery-confirm/blob/master/LICENSE) + */ +(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory);}else{if(typeof module==="object"&&module.exports){module.exports=function(root,jQuery){if(jQuery===undefined){if(typeof window!=="undefined"){jQuery=require("jquery");}else{jQuery=require("jquery")(root);}}factory(jQuery);return jQuery;};}else{factory(jQuery);}}}(function($){var w=window;$.fn.confirm=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false};}$(this).each(function(){var $this=$(this);if($this.attr("jc-attached")){console.warn("jConfirm has already been attached to this element ",$this[0]);return;}$this.on("click",function(e){e.preventDefault();var jcOption=$.extend({},options);if($this.attr("data-title")){jcOption.title=$this.attr("data-title");}if($this.attr("data-content")){jcOption.content=$this.attr("data-content");}if(typeof jcOption.buttons==="undefined"){jcOption.buttons={};}jcOption["$target"]=$this;if($this.attr("href")&&Object.keys(jcOption.buttons).length===0){var buttons=$.extend(true,{},w.jconfirm.pluginDefaults.defaultButtons,(w.jconfirm.defaults||{}).defaultButtons||{});var firstBtn=Object.keys(buttons)[0];jcOption.buttons=buttons;jcOption.buttons[firstBtn].action=function(){location.href=$this.attr("href");};}jcOption.closeIcon=false;var instance=$.confirm(jcOption);});$this.attr("jc-attached",true);});return $(this);};$.confirm=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false};}var putDefaultButtons=!(options.buttons===false);if(typeof options.buttons!=="object"){options.buttons={};}if(Object.keys(options.buttons).length===0&&putDefaultButtons){var buttons=$.extend(true,{},w.jconfirm.pluginDefaults.defaultButtons,(w.jconfirm.defaults||{}).defaultButtons||{});options.buttons=buttons;}return w.jconfirm(options);};$.alert=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false};}var putDefaultButtons=!(options.buttons===false);if(typeof options.buttons!=="object"){options.buttons={};}if(Object.keys(options.buttons).length===0&&putDefaultButtons){var buttons=$.extend(true,{},w.jconfirm.pluginDefaults.defaultButtons,(w.jconfirm.defaults||{}).defaultButtons||{});var firstBtn=Object.keys(buttons)[0];options.buttons[firstBtn]=buttons[firstBtn];}return w.jconfirm(options);};$.dialog=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false,closeIcon:function(){}};}options.buttons={};if(typeof options.closeIcon==="undefined"){options.closeIcon=function(){};}options.confirmKeys=[13];return w.jconfirm(options);};w.jconfirm=function(options){if(typeof options==="undefined"){options={};}var pluginOptions=$.extend(true,{},w.jconfirm.pluginDefaults);if(w.jconfirm.defaults){pluginOptions=$.extend(true,pluginOptions,w.jconfirm.defaults);}pluginOptions=$.extend(true,{},pluginOptions,options);var instance=new w.Jconfirm(pluginOptions);w.jconfirm.instances.push(instance);return instance;};w.Jconfirm=function(options){$.extend(this,options);this._init();};w.Jconfirm.prototype={_init:function(){var that=this;if(!w.jconfirm.instances.length){w.jconfirm.lastFocused=$("body").find(":focus");}this._id=Math.round(Math.random()*99999);this.contentParsed=$(document.createElement("div"));if(!this.lazyOpen){setTimeout(function(){that.open();},0);}},_buildHTML:function(){var that=this;this._parseAnimation(this.animation,"o");this._parseAnimation(this.closeAnimation,"c");this._parseBgDismissAnimation(this.backgroundDismissAnimation);this._parseColumnClass(this.columnClass);this._parseTheme(this.theme);this._parseType(this.type);var template=$(this.template);template.find(".jconfirm-box").addClass(this.animationParsed).addClass(this.backgroundDismissAnimationParsed).addClass(this.typeParsed);if(this.typeAnimated){template.find(".jconfirm-box").addClass("jconfirm-type-animated");}if(this.useBootstrap){template.find(".jc-bs3-row").addClass(this.bootstrapClasses.row);template.find(".jc-bs3-row").addClass("justify-content-md-center justify-content-sm-center justify-content-xs-center justify-content-lg-center");template.find(".jconfirm-box-container").addClass(this.columnClassParsed);if(this.containerFluid){template.find(".jc-bs3-container").addClass(this.bootstrapClasses.containerFluid);}else{template.find(".jc-bs3-container").addClass(this.bootstrapClasses.container);}}else{template.find(".jconfirm-box").css("width",this.boxWidth);}if(this.titleClass){template.find(".jconfirm-title-c").addClass(this.titleClass);}template.addClass(this.themeParsed);var ariaLabel="jconfirm-box"+this._id;template.find(".jconfirm-box").attr("aria-labelledby",ariaLabel).attr("tabindex",-1);template.find(".jconfirm-content").attr("id",ariaLabel);if(this.bgOpacity!==null){template.find(".jconfirm-bg").css("opacity",this.bgOpacity);}if(this.rtl){template.addClass("jconfirm-rtl");}this.$el=template.appendTo(this.container);this.$jconfirmBoxContainer=this.$el.find(".jconfirm-box-container");this.$jconfirmBox=this.$body=this.$el.find(".jconfirm-box");this.$jconfirmBg=this.$el.find(".jconfirm-bg");this.$title=this.$el.find(".jconfirm-title");this.$titleContainer=this.$el.find(".jconfirm-title-c");this.$content=this.$el.find("div.jconfirm-content");this.$contentPane=this.$el.find(".jconfirm-content-pane");this.$icon=this.$el.find(".jconfirm-icon-c");this.$closeIcon=this.$el.find(".jconfirm-closeIcon");this.$holder=this.$el.find(".jconfirm-holder");this.$btnc=this.$el.find(".jconfirm-buttons");this.$scrollPane=this.$el.find(".jconfirm-scrollpane");that.setStartingPoint();this._contentReady=$.Deferred();this._modalReady=$.Deferred();this.$holder.css({"padding-top":this.offsetTop,"padding-bottom":this.offsetBottom,});this.setTitle();this.setIcon();this._setButtons();this._parseContent();this.initDraggable();if(this.isAjax){this.showLoading(false);}$.when(this._contentReady,this._modalReady).then(function(){if(that.isAjaxLoading){setTimeout(function(){that.isAjaxLoading=false;that.setContent();that.setTitle();that.setIcon();setTimeout(function(){that.hideLoading(false);that._updateContentMaxHeight();},100);if(typeof that.onContentReady==="function"){that.onContentReady();}},50);}else{that._updateContentMaxHeight();that.setTitle();that.setIcon();if(typeof that.onContentReady==="function"){that.onContentReady();}}if(that.autoClose){that._startCountDown();}}).then(function(){that._watchContent();});if(this.animation==="none"){this.animationSpeed=1;this.animationBounce=1;}this.$body.css(this._getCSS(this.animationSpeed,this.animationBounce));this.$contentPane.css(this._getCSS(this.animationSpeed,1));this.$jconfirmBg.css(this._getCSS(this.animationSpeed,1));this.$jconfirmBoxContainer.css(this._getCSS(this.animationSpeed,1));},_typePrefix:"jconfirm-type-",typeParsed:"",_parseType:function(type){this.typeParsed=this._typePrefix+type;},setType:function(type){var oldClass=this.typeParsed;this._parseType(type);this.$jconfirmBox.removeClass(oldClass).addClass(this.typeParsed);},themeParsed:"",_themePrefix:"jconfirm-",setTheme:function(theme){var previous=this.theme;this.theme=theme||this.theme;this._parseTheme(this.theme);if(previous){this.$el.removeClass(previous);}this.$el.addClass(this.themeParsed);this.theme=theme;},_parseTheme:function(theme){var that=this;theme=theme.split(",");$.each(theme,function(k,a){if(a.indexOf(that._themePrefix)===-1){theme[k]=that._themePrefix+$.trim(a);}});this.themeParsed=theme.join(" ").toLowerCase();},backgroundDismissAnimationParsed:"",_bgDismissPrefix:"jconfirm-hilight-",_parseBgDismissAnimation:function(bgDismissAnimation){var animation=bgDismissAnimation.split(",");var that=this;$.each(animation,function(k,a){if(a.indexOf(that._bgDismissPrefix)===-1){animation[k]=that._bgDismissPrefix+$.trim(a);}});this.backgroundDismissAnimationParsed=animation.join(" ").toLowerCase();},animationParsed:"",closeAnimationParsed:"",_animationPrefix:"jconfirm-animation-",setAnimation:function(animation){this.animation=animation||this.animation;this._parseAnimation(this.animation,"o");},_parseAnimation:function(animation,which){which=which||"o";var animations=animation.split(",");var that=this;$.each(animations,function(k,a){if(a.indexOf(that._animationPrefix)===-1){animations[k]=that._animationPrefix+$.trim(a);}});var a_string=animations.join(" ").toLowerCase();if(which==="o"){this.animationParsed=a_string;}else{this.closeAnimationParsed=a_string;}return a_string;},setCloseAnimation:function(closeAnimation){this.closeAnimation=closeAnimation||this.closeAnimation;this._parseAnimation(this.closeAnimation,"c");},setAnimationSpeed:function(speed){this.animationSpeed=speed||this.animationSpeed;},columnClassParsed:"",setColumnClass:function(colClass){if(!this.useBootstrap){console.warn("cannot set columnClass, useBootstrap is set to false");return;}this.columnClass=colClass||this.columnClass;this._parseColumnClass(this.columnClass);this.$jconfirmBoxContainer.addClass(this.columnClassParsed);},_updateContentMaxHeight:function(){var height=$(window).height()-(this.$jconfirmBox.outerHeight()-this.$contentPane.outerHeight())-(this.offsetTop+this.offsetBottom);this.$contentPane.css({"max-height":height+"px"});},setBoxWidth:function(width){if(this.useBootstrap){console.warn("cannot set boxWidth, useBootstrap is set to true");return;}this.boxWidth=width;this.$jconfirmBox.css("width",width);},_parseColumnClass:function(colClass){colClass=colClass.toLowerCase();var p;switch(colClass){case"xl":case"xlarge":p="col-md-12";break;case"l":case"large":p="col-md-8 col-md-offset-2";break;case"m":case"medium":p="col-md-6 col-md-offset-3";break;case"s":case"small":p="col-md-4 col-md-offset-4";break;case"xs":case"xsmall":p="col-md-2 col-md-offset-5";break;default:p=colClass;}this.columnClassParsed=p;},initDraggable:function(){var that=this;var $t=this.$titleContainer;this.resetDrag();if(this.draggable){$t.on("mousedown",function(e){$t.addClass("jconfirm-hand");that.mouseX=e.clientX;that.mouseY=e.clientY;that.isDrag=true;});$(window).on("mousemove."+this._id,function(e){if(that.isDrag){that.movingX=e.clientX-that.mouseX+that.initialX;that.movingY=e.clientY-that.mouseY+that.initialY;that.setDrag();}});$(window).on("mouseup."+this._id,function(){$t.removeClass("jconfirm-hand");if(that.isDrag){that.isDrag=false;that.initialX=that.movingX;that.initialY=that.movingY;}});}},resetDrag:function(){this.isDrag=false;this.initialX=0;this.initialY=0;this.movingX=0;this.movingY=0;this.mouseX=0;this.mouseY=0;this.$jconfirmBoxContainer.css("transform","translate("+0+"px, "+0+"px)");},setDrag:function(){if(!this.draggable){return;}this.alignMiddle=false;var boxWidth=this.$jconfirmBox.outerWidth();var boxHeight=this.$jconfirmBox.outerHeight();var windowWidth=$(window).width();var windowHeight=$(window).height();var that=this;var dragUpdate=1;if(that.movingX%dragUpdate===0||that.movingY%dragUpdate===0){if(that.dragWindowBorder){var leftDistance=(windowWidth/2)-boxWidth/2;var topDistance=(windowHeight/2)-boxHeight/2;topDistance-=that.dragWindowGap;leftDistance-=that.dragWindowGap;if(leftDistance+that.movingX<0){that.movingX=-leftDistance;}else{if(leftDistance-that.movingX<0){that.movingX=leftDistance;}}if(topDistance+that.movingY<0){that.movingY=-topDistance;}else{if(topDistance-that.movingY<0){that.movingY=topDistance;}}}that.$jconfirmBoxContainer.css("transform","translate("+that.movingX+"px, "+that.movingY+"px)");}},_scrollTop:function(){if(typeof pageYOffset!=="undefined"){return pageYOffset;}else{var B=document.body;var D=document.documentElement;D=(D.clientHeight)?D:B;return D.scrollTop;}},_watchContent:function(){var that=this;if(this._timer){clearInterval(this._timer);}var prevContentHeight=0;this._timer=setInterval(function(){if(that.smoothContent){var contentHeight=that.$content.outerHeight()||0;if(contentHeight!==prevContentHeight){prevContentHeight=contentHeight;}var wh=$(window).height();var total=that.offsetTop+that.offsetBottom+that.$jconfirmBox.height()-that.$contentPane.height()+that.$content.height();if(total').html(that.buttons[key].text).addClass(that.buttons[key].btnClass).prop("disabled",that.buttons[key].isDisabled).css("display",that.buttons[key].isHidden?"none":"").click(function(e){e.preventDefault();var res=that.buttons[key].action.apply(that,[that.buttons[key]]);that.onAction.apply(that,[key,that.buttons[key]]);that._stopCountDown();if(typeof res==="undefined"||res){that.close();}});that.buttons[key].el=button_element;that.buttons[key].setText=function(text){button_element.html(text);};that.buttons[key].addClass=function(className){button_element.addClass(className);};that.buttons[key].removeClass=function(className){button_element.removeClass(className);};that.buttons[key].disable=function(){that.buttons[key].isDisabled=true;button_element.prop("disabled",true);};that.buttons[key].enable=function(){that.buttons[key].isDisabled=false;button_element.prop("disabled",false);};that.buttons[key].show=function(){that.buttons[key].isHidden=false;button_element.css("display","");};that.buttons[key].hide=function(){that.buttons[key].isHidden=true;button_element.css("display","none");};that["$_"+key]=that["$$"+key]=button_element;that.$btnc.append(button_element);});if(total_buttons===0){this.$btnc.hide();}if(this.closeIcon===null&&total_buttons===0){this.closeIcon=true;}if(this.closeIcon){if(this.closeIconClass){var closeHtml='';this.$closeIcon.html(closeHtml);}this.$closeIcon.click(function(e){e.preventDefault();var buttonName=false;var shouldClose=false;var str;if(typeof that.closeIcon==="function"){str=that.closeIcon();}else{str=that.closeIcon;}if(typeof str==="string"&&typeof that.buttons[str]!=="undefined"){buttonName=str;shouldClose=false;}else{if(typeof str==="undefined"||!!(str)===true){shouldClose=true;}else{shouldClose=false;}}if(buttonName){var btnResponse=that.buttons[buttonName].action.apply(that);shouldClose=(typeof btnResponse==="undefined")||!!(btnResponse);}if(shouldClose){that.close();}});this.$closeIcon.show();}else{this.$closeIcon.hide();}},setTitle:function(string,force){force=force||false;if(typeof string!=="undefined"){if(typeof string==="string"){this.title=string;}else{if(typeof string==="function"){if(typeof string.promise==="function"){console.error("Promise was returned from title function, this is not supported.");}var response=string();if(typeof response==="string"){this.title=response;}else{this.title=false;}}else{this.title=false;}}}if(this.isAjaxLoading&&!force){return;}this.$title.html(this.title||"");this.updateTitleContainer();},setIcon:function(iconClass,force){force=force||false;if(typeof iconClass!=="undefined"){if(typeof iconClass==="string"){this.icon=iconClass;}else{if(typeof iconClass==="function"){var response=iconClass();if(typeof response==="string"){this.icon=response;}else{this.icon=false;}}else{this.icon=false;}}}if(this.isAjaxLoading&&!force){return;}this.$icon.html(this.icon?'':"");this.updateTitleContainer();},updateTitleContainer:function(){if(!this.title&&!this.icon){this.$titleContainer.hide();}else{this.$titleContainer.show();}},setContentPrepend:function(content,force){if(!content){return;}this.contentParsed.prepend(content);},setContentAppend:function(content){if(!content){return;}this.contentParsed.append(content);},setContent:function(content,force){force=!!force;var that=this;if(content){this.contentParsed.html("").append(content);}if(this.isAjaxLoading&&!force){return;}this.$content.html("");this.$content.append(this.contentParsed);setTimeout(function(){that.$body.find("input[autofocus]:visible:first").focus();},100);},loadingSpinner:false,showLoading:function(disableButtons){this.loadingSpinner=true;this.$jconfirmBox.addClass("loading");if(disableButtons){this.$btnc.find("button").prop("disabled",true);}},hideLoading:function(enableButtons){this.loadingSpinner=false;this.$jconfirmBox.removeClass("loading");if(enableButtons){this.$btnc.find("button").prop("disabled",false);}},ajaxResponse:false,contentParsed:"",isAjax:false,isAjaxLoading:false,_parseContent:function(){var that=this;var e=" ";if(typeof this.content==="function"){var res=this.content.apply(this);if(typeof res==="string"){this.content=res;}else{if(typeof res==="object"&&typeof res.always==="function"){this.isAjax=true;this.isAjaxLoading=true;res.always(function(data,status,xhr){that.ajaxResponse={data:data,status:status,xhr:xhr};that._contentReady.resolve(data,status,xhr);if(typeof that.contentLoaded==="function"){that.contentLoaded(data,status,xhr);}});this.content=e;}else{this.content=e;}}}if(typeof this.content==="string"&&this.content.substr(0,4).toLowerCase()==="url:"){this.isAjax=true;this.isAjaxLoading=true;var u=this.content.substring(4,this.content.length);$.get(u).done(function(html){that.contentParsed.html(html);}).always(function(data,status,xhr){that.ajaxResponse={data:data,status:status,xhr:xhr};that._contentReady.resolve(data,status,xhr);if(typeof that.contentLoaded==="function"){that.contentLoaded(data,status,xhr);}});}if(!this.content){this.content=e;}if(!this.isAjax){this.contentParsed.html(this.content);this.setContent();that._contentReady.resolve();}},_stopCountDown:function(){clearInterval(this.autoCloseInterval);if(this.$cd){this.$cd.remove();}},_startCountDown:function(){var that=this;var opt=this.autoClose.split("|");if(opt.length!==2){console.error("Invalid option for autoClose. example 'close|10000'");return false;}var button_key=opt[0];var time=parseInt(opt[1]);if(typeof this.buttons[button_key]==="undefined"){console.error("Invalid button key '"+button_key+"' for autoClose");return false;}var seconds=Math.ceil(time/1000);this.$cd=$(' ('+seconds+")").appendTo(this["$_"+button_key]);this.autoCloseInterval=setInterval(function(){that.$cd.html(" ("+(seconds-=1)+") ");if(seconds<=0){that["$$"+button_key].trigger("click");that._stopCountDown();}},1000);},_getKey:function(key){switch(key){case 192:return"tilde";case 13:return"enter";case 16:return"shift";case 9:return"tab";case 20:return"capslock";case 17:return"ctrl";case 91:return"win";case 18:return"alt";case 27:return"esc";case 32:return"space";}var initial=String.fromCharCode(key);if(/^[A-z0-9]+$/.test(initial)){return initial.toLowerCase();}else{return false;}},reactOnKey:function(e){var that=this;var a=$(".jconfirm");if(a.eq(a.length-1)[0]!==this.$el[0]){return false;}var key=e.which;if(this.$content.find(":input").is(":focus")&&/13|32/.test(key)){return false;}var keyChar=this._getKey(key);if(keyChar==="esc"&&this.escapeKey){if(this.escapeKey===true){this.$scrollPane.trigger("click");}else{if(typeof this.escapeKey==="string"||typeof this.escapeKey==="function"){var buttonKey;if(typeof this.escapeKey==="function"){buttonKey=this.escapeKey();}else{buttonKey=this.escapeKey;}if(buttonKey){if(typeof this.buttons[buttonKey]==="undefined"){console.warn("Invalid escapeKey, no buttons found with key "+buttonKey);}else{this["$_"+buttonKey].trigger("click");}}}}}$.each(this.buttons,function(key,button){if(button.keys.indexOf(keyChar)!==-1){that["$_"+key].trigger("click");}});},setDialogCenter:function(){console.info("setDialogCenter is deprecated, dialogs are centered with CSS3 tables");},_unwatchContent:function(){clearInterval(this._timer);},close:function(onClosePayload){var that=this;if(typeof this.onClose==="function"){this.onClose(onClosePayload);}this._unwatchContent();$(window).unbind("resize."+this._id);$(window).unbind("keyup."+this._id);$(window).unbind("jcKeyDown."+this._id);if(this.draggable){$(window).unbind("mousemove."+this._id);$(window).unbind("mouseup."+this._id);this.$titleContainer.unbind("mousedown");}that.$el.removeClass(that.loadedClass);$("body").removeClass("jconfirm-no-scroll-"+that._id);that.$jconfirmBoxContainer.removeClass("jconfirm-no-transition");setTimeout(function(){that.$body.addClass(that.closeAnimationParsed);that.$jconfirmBg.addClass("jconfirm-bg-h");var closeTimer=(that.closeAnimation==="none")?1:that.animationSpeed;setTimeout(function(){that.$el.remove();var l=w.jconfirm.instances;var i=w.jconfirm.instances.length-1;for(i;i>=0;i--){if(w.jconfirm.instances[i]._id===that._id){w.jconfirm.instances.splice(i,1);}}if(!w.jconfirm.instances.length){if(that.scrollToPreviousElement&&w.jconfirm.lastFocused&&w.jconfirm.lastFocused.length&&$.contains(document,w.jconfirm.lastFocused[0])){var $lf=w.jconfirm.lastFocused;if(that.scrollToPreviousElementAnimate){var st=$(window).scrollTop();var ot=w.jconfirm.lastFocused.offset().top;var wh=$(window).height();if(!(ot>st&&ot<(st+wh))){var scrollTo=(ot-Math.round((wh/3)));$("html, body").animate({scrollTop:scrollTo},that.animationSpeed,"swing",function(){$lf.focus();});}else{$lf.focus();}}else{$lf.focus();}w.jconfirm.lastFocused=false;}}if(typeof that.onDestroy==="function"){that.onDestroy();}},closeTimer*0.4);},50);return true;},open:function(){if(this.isOpen()){return false;}this._buildHTML();this._bindEvents();this._open();return true;},setStartingPoint:function(){var el=false;if(this.animateFromElement!==true&&this.animateFromElement){el=this.animateFromElement;w.jconfirm.lastClicked=false;}else{if(w.jconfirm.lastClicked&&this.animateFromElement===true){el=w.jconfirm.lastClicked;w.jconfirm.lastClicked=false;}else{return false;}}if(!el){return false;}var offset=el.offset();var iTop=el.outerHeight()/2;var iLeft=el.outerWidth()/2;iTop-=this.$jconfirmBox.outerHeight()/2;iLeft-=this.$jconfirmBox.outerWidth()/2;var sourceTop=offset.top+iTop;sourceTop=sourceTop-this._scrollTop();var sourceLeft=offset.left+iLeft;var wh=$(window).height()/2;var ww=$(window).width()/2;var targetH=wh-this.$jconfirmBox.outerHeight()/2;var targetW=ww-this.$jconfirmBox.outerWidth()/2;sourceTop-=targetH;sourceLeft-=targetW;if(Math.abs(sourceTop)>wh||Math.abs(sourceLeft)>ww){return false;}this.$jconfirmBoxContainer.css("transform","translate("+sourceLeft+"px, "+sourceTop+"px)");},_open:function(){var that=this;if(typeof that.onOpenBefore==="function"){that.onOpenBefore();}this.$body.removeClass(this.animationParsed);this.$jconfirmBg.removeClass("jconfirm-bg-h");this.$body.focus();that.$jconfirmBoxContainer.css("transform","translate("+0+"px, "+0+"px)");setTimeout(function(){that.$body.css(that._getCSS(that.animationSpeed,1));that.$body.css({"transition-property":that.$body.css("transition-property")+", margin"});that.$jconfirmBoxContainer.addClass("jconfirm-no-transition");that._modalReady.resolve();if(typeof that.onOpen==="function"){that.onOpen();}that.$el.addClass(that.loadedClass);},this.animationSpeed);},loadedClass:"jconfirm-open",isClosed:function(){return !this.$el||this.$el.parent().length===0;},isOpen:function(){return !this.isClosed();},toggle:function(){if(!this.isOpen()){this.open();}else{this.close();}}};w.jconfirm.instances=[];w.jconfirm.lastFocused=false;w.jconfirm.pluginDefaults={template:'
        ',title:"Hello",titleClass:"",type:"default",typeAnimated:true,draggable:true,dragWindowGap:15,dragWindowBorder:true,animateFromElement:true,alignMiddle:true,smoothContent:true,content:"Are you sure to continue?",buttons:{},defaultButtons:{ok:{action:function(){}},close:{action:function(){}}},contentLoaded:function(){},icon:"",lazyOpen:false,bgOpacity:null,theme:"light",animation:"scale",closeAnimation:"scale",animationSpeed:400,animationBounce:1,escapeKey:true,rtl:false,container:"body",containerFluid:false,backgroundDismiss:false,backgroundDismissAnimation:"shake",autoClose:false,closeIcon:null,closeIconClass:false,watchInterval:100,columnClass:"col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1",boxWidth:"50%",scrollToPreviousElement:true,scrollToPreviousElementAnimate:true,useBootstrap:true,offsetTop:40,offsetBottom:40,bootstrapClasses:{container:"container",containerFluid:"container-fluid",row:"row"},onContentReady:function(){},onOpenBefore:function(){},onOpen:function(){},onClose:function(){},onDestroy:function(){},onAction:function(){}};var keyDown=false;$(window).on("keydown",function(e){if(!keyDown){var $target=$(e.target);var pass=false;if($target.closest(".jconfirm-box").length){pass=true;}if(pass){$(window).trigger("jcKeyDown");}keyDown=true;}});$(window).on("keyup",function(){keyDown=false;});w.jconfirm.lastClicked=false;$(document).on("mousedown","button, a, [jc-source]",function(){w.jconfirm.lastClicked=$(this);});})); \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/loco.xml b/wp-content/plugins/wp-mail-smtp/loco.xml new file mode 100644 index 0000000..9d9ec0c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/loco.xml @@ -0,0 +1,29 @@ + + + + + + . + + + assets/languages + + + + + + + + . + + + assets/pro/languages + + + + + diff --git a/wp-content/plugins/wp-mail-smtp/readme.txt b/wp-content/plugins/wp-mail-smtp/readme.txt new file mode 100644 index 0000000..f28b711 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/readme.txt @@ -0,0 +1,406 @@ +=== WP Mail SMTP by WPForms === +Contributors: wpforms, jaredatch, smub, slaFFik +Tags: smtp, wp mail smtp, wordpress smtp, gmail smtp, sendgrid smtp, mailgun smtp, mail, mailer, phpmailer, wp_mail, email, mailgun, sengrid, gmail, pepipost, sendinblue, wp smtp +Requires at least: 4.9 +Tested up to: 5.3 +Stable tag: 1.9.0 +Requires PHP: 5.3 + +The most popular WordPress SMTP and PHP Mailer plugin. Trusted by over 1 million sites. + +== Description == + +### WordPress Mail SMTP Plugin + +Having problems with your WordPress site not sending emails? You're not alone. Over 1 million websites use WP Mail SMTP to send their emails reliably. + +Our goal is to make email deliverability easy and reliable. We want to ensure your emails reach the inbox. + +WP Mail SMTP fixes your email deliverability by reconfiguring WordPress to use a proper SMTP provider when sending emails. + += What is SMTP? = + +SMTP (Simple Mail Transfer Protocol) is an industry standard for sending emails. Proper SMTP configuration helps increase email deliverability by using authentication. + +Popular email clients like Gmail, Yahoo, and Office 365 are in a constant battle with email spammers. One of the things they look at is if an email is originating from the location it claims to be originating from. + +If the proper authentication isn't there, then emails either go in the SPAM folder or worst, don't get delivered at all. + +This is a problem for a lot of WordPress sites because by default, WordPress uses the PHP mail function to send emails generated by WordPress or any contact form plugin like WPForms. + +The issue is that most WordPress hosting companies don't have their servers properly configured for sending PHP emails. + +The combination of two causes your WordPress emails to not get delivered. + += How does WP Mail SMTP work? = + +WP Mail SMTP plugin easily resolves email delivery problems by improving and changing how your WordPress site sends email. We reconfigure the `wp_mail()` function to either use proper SMTP host credentials or leverage a built-in SMTP mail provider. + +When using one of our built-in SMTP mail provider integrations (recommended), emails are sent using the provider's direct API. This means even if your web host is blocking SMTP ports, your emails still send successfully. + +This helps you fix all WordPress not sending email issues. + +WP Mail SMTP plugin includes many different SMTP setup options: + +1. Pepipost SMTP (Recommended) +2. Sendinblue SMTP (Recommended) +3. Mailgun SMTP +4. SendGrid SMTP +5. Gmail SMTP +6. Microsoft SMTP (Outlook.com and Office 365) [Pro] +7. Amazon SES SMTP [Pro] +8. All Other SMTP + +For all options, you can specify the "from name" and "email address" for outgoing emails. + +Instead of having users use different SMTP plugins and workflows for different SMTP providers, we decided to bring it all in one. This is what makes WP Mail SMTP, the best SMTP solution for WordPress. + += Pepipost SMTP = + +Pepipost is a recommended transactional email service. + +Every month they delivers over 8 billion emails from 20,000+ customers. + +Their mission is to reliably send emails in the most efficient way and at the most disruptive pricing ever. +Pepipost provides users 30,000 emails the first 30 days. + +Read our Pepipost documentation for more details. + += Sendinblue SMTP = + +Sendinblue is a recommended transactional email service. + +They serve 80,000+ growing companies around the world and send over 30 million emails each day. + +Their email deliverability experts are constantly at work optimizing the reliability and speed of their SMTP infrastructure. Sendinblue provides users 300 free emails per day. + +Read our Sendinblue documentation for more details. + += Mailgun SMTP = + +Mailgun SMTP is a popular SMTP service provider that allows you to send large quantities of emails. They provide 5,000 free emails per month for 3 months. + +WP Mail SMTP plugin offers a native integration with MailGun. All you have to do is connect your Mailgun account, and you will improve your email deliverability. + +Read our Mailgun documentation for more details. + += SendGrid SMTP = + +SendGrid has a free SMTP plan that you can use to send up to 100 emails per day. With our native SendGrid SMTP integration, you can easily and securely set up SendGrid SMTP on your WordPress site. + +Read our SendGrid documentation for more details. + += Gmail SMTP = + +Often bloggers and small business owners don't want to use third-party SMTP services. Well you can use your Gmail or G Suite account for SMTP emails. + +This allows you to use your professional email address and improve email deliverability. + +Unlike other Gmail SMTP plugins, our Gmail SMTP option uses OAuth to authenticate your Google account, keeping your login information 100% secure. + +Read our Gmail documentation for more details. + += Microsoft SMTP (Outlook.com and Office 365) = + +Many business use Outlook.com or Office 365 to their to power their email. For those users, the Microsoft mailer can be a great option. This integration allows you to use your existing Outlook.com or Office 365 account to send your emails reliably. + += Amazon SES SMTP = + +Advanced or technical users can harness the power of Amazon AWS (Amazon Web Services) with the Amazon SES mailer. With this integration, you can send a high volume of emails at a very reasonable rate. + +Read our Amazon SES documentation for more details. + += Other SMTP = + +WP Mail SMTP plugin also works with all major email services such as Gmail, Yahoo, Outlook, Microsoft Live, and any other email sending service that offers SMTP. + +You can set the following options: + +* Specify an SMTP host. +* Specify an SMTP port. +* Choose SSL / TLS encryption. +* Choose to use SMTP authentication or not. +* Specify an SMTP username and password. + +To see recommended settings for the popular services as well as troubleshooting tips, check out our SMTP documentation. + +We hope that you find WP Mail SMTP plugin helpful! + +### WP Mail SMTP PRO + +In addition to native Microsoft and Amazon SES integrations, WP Mail SMTP Pro provides access to many other powerful features and services. + +Click here to purchase WP Mail SMTP Pro now! + += Email Log = + +Email Logging lets you log and view all emails sent from your site. Email logs are helpful for storing emails for your records, auditing outgoing emails, and debugging during site development. + += Manage WordPress Emails and Notifications = + +The Manage Notification feature gives you full control over which email notifications WordPress sends. This means you can disable different WordPress notification emails. Don't want to receive emails when new users are created? No problem, turn it off. + += Expert Support = + +We provide limited support for the WP Mail SMTP plugin on the WordPress.org forums. Access to our world class one-on-one email support is available to WP Mail SMTP Pro users. + += White Glove Setup = + +Our White Glove Setup service is a great option that anyone can benefit from. Whether you don't have the time or maybe you feel a bit in over your head - we've got you covered. + +You can sit back and relax while we set up everything for you. White glove setup includes WP Mail SMTP plugin installation and setup, configuration adjustments to your DNS for proper email domain name verification, Mailgun setup, and final testing to confirm everything is passing with flying colors. + +### Security + +The WP Mail SMTP team takes security very seriously. Not only does the plugin follow all security best practices, but we have several options available to ensure your site is safe and secure. + +- Direct SMTP mailer integrations (recommended), such as Google and Mailgun, use the official provider APIs. This means you never enter your username or password in the plugin settings and these credentials are not stored in the database. Instead, we use tokens or API keys which are much more secure. + +- When using Other SMTP mailer, we provide the option to insert your password in your `wp-config.php` file, so it's not visible in your WordPress settings or saved in the database. + +### Credits + +WP Mail SMTP plugin was originally created by Callum Macdonald. It is now owned and maintained by the team behind WPForms - the best drag & drop form builder for WordPress. + +You can try the free version of WPForms plugin to see why it's the best in the market. + +### What's Next + +If you like this plugin, then consider checking out our other projects: + +* OptinMonster - Get More Email Subscribers with the most popular conversion optimization plugin for WordPress. +* MonsterInsights - See the Stats that Matter and Grow Your Business with Confidence. Best Google Analytics Plugin for WordPress. +* SeedProd - Jumpstart your website with the #1 Coming Soon & Maintenance Mode Plugin for WordPress. + +Visit WPBeginner to learn from our WordPress Tutorials and find out about other best WordPress plugins. + +== Installation == + +1. Install WP Mail SMTP by WPForms either via the WordPress.org plugin repository or by uploading the files to your server. (See instructions on how to install a WordPress plugin) +2. Activate WP Mail SMTP by WPForms. +3. Navigate to the Settings area of WP Mail SMTP in the WordPress admin. +4. Choose your SMTP option (Mailgun SMTP, SendGrid SMTP, Gmail SMTP, or Other SMTP) and follow the instructions to set it up. +5. Need more help? Get support with WP Mail SMTP PRO. + +== Frequently Asked Questions == + += Can I use this plugin to send email via Gmail, G Suite, Outlook.com, Office 365, Hotmail, Yahoo, or AOL SMTP? = + +Yes! We have extensive documentation that covers setting up SMTP most popular email services. + +Read our docs to see the correct SMTP settings for each service. + += Help! I need support or have an issue. = + +Please read our support policy for more information. + +Limited support is available for WP Mail SMTP users via WordPress.org support forums. + +Email support and set up assistance is available to WP Mail SMTP Pro users. + += I found a bug, now what? = + +If you've stumbled upon a bug, the best place to report it is in the WP Mail SMTP GitHub repository. GitHub is where the plugin is actively developed, and posting there will get your issue quickly seen by our developers (myself and Slava). Once posted, we'll review your bug report and triage the bug. When creating an issue, the more details you can add to your report, the faster the bug can be solved. + += Can you add feature x, y or z to the plugin? = + +Short answer: maybe. + +By all means please contact us to discuss features or options you'd like to see added to the plugin. We can't guarantee to add all of them, but we will consider all sensible requests. We can be contacted here: +https://wpmailsmtp.com/contact/ + +== Screenshots == + +1. WP Mail SMTP Settings page +2. Gmail / G Suite settings +3. Mailgun settings +4. SendGrid settings +5. SMTP settings +6. Send a Test Email + +== Changelog == + += 1.9.0 - 2020-03-23 = +* Added: Add various Status tests and Info section on Tools > Site Health page. +* Added: Notify admin if there are unsaved changes in plugin admin area options. +* Fixed: Test email now has a proper bottom margin for better look. +* Changed: Update "About us" plugin page with relevant information. +* Changed: Save default WordPress FROM Email address when incorrect FROM Email address is saved by a user. + += 1.8.1 - 2019-12-13 = +* Fixed: Revert Guzzle version to 6.4.1 because Sendinblue and Gmail mailers may experience issues under certain circumstances while sending emails (not all sites are affected). +* Fixed: Make compatible the WordPress PhpMailer class inline attachments management with the Sendgrid API. + += 1.8.0 - 2019-12-12 = +* Added: New recommended mailer: Pepipost. +* Added: "Suggest a Mailer" link in a list of mailers to send us your ideas about new ones. +* Fixed: Sendgrid: Content ID for attachments missing. +* Changed: Timeout to HTTP requests (pepipost, sendgrid, mailgun), same as max_execution_time, to prevent fails when sending emails with big attachments. + += 1.7.1 - 2019-11-11 = +* Fixed: Compatibility with WordPress 5.3. +* Fixed: `Processor::get_default_email()` always returns empty value when server incorrectly configured. + += 1.7.0 - 2019-10-24 = +* Added: Add a new constant `WPMS_DO_NOT_SEND` to block email sending. +* Fixed: Default email (wordpress@example.com) rewriting in CLI mode. +* Fixed: Incorrect conflicts detection with certain plugins. +* Fixed: various typos in plugin settings. + += 1.6.2 - 2019-09-02 = +* Fixed: Race condition when loading with certain plugins, that send emails very early. Makes email delivery more reliable. + += 1.6.0 - 2019-08-21 = +* Added: New transactional mailer: Sendinblue. +* Added: Educate users to use transactional mailers for better deliverability. +* Added: New option and filter to disable admin area delivery error notices. +* Changed: Hide private API key saved in the DB for API based mailers using `input[type=password]`. +* Changed: Update links to various docs, pointing now to https://wpmailsmtp.com. + += 1.5.2 - 2019-07-18 = +* Fixed: "Redirect URI mismatch" error for "Gmail" mailer when trying to re-authorize an account that was initially created with version < v1.5.0. +* Changed: Make "Authentication" setting in "Other SMTP" mailer ON by default for new users. +* Changed: Mailers docs links now point to wpmailsmtp.com own site. + += 1.5.1 - 2019-07-12 = +* Fixed: Duplicated emails sent to the first recipient in a loop (and others not receiving their emails). + += 1.5.0 - 2019-07-09 = +* Added: Loсo plugin support. +* Added: "About us" admin area page. +* Added: Display in debug output a possible conflicting plugin existence. +* Added: Lots of actions and filters to improve flexibility of the plugin. +* Changed: Plugin menu is now top level. +* Changed: Hide secrets/API keys in page DOM in plugin admin area. +* Changed: Do not save constant values into the database when plugin settings are saved. +* Changed: Lots of i18n improvements to support translation for both free and paid version of the plugin. +* Changed: Gmail mailer - allow to change From Name email header. +* Changed: Gmail mailer - display email used to create a connection. +* Changed: WordPress 4.9 is the minimum WordPress version we support. +* Fixed: X-Mailer header should be present in all emails. +* Fixed: PHP notices when migrating under certain circumstances from 0.x version of the plugin. +* Fixed: Options::get_group() now supports values set via constants. + += 1.4.2 - 2019-03-23 = +* Changed: Tested up to WordPress 5.1.x. +* Changed: Removed TGMPA library. + += 1.4.1 - 2018-12-03 = +* Fixed: correctly process backslashes in SMTP passwords defined via constants. +* Changed: allow to send a Test Email when Default (none) mailer is selected in plugin settings. + += 1.4.0 - 2018-11-29 = +* Added: New option: Do Not Send - block emails from being sent. +* Added: New option: Send HTML or plain text emails when doing an Email Test. +* Added: New option: Mailgun region selection - US and EU (US is default to preserve compatibility). +* Fixed: Compatibility with WordPress 3.6+. +* Fixed: Compatibility with WordPress 5.0. +* Fixed: Constants usage is much more reliable now, works correctly on Multisite. Constants are global accross the whole network. +* Fixed: Preserve multipart emails when using Sendgrid/Mailgun mailers (were converted to HTML-only). +* Fixed: Security hardening. +* Changed: Prefill Email Test page From field with currently logged in user email. +* Changed: Update libraries: google/apiclient-services, google/auth, phpseclib/phpseclib and their dependecies. +* Changed: Display in debug output cURL version if Gmail mailing failed. +* Changed: Display in debug output OpenSSL version if it exists if Gmail/SMTP mailing failed. +* Changed: Display plugin version in dashboard error notice when emailing failed. +* Changed: Do not allow to send Test Email if mailer not configured properly. +* Changed: Notify in plugin admin area that Gmail doesn't allow to redefine From Name/Email etc. +* Changed: List all constants with descriptions in plugin main file: wp_mail_smtp.php. +* Changed: TGMPA: change descriptions from "Required" to "Recommended" (labels were incorrect). + += 1.3.3 - 2018-07-05 = +* Fixed: Compatibility with other plugins, that are using Google Service or Google Client classes. +* Changed: Optimize code loading. + += 1.3.2 - 2018-06-29 = +* Make sure that other plugins/themes are not conflicting with our TGMPA library. + += 1.3.1 - 2018-06-29 = +* Fixed: Other SMTP: Clear new Debug messages about failed email delivery on next successful email sending. +* Fixed: Introduce conditional autoloader to workaround Gmail PHP 5.5 requirement and its library compatibility issues vs PHP 5.3+ minimum viable plugin version. + += 1.3.0 - 2018-06-28 = +* Added: New option: force From Email rewrite regardless of the current value. +* Added: New option: force From Name rewrite regardless of the current value. +* Added: New option: remove all plugin data on plugin uninstall (when user deletes it). +* Added: Notify site admins in wp-admin area with a notice about last failed email delivery. Cleans up on successful delivery. +* Added: Notify site admins in wp-admin area with a notice about possible compatibility issues with other SMTP and email delivery plugins. +* Added: Improve User Debug Experience when doing Email Test - display helpful description and steps to fix the issue. +* Added: New users: provide default SMTP Port value for new users based on Encryption selection. +* Added: New users: notify about not configured plugin settings. +* Added: New users: Recommend free WPForms Lite plugin for those who don't have it. +* Added: SendGrid/Mailgun: provide support for multipart/alternative types of emails. +* Added: Gmail: new button to remove connection and to connect a new Google account. +* Fixed: Support plugin installation into /mu-plugins/ directory. +* Fixed: SendGrid: required text/plain part of email being the first one - fixes plain text emails not having links. +* Fixed: SendGrid and Mailgun: improperly sending plain text emails in html format. +* Fixed: SMTP Debug output was empty in some cases. +* Fixed: Compatibility with lots of other plugins that use Google Analytics library of different versions. +* Fixed: "client_id is empty" is no more a problem, should be fixed. +* Changed: For SendGrid and Mailgun allow using custom defined attachments names if present. Fallback to file name. +* Changed: Gmail: switch to a wider scope to prevent possible issues in certain circumstances. +* Changed: Remove whitespaces start/end of keys, secrets etc. +* Changed: Improved helpful description tests of various options. +* Changed: Improved plugin autoloading functionality. + += 1.2.5 - 2017-02-05 = +* Fixed: `Return path` can't be turned off. +* Fixed: `Authentication` sometimes can't be turned off. +* Fixed: `Auto TLS` sometimes can't be turned off. +* Fixed: BCC support for Gmail was broken. +* Fixed: Debug output improved to handle SELinux and grsecurity. +* Fixed: Strip slashes from plugin settings (useful for `From Name` option). +* Fixed: Change the way sanitization is done to prevent accidental removal of useful data. +* Fixed: Plugin activation will not overwrite settings back to defaults. +* Fixed: Properly set `Auto TLS` option on plugin activation. +* Fixed: Providers autoloading improved for certain Windows-based installs. +* Fixed: Use the proper path to load translations from plugin's `/languages` directory. +* Changed: Do not autoload on each page request plugin settings from WordPress options table. +* Changed: Do not autoload Pepipost classes unless it's saved as active mailer in settings. + += 1.2.4 - 2017-01-28 = +* Fixed: Improved escaping in debug reporting. + += 1.2.3 - 2017-01-22 = +* Fixed: Gmail tokens were reset after clicking Save Settings. +* Fixed: Slight typo in Gmail success message. + += 1.2.2 - 2017-12-27 = +* Fixed: Correctly handle Mailgun debug message for an incorrect api key. +* Fixed: Fatal error for Gmail and SMTP mailers with Nginx web-server (without Apache at all). +* Changed: Update X-Mailer emails header to show the real sender with a mailer and plugin version. + += 1.2.1 - 2017-12-21 = +* Fixed: Failed SMTP connections generate fatal errors. + += 1.2.0 - 2017-12-21 = +* Fixed: Decrease the factual minimum WordPress version from 3.9 to 3.6. +* Changed: Improve debug output for all mail providers. + += 1.1.0 - 2017-12-18 = +* Added: New option "Auto TLS" for SMTP mailer. Default is enabled. Migration routine for all sites. +* Changed: Improve debug output - clear styles and context-aware content. +* Changed: Better exceptions handling for Google authentication process. +* Changed: Do not sanitize passwords, api keys etc - as they may contain special characters in certain order and sanitization will break those values. +* Changed: Improve wording of some helpful texts inside plugin admin area. +* Fixed: Do not include certain files in dependency libraries that are not used by Google mailer. This should stop flagging plugin by Wordfence and VaultPress. +* Fixed: Constants usage is working now, to define the SMTP password, for example. +* Fixed: Notice for default mailer. + += 1.0.2 - 2017-12-12 = +* Fixed: PHPMailer using incorrect SMTPSecure value. + += 1.0.1 - 2017-12-12 = +* Fixed: Global POST processing conflict. + += 1.0.0 - 2017-12-12 = +* Added: Automatic migration tool to move options from older storage format to a new one. +* Added: Added Gmail & G Suite email provider integration - without your email and password. +* Added: Added SendGrid email provider integration - using the API key only. +* Added: Added Mailgun email provider integration - using the API key and configured domain only. +* Added: New compatibility mode - for PHP 5.2 old plugin will be loaded, for PHP 5.3 and higher - new version of admin area and new functionality. +* Changed: The new look of the admin area. +* Changed: SMTP password field now has "password" type. +* Changed: SMTP password field does not display real password at all when using constants in `wp-config.php` to define it. +* Changed: Escape properly all translations. +* Changed: More helpful test email content (with a mailer name). diff --git a/wp-content/plugins/wp-mail-smtp/src/Admin/Area.php b/wp-content/plugins/wp-mail-smtp/src/Admin/Area.php new file mode 100644 index 0000000..0eac582 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Admin/Area.php @@ -0,0 +1,891 @@ +hooks(); + } + + /** + * Assign all hooks to proper places. + * + * @since 1.0.0 + */ + protected function hooks() { + + // Add the Settings link to a plugin on Plugins page. + add_filter( 'plugin_action_links', array( $this, 'add_plugin_action_link' ), 10, 2 ); + + // Add the options page. + add_action( 'admin_menu', array( $this, 'add_admin_options_page' ) ); + + // Admin footer text. + add_filter( 'admin_footer_text', array( $this, 'get_admin_footer' ), 1, 2 ); + + // Enqueue admin area scripts and styles. + add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) ); + + // Process the admin page forms actions. + add_action( 'admin_init', array( $this, 'process_actions' ) ); + + // Display custom notices based on the error/success codes. + add_action( 'admin_init', array( $this, 'display_custom_auth_notices' ) ); + + // Display notice instructing the user to complete plugin setup. + add_action( 'admin_init', array( $this, 'display_setup_notice' ) ); + + // Outputs the plugin admin header. + add_action( 'in_admin_header', array( $this, 'display_admin_header' ), 100 ); + + // Hide all unrelated to the plugin notices on the plugin admin pages. + add_action( 'admin_print_scripts', array( $this, 'hide_unrelated_notices' ) ); + + // Process all AJAX requests. + add_action( 'wp_ajax_wp_mail_smtp_ajax', array( $this, 'process_ajax' ) ); + } + + /** + * Display custom notices based on the error/success codes. + * + * @since 1.0.0 + */ + public function display_custom_auth_notices() { + + $error = isset( $_GET['error'] ) ? sanitize_key( $_GET['error'] ) : ''; // phpcs:ignore + $success = isset( $_GET['success'] ) ? sanitize_key( $_GET['success'] ) : ''; // phpcs:ignore + + if ( empty( $error ) && empty( $success ) ) { + return; + } + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + switch ( $error ) { + case 'google_access_denied': + WP::add_admin_notice( + /* translators: %s - error code, returned by Google API. */ + sprintf( esc_html__( 'There was an error while processing the authentication request: %s. Please try again.', 'wp-mail-smtp' ), '' . $error . '' ), + WP::ADMIN_NOTICE_ERROR + ); + break; + + case 'google_no_code_scope': + case 'microsoft_no_code': + WP::add_admin_notice( + esc_html__( 'There was an error while processing the authentication request. Please try again.', 'wp-mail-smtp' ), + WP::ADMIN_NOTICE_ERROR + ); + break; + + case 'google_no_clients': + WP::add_admin_notice( + esc_html__( 'There was an error while processing the authentication request. Please make sure that you have Client ID and Client Secret both valid and saved.', 'wp-mail-smtp' ), + WP::ADMIN_NOTICE_ERROR + ); + break; + } + + switch ( $success ) { + case 'google_site_linked': + WP::add_admin_notice( + esc_html__( 'You have successfully linked the current site with your Google API project. Now you can start sending emails through Gmail.', 'wp-mail-smtp' ), + WP::ADMIN_NOTICE_SUCCESS + ); + break; + case 'microsoft_site_linked': + WP::add_admin_notice( + esc_html__( 'You have successfully linked the current site with your Microsoft API project. Now you can start sending emails through Outlook.', 'wp-mail-smtp' ), + WP::ADMIN_NOTICE_SUCCESS + ); + break; + } + } + + /** + * Display notice instructing the user to complete plugin setup. + * + * @since 1.3.0 + */ + public function display_setup_notice() { + + // Bail if we're not on a plugin page. + if ( ! $this->is_admin_page( 'general' ) ) { + return; + } + + $default_options = wp_json_encode( Options::get_defaults() ); + $current_options = wp_json_encode( Options::init()->get_all() ); + + // Check if the current settings are the same as the default settings. + if ( $current_options !== $default_options ) { + return; + } + + // Display notice informing user further action is needed. + WP::add_admin_notice( + sprintf( + wp_kses( + /* translators: %s - Mailer anchor link. */ + __( 'Thanks for using WP Mail SMTP! To complete the plugin setup and start sending emails, please select and configure your Mailer.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + ), + 'strong' => array(), + ) + ), + wp_mail_smtp()->get_admin()->get_admin_page_url( self::SLUG . '#wp-mail-smtp-setting-row-mailer' ) + ), + WP::ADMIN_NOTICE_INFO + ); + } + + /** + * Add admin area menu item. + * + * @since 1.0.0 + * @since 1.5.0 Moved the menu to the top level. Added several more pages. + */ + public function add_admin_options_page() { + + $this->hook = \add_menu_page( + \esc_html__( 'WP Mail SMTP', 'wp-mail-smtp' ), + \esc_html__( 'WP Mail SMTP', 'wp-mail-smtp' ), + 'manage_options', + self::SLUG, + array( $this, 'display' ), + 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9IiM5ZWEzYTgiIHdpZHRoPSI2NCIgaGVpZ2h0PSI2NCIgdmlld0JveD0iMCAwIDQzIDM0Ij48cGF0aCBkPSJNMC4wMDcsMy41ODVWMjAuNDIxcTAsMy41ODYsMy43NTEsMy41ODVMMjAsMjRWMTlIMzBWMTQuMDE0bDAuOTkxLTFMMzQsMTNWMy41ODVRMzQsMCwzMC4yNDksMEgzLjc1OFEwLjAwNywwLC4wMDcsMy41ODVoMFpNMy41MjQsNi4xNTdhMS40OSwxLjQ5LDAsMCwxLS41MDgtMC45MzUsMS41ODEsMS41ODEsMCwwLDEsLjI3NC0xLjIwOCwxLjQ0OSwxLjQ0OSwwLDAsMSwxLjA5NC0uNjYzLDEuNzU2LDEuNzU2LDAsMCwxLDEuMjUuMzEybDExLjQwOSw3LjcxNkwyOC4zNzQsMy42NjNhMS45NiwxLjk2LDAsMCwxLDEuMjg5LS4zMTIsMS41NDYsMS41NDYsMCwwLDEsMS4wOTQuNjYzLDEuNCwxLjQsMCwwLDEsLjI3MywxLjIwOCwxLjY3LDEuNjcsMCwwLDEtLjU0Ny45MzVMMTcuMDQzLDE3LjIyNVoiLz48cGF0aCBkPSJNMjIsMjhIMzJsLTAuMDA5LDQuNjI0YTEuMTI2LDEuMTI2LDAsMCwwLDEuOTIyLjhsOC4yNS04LjIzNmExLjEyNiwxLjEyNiwwLDAsMCwwLTEuNTk0bC04LjI1LTguMjQxYTEuMTI2LDEuMTI2LDAsMCwwLTEuOTIyLjh2NC44NjZMMjIsMjF2N1oiLz48L3N2Zz4=', + 98 + ); + + \add_submenu_page( + self::SLUG, + $this->get_current_tab_title() . ' ‹ ' . \esc_html__( 'Settings', 'wp-mail-smtp' ), + \esc_html__( 'Settings', 'wp-mail-smtp' ), + 'manage_options', + self::SLUG, + array( $this, 'display' ) + ); + \add_submenu_page( + self::SLUG, + \esc_html__( 'Email Log', 'wp-mail-smtp' ), + \esc_html__( 'Email Log', 'wp-mail-smtp' ), + 'manage_options', + self::SLUG . '-logs', + array( $this, 'display' ) + ); + \add_submenu_page( + self::SLUG, + \esc_html__( 'About Us', 'wp-mail-smtp' ), + \esc_html__( 'About Us', 'wp-mail-smtp' ), + 'manage_options', + self::SLUG . '-about', + array( $this, 'display' ) + ); + } + + /** + * Enqueue admin area scripts and styles. + * + * @since 1.0.0 + * @since 1.5.0 Added new assets for new pages. + * @since 1.7.0 Added jQuery Confirm library css/js files. + * + * @param string $hook + */ + public function enqueue_assets( $hook ) { + + if ( strpos( $hook, self::SLUG ) === false ) { + return; + } + + // General styles and js. + \wp_enqueue_style( + 'wp-mail-smtp-admin', + \wp_mail_smtp()->assets_url . '/css/smtp-admin.min.css', + false, + WPMS_PLUGIN_VER + ); + + \wp_enqueue_script( + 'wp-mail-smtp-admin', + \wp_mail_smtp()->assets_url . '/js/smtp-admin' . WP::asset_min() . '.js', + array( 'jquery' ), + WPMS_PLUGIN_VER, + false + ); + + \wp_localize_script( + 'wp-mail-smtp-admin', + 'wp_mail_smtp', + array( + 'text_provider_remove' => esc_html__( 'Are you sure you want to reset the current provider connection? You will need to immediately create a new one to be able to send emails.', 'wp-mail-smtp' ), + 'text_settings_not_saved' => esc_html__( 'Changes that you made to the settings are not saved!', 'wp-mail-smtp' ), + 'education' => array( + 'upgrade_icon_lock' => '', + 'upgrade_title' => esc_html__( '%name% is a PRO Feature', 'wp-mail-smtp' ), + 'upgrade_button' => esc_html__( 'Upgrade to Pro', 'wp-mail-smtp' ), + 'upgrade_url' => 'https://wpmailsmtp.com/lite-upgrade/?discount=SMTPLITEUPGRADE&utm_source=WordPress&utm_medium=plugin-settings&utm_campaign=liteplugin', + 'upgrade_bonus' => '

        ' . + wp_kses( + __( 'Bonus: WP Mail SMTP users get 20% off regular price,
        applied at checkout.', 'wp-mail-smtp' ), + array( + 'strong' => true, + 'span' => true, + 'br' => true, + ) + ) + . '

        ', + 'upgrade_doc' => ' + ' . esc_html__( 'Already purchased?', 'wp-mail-smtp' ) . ' + ', + ), + ) + ); + + /* + * jQuery Confirm library v3.3.4. + */ + \wp_enqueue_style( + 'wp-mail-smtp-admin-jconfirm', + \wp_mail_smtp()->assets_url . '/libs/jquery-confirm.min.css', + array( 'wp-mail-smtp-admin' ), + '3.3.4' + ); + \wp_enqueue_script( + 'wp-mail-smtp-admin-jconfirm', + \wp_mail_smtp()->assets_url . '/libs/jquery-confirm.min.js', + array( 'wp-mail-smtp-admin' ), + '3.3.4', + false + ); + + /* + * Logs page. + */ + if ( $this->is_admin_page( 'logs' ) ) { + \wp_enqueue_style( + 'wp-mail-smtp-admin-logs', + apply_filters( 'wp_mail_smtp_admin_enqueue_assets_logs_css', '' ), + array( 'wp-mail-smtp-admin' ), + WPMS_PLUGIN_VER + ); + + \wp_enqueue_script( + 'wp-mail-smtp-admin-logs', + apply_filters( 'wp_mail_smtp_admin_enqueue_assets_logs_js', '' ), + array( 'wp-mail-smtp-admin' ), + WPMS_PLUGIN_VER, + false + ); + } + + /* + * About page. + */ + if ( $this->is_admin_page( 'about' ) ) { + + \wp_enqueue_style( + 'wp-mail-smtp-admin-about', + \wp_mail_smtp()->assets_url . '/css/smtp-about.min.css', + array( 'wp-mail-smtp-admin' ), + WPMS_PLUGIN_VER + ); + + \wp_enqueue_script( + 'wp-mail-smtp-admin-about', + \wp_mail_smtp()->assets_url . '/js/smtp-about' . WP::asset_min() . '.js', + array( 'wp-mail-smtp-admin' ), + '0.7.2', + false + ); + + $settings = array( + 'ajax_url' => \admin_url( 'admin-ajax.php' ), + 'nonce' => \wp_create_nonce( 'wp-mail-smtp-about' ), + // Strings. + 'plugin_activate' => \esc_html__( 'Activate', 'wp-mail-smtp' ), + 'plugin_activated' => \esc_html__( 'Activated', 'wp-mail-smtp' ), + 'plugin_active' => \esc_html__( 'Active', 'wp-mail-smtp' ), + 'plugin_inactive' => \esc_html__( 'Inactive', 'wp-mail-smtp' ), + 'plugin_processing' => \esc_html__( 'Processing...', 'wp-mail-smtp' ), + 'plugin_install_error' => \esc_html__( 'Could not install a plugin. Please download from WordPress.org and install manually.', 'wp-mail-smtp' ), + 'plugin_install_activate_btn' => \esc_html__( 'Install and Activate', 'wp-mail-smtp' ), + 'plugin_activate_btn' => \esc_html__( 'Activate', 'wp-mail-smtp' ), + 'plugin_download_btn' => \esc_html__( 'Download', 'wp-mail-smtp' ), + ); + + \wp_localize_script( + 'wp-mail-smtp-admin-about', + 'wp_mail_smtp_about', + $settings + ); + + \wp_enqueue_script( + 'wp-mail-smtp-admin-about-matchheight', + \wp_mail_smtp()->assets_url . '/js/jquery.matchHeight.min.js', + array( 'wp-mail-smtp-admin' ), + '0.7.2', + false + ); + } + + do_action( 'wp_mail_smtp_admin_area_enqueue_assets', $hook ); + } + + /** + * Outputs the plugin admin header. + * + * @since 1.0.0 + */ + public function display_admin_header() { + + // Bail if we're not on a plugin page. + if ( ! $this->is_admin_page() ) { + return; + } + ?> + +
        +
        + + +
        + + is_admin_page() ) { + $url = 'https://wordpress.org/support/plugin/wp-mail-smtp/reviews/?filter=5#new-post'; + + $text = sprintf( + wp_kses( + /* translators: %1$s - WP.org link; %2$s - same WP.org link. */ + __( 'Please rate WP Mail SMTP ★★★★★ on WordPress.org to help us spread the word. Thank you from the WP Mail SMTP team!', 'wp-mail-smtp' ), + array( + 'strong' => array(), + 'a' => array( + 'href' => array(), + 'target' => array(), + 'rel' => array(), + ), + ) + ), + $url, + $url + ); + } + + return $text; + } + + /** + * Display content of the admin area page. + * + * @since 1.0.0 + * @since 1.5.0 Rewrite to distinguish between General tabs and separate pages. + */ + public function display() { + + // Bail if we're not on a plugin page. + if ( ! $this->is_admin_page() ) { + return; + } + + $page = ! empty( $_GET['page'] ) ? \sanitize_key( $_GET['page'] ) : ''; // phpcs:ignore + ?> + +
        + + + +
        + display_tabs(); ?> +
        + + is_pro() && wp_mail_smtp()->pro->get_logs()->is_archive(); + ?> + +
        + display(); ?> +
        + + + +
        + display(); ?> +
        + + +
        + + + +
        + get_pages() as $page_slug => $page ) : + $label = $page->get_label(); + if ( empty( $label ) ) { + continue; + } + $class = $page_slug === $this->get_current_tab() ? 'active' : ''; + ?> + + + + + + +
        + +
        +

        + get_current_tab_title() ); ?> +

        + + display_current_tab_content(); ?> +
        + + get_pages(); + + if ( ! array_key_exists( $this->get_current_tab(), $pages ) ) { + return; + } + + $pages[ $this->get_current_tab() ]->display(); + } + + /** + * Get the current admin area tab. + * + * @since 1.0.0 + * + * @return string + */ + protected function get_current_tab() { + + $current = ''; + + if ( $this->is_admin_page( 'general' ) ) { + $current = ! empty( $_GET['tab'] ) ? sanitize_key( $_GET['tab'] ) : 'settings'; // phpcs:ignore + } + + return $current; + } + + /** + * Get the array of default registered tabs for General page admin area. + * + * @since 1.0.0 + * + * @return \WPMailSMTP\Admin\PageAbstract[] + */ + public function get_pages() { + + if ( empty( $this->pages ) ) { + $this->pages = array( + 'settings' => new Pages\SettingsTab(), + 'test' => new Pages\TestTab(), + 'logs' => new Pages\LogsTab(), + 'control' => new Pages\ControlTab(), + 'misc' => new Pages\MiscTab(), + 'auth' => new Pages\AuthTab(), + ); + } + + return apply_filters( 'wp_mail_smtp_admin_get_pages', $this->pages ); + } + + /** + * Get the current tab title. + * + * @since 1.0.0 + * + * @return string + */ + public function get_current_tab_title() { + + $pages = $this->get_pages(); + + if ( ! array_key_exists( $this->get_current_tab(), $pages ) ) { + return ''; + } + + return $pages[ $this->get_current_tab() ]->get_title(); + } + + /** + * Check whether we are on an admin page. + * + * @since 1.0.0 + * @since 1.5.0 Added support for new pages. + * + * @param array|string $slug ID(s) of a plugin page. Possible values: 'general', 'logs', 'about' or array of them. + * + * @return bool + */ + public function is_admin_page( $slug = array() ) { + + $cur_page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : ''; // phpcs:ignore + $check = self::SLUG; + $pages_equal = false; + + if ( is_string( $slug ) ) { + $slug = sanitize_key( $slug ); + + if ( + in_array( $slug, self::$pages_registered, true ) && + $slug !== 'general' + ) { + $check = self::SLUG . '-' . $slug; + } + + $pages_equal = $cur_page === $check; + } elseif ( is_array( $slug ) ) { + if ( empty( $slug ) ) { + $slug = array_map( function ( $v ) { + if ( $v === 'general' ) { + return Area::SLUG; + } + return Area::SLUG . '-' . $v; + }, self::$pages_registered ); + } else { + $slug = array_map( function ( $v ) { + if ( $v === 'general' ) { + return Area::SLUG; + } + return Area::SLUG . '-' . sanitize_key( $v ); + }, $slug ); + } + + $pages_equal = in_array( $cur_page, $slug, true ); + } + + return is_admin() && $pages_equal; + } + + /** + * Give ability to use either admin area option or a filter to hide error notices about failed email delivery. + * Filter has higher priority and overrides an option. + * + * @since 1.6.0 + * + * @return bool + */ + public function is_error_delivery_notice_enabled() { + + $is_hard_enabled = (bool) apply_filters( 'wp_mail_smtp_admin_is_error_delivery_notice_enabled', true ); + + // If someone changed the value to false using a filter - disable completely. + if ( ! $is_hard_enabled ) { + return false; + } + + return ! (bool) Options::init()->get( 'general', 'email_delivery_errors_hidden' ); + } + + /** + * All possible plugin forms manipulation will be done here. + * + * @since 1.0.0 + */ + public function process_actions() { + + // Bail if we're not on a plugin General page. + if ( ! $this->is_admin_page( 'general' ) ) { + return; + } + + $pages = $this->get_pages(); + + // Allow to process only own tabs. + if ( ! array_key_exists( $this->get_current_tab(), $pages ) ) { + return; + } + + // Process POST only if it exists. + if ( ! empty( $_POST ) ) { + if ( ! empty( $_POST['wp-mail-smtp'] ) ) { + $post = $_POST['wp-mail-smtp']; + } else { + $post = array(); + } + + $pages[ $this->get_current_tab() ]->process_post( $post ); + } + + // This won't do anything for most pages. + // Works for plugin page only, when GET params are allowed. + $pages[ $this->get_current_tab() ]->process_auth(); + } + + /** + * Process all AJAX requests. + * + * @since 1.3.0 + * @since 1.5.0 Added tasks to process plugins management. + */ + public function process_ajax() { + + $data = array(); + + // Only admins can fire these ajax requests. + if ( ! current_user_can( 'manage_options' ) ) { + wp_send_json_error( $data ); + } + + if ( empty( $_POST['task'] ) ) { // phpcs:ignore + wp_send_json_error( $data ); + } + + $task = sanitize_key( $_POST['task'] ); // phpcs:ignore + + switch ( $task ) { + case 'pro_banner_dismiss': + update_user_meta( get_current_user_id(), 'wp_mail_smtp_pro_banner_dismissed', true ); + $data['message'] = esc_html__( 'WP Mail SMTP Pro related message was successfully dismissed.', 'wp-mail-smtp' ); + break; + + case 'about_plugin_install': + Pages\About::ajax_plugin_install(); + break; + + case 'about_plugin_activate': + Pages\About::ajax_plugin_activate(); + break; + + case 'notice_dismiss': + $notice = sanitize_key( $_POST['notice'] ); // phpcs:ignore + $mailer = sanitize_key( $_POST['mailer'] ); // phpcs:ignore + if ( empty( $notice ) || empty( $mailer ) ) { + break; + } + + update_user_meta( get_current_user_id(), "wp_mail_smtp_notice_{$notice}_for_{$mailer}_dismissed", true ); + $data['message'] = esc_html__( 'Educational notice for this mailer was successfully dismissed.', 'wp-mail-smtp' ); + break; + + default: + // Allow custom tasks data processing being added here. + $data = apply_filters( 'wp_mail_smtp_admin_process_ajax_' . $task . '_data', $data ); + } + + // Final ability to rewrite all the data, just in case. + $data = (array) apply_filters( 'wp_mail_smtp_admin_process_ajax_data', $data, $task ); + + if ( empty( $data ) ) { + wp_send_json_error( $data ); + } + + wp_send_json_success( $data ); + } + + /** + * Add a link to Settings page of a plugin on Plugins page. + * + * @since 1.0.0 + * @since 1.5.0 Added a link to Email Log. + * + * @param array $links + * @param string $file + * + * @return mixed + */ + public function add_plugin_action_link( $links, $file ) { + + // Will target both pro and lite version of a plugin. + if ( strpos( $file, 'wp-mail-smtp' ) === false ) { + return $links; + } + + $settings_link = '' . esc_html__( 'Settings', 'wp-mail-smtp' ) . ''; + $logs_link = '' . esc_html__( 'Email Log', 'wp-mail-smtp' ) . ''; + + array_unshift( $links, $settings_link, $logs_link ); + + return $links; + } + + /** + * Get plugin admin area page URL. + * + * @since 1.0.0 + * @since 1.5.0 URL is changed to support the top level position of the plugin admin area. + * + * @param string $page + * + * @return string + */ + public function get_admin_page_url( $page = '' ) { + + if ( empty( $page ) ) { + $page = self::SLUG; + } + + return add_query_arg( + 'page', + $page, + admin_url( 'admin.php' ) + ); + } + + /** + * Remove all non-WP Mail SMTP plugin notices from plugin pages. + * + * @since 1.0.0 + */ + public function hide_unrelated_notices() { + + // Bail if we're not on our screen or page. + if ( empty( $_REQUEST['page'] ) || strpos( $_REQUEST['page'], self::SLUG ) === false ) { + return; + } + + global $wp_filter; + + if ( ! empty( $wp_filter['user_admin_notices']->callbacks ) && is_array( $wp_filter['user_admin_notices']->callbacks ) ) { + foreach ( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) { + foreach ( $hooks as $name => $arr ) { + if ( is_object( $arr['function'] ) && $arr['function'] instanceof \Closure ) { + unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] ); + continue; + } + if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'wpmailsmtp' ) !== false ) { + continue; + } + if ( ! empty( $name ) && strpos( strtolower( $name ), 'wpmailsmtp' ) === false ) { + unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] ); + } + } + } + } + + if ( ! empty( $wp_filter['admin_notices']->callbacks ) && is_array( $wp_filter['admin_notices']->callbacks ) ) { + foreach ( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) { + foreach ( $hooks as $name => $arr ) { + if ( is_object( $arr['function'] ) && $arr['function'] instanceof \Closure ) { + unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] ); + continue; + } + if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'wpmailsmtp' ) !== false ) { + continue; + } + if ( ! empty( $name ) && strpos( strtolower( $name ), 'wpmailsmtp' ) === false ) { + unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] ); + } + } + } + } + + if ( ! empty( $wp_filter['all_admin_notices']->callbacks ) && is_array( $wp_filter['all_admin_notices']->callbacks ) ) { + foreach ( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) { + foreach ( $hooks as $name => $arr ) { + if ( is_object( $arr['function'] ) && $arr['function'] instanceof \Closure ) { + unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] ); + continue; + } + if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'wpmailsmtp' ) !== false ) { + continue; + } + if ( ! empty( $name ) && strpos( strtolower( $name ), 'wpmailsmtp' ) === false ) { + unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] ); + } + } + } + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Admin/PageAbstract.php b/wp-content/plugins/wp-mail-smtp/src/Admin/PageAbstract.php new file mode 100644 index 0000000..70b556d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Admin/PageAbstract.php @@ -0,0 +1,87 @@ +slug, + admin_url( 'admin.php?page=' . Area::SLUG ) + ) + ); + } + + /** + * Process tab form submission ($_POST ). + * + * @since 1.0.0 + * + * @param array $data $_POST data specific for the plugin. + */ + public function process_post( $data ) { + } + + /** + * Process tab & mailer specific Auth actions. + * + * @since 1.0.0 + */ + public function process_auth() { + } + + /** + * Print the nonce field for a specific tab. + * + * @since 1.0.0 + */ + public function wp_nonce_field() { + + wp_nonce_field( Area::SLUG . '-' . $this->slug ); + } + + /** + * Make sure that a user was referred from plugin admin page. + * To avoid security problems. + * + * @since 1.0.0 + */ + public function check_admin_referer() { + + check_admin_referer( Area::SLUG . '-' . $this->slug ); + } + + /** + * Save button to be reused on other tabs. + * + * @since 1.5.0 + */ + public function display_save_btn() { + + ?> + +

        + +

        + + get_defined_tab( $tab ), + admin_url( 'admin.php?page=' . Area::SLUG . '-' . $this->slug ) + ); + } + + /** + * Get the current tab. + * + * @since 1.5.0 + * + * @return string Current tab. + */ + public function get_current_tab() { + + if ( empty( $_GET['tab'] ) ) { // phpcs:ignore + return $this->slug; + } + + return $this->get_defined_tab( $_GET['tab'] ); // phpcs:ignore + } + + /** + * Get the defined or default tab. + * + * @since 1.5.0 + * + * @param string $tab Tab to check. + * + * @return string Defined tab. Fallback to default one if it doesn't exist. + */ + protected function get_defined_tab( $tab ) { + + $tab = \sanitize_key( $tab ); + + return \in_array( $tab, $this->tabs, true ) ? $tab : $this->slug; + } + + /** + * Get label for a tab. + * Process only those that exists. + * Defaults to "About Us". + * + * @since 1.5.0 + * + * @param string $tab Tab to get label for. + * + * @return string + */ + public function get_label( $tab = '' ) { + + switch ( $this->get_defined_tab( $tab ) ) { + case 'versus': + $label = \sprintf( + /* translators: %s - plugin current license type. */ + \esc_html__( '%s vs Pro', 'wp-mail-smtp' ), + \ucfirst( \wp_mail_smtp()->get_license_type() ) + ); + break; + + case 'about': + default: + $label = \esc_html__( 'About Us', 'wp-mail-smtp' ); + break; + } + + return $label; + } + + /** + * @inheritdoc + */ + public function get_title() { + return $this->get_label( $this->get_current_tab() ); + } + + /** + * Display About page content based on the current tab. + * + * @since 1.5.0 + */ + public function display() { + ?> + +
        + + get_label( 'about' ) ); ?> + + + get_license_type() === 'lite' ) : ?> + + get_label( 'versus' ) ); ?> + + +
        + +
        +

        + get_label( $this->get_current_tab() ) ); ?> +

        + + get_current_tab(); + + if ( \method_exists( $this, $callback ) ) { + $this->{$callback}(); + } else { + $this->display_about(); + } + ?> +
        + + + +
        + +
        +

        + +

        + +

        + +

        +

        + +

        +

        + WPForms, the largest WordPress resource site, WPBeginner, the most popular lead-generation software, OptinMonster, the best WordPress analytics plugin, MonsterInsights, and the most powerful WordPress contest plugin, RafflePress.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + ) + ), + 'https://wpforms.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp', + 'https://www.wpbeginner.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp', + 'https://optinmonster.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp', + 'https://www.monsterinsights.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp', + 'https://rafflepress.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp' + ); + ?> +

        +

        + +

        +
        + +
        +
        + <?php esc_attr_e( 'The WPForms Team photo', 'wp-mail-smtp' ); ?> +
        + +
        +
        +
        + +
        + +
        +
        + get_am_plugins() as $key => $plugin ) : + $is_url_external = false; + + $data = $this->get_about_plugins_data( $plugin ); + + if ( isset( $plugin['pro'] ) && \array_key_exists( $plugin['pro']['path'], \get_plugins() ) ) { + $is_url_external = true; + $plugin = $plugin['pro']; + + $data = array_merge( $data, $this->get_about_plugins_data( $plugin, true ) ); + } + + ?> +
        +
        +
        + +
        + +
        +

        + +

        +
        +
        +
        + + ' . $data['status_text'] . '' + ); + ?> + +
        +
        + + + + +
        +
        +
        +
        + +
        +
        + + array( + 'path' => 'google-analytics-for-wordpress/googleanalytics.php', + 'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-mi.png', + 'name' => \esc_html__( 'MonsterInsights', 'wp-mail-smtp' ), + 'desc' => \esc_html__( 'MonsterInsights makes it “effortless” to properly connect your WordPress site with Google Analytics, so you can start making data-driven decisions to grow your business.', 'wp-mail-smtp' ), + 'url' => 'https://downloads.wordpress.org/plugin/google-analytics-for-wordpress.zip', + 'pro' => array( + 'path' => 'google-analytics-premium/googleanalytics-premium.php', + 'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-mi.png', + 'name' => \esc_html__( 'MonsterInsights Pro', 'wp-mail-smtp' ), + 'desc' => \esc_html__( 'MonsterInsights makes it “effortless” to properly connect your WordPress site with Google Analytics, so you can start making data-driven decisions to grow your business.', 'wp-mail-smtp' ), + 'url' => 'https://www.monsterinsights.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp', + ), + ), + 'om' => array( + 'path' => 'optinmonster/optin-monster-wp-api.php', + 'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-om.png', + 'name' => \esc_html__( 'OptinMonster', 'wp-mail-smtp' ), + 'desc' => \esc_html__( 'Our high-converting optin forms like Exit-Intent® popups, Fullscreen Welcome Mats, and Scroll boxes help you dramatically boost conversions and get more email subscribers.', 'wp-mail-smtp' ), + 'url' => 'https://downloads.wordpress.org/plugin/optinmonster.zip', + ), + 'wpforms' => array( + 'path' => 'wpforms-lite/wpforms.php', + 'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-wpf.png', + 'name' => \esc_html__( 'Contact Forms by WPForms', 'wp-mail-smtp' ), + 'desc' => \esc_html__( 'The best WordPress contact form plugin. Drag & Drop online form builder that helps you create beautiful contact forms with just a few clicks.', 'wp-mail-smtp' ), + 'url' => 'https://downloads.wordpress.org/plugin/wpforms-lite.zip', + 'pro' => array( + 'path' => 'wpforms/wpforms.php', + 'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-wpf.png', + 'name' => \esc_html__( 'WPForms Pro', 'wp-mail-smtp' ), + 'desc' => \esc_html__( 'The best WordPress contact form plugin. Drag & Drop online form builder that helps you create beautiful contact forms with just a few clicks.', 'wp-mail-smtp' ), + 'url' => 'https://wpforms.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp', + ), + ), + 'rafflepress' => array( + 'path' => 'rafflepress/rafflepress.php', + 'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-rp.png', + 'name' => \esc_html__( 'RafflePress', 'wp-mail-smtp' ), + 'desc' => \esc_html__( 'Turn your visitors into brand ambassadors! Easily grow your email list, website traffic, and social media followers with powerful viral giveaways & contests.', 'wp-mail-smtp' ), + 'url' => 'https://downloads.wordpress.org/plugin/rafflepress.zip', + 'pro' => array( + 'path' => 'rafflepress-pro/rafflepress-pro.php', + 'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-rp.png', + 'name' => \esc_html__( 'RafflePress Pro', 'wp-mail-smtp' ), + 'desc' => \esc_html__( 'Turn your visitors into brand ambassadors! Easily grow your email list, website traffic, and social media followers with powerful viral giveaways & contests.', 'wp-mail-smtp' ), + 'url' => 'https://rafflepress.com/pricing/', + ), + ), + ); + + return $data; + } + + /** + * Active the given plugin. + * + * @since 1.5.0 + */ + public static function ajax_plugin_activate() { + + // Run a security check. + \check_ajax_referer( 'wp-mail-smtp-about', 'nonce' ); + + $error = \esc_html__( 'Could not activate the plugin. Please activate it from the Plugins page.', 'wp-mail-smtp' ); + + // Check for permissions. + if ( ! \current_user_can( 'activate_plugins' ) ) { + \wp_send_json_error( $error ); + } + + if ( isset( $_POST['plugin'] ) ) { + + $activate = \activate_plugins( $_POST['plugin'] ); // phpcs:ignore + + if ( ! \is_wp_error( $activate ) ) { + \wp_send_json_success( esc_html__( 'Plugin activated.', 'wp-mail-smtp' ) ); + } + } + + \wp_send_json_error( $error ); + } + + /** + * Install & activate the given plugin. + * + * @since 1.5.0 + */ + public static function ajax_plugin_install() { + + // Run a security check. + \check_ajax_referer( 'wp-mail-smtp-about', 'nonce' ); + + $error = \esc_html__( 'Could not install the plugin.', 'wp-mail-smtp' ); + + // Check for permissions. + if ( ! \current_user_can( 'activate_plugins' ) ) { + \wp_send_json_error( $error ); + } + + if ( empty( $_POST['plugin'] ) ) { + \wp_send_json_error(); + } + + // Set the current screen to avoid undefined notices. + \set_current_screen( 'wp-mail-smtp_page_wp-mail-smtp-about' ); + + // Prepare variables. + $url = \esc_url_raw( + \add_query_arg( + array( + 'page' => 'wp-mail-smtp-about', + ), + \admin_url( 'admin.php' ) + ) + ); + + $creds = \request_filesystem_credentials( $url, '', false, false, null ); + + // Check for file system permissions. + if ( false === $creds ) { + \wp_send_json_error( $error ); + } + + if ( ! \WP_Filesystem( $creds ) ) { + \wp_send_json_error( $error ); + } + + // Do not allow WordPress to search/download translations, as this will break JS output. + \remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 ); + + // Create the plugin upgrader with our custom skin. + $installer = new PluginsInstallUpgrader( new PluginsInstallSkin() ); + + // Error check. + if ( ! \method_exists( $installer, 'install' ) || empty( $_POST['plugin'] ) ) { + \wp_send_json_error( $error ); + } + + $installer->install( $_POST['plugin'] ); // phpcs:ignore + + // Flush the cache and return the newly installed plugin basename. + \wp_cache_flush(); + + if ( $installer->plugin_info() ) { + + $plugin_basename = $installer->plugin_info(); + + // Activate the plugin silently. + $activated = \activate_plugin( $plugin_basename ); + + if ( ! \is_wp_error( $activated ) ) { + \wp_send_json_success( + array( + 'msg' => \esc_html__( 'Plugin installed & activated.', 'wp-mail-smtp' ), + 'is_activated' => true, + 'basename' => $plugin_basename, + ) + ); + } else { + \wp_send_json_success( + array( + 'msg' => esc_html__( 'Plugin installed.', 'wp-mail-smtp' ), + 'is_activated' => false, + 'basename' => $plugin_basename, + ) + ); + } + } + + \wp_send_json_error( $error ); + } + + /** + * Display a "Lite vs Pro" tab content. + * + * @since 1.5.0 + */ + protected function display_versus() { + + $license = \wp_mail_smtp()->get_license_type(); + ?> + +
        +

        + + + +

        + +

        + +

        +
        + +
        + +
        +
        +

        + +

        +
        +
        +

        + +

        +
        +
        +

        + +

        +
        +
        +
        + + + get_license_features() as $slug => $name ) { + $current = $this->get_license_data( $slug, $license ); + $pro = $this->get_license_data( $slug, 'pro' ); + ?> + + + + + + +
        +

        +
        +

        + ', $current['text'] ); ?> +

        +
        +

        + ', $pro['text'] ); ?> +

        +
        + +
        + +
        + + +
        +
        +

        + + + +

        + +

        + 20% off regular price, automatically applied at checkout.', 'wp-mail-smtp' ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ); + ?> +

        +
        +
        + + + \esc_html__( 'Email Log', 'wp-mail-smtp' ), + 'control' => \esc_html__( 'Email Controls', 'wp-mail-smtp' ), + 'mailers' => \esc_html__( 'Additional Mailers', 'wp-mail-smtp' ), + 'support' => \esc_html__( 'Customer Support', 'wp-mail-smtp' ), + ); + } + + /** + * Get the array of data that compared the license data. + * + * @since 1.5.0 + * + * @param string $feature Feature name. + * @param string $license License type to get data for. + * + * @return array|false + */ + private function get_license_data( $feature, $license ) { + + $data = array( + 'log' => array( + 'lite' => array( + 'status' => 'none', + 'text' => array( + '' . esc_html__( 'Emails are not logged', 'wp-mail-smtp' ) . '', + ), + ), + 'pro' => array( + 'status' => 'full', + 'text' => array( + '' . esc_html__( 'Complete Email Log management inside WordPress', 'wp-mail-smtp' ) . '', + ), + ), + ), + 'control' => array( + 'lite' => array( + 'status' => 'none', + 'text' => array( + '' . esc_html__( 'No controls over whether default WordPress emails are sent', 'wp-mail-smtp' ) . '', + ), + ), + 'pro' => array( + 'status' => 'full', + 'text' => array( + '' . esc_html__( 'Complete Email Controls management for most default WordPress emails', 'wp-mail-smtp' ) . '', + ), + ), + ), + 'mailers' => array( + 'lite' => array( + 'status' => 'none', + 'text' => array( + '' . esc_html__( 'Only default list of mailers', 'wp-mail-smtp' ) . '', + ), + ), + 'pro' => array( + 'status' => 'full', + 'text' => array( + '' . esc_html__( 'Additional mailers: Microsoft Outlook (with Office365 support) and Amazon SES', 'wp-mail-smtp' ) . '', + ), + ), + ), + 'support' => array( + 'lite' => array( + 'status' => 'none', + 'text' => array( + '' . esc_html__( 'Limited Support', 'wp-mail-smtp' ) . '', + ), + ), + 'pro' => array( + 'status' => 'full', + 'text' => array( + '' . esc_html__( 'Priority Support', 'wp-mail-smtp' ) . '', + ), + ), + ), + ); + + // Wrong feature? + if ( ! isset( $data[ $feature ] ) ) { + return false; + } + + // Wrong license type? + if ( ! isset( $data[ $feature ][ $license ] ) ) { + return false; + } + + return $data[ $feature ][ $license ]; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/AuthTab.php b/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/AuthTab.php new file mode 100644 index 0000000..661b108 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/AuthTab.php @@ -0,0 +1,63 @@ +get_providers()->get_auth( Options::init()->get( 'mail', 'mailer' ) ); + + if ( + $auth && + $auth instanceof AuthAbstract && + method_exists( $auth, 'process' ) + ) { + $auth->process(); + } + } + + /** + * Return nothing, as we don't need this functionality. + * + * @since 1.0.0 + */ + public function get_label() { + return ''; + } + + /** + * Return nothing, as we don't need this functionality. + * + * @since 1.0.0 + */ + public function get_title() { + return ''; + } + + /** + * Do nothing, as we don't need this functionality. + * + * @since 1.0.0 + */ + public function display() { + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/ControlTab.php b/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/ControlTab.php new file mode 100644 index 0000000..30234b8 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/ControlTab.php @@ -0,0 +1,124 @@ +get_label(); + } + + /** + * @inheritdoc + */ + public function display() { + + $features = array( + array( + 'image' => 'comments.png', + 'title' => esc_html__( 'Comment Notifications', 'wp-mail-smtp' ), + 'desc' => esc_html__( 'Manage emails sent when comments are published or awaiting moderation.', 'wp-mail-smtp' ), + ), + array( + 'image' => 'admin.png', + 'title' => esc_html__( 'Site Admin Email Change Notifications', 'wp-mail-smtp' ), + 'desc' => esc_html__( 'Manage emails sent when site admin\'s account has been changed.', 'wp-mail-smtp' ), + ), + array( + 'image' => 'users.png', + 'title' => esc_html__( 'User Change Notifications', 'wp-mail-smtp' ), + 'desc' => esc_html__( 'Limit emails triggered by password changed/reset, email changed, and more.', 'wp-mail-smtp' ), + ), + array( + 'image' => 'personal.png', + 'title' => esc_html__( 'Personal Data Requests Notifications', 'wp-mail-smtp' ), + 'desc' => esc_html__( 'Control emails for data requests and data removal actions.', 'wp-mail-smtp' ), + ), + array( + 'image' => 'update.png', + 'title' => esc_html__( 'Automatic Update Notifications', 'wp-mail-smtp' ), + 'desc' => esc_html__( 'Manage emails sent by the core automatic update process.', 'wp-mail-smtp' ), + ), + array( + 'image' => 'user_new.png', + 'title' => esc_html__( 'New User Notifications', 'wp-mail-smtp' ), + 'desc' => esc_html__( 'Toggle emails sent to both user and site administrator about new user accounts.', 'wp-mail-smtp' ), + ), + + ) + ?> + +
        +

        + +

        + +

        + +
        + +
        + +
        +
        + +
        +
        +

        +

        +
        +
        + +
        + +
        + +
        + + + +
        + +
        + + slug, + admin_url( 'admin.php' ) + ); + } + + /** + * @inheritdoc + */ + public function get_label() { + return esc_html__( 'Email Log', 'wp-mail-smtp' ); + } + + /** + * @inheritdoc + */ + public function get_title() { + return $this->get_label(); + } + + /** + * @inheritdoc + */ + public function display() { + ?> + +
        +

        + get_label() ); ?> +

        +
        + +
        +

        + +

        +
        + +

        + +
        + <?php esc_attr_e( 'Logs Archive Page Screenshot', 'wp-mail-smtp' ); ?> + <?php esc_attr_e( 'Logs Single Page Screenshot', 'wp-mail-smtp' ); ?> +
        + +
        + + + +
        + +
        + + get_label(); + } + + /** + * Custom URL for this tab, redirects to Email Log page. + * + * @since 1.6.0 + * + * @return string + */ + public function get_link() { + + return wp_mail_smtp()->get_admin()->get_admin_page_url( Area::SLUG . '-' . $this->slug ); + } + + /** + * Not used as we are simply redirecting users. + * + * @since 1.6.0 + */ + public function display() { + } + + /** + * Not used as we are simply redirecting users. + * + * @since 1.6.0 + * + * @param array $data + */ + public function process_post( $data ) { + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/MiscTab.php b/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/MiscTab.php new file mode 100644 index 0000000..ee417fe --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/MiscTab.php @@ -0,0 +1,219 @@ +get_label(); + } + + /** + * @inheritdoc + */ + public function display() { + + $options = new Options(); + ?> + +
        + wp_nonce_field(); ?> + + +
        +
        +

        get_title(); ?>

        +
        +
        + + +
        +
        + +
        +
        + is_const_defined( 'general', 'do_not_send' ) ? 'disabled' : ''; ?> + get( 'general', 'do_not_send' ) ); ?> + > + +

        + wp_mail() function to send emails.', 'wp-mail-smtp' ), + array( + 'code' => array(), + ) + ) + ); + ?> +
        + +
        + +
        + is_const_defined( 'general', 'do_not_send' ) ) { + printf( /* translators: %1$s - constant that was used; %2$s - file where it was used. */ + esc_html__( 'The value of this field was set using a constant %1$s most likely inside %2$s of your WordPress installation.', 'wp-mail-smtp' ), + 'WPMS_DO_NOT_SEND', + 'wp-config.php' + ); + } else { + printf( /* translators: %1$s - constant to use; %2$s - file to put that constant in. */ + esc_html__( 'If you want to disable using a constant, put %1$s in your %2$s file.', 'wp-mail-smtp' ), + 'define( \'WPMS_DO_NOT_SEND\', true );', + 'wp-config.php' + ); + } + ?> +

        +
        +
        + + +
        +
        + +
        +
        + get( 'general', 'am_notifications_hidden' ) ); ?> + id="wp-mail-smtp-setting-am_notifications_hidden" + > + +
        +
        + + +
        +
        + +
        +
        + get_admin()->is_error_delivery_notice_enabled(); + ?> + + + + get( 'general', 'email_delivery_errors_hidden' ) ); ?> + id="wp-mail-smtp-setting-email_delivery_errors_hidden"> + + + + + +

        + wp_mail_smtp_admin_is_error_delivery_notice_enabled' + ); + ?> +

        + +

        + This is not recommended and should only be done for staging or development sites.', 'wp-mail-smtp' ), + array( + 'strong' => true, + ) + ); + ?> +

        + +
        +
        + + +
        +
        + +
        +
        + get( 'general', 'uninstall' ) ); ?> + id="wp-mail-smtp-setting-uninstall"> + +
        +
        + + display_save_btn(); ?> + +
        + + check_admin_referer(); + + $options = new Options(); + + // Unchecked checkboxes doesn't exist in $_POST, so we need to ensure we actually have them in data to save. + if ( empty( $data['general']['am_notifications_hidden'] ) ) { + $data['general']['am_notifications_hidden'] = false; + } + if ( empty( $data['general']['uninstall'] ) ) { + $data['general']['uninstall'] = false; + } + + $to_save = array_merge( $options->get_all(), $data ); + + // All the sanitization is done there. + $options->set( $to_save ); + + WP::add_admin_notice( + esc_html__( 'Settings were successfully saved.', 'wp-mail-smtp' ), + WP::ADMIN_NOTICE_SUCCESS + ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/SettingsTab.php b/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/SettingsTab.php new file mode 100644 index 0000000..276ae21 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/SettingsTab.php @@ -0,0 +1,546 @@ +get_label(); + } + + /** + * @inheritdoc + */ + public function display() { + + $options = new Options(); + $mailer = $options->get( 'mail', 'mailer' ); + + $disabled_email = 'gmail' === $mailer || 'outlook' === $mailer ? 'disabled' : ''; + $disabled_name = 'outlook' === $mailer ? 'disabled' : ''; + ?> + +
        + wp_nonce_field(); ?> + + +
        +
        +

        + +

        + +

        +
        +
        + + +
        +
        + +
        +
        + +
        +
        + + +
        +
        +

        +
        +
        + + +
        +
        + +
        +
        + is_const_defined( 'mail', 'from_email' ) || ! empty( $disabled_email ) ? 'disabled' : ''; ?> + id="wp-mail-smtp-setting-from_email" spellcheck="false" + placeholder="get_processor()->get_default_email() ); ?>"> + + +

        +
        + +

        +

        + +

        + + +
        + + get( 'mail', 'from_email_force' ) ); ?> + is_const_defined( 'mail', 'from_email_force' ) || ! empty( $disabled_email ) ? 'disabled' : ''; ?> + id="wp-mail-smtp-setting-from_email_force"> + + + + +

        + +

        + +

        + +

        + + +
        +
        + + +
        +
        + +
        +
        + is_const_defined( 'mail', 'from_name' ) || ! empty( $disabled_name ) ? 'disabled' : ''; ?> + id="wp-mail-smtp-setting-from_name" spellcheck="false" + placeholder="get_processor()->get_default_name() ); ?>"> + + +

        + +

        + + +
        + + get( 'mail', 'from_name_force' ) ); ?> + is_const_defined( 'mail', 'from_name_force' ) || ! empty( $disabled_name ) ? 'disabled' : ''; ?> + id="wp-mail-smtp-setting-from_name_force"> + + + + +

        + +

        + +

        + +

        + +
        +
        + + +
        +
        + +
        +
        + get( 'mail', 'return_path' ) ); ?> + is_const_defined( 'mail', 'return_path' ) ? 'disabled' : ''; ?> + id="wp-mail-smtp-setting-return_path"> + + + +

        +
        + +

        +
        +
        + + +
        +
        + +
        +
        +
        + + get_providers()->get_options_all() as $provider ) : ?> + +
        + +
        + <?php echo esc_attr( $provider->get_title() ); ?> +
        + +
        + is_disabled() ) : ?> + + + get_slug(), $mailer ); ?> + is_const_defined( 'mail', 'mailer' ) || $provider->is_disabled() ? 'disabled' : ''; ?> + is_disabled() ? 'class="educate"' : ''; ?> + /> + + +
        +
        + + + + +
        + + + + +
        + +
        +
        + +
        +
        +
        + + +
        + get_providers()->get_options_all() as $provider ) : ?> + get_description(); ?> +
        + + +
        +
        + is_disabled() ) : ?> + display_options(); ?> + +

        get_title(); ?>

        + get_notice( 'educational' ); + $is_dismissed = (bool) get_user_meta( get_current_user_id(), "wp_mail_smtp_notice_educational_for_{$provider->get_slug()}_dismissed", true ); + if ( ! empty( $provider_edu_notice ) && ! $is_dismissed ) : + ?> +

        + + + + + +

        + + + +

        + + +
        +
        + + display_options(); ?> +
        + + + +
        + + display_save_btn(); ?> + +
        + + display_wpforms(); + $this->display_pro_banner(); + } + + /** + * License key text for a Lite version of the plugin. + * + * @since 1.5.0 + * + * @param Options $options + */ + public static function display_license_key_field_content( $options ) { + ?> + +

        🙂

        + +

        + upgrading to PRO.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'class' => array(), + 'target' => array(), + 'rel' => array(), + ), + 'strong' => array(), + ) + ), + esc_url( wp_mail_smtp()->get_upgrade_link( 'general-license-key' ) ) + ); + ?> +

        + +

        + 20% off, automatically applied at checkout!', 'wp-mail-smtp' ), + array( + 'strong' => array(), + 'br' => array(), + ) + ); + ?> +

        + + is_pro() ) { + return; + } + + $is_dismissed = get_user_meta( get_current_user_id(), 'wp_mail_smtp_pro_banner_dismissed', true ); + + // Do not display if user dismissed. + if ( (bool) $is_dismissed === true ) { + return; + } + ?> + +
        + + + + + +

        + +

        + +

        + +

        + +

        + +

        + +

        + +
        +
          +
        • +
        • +
        • +
        • +
        • +
        • +
        +
          +
        • +
        • +
        • +
        • +
        • +
        • +
        +
        + +

        + Get WP Mail SMTP Pro Today and Unlock all the Powerful Features »', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'target' => array(), + 'rel' => array(), + ), + 'strong' => array(), + ) + ), + esc_url( wp_mail_smtp()->get_upgrade_link( 'general-cta' ) ) + ); + ?> +

        + +

        + Bonus: WP Mail SMTP users get 20% off regular price, automatically applied at checkout.', 'wp-mail-smtp' ), + array( + 'strong' => array(), + 'span' => array( + 'class' => array(), + ), + ) + ); + ?> +

        + +
        + + check_admin_referer(); + + $options = new Options(); + $old_opt = $options->get_all(); + + // When checkbox is unchecked - it's not submitted at all, so we need to define its default false value. + if ( ! isset( $data['mail']['from_email_force'] ) ) { + $data['mail']['from_email_force'] = false; + } + if ( ! isset( $data['mail']['from_name_force'] ) ) { + $data['mail']['from_name_force'] = false; + } + if ( ! isset( $data['mail']['return_path'] ) ) { + $data['mail']['return_path'] = false; + } + if ( ! isset( $data['smtp']['autotls'] ) ) { + $data['smtp']['autotls'] = false; + } + if ( ! isset( $data['smtp']['auth'] ) ) { + $data['smtp']['auth'] = false; + } + + // Remove all debug messages when switching mailers. + if ( + ! empty( $old_opt['mail']['mailer'] ) && + ! empty( $data['mail']['mailer'] ) && + $old_opt['mail']['mailer'] !== $data['mail']['mailer'] + ) { + Debug::clear(); + } + + $to_redirect = false; + + // Old and new Gmail client id/secret values are different - we need to invalidate tokens and scroll to Auth button. + if ( + $options->get( 'mail', 'mailer' ) === 'gmail' && + ! empty( $data['gmail']['client_id'] ) && + ! empty( $data['gmail']['client_secret'] ) && + ( + $options->get( 'gmail', 'client_id' ) !== $data['gmail']['client_id'] || + $options->get( 'gmail', 'client_secret' ) !== $data['gmail']['client_secret'] + ) + ) { + unset( $old_opt['gmail'] ); + + if ( + ! empty( $data['gmail']['client_id'] ) && + ! empty( $data['gmail']['client_secret'] ) + ) { + $to_redirect = true; + } + } + + // New gmail clients data will be added from new $data. + $to_save = Options::array_merge_recursive( $old_opt, $data ); + + // All the sanitization is done in Options class. + $options->set( $to_save ); + + if ( $to_redirect ) { + wp_redirect( $_POST['_wp_http_referer'] . '#wp-mail-smtp-setting-row-gmail-authorize' ); + exit; + } + + WP::add_admin_notice( + esc_html__( 'Settings were successfully saved.', 'wp-mail-smtp' ), + WP::ADMIN_NOTICE_SUCCESS + ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/TestTab.php b/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/TestTab.php new file mode 100644 index 0000000..a9a96f3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/TestTab.php @@ -0,0 +1,1115 @@ +get_label(); + } + + /** + * @inheritdoc + */ + public function display() { + ?> + +
        + wp_nonce_field(); ?> + + +
        +
        +

        +
        +
        + + +
        +
        + +
        +
        + +

        + +

        +
        +
        + + +
        +
        + +
        +
        + +

        + +

        +
        +
        + +

        + get_providers()->get_mailer( + Options::init()->get( 'mail', 'mailer' ), + wp_mail_smtp()->get_processor()->get_phpmailer() + )->is_mailer_complete() + ) { + $btn = 'wp-mail-smtp-btn-red'; + $disabled = 'disabled'; + + $help_text = '' . esc_html__( 'You cannot send an email. Mailer is not properly configured. Please check your settings.', 'wp-mail-smtp' ) . ''; + } + ?> + + +

        +
        + + display_debug_details(); + } + + /** + * @inheritdoc + */ + public function process_post( $data ) { + + $this->check_admin_referer(); + + if ( ! empty( $data['test']['email'] ) ) { + $data['test']['email'] = filter_var( $data['test']['email'], FILTER_VALIDATE_EMAIL ); + } + + $is_html = true; + if ( empty( $data['test']['html'] ) ) { + $is_html = false; + } + + if ( empty( $data['test']['email'] ) ) { + WP::add_admin_notice( + esc_html__( 'Test failed. Please use a valid email address and try to resend the test email.', 'wp-mail-smtp' ), + WP::ADMIN_NOTICE_WARNING + ); + return; + } + + $phpmailer = wp_mail_smtp()->get_processor()->get_phpmailer(); + + // Set SMTPDebug level, default is 3 (commands + data + connection status). + $phpmailer->SMTPDebug = apply_filters( 'wp_mail_smtp_admin_test_email_smtp_debug', 3 ); + + /* translators: %s - email address a test email will be sent to. */ + $subject = 'WP Mail SMTP: ' . sprintf( esc_html__( 'Test email to %s', 'wp-mail-smtp' ), $data['test']['email'] ); + + if ( $is_html ) { + add_filter( 'wp_mail_content_type', array( __CLASS__, 'set_test_html_content_type' ) ); + + /* translators: %s - email address a test email will be sent to. */ + $subject = 'WP Mail SMTP: HTML ' . sprintf( esc_html__( 'Test email to %s', 'wp-mail-smtp' ), $data['test']['email'] ); + } + + // Start output buffering to grab smtp debugging output. + ob_start(); + + // Send the test mail. + $result = wp_mail( + $data['test']['email'], + $subject, + $this->get_email_message( $is_html ), + array( + 'X-Mailer-Type:WPMailSMTP/Admin/Test', + ) + ); + + $smtp_debug = ob_get_clean(); + + if ( $is_html ) { + remove_filter( 'wp_mail_content_type', array( __NAMESPACE__, 'set_test_html_content_type' ) ); + } + + /* + * Notify a user about the results. + */ + if ( $result ) { + $result_message = esc_html__( 'Test plain text email was sent successfully!', 'wp-mail-smtp' ); + if ( $is_html ) { + $result_message = sprintf( + /* translators: %s - "HTML" in bold. */ + esc_html__( 'Test %s email was sent successfully! Please check your inbox to make sure it is delivered.', 'wp-mail-smtp' ), + 'HTML' + ); + } + WP::add_admin_notice( + $result_message, + WP::ADMIN_NOTICE_SUCCESS + ); + } else { + // Grab the smtp debugging output. + $this->debug['smtp_debug'] = $smtp_debug; + $this->debug['smtp_error'] = wp_strip_all_tags( $phpmailer->ErrorInfo ); + $this->debug['error_log'] = $this->get_debug_messages( $phpmailer, $smtp_debug ); + } + } + + /** + * Get the email message that should be sent. + * + * @since 1.4.0 + * + * @param bool $is_html Whether to send an HTML email or plain text. + * + * @return string + */ + private function get_email_message( $is_html = true ) { + + // Default plain text version of the email. + $message = $this->get_email_message_text(); + + if ( $is_html ) { + $message = $this->get_email_message_html(); + } + + return $message; + } + + /** + * Get the HTML prepared message for test email. + * + * @since 1.4.0 + * + * @return string + */ + private function get_email_message_html() { + + ob_start(); + ?> + + + + + + + WP Mail SMTP Test Email + + + + + + + +
        + + + + + + + + + + + + is_pro() ) : ?> + + + + +
        + WP Mail SMTP Logo +
        +
        +

        + Success +

        +

        + Congrats, test email was sent successfully! +

        +

        + Thank you for trying out WP Mail SMTP. We're on a mission to make sure that your emails actually get delivered. +

        + is_pro() ) : ?> +

        + If you find this free plugin useful, please consider giving WP Mail SMTP Pro a try! +

        + +

        + Signature +

        +

        + Jared Atchison
        Lead Developer, WP Mail SMTP +

        +
        +
        +
        + Unlock More Features with WP Mail SMTP Pro +
        +

        + Email Logs and Notification Controls
        + Amazon SES / Outlook.com / Office 365 integrations
        + Access to our world class support team +

        +

        + WP Mail SMTP users get 20% off, automatically applied at checkout +

        +
        + + + + +
        + + + + +
        + + Upgrade to WP Mail SMTP Pro Today + +
        +
        +
        +
        +
        + + + + is_pro() ) { + // WP Mail SMTP Pro & WPForms paid installed. + $message = +'Congrats, test email was sent successfully! + +Thank you for trying out WP Mail SMTP. We are on a mission to make sure your emails actually get delivered. + +- Jared Atchison +Lead Developer, WP Mail SMTP'; + } else { + // Free WP Mail SMTP is installed. + $message = +'Congrats, test email was sent successfully! + +Thank you for trying out WP Mail SMTP. We are on a mission to make sure your emails actually get delivered. + +If you find this free plugin useful, please consider giving WP Mail SMTP Pro a try! + +https://wpmailsmtp.com/lite-upgrade/ + +Unlock More Features with WP Mail SMTP Pro: + ++ Email Logs and Notification Controls ++ Amazon SES / Outlook.com / Office 365 integrations ++ Access to our world class support team + +- Jared Atchison +Lead Developer, WP Mail SMTP'; + } + // phpcs:enable + + return $message; + } + + /** + * Set the HTML content type for a test email. + * + * @since 1.4.0 + * + * @return string + */ + public static function set_test_html_content_type() { + + return 'text/html'; + } + + /** + * Prepare debug information, that will help users to identify the error. + * + * @since 1.0.0 + * + * @param MailCatcher $phpmailer + * @param string $smtp_debug + * + * @return string + */ + protected function get_debug_messages( $phpmailer, $smtp_debug ) { + + $options = new Options(); + $conflicts = new Conflicts(); + + $this->debug['mailer'] = $options->get( 'mail', 'mailer' ); + + /* + * Versions Debug. + */ + + $versions_text = 'Versions:
        '; + + $versions_text .= 'WordPress: ' . get_bloginfo( 'version' ) . '
        '; + $versions_text .= 'WordPress MS: ' . ( is_multisite() ? 'Yes' : 'No' ) . '
        '; + $versions_text .= 'PHP: ' . PHP_VERSION . '
        '; + $versions_text .= 'WP Mail SMTP: ' . WPMS_PLUGIN_VER . '
        '; + + /* + * Mailer Debug. + */ + + $mailer_text = 'Params:
        '; + + $mailer_text .= 'Mailer: ' . $this->debug['mailer'] . '
        '; + $mailer_text .= 'Constants: ' . ( $options->is_const_enabled() ? 'Yes' : 'No' ) . '
        '; + if ( $conflicts->is_detected() ) { + $mailer_text .= 'Conflicts: ' . esc_html( $conflicts->get_conflict_name() ) . '
        '; + } + + // Display different debug info based on the mailer. + $mailer = wp_mail_smtp()->get_providers()->get_mailer( $this->debug['mailer'], $phpmailer ); + + if ( $mailer ) { + $mailer_text .= $mailer->get_debug_info(); + } + + /* + * General Debug. + */ + + $debug_text = implode( '
        ', Debug::get() ); + Debug::clear(); + if ( ! empty( $debug_text ) ) { + $debug_text = '
        Debug:
        ' . $debug_text . '
        '; + } + + /* + * SMTP Debug. + */ + + $smtp_text = ''; + if ( $options->is_mailer_smtp() ) { + $smtp_text = 'SMTP Debug:
        '; + if ( ! empty( $smtp_debug ) ) { + $smtp_text .= '
        ' . $smtp_debug . '
        '; + } else { + $smtp_text .= '[empty]'; + } + } + + $errors = apply_filters( + 'wp_mail_smtp_admin_test_get_debug_messages', + array( + $versions_text, + $mailer_text, + $debug_text, + $smtp_text, + ) + ); + + return '
        ' . implode( '
        ', array_filter( $errors ) ) . '
        '; + } + + /** + * Returns debug information for detection, processing, and display. + * + * @since 1.3.0 + * + * @return array + */ + protected function get_debug_details() { + + $options = new Options(); + $smtp_host = $options->get( 'smtp', 'host' ); + $smtp_port = $options->get( 'smtp', 'port' ); + $smtp_encryption = $options->get( 'smtp', 'encryption' ); + + $details = array( + // [any] - cURL error 60/77. + array( + 'mailer' => 'any', + 'errors' => array( + array( 'cURL error 60' ), + array( 'cURL error 77' ), + ), + 'description' => array( + '' . esc_html__( 'SSL certificate issue.', 'wp-mail-smtp' ) . '', + esc_html__( 'This means your web server cannot reliably make secure connections (make requests to HTTPS sites).', 'wp-mail-smtp' ), + esc_html__( 'Typically this error is returned when web server is not configured properly.', 'wp-mail-smtp' ), + ), + 'steps' => array( + esc_html__( 'Contact your web hosting provider and inform them your site has an issue with SSL certificates.', 'wp-mail-smtp' ), + esc_html__( 'The exact error you can provide them is in the Error log, available at the bottom of this page.', 'wp-mail-smtp' ), + esc_html__( 'Ask them to resolve the issue then try again.', 'wp-mail-smtp' ), + ), + ), + // [any] - cURL error 6/7. + array( + 'mailer' => 'any', + 'errors' => array( + array( 'cURL error 6' ), + array( 'cURL error 7' ), + ), + 'description' => array( + '' . esc_html__( 'Could not connect to host.', 'wp-mail-smtp' ) . '', + ! empty( $smtp_host ) + ? sprintf( + /* translators: %s - SMTP host address. */ + esc_html__( 'This means your web server was unable to connect to %s.', 'wp-mail-smtp' ), + $smtp_host + ) + : esc_html__( 'This means your web server was unable to connect to the host server.', 'wp-mail-smtp' ), + esc_html__( 'Typically this error is returned your web server is blocking the connections or the SMTP host denying the request.', 'wp-mail-smtp' ), + ), + 'steps' => array( + sprintf( + /* translators: %s - SMTP host address. */ + esc_html__( 'Contact your web hosting provider and ask them to verify your server can connect to %s. Additionally, ask them if a firewall or security policy may be preventing the connection.', 'wp-mail-smtp' ), + $smtp_host + ), + esc_html__( 'If using "Other SMTP" Mailer, triple check your SMTP settings including host address, email, and password.', 'wp-mail-smtp' ), + esc_html__( 'If using "Other SMTP" Mailer, contact your SMTP host to confirm they are accepting outside connections with the settings you have configured (address, username, port, security, etc).', 'wp-mail-smtp' ), + ), + ), + // [any] - cURL error XX (other). + array( + 'mailer' => 'any', + 'errors' => array( + array( 'cURL error' ), + ), + 'description' => array( + '' . esc_html__( 'Could not connect to your host.', 'wp-mail-smtp' ) . '', + ! empty( $smtp_host ) + ? sprintf( + /* translators: %s - SMTP host address. */ + esc_html__( 'This means your web server was unable to connect to %s.', 'wp-mail-smtp' ), + $smtp_host + ) + : esc_html__( 'This means your web server was unable to connect to the host server.', 'wp-mail-smtp' ), + esc_html__( 'Typically this error is returned when web server is not configured properly.', 'wp-mail-smtp' ), + ), + 'steps' => array( + esc_html__( 'Contact your web hosting provider and inform them you are having issues making outbound connections.', 'wp-mail-smtp' ), + esc_html__( 'The exact error you can provide them is in the Error log, available at the bottom of this page.', 'wp-mail-smtp' ), + esc_html__( 'Ask them to resolve the issue then try again.', 'wp-mail-smtp' ), + ), + ), + // [smtp] - SMTP Error: Count not authenticate. + array( + 'mailer' => 'smtp', + 'errors' => array( + array( 'SMTP Error: Could not authenticate.' ), + ), + 'description' => array( + '' . esc_html__( 'Could not authenticate your SMTP account.', 'wp-mail-smtp' ) . '', + esc_html__( 'This means we were able to connect to your SMTP host, but were not able to proceed using the email/password in the settings.', 'wp-mail-smtp' ), + esc_html__( 'Typically this error is returned when the email or password is not correct or is not what the SMTP host is expecting.', 'wp-mail-smtp' ), + ), + 'steps' => array( + esc_html__( 'Triple check your SMTP settings including host address, email, and password. If you have recently reset your password you will need to update the settings.', 'wp-mail-smtp' ), + esc_html__( 'Contact your SMTP host to confirm you are using the correct username and password.', 'wp-mail-smtp' ), + esc_html__( 'Verify with your SMTP host that your account has permissions to send emails using outside connections.', 'wp-mail-smtp' ), + ), + ), + // [smtp] - Sending bulk email, hitting rate limit. + array( + 'mailer' => 'smtp', + 'errors' => array( + array( 'We do not authorize the use of this system to transport unsolicited' ), + ), + 'description' => array( + '' . esc_html__( 'Error due to unsolicited and/or bulk e-mail.', 'wp-mail-smtp' ) . '', + esc_html__( 'This means the connection to your SMTP host was made successfully, but the host rejected the email.', 'wp-mail-smtp' ), + esc_html__( 'Typically this error is returned when you are sending too many e-mails or e-mails that have been identified as spam.', 'wp-mail-smtp' ), + ), + 'steps' => array( + esc_html__( 'Check the emails that are sending are sending individually. Example: email is not sending to 30 recipients. You can install any WordPress e-mail logging plugin to do that.', 'wp-mail-smtp' ), + esc_html__( 'Contact your SMTP host to ask about sending/rate limits.', 'wp-mail-smtp' ), + esc_html__( 'Verify with them your SMTP account is in good standing and your account has not been flagged.', 'wp-mail-smtp' ), + ), + ), + // [smtp] - Unauthenticated senders not allowed. + array( + 'mailer' => 'smtp', + 'errors' => array( + array( 'Unauthenticated senders not allowed' ), + ), + 'description' => array( + '' . esc_html__( 'Unauthenticated senders are not allowed.', 'wp-mail-smtp' ) . '', + esc_html__( 'This means the connection to your SMTP host was made successfully, but you should enable Authentication and provide correct Username and Password.', 'wp-mail-smtp' ), + ), + 'steps' => array( + esc_html__( 'Go to WP Mail SMTP plugin Settings page.', 'wp-mail-smtp' ), + esc_html__( 'Enable Authentication', 'wp-mail-smtp' ), + esc_html__( 'Enter correct SMTP Username (usually this is an email address) and Password in the appropriate fields.', 'wp-mail-smtp' ), + ), + ), + // [smtp] - SMTP connect() failed. + array( + 'mailer' => 'smtp', + 'errors' => array( + array( 'SMTP connect() failed' ), + ), + 'description' => array( + '' . esc_html__( 'Could not connect to the SMTP host.', 'wp-mail-smtp' ) . '', + ! empty( $smtp_host ) + ? sprintf( + /* translators: %s - SMTP host address. */ + esc_html__( 'This means your web server was unable to connect to %s.', 'wp-mail-smtp' ), + $smtp_host + ) + : esc_html__( 'This means your web server was unable to connect to the host server.', 'wp-mail-smtp' ), + esc_html__( 'Typically this error is returned for one of the following reasons:', 'wp-mail-smtp' ), + '-' . esc_html__( 'SMTP settings are incorrect (wrong port, security setting, incorrect host).', 'wp-mail-smtp' ) . '
        ' . + '-' . esc_html__( 'Your web server is blocking the connection.', 'wp-mail-smtp' ) . '
        ' . + '-' . esc_html__( 'Your SMTP host is rejecting the connection.', 'wp-mail-smtp' ), + ), + 'steps' => array( + esc_html__( 'Triple check your SMTP settings including host address, email, and password, port, and security.', 'wp-mail-smtp' ), + sprintf( + wp_kses( + /* translators: %1$s - SMTP host address, %2$s - SMTP port, %3$s - SMTP encryption. */ + __( 'Contact your web hosting provider and ask them to verify your server can connect to %1$s on port %2$s using %3$s encryption. Additionally, ask them if a firewall or security policy may be preventing the connection - many shared hosts block certain ports.
        Note: this is the most common cause of this issue.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + 'strong' => array(), + 'br' => array(), + ) + ), + $smtp_host, + $smtp_port, + 'none' === $smtp_encryption ? esc_html__( 'no', 'wp-mail-smtp' ) : $smtp_encryption + ), + esc_html__( 'Contact your SMTP host to confirm you are using the correct username and password.', 'wp-mail-smtp' ), + esc_html__( 'Verify with your SMTP host that your account has permissions to send emails using outside connections.', 'wp-mail-smtp' ), + ), + ), + // [mailgun] - Please activate your Mailgun account. + array( + 'mailer' => 'mailgun', + 'errors' => array( + array( 'Please activate your Mailgun account' ), + ), + 'description' => array( + '' . esc_html__( 'Mailgun failed.', 'wp-mail-smtp' ) . '', + esc_html__( 'It seems that you forgot to activate your Mailgun account.', 'wp-mail-smtp' ), + ), + 'steps' => array( + esc_html__( 'Check your inbox you used to create a Mailgun account. Click the activation link in an email from Mailgun.', 'wp-mail-smtp' ), + esc_html__( 'If you do not see activation email, go to your Mailgun control panel and resend the activation email.', 'wp-mail-smtp' ), + ), + ), + // [mailgun] - Forbidden. + array( + 'mailer' => 'mailgun', + 'errors' => array( + array( 'Forbidden' ), + ), + 'description' => array( + '' . esc_html__( 'Mailgun failed.', 'wp-mail-smtp' ) . '', + esc_html__( 'Typically this error is because there is an issue with your Mailgun settings, in many cases the API key.', 'wp-mail-smtp' ), + ), + 'steps' => array( + esc_html__( 'Verify your API key is correct.', 'wp-mail-smtp' ), + esc_html__( 'Go to your Mailgun account and view your API key.', 'wp-mail-smtp' ), + esc_html__( 'Note that the API key includes the "key" prefix, so make sure that it is in the WP Mail SMTP Mailgun API setting.', 'wp-mail-smtp' ), + ), + ), + // [mailgun] - Free accounts are for test purposes only. + array( + 'mailer' => 'mailgun', + 'errors' => array( + array( 'Free accounts are for test purposes only' ), + ), + 'description' => array( + '' . esc_html__( 'Mailgun failed.', 'wp-mail-smtp' ) . '', + esc_html__( 'Your Mailgun account does not have access to send emails.', 'wp-mail-smtp' ), + esc_html__( 'Typically this error is because you have not set up and/or complete domain name verification for your Mailgun account.', 'wp-mail-smtp' ), + ), + 'steps' => array( + sprintf( + wp_kses( + /* translators: %s - Mailgun documentation URL. */ + __( 'Go to our how-to guide for setting up Mailgun with WP Mail SMTP.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + ) + ), + 'https://wpforms.com/how-to-send-wordpress-emails-with-mailgun/' + ), + esc_html__( 'Complete the steps in section "2. Verify Your Domain".', 'wp-mail-smtp' ), + ), + ), + // [gmail] - 401: Login Required. + array( + 'mailer' => 'gmail', + 'errors' => array( + array( '401', 'Login Required' ), + ), + 'description' => array( + '' . esc_html__( 'Google API Error.', 'wp-mail-smtp' ) . '', + esc_html__( 'You have not properly configured Gmail mailer.', 'wp-mail-smtp' ), + esc_html__( 'Make sure that you have clicked the "Allow plugin to send emails using your Google account" button under Gmail settings.', 'wp-mail-smtp' ), + ), + 'steps' => array( + esc_html__( 'Go to plugin Settings page and click the "Allow plugin to send emails using your Google account" button.', 'wp-mail-smtp' ), + esc_html__( 'After the click you should be redirected to a Gmail authorization screen, where you will be asked a permission to send emails on your behalf.', 'wp-mail-smtp' ), + esc_html__( 'Please click "Agree", if you see that button. If not - you will need to enable less secure apps first:', 'wp-mail-smtp' ) + . '
          ' + . '
        • ' . + sprintf( + wp_kses( + /* translators: %s - Google support article URL. */ + __( 'if you are using regular Gmail account, please read this article to proceed.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'target' => array(), + 'rel' => array(), + ), + ) + ), + 'https://support.google.com/accounts/answer/6010255?hl=en' + ) + . '
        • ' + . '
        • ' . + sprintf( + wp_kses( + /* translators: %s - Google support article URL. */ + __( 'if you are using G Suite, please read this article to proceed.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'target' => array(), + 'rel' => array(), + ), + ) + ), + 'https://support.google.com/cloudidentity/answer/6260879?hl=en' + ) + . '
        • ' + . '
        ', + ), + ), + // [gmail] - 400: Recipient address required. + array( + 'mailer' => 'gmail', + 'errors' => array( + array( '400', 'Recipient address required' ), + ), + 'description' => array( + '' . esc_html__( 'Google API Error.', 'wp-mail-smtp' ) . '', + esc_html__( 'Typically this error is because address the email was sent to is invalid or was empty.', 'wp-mail-smtp' ), + ), + 'steps' => array( + esc_html__( 'Check the "Send To" email address used and confirm it is a valid email and was not empty.', 'wp-mail-smtp' ), + sprintf( + /* translators: 1 - correct email address example. 2 - incorrect email address example. */ + esc_html__( 'It should be something like this: %1$s. These are incorrect values: %2$s.', 'wp-mail-smtp' ), + 'info@example.com', + 'info@localhost, info@192.168.1.1' + ), + esc_html__( 'Make sure that the generated email has a TO header, useful when you are responsible for email creation.', 'wp-mail-smtp' ), + ), + ), + // [gmail] - Token has been expired or revoked. + array( + 'mailer' => 'gmail', + 'errors' => array( + array( 'invalid_grant', 'Token has been expired or revoked' ), + ), + 'description' => array( + '' . esc_html__( 'Google API Error.', 'wp-mail-smtp' ) . '', + esc_html__( 'Unfortunately, this error can be due to many different reasons.', 'wp-mail-smtp' ), + ), + 'steps' => array( + sprintf( + wp_kses( + /* translators: %s - Blog article URL. */ + __( 'Please read this article to learn more about what can cause this error and how it can be resolved.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'target' => array(), + 'rel' => array(), + ), + ) + ), + 'https://blog.timekit.io/google-oauth-invalid-grant-nightmare-and-how-to-fix-it-9f4efaf1da35' + ), + ), + ), + // [gmail] - Code was already redeemed. + array( + 'mailer' => 'gmail', + 'errors' => array( + array( 'invalid_grant', 'Code was already redeemed' ), + ), + 'description' => array( + '' . esc_html__( 'Google API Error.', 'wp-mail-smtp' ) . '', + esc_html__( 'Authentication code that Google returned to you has already been used on your previous auth attempt.', 'wp-mail-smtp' ), + ), + 'steps' => array( + esc_html__( 'Make sure that you are not trying to manually clean up the plugin options to retry the "Allow..." step.', 'wp-mail-smtp' ), + esc_html__( 'Reinstall the plugin with clean plugin data turned on on Misc page. This will remove all the plugin options and you will be safe to retry.', 'wp-mail-smtp' ), + esc_html__( 'Make sure there is no aggressive caching on site admin area pages or try to clean cache between attempts.', 'wp-mail-smtp' ), + ), + ), + // [gmail] - 400: Mail service not enabled. + array( + 'mailer' => 'gmail', + 'errors' => array( + array( '400', 'Mail service not enabled' ), + ), + 'description' => array( + '' . esc_html__( 'Google API Error.', 'wp-mail-smtp' ) . '', + esc_html__( 'There are various reasons for that, please review the steps below.', 'wp-mail-smtp' ), + ), + 'steps' => array( + sprintf( + wp_kses( + /* translators: %s - Google G Suite Admin area URL. */ + __( 'Make sure that your G Suite trial period has not expired. You can check the status here.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + ) + ), + 'https://admin.google.com' + ), + sprintf( + wp_kses( + /* translators: %s - Google G Suite Admin area URL. */ + __( 'Make sure that Gmail app in your G Suite is actually enabled. You can check that in Apps list in G Suite Admin area.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + ) + ), + 'https://admin.google.com' + ), + sprintf( + wp_kses( + /* translators: %s - Google Developers Console URL. */ + __( 'Make sure that you have Gmail API enabled, and you can do that here.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + ) + ), + 'https://console.developers.google.com/' + ), + ), + ), + // [gmail] - 403: Project X is not found and cannot be used for API calls. + array( + 'mailer' => 'gmail', + 'errors' => array( + array( '403', 'is not found and cannot be used for API calls' ), + ), + 'description' => array( + '' . esc_html__( 'Google API Error.', 'wp-mail-smtp' ) . '', + ), + 'steps' => array( + esc_html__( 'Make sure that the used Client ID/Secret correspond to a proper project that has Gmail API enabled.', 'wp-mail-smtp' ), + sprintf( + wp_kses( + /* translators: %s - WPForms.com tutorial URL. */ + esc_html__( 'Please follow our Gmail tutorial to be sure that all the correct project and data is applied.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + ) + ), + 'https://wpforms.com/how-to-securely-send-wordpress-emails-using-gmail-smtp/' + ), + ), + ), + // [gmail] - The OAuth client was disabled. + array( + 'mailer' => 'gmail', + 'errors' => array( + array( 'disabled_client', 'The OAuth client was disabled' ), + ), + 'description' => array( + '' . esc_html__( 'Google API Error.', 'wp-mail-smtp' ) . '', + esc_html__( 'You may have added a new API to a project', 'wp-mail-smtp' ), + ), + 'steps' => array( + esc_html__( 'Make sure that the used Client ID/Secret correspond to a proper project that has Gmail API enabled.', 'wp-mail-smtp' ), + esc_html__( 'Try to use a separate project for your emails, so the project has only 1 Gmail API in it enabled. You will need to remove the old project and create a new one from scratch.', 'wp-mail-smtp' ), + ), + ), + ); + + // Error detection logic. + foreach ( $details as $data ) { + + // Check for appropriate mailer. + if ( 'any' !== $data['mailer'] && $this->debug['mailer'] !== $data['mailer'] ) { + continue; + } + + $match = false; + + // Attempt to detect errors. + foreach ( $data['errors'] as $error_group ) { + foreach ( $error_group as $error_code => $error_message ) { + $match = ( false !== strpos( $this->debug['error_log'], $error_message ) || false !== strpos( $this->debug['error_log'], $error_message ) ); + if ( ! $match ) { + break; + } + } + if ( $match ) { + break; + } + } + + if ( $match ) { + return $data; + } + } + + // Return defaults. + return array( + 'description' => array( + '' . esc_html__( 'An issue was detected.', 'wp-mail-smtp' ) . '', + esc_html__( 'This means your test email was unable to be sent.', 'wp-mail-smtp' ), + esc_html__( 'Typically this error is returned for one of the following reasons:', 'wp-mail-smtp' ), + '- ' . esc_html__( 'Plugin settings are incorrect (wrong SMTP settings, invalid Mailer configuration, etc).', 'wp-mail-smtp' ) . '
        ' . + '- ' . esc_html__( 'Your web server is blocking the connection.', 'wp-mail-smtp' ) . '
        ' . + '- ' . esc_html__( 'Your host is rejecting the connection.', 'wp-mail-smtp' ), + ), + 'steps' => array( + esc_html__( 'Triple check the plugin settings, consider reconfiguring to make sure everything is correct (eg bad copy and paste).', 'wp-mail-smtp' ), + wp_kses( + __( 'Contact your web hosting provider and ask them to verify your server can make outside connections. Additionally, ask them if a firewall or security policy may be preventing the connection - many shared hosts block certain ports.
        Note: this is the most common cause of this issue.', 'wp-mail-smtp' ), + array( + 'strong' => array(), + 'br' => array(), + ) + ), + esc_html__( 'Try using a different mailer.', 'wp-mail-smtp' ), + ), + ); + } + + /** + * Displays all the various error and debug details. + * + * @since 1.3.0 + */ + protected function display_debug_details() { + + if ( empty( $this->debug ) ) { + return; + } + + $debug = $this->get_debug_details(); + ?> +
        +

        +
        + +
        + ' . $description . '

        '; + } + ?> + +

        + +
          + ' . $step . ''; + } + ?> +
        + +

        + + is_pro() ) : ?> + +

        + submit a support ticket.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + ) + ), + 'https://wpmailsmtp.com/account/support/' + ); + ?> +

        + + + +

        + +

        + +

        + upgrade to WP Mail SMTP Pro. Along with getting expert support, you will also get Notification controls, Email Logging, and integrations for Amazon SES, Office 365, and Outlook.com.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'target' => array(), + 'rel' => array(), + ), + ) + ), + esc_url( wp_mail_smtp()->get_upgrade_link( 'email-test-fail' ) ) + ) + ?> +

        + +

        + +

        + +

        + 20% off regular pricing, automatically applied at checkout!', 'wp-mail-smtp' ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ); + ?> +

        + +

        + limited support on the WordPress.org support forums. You can create a support thread there, but please understand that free support is not guaranteed and is limited to simple issues. If you have an urgent or complex issue, then please consider upgrading to WP Mail SMTP Pro to access our priority support ticket system.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + ) + ), + 'https://wordpress.org/support/topic/wp-mail-smtp-support-policy/', + 'https://wordpress.org/support/plugin/wp-mail-smtp/', + esc_url( wp_mail_smtp()->get_upgrade_link( 'email-test-fail' ) ) + ); + ?> +

        + + + +

        + + + + +

        + +
        + debug['error_log']; ?> +
        + +

        + +

        +
        + '', // Please always pass this. + 'destination' => '', // And this + 'clear_destination' => false, + 'abort_if_destination_exists' => true, // Abort if the Destination directory exists, Pass clear_destination as false please + 'clear_working' => true, + 'is_multi' => false, + 'hook_extra' => array(), // Pass any extra $hook_extra args here, this will be passed to any hooked filters. + ); + + $options = wp_parse_args( $options, $defaults ); + + /** + * Filters the package options before running an update. + * + * See also {@see 'upgrader_process_complete'}. + * + * @since 4.3.0 + * + * @param array $options { + * Options used by the upgrader. + * + * @type string $package Package for update. + * @type string $destination Update location. + * @type bool $clear_destination Clear the destination resource. + * @type bool $clear_working Clear the working resource. + * @type bool $abort_if_destination_exists Abort if the Destination directory exists. + * @type bool $is_multi Whether the upgrader is running multiple times. + * @type array $hook_extra { + * Extra hook arguments. + * + * @type string $action Type of action. Default 'update'. + * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'. + * @type bool $bulk Whether the update process is a bulk update. Default true. + * @type string $plugin Path to the plugin file relative to the plugins directory. + * @type string $theme The stylesheet or template name of the theme. + * @type string $language_update_type The language pack update type. Accepts 'plugin', 'theme', + * or 'core'. + * @type object $language_update The language pack update offer. + * } + * } + */ + $options = apply_filters( 'upgrader_package_options', $options ); + + if ( ! $options['is_multi'] ) { // call $this->header separately if running multiple times + $this->skin->header(); + } + + // Connect to the Filesystem first. + $res = $this->fs_connect( array( WP_CONTENT_DIR, $options['destination'] ) ); + // Mainly for non-connected filesystem. + if ( ! $res ) { + if ( ! $options['is_multi'] ) { + $this->skin->footer(); + } + return false; + } + + $this->skin->before(); + + if ( is_wp_error( $res ) ) { + $this->skin->error( $res ); + $this->skin->after(); + if ( ! $options['is_multi'] ) { + $this->skin->footer(); + } + return $res; + } + + /* + * Download the package (Note, This just returns the filename + * of the file if the package is a local file) + */ + $download = $this->download_package( $options['package'], true ); + + // Allow for signature soft-fail. + // WARNING: This may be removed in the future. + if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) { + + // Don't output the 'no signature could be found' failure message for now. + if ( 'signature_verification_no_signature' != $download->get_error_code() || WP_DEBUG ) { + // Outout the failure error as a normal feedback, and not as an error: + //$this->skin->feedback( $download->get_error_message() ); + + // Report this failure back to WordPress.org for debugging purposes. + wp_version_check( + array( + 'signature_failure_code' => $download->get_error_code(), + 'signature_failure_data' => $download->get_error_data(), + ) + ); + } + + // Pretend this error didn't happen. + $download = $download->get_error_data( 'softfail-filename' ); + } + + if ( is_wp_error( $download ) ) { + $this->skin->error( $download ); + $this->skin->after(); + if ( ! $options['is_multi'] ) { + $this->skin->footer(); + } + return $download; + } + + $delete_package = ( $download != $options['package'] ); // Do not delete a "local" file + + // Unzips the file into a temporary directory. + $working_dir = $this->unpack_package( $download, $delete_package ); + if ( is_wp_error( $working_dir ) ) { + $this->skin->error( $working_dir ); + $this->skin->after(); + if ( ! $options['is_multi'] ) { + $this->skin->footer(); + } + return $working_dir; + } + + // With the given options, this installs it to the destination directory. + $result = $this->install_package( + array( + 'source' => $working_dir, + 'destination' => $options['destination'], + 'clear_destination' => $options['clear_destination'], + 'abort_if_destination_exists' => $options['abort_if_destination_exists'], + 'clear_working' => $options['clear_working'], + 'hook_extra' => $options['hook_extra'], + ) + ); + + $this->skin->set_result( $result ); + if ( is_wp_error( $result ) ) { + $this->skin->error( $result ); + //$this->skin->feedback( 'process_failed' ); + } else { + // Installation succeeded. + //$this->skin->feedback( 'process_success' ); + } + + $this->skin->after(); + + if ( ! $options['is_multi'] ) { + + /** + * Fires when the upgrader process is complete. + * + * See also {@see 'upgrader_package_options'}. + * + * @since 3.6.0 + * @since 3.7.0 Added to WP_Upgrader::run(). + * @since 4.6.0 `$translations` was added as a possible argument to `$hook_extra`. + * + * @param WP_Upgrader $this WP_Upgrader instance. In other contexts, $this, might be a + * Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance. + * @param array $hook_extra { + * Array of bulk item update data. + * + * @type string $action Type of action. Default 'update'. + * @type string $type Type of update process. Accepts 'plugin', 'theme', 'translation', or 'core'. + * @type bool $bulk Whether the update process is a bulk update. Default true. + * @type array $plugins Array of the basename paths of the plugins' main files. + * @type array $themes The theme slugs. + * @type array $translations { + * Array of translations update data. + * + * @type string $language The locale the translation is for. + * @type string $type Type of translation. Accepts 'plugin', 'theme', or 'core'. + * @type string $slug Text domain the translation is for. The slug of a theme/plugin or + * 'default' for core translations. + * @type string $version The version of a theme, plugin, or core. + * } + * } + */ + do_action( 'upgrader_process_complete', $this, $options['hook_extra'] ); + + $this->skin->footer(); + } + + return $result; + } + + /** + * Toggle maintenance mode for the site. + * + * Creates/deletes the maintenance file to enable/disable maintenance mode. + * + * @since 2.8.0 + * + * @global WP_Filesystem_Base $wp_filesystem Subclass + * + * @param bool $enable True to enable maintenance mode, false to disable. + */ + public function maintenance_mode( $enable = false ) { + global $wp_filesystem; + $file = $wp_filesystem->abspath() . '.maintenance'; + if ( $enable ) { + //$this->skin->feedback( 'maintenance_start' ); + // Create maintenance file to signal that we are upgrading + $maintenance_string = ''; + $wp_filesystem->delete( $file ); + $wp_filesystem->put_contents( $file, $maintenance_string, FS_CHMOD_FILE ); + } elseif ( ! $enable && $wp_filesystem->exists( $file ) ) { + //$this->skin->feedback( 'maintenance_end' ); + $wp_filesystem->delete( $file ); + } + } + + /** + * Download a package. + * + * @since 2.8.0 + * + * @param string $package The URI of the package. If this is the full path to an + * existing local file, it will be returned untouched. + * @param bool $check_signatures Whether to validate file signatures. Default false. + * @return string|WP_Error The full path to the downloaded package file, or a WP_Error object. + */ + public function download_package( $package, $check_signatures = false ) { + + /** + * Filters whether to return the package. + * + * @since 3.7.0 + * + * @param bool $reply Whether to bail without returning the package. + * Default false. + * @param string $package The package file name. + * @param WP_Upgrader $this The WP_Upgrader instance. + */ + $reply = apply_filters( 'upgrader_pre_download', false, $package, $this ); + if ( false !== $reply ) { + return $reply; + } + + if ( ! preg_match( '!^(http|https|ftp)://!i', $package ) && file_exists( $package ) ) { //Local file or remote? + return $package; //must be a local file.. + } + + if ( empty( $package ) ) { + return new WP_Error( 'no_package', $this->strings['no_package'] ); + } + + //$this->skin->feedback( 'downloading_package', $package ); + + $download_file = download_url( $package, 300, $check_signatures ); + + if ( is_wp_error( $download_file ) && ! $download_file->get_error_data( 'softfail-filename' ) ) { + return new WP_Error( 'download_failed', $this->strings['download_failed'], $download_file->get_error_message() ); + } + + return $download_file; + } + + /** + * Unpack a compressed package file. + * + * @since 2.8.0 + * + * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. + * + * @param string $package Full path to the package file. + * @param bool $delete_package Optional. Whether to delete the package file after attempting + * to unpack it. Default true. + * @return string|WP_Error The path to the unpacked contents, or a WP_Error on failure. + */ + public function unpack_package( $package, $delete_package = true ) { + global $wp_filesystem; + + //$this->skin->feedback( 'unpack_package' ); + + $upgrade_folder = $wp_filesystem->wp_content_dir() . 'upgrade/'; + + //Clean up contents of upgrade directory beforehand. + $upgrade_files = $wp_filesystem->dirlist( $upgrade_folder ); + if ( ! empty( $upgrade_files ) ) { + foreach ( $upgrade_files as $file ) { + $wp_filesystem->delete( $upgrade_folder . $file['name'], true ); + } + } + + // We need a working directory - Strip off any .tmp or .zip suffixes + $working_dir = $upgrade_folder . basename( basename( $package, '.tmp' ), '.zip' ); + + // Clean up working directory + if ( $wp_filesystem->is_dir( $working_dir ) ) { + $wp_filesystem->delete( $working_dir, true ); + } + + // Unzip package to working directory + $result = unzip_file( $package, $working_dir ); + + // Once extracted, delete the package if required. + if ( $delete_package ) { + unlink( $package ); + } + + if ( is_wp_error( $result ) ) { + $wp_filesystem->delete( $working_dir, true ); + if ( 'incompatible_archive' == $result->get_error_code() ) { + return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], $result->get_error_data() ); + } + return $result; + } + + return $working_dir; + } + + /** + * Install a package. + * + * Copies the contents of a package form a source directory, and installs them in + * a destination directory. Optionally removes the source. It can also optionally + * clear out the destination folder if it already exists. + * + * @since 2.8.0 + * + * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. + * @global array $wp_theme_directories + * + * @param array|string $args { + * Optional. Array or string of arguments for installing a package. Default empty array. + * + * @type string $source Required path to the package source. Default empty. + * @type string $destination Required path to a folder to install the package in. + * Default empty. + * @type bool $clear_destination Whether to delete any files already in the destination + * folder. Default false. + * @type bool $clear_working Whether to delete the files form the working directory + * after copying to the destination. Default false. + * @type bool $abort_if_destination_exists Whether to abort the installation if + * the destination folder already exists. Default true. + * @type array $hook_extra Extra arguments to pass to the filter hooks called by + * WP_Upgrader::install_package(). Default empty array. + * } + * + * @return array|WP_Error The result (also stored in `WP_Upgrader::$result`), or a WP_Error on failure. + */ + public function install_package( $args = array() ) { + global $wp_filesystem, $wp_theme_directories; + + $defaults = array( + 'source' => '', // Please always pass this + 'destination' => '', // and this + 'clear_destination' => false, + 'clear_working' => false, + 'abort_if_destination_exists' => true, + 'hook_extra' => array(), + ); + + $args = wp_parse_args( $args, $defaults ); + + // These were previously extract()'d. + $source = $args['source']; + $destination = $args['destination']; + $clear_destination = $args['clear_destination']; + + set_time_limit( 300 ); + + if ( empty( $source ) || empty( $destination ) ) { + return new WP_Error( 'bad_request', $this->strings['bad_request'] ); + } + //$this->skin->feedback( 'installing_package' ); + + /** + * Filters the install response before the installation has started. + * + * Returning a truthy value, or one that could be evaluated as a WP_Error + * will effectively short-circuit the installation, returning that value + * instead. + * + * @since 2.8.0 + * + * @param bool|WP_Error $response Response. + * @param array $hook_extra Extra arguments passed to hooked filters. + */ + $res = apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ); + + if ( is_wp_error( $res ) ) { + return $res; + } + + //Retain the Original source and destinations + $remote_source = $args['source']; + $local_destination = $destination; + + $source_files = array_keys( $wp_filesystem->dirlist( $remote_source ) ); + $remote_destination = $wp_filesystem->find_folder( $local_destination ); + + //Locate which directory to copy to the new folder, This is based on the actual folder holding the files. + if ( 1 == count( $source_files ) && $wp_filesystem->is_dir( trailingslashit( $args['source'] ) . $source_files[0] . '/' ) ) { //Only one folder? Then we want its contents. + $source = trailingslashit( $args['source'] ) . trailingslashit( $source_files[0] ); + } elseif ( count( $source_files ) == 0 ) { + return new WP_Error( 'incompatible_archive_empty', $this->strings['incompatible_archive'], $this->strings['no_files'] ); // There are no files? + } else { // It's only a single file, the upgrader will use the folder name of this file as the destination folder. Folder name is based on zip filename. + $source = trailingslashit( $args['source'] ); + } + + /** + * Filters the source file location for the upgrade package. + * + * @since 2.8.0 + * @since 4.4.0 The $hook_extra parameter became available. + * + * @param string $source File source location. + * @param string $remote_source Remote file source location. + * @param WP_Upgrader $this WP_Upgrader instance. + * @param array $hook_extra Extra arguments passed to hooked filters. + */ + $source = apply_filters( 'upgrader_source_selection', $source, $remote_source, $this, $args['hook_extra'] ); + + if ( is_wp_error( $source ) ) { + return $source; + } + + // Has the source location changed? If so, we need a new source_files list. + if ( $source !== $remote_source ) { + $source_files = array_keys( $wp_filesystem->dirlist( $source ) ); + } + + /* + * Protection against deleting files in any important base directories. + * Theme_Upgrader & Plugin_Upgrader also trigger this, as they pass the + * destination directory (WP_PLUGIN_DIR / wp-content/themes) intending + * to copy the directory into the directory, whilst they pass the source + * as the actual files to copy. + */ + $protected_directories = array( ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, WP_CONTENT_DIR . '/themes' ); + + if ( is_array( $wp_theme_directories ) ) { + $protected_directories = array_merge( $protected_directories, $wp_theme_directories ); + } + + if ( in_array( $destination, $protected_directories ) ) { + $remote_destination = trailingslashit( $remote_destination ) . trailingslashit( basename( $source ) ); + $destination = trailingslashit( $destination ) . trailingslashit( basename( $source ) ); + } + + if ( $clear_destination ) { + // We're going to clear the destination if there's something there. + //$this->skin->feedback( 'remove_old' ); + + $removed = $this->clear_destination( $remote_destination ); + + /** + * Filters whether the upgrader cleared the destination. + * + * @since 2.8.0 + * + * @param mixed $removed Whether the destination was cleared. true on success, WP_Error on failure + * @param string $local_destination The local package destination. + * @param string $remote_destination The remote package destination. + * @param array $hook_extra Extra arguments passed to hooked filters. + */ + $removed = apply_filters( 'upgrader_clear_destination', $removed, $local_destination, $remote_destination, $args['hook_extra'] ); + + if ( is_wp_error( $removed ) ) { + return $removed; + } + } elseif ( $args['abort_if_destination_exists'] && $wp_filesystem->exists( $remote_destination ) ) { + //If we're not clearing the destination folder and something exists there already, Bail. + //But first check to see if there are actually any files in the folder. + $_files = $wp_filesystem->dirlist( $remote_destination ); + if ( ! empty( $_files ) ) { + $wp_filesystem->delete( $remote_source, true ); //Clear out the source files. + return new WP_Error( 'folder_exists', $this->strings['folder_exists'], $remote_destination ); + } + } + + //Create destination if needed + if ( ! $wp_filesystem->exists( $remote_destination ) ) { + if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) { + return new WP_Error( 'mkdir_failed_destination', $this->strings['mkdir_failed'], $remote_destination ); + } + } + // Copy new version of item into place. + $result = copy_dir( $source, $remote_destination ); + if ( is_wp_error( $result ) ) { + if ( $args['clear_working'] ) { + $wp_filesystem->delete( $remote_source, true ); + } + return $result; + } + + //Clear the Working folder? + if ( $args['clear_working'] ) { + $wp_filesystem->delete( $remote_source, true ); + } + + $destination_name = basename( str_replace( $local_destination, '', $destination ) ); + if ( '.' == $destination_name ) { + $destination_name = ''; + } + + $this->result = compact( 'source', 'source_files', 'destination', 'destination_name', 'local_destination', 'remote_destination', 'clear_destination' ); + + /** + * Filters the installation response after the installation has finished. + * + * @since 2.8.0 + * + * @param bool $response Installation response. + * @param array $hook_extra Extra arguments passed to hooked filters. + * @param array $result Installation result data. + */ + $res = apply_filters( 'upgrader_post_install', true, $args['hook_extra'], $this->result ); + + if ( is_wp_error( $res ) ) { + $this->result = $res; + return $res; + } + + //Bombard the calling function will all the info which we've just used. + return $this->result; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Conflicts.php b/wp-content/plugins/wp-mail-smtp/src/Conflicts.php new file mode 100644 index 0000000..91c22fb --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Conflicts.php @@ -0,0 +1,184 @@ + array( + 'name' => 'Easy WP SMTP', + ), + 'postman_start' => array( + 'name' => 'Postman SMTP', + ), + 'post_start' => array( + 'name' => 'Post SMTP Mailer/Email Log', + ), + 'mail_bank' => array( + 'name' => 'WP Mail Bank', + ), + 'SMTP_MAILER' => array( + 'name' => 'SMTP Mailer', + 'class' => true, + ), + 'GMAIL_SMTP' => array( + 'name' => 'Gmail SMTP', + 'class' => true, + ), + 'WP_Email_Smtp' => array( + 'name' => 'WP Email SMTP', + 'class' => true, + ), + 'smtpmail_include' => array( + 'name' => 'SMTP Mail', + ), + 'bwssmtp_init' => array( + 'name' => 'SMTP by BestWebSoft', + ), + 'WPSendGrid_SMTP' => array( + 'name' => 'WP SendGrid SMTP', + 'class' => true, + ), + 'sar_friendly_smtp' => array( + 'name' => 'SAR Friendly SMTP', + ), + 'WPGmail_SMTP' => array( + 'name' => 'WP Gmail SMTP', + 'class' => true, + ), + 'st_smtp_check_config' => array( + 'name' => 'Cimy Swift SMTP', + ), + 'WP_Easy_SMTP' => array( + 'name' => 'WP Easy SMTP', + 'class' => true, + ), + 'WPMailgun_SMTP' => array( + 'name' => 'WP Mailgun SMTP', + 'class' => true, + ), + 'my_smtp_wp' => array( + 'name' => 'MY SMTP WP', + ), + 'mail_booster' => array( + 'name' => 'WP Mail Booster', + ), + 'Sendgrid_Settings' => array( + 'name' => 'SendGrid', + 'class' => true, + ), + 'WPMS_php_mailer' => array( + 'name' => 'WP Mail Smtp Mailer', + ), + 'WPAmazonSES_SMTP' => array( + 'name' => 'WP Amazon SES SMTP', + 'class' => true, + ), + 'Postmark_Mail' => array( + 'name' => 'Postmark for WordPress', + 'class' => true, + ), + 'Mailgun' => array( + 'name' => 'Mailgun', + 'class' => true, + ), + 'WPSparkPost\SparkPost' => array( + 'name' => 'SparkPost', + 'class' => true, + ), + 'WPYahoo_SMTP' => array( + 'name' => 'WP Yahoo SMTP', + 'class' => true, + ), + 'wpses_init' => array( + 'name' => 'WP SES', + 'class' => true, + ), + 'TSPHPMailer' => array( + 'name' => 'turboSMTP', + ), + 'WP_SMTP' => array( + 'name' => 'WP SMTP', + 'class' => true, + ), + ); + + /** + * @var array Conflict information. + */ + protected $conflict = array(); + + /** + * Whether we have a conflict with predefined list of plugins. + * + * @since 1.5.0 + * + * @return bool + */ + public function is_detected() { + + foreach ( self::$plugins as $callback => $plugin ) { + if ( ! empty( $plugin['class'] ) ) { + $detected = \class_exists( $callback, false ); + } else { + $detected = \function_exists( $callback ); + } + + if ( $detected ) { + $this->conflict = $plugin; + break; + } + } + + return ! empty( $this->conflict ); + } + + /** + * Add a warning admin message to a user about the conflicting plugin. + * + * @since 1.5.0 + */ + public function notify() { + + if ( empty( $this->conflict ) ) { + return; + } + + WP::add_admin_notice( + \sprintf( /* translators: %1$s - Plugin name causing conflict; %2$s - Plugin name causing conflict. */ + \esc_html__( 'Heads up! WP Mail SMTP has detected %1$s is activated. Please deactivate %2$s to prevent conflicts.', 'wp-mail-smtp' ), + $this->get_conflict_name(), + $this->get_conflict_name() + ), + WP::ADMIN_NOTICE_WARNING + ); + } + + /** + * Get the conflicting plugin name is any. + * + * @since 1.5.0 + * + * @return null|string + */ + public function get_conflict_name() { + + $name = null; + + if ( ! empty( $this->conflict['name'] ) ) { + $name = $this->conflict['name']; + } + + return $name; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Core.php b/wp-content/plugins/wp-mail-smtp/src/Core.php new file mode 100644 index 0000000..f903893 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Core.php @@ -0,0 +1,738 @@ +pro->example(). + * + * @since 1.5.0 + * + * @var \WPMailSMTP\Pro\Pro + */ + public $pro; + + /** + * Core constructor. + * + * @since 1.0.0 + */ + public function __construct() { + + $this->plugin_url = rtrim( plugin_dir_url( __DIR__ ), '/\\' ); + $this->assets_url = $this->plugin_url . '/assets'; + $this->plugin_path = rtrim( plugin_dir_path( __DIR__ ), '/\\' ); + + if ( $this->is_not_loadable() ) { + $this->do_not_load(); + + return; + } + + // Finally, load all the plugin. + $this->hooks(); + $this->init_early(); + } + + /** + * Currently used for Pro version only. + * + * @since 1.5.0 + * + * @return bool + */ + protected function is_not_loadable() { + + // Check the Pro. + if ( + is_readable( $this->plugin_path . '/src/Pro/Pro.php' ) && + ! $this->is_pro_allowed() + ) { + // So there is a Pro version, but its PHP version check failed. + return true; + } + + return false; + } + + /** + * What to do if plugin is not loaded. + * + * @since 1.5.0 + */ + protected function do_not_load() { + + add_action( 'admin_notices', function () { + + ?> +
        +

        + insecure version of PHP that is no longer supported. Please contact your web hosting provider to update your PHP version or switch to a recommended WordPress hosting company.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'target' => array(), + 'rel' => array(), + ), + 'strong' => array(), + ) + ), + 'https://www.wpbeginner.com/wordpress-hosting/' + ); + ?> +

        + Note: WP Mail SMTP plugin is disabled on your site until you fix the issue. Read more for additional information.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'target' => array(), + 'rel' => array(), + ), + 'strong' => array(), + ) + ), + 'https://wpforms.com/docs/supported-php-version/' + ); + ?> +

        +
        + + plugin_path ) . '/assets/languages' ); + + /* + * Constantly check in admin area, that we don't need to upgrade DB. + * Do not wait for the `admin_init` hook, because some actions are already done + * on `plugins_loaded`, so migration has to be done before. + * We should not fire this in AJAX requests. + */ + if ( WP::in_wp_admin() ) { + $this->get_migration(); + $this->get_upgrade(); + $this->detect_conflicts(); + } + + // In admin area, regardless of AJAX or not AJAX request. + if ( is_admin() ) { + $this->get_admin(); + $this->get_site_health()->init(); + } + + // Plugin admin area notices. Display to "admins" only. + if ( current_user_can( 'manage_options' ) ) { + add_action( 'admin_notices', array( '\WPMailSMTP\WP', 'display_admin_notices' ) ); + add_action( 'admin_notices', array( $this, 'display_general_notices' ) ); + } + } + + /** + * Whether the Pro part of the plugin is allowed to be loaded. + * + * @since 1.5.0 + * @since 1.6.0 Added a filter. + * + * @return bool + */ + protected function is_pro_allowed() { + + $is_allowed = true; + + if ( ! is_readable( $this->plugin_path . '/src/Pro/Pro.php' ) ) { + $is_allowed = false; + } + + if ( version_compare( phpversion(), '5.6', '<' ) ) { + $is_allowed = false; + } + + return apply_filters( 'wp_mail_smtp_core_is_pro_allowed', $is_allowed ); + } + + /** + * Get/Load the Pro code of the plugin if it exists. + * + * @since 1.6.2 + * + * @return \WPMailSMTP\Pro\Pro + */ + public function get_pro() { + + if ( ! $this->is_pro_allowed() ) { + return $this->pro; + } + + if ( ! $this->is_pro() ) { + $this->pro = new \WPMailSMTP\Pro\Pro(); + } + + return $this->pro; + } + + /** + * This method allows to overwrite certain core WP functions, because it's fired: + * - after `muplugins_loaded` hook, + * - before WordPress own `wp-includes/pluggable.php` file include, + * - before `plugin_loaded` and `plugins_loaded` hooks. + * + * @since 1.5.0 + */ + protected function init_early() { + + $pro_files = $this->is_pro_allowed() ? \WPMailSMTP\Pro\Pro::PLUGGABLE_FILES : array(); + + $files = (array) apply_filters( 'wp_mail_smtp_core_init_early_include_files', $pro_files ); + + foreach ( $files as $file ) { + $path = $this->plugin_path . '/' . $file; + + if ( is_readable( $path ) ) { + /** @noinspection PhpIncludeInspection */ + include_once $path; + } + } + } + + /** + * Load the plugin core processor. + * + * @since 1.0.0 + * + * @return Processor + */ + public function get_processor() { + + static $processor; + + if ( ! isset( $processor ) ) { + $processor = apply_filters( 'wp_mail_smtp_core_get_processor', new Processor() ); + } + + return $processor; + } + + /** + * Load the plugin admin area. + * + * @since 1.0.0 + * + * @return Admin\Area + */ + public function get_admin() { + + static $admin; + + if ( ! isset( $admin ) ) { + $admin = apply_filters( 'wp_mail_smtp_core_get_admin', new Admin\Area() ); + } + + return $admin; + } + + /** + * Load the plugin providers loader. + * + * @since 1.0.0 + * + * @return Providers\Loader + */ + public function get_providers() { + + static $providers; + + if ( ! isset( $providers ) ) { + $providers = apply_filters( 'wp_mail_smtp_core_get_providers', new Providers\Loader() ); + } + + return $providers; + } + + /** + * Load the plugin option migrator. + * + * @since 1.0.0 + * + * @return Migration + */ + public function get_migration() { + + static $migration; + + if ( ! isset( $migration ) ) { + $migration = apply_filters( 'wp_mail_smtp_core_get_migration', new Migration() ); + } + + return $migration; + } + + /** + * Load the plugin upgrader. + * + * @since 1.1.0 + * + * @return Upgrade + */ + public function get_upgrade() { + + static $upgrade; + + if ( ! isset( $upgrade ) ) { + $upgrade = apply_filters( 'wp_mail_smtp_core_get_upgrade', new Upgrade() ); + } + + return $upgrade; + } + + /** + * Get the plugin's WP Site Health object. + * + * @since {VERSION} + * + * @return SiteHealth + */ + public function get_site_health() { + + static $site_health; + + if ( ! isset( $site_health ) ) { + $site_health = apply_filters( 'wp_mail_smtp_core_get_site_health', new SiteHealth() ); + } + + return $site_health; + } + + /** + * Display various notifications to a user + * + * @since 1.0.0 + */ + public function init_notifications() { + + // Old PHP version notification. + if ( + version_compare( phpversion(), '5.6', '<' ) && + is_super_admin() && + ( + isset( $GLOBALS['pagenow'] ) && + $GLOBALS['pagenow'] === 'index.php' + ) + ) { + WP::add_admin_notice( + sprintf( + wp_kses( /* translators: %1$s - WP Mail SMTP plugin name; %2$s - WPForms.com URL to a related doc. */ + __( 'Your site is running an outdated version of PHP that is no longer supported and may cause issues with %1$s. Read more for additional information.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'target' => array(), + 'rel' => array(), + ), + ) + ), + 'WP Mail SMTP', + 'https://wpforms.com/docs/supported-php-version/' + ) . + '

        ' . + wp_kses( + __( 'Please Note: Support for PHP 5.3-5.5 will be discontinued in 2020. After this, if no further action is taken, WP Mail SMTP functionality will be disabled.', 'wp-mail-smtp' ), + array( + 'strong' => array(), + 'em' => array(), + ) + ) . + '', + WP::ADMIN_NOTICE_ERROR, + false + ); + } + + // Awesome Motive Notifications. + if ( Options::init()->get( 'general', 'am_notifications_hidden' ) ) { + return; + } + } + + /** + * Display all debug mail-delivery related notices. + * + * @since 1.3.0 + * @since 1.6.0 Added a filter that allows to hide debug errors. + */ + public static function display_general_notices() { + + if ( wp_mail_smtp()->is_blocked() ) { + ?> + +
        +

        + EMAILING DISABLED: The %s is currently blocking all emails from being sent.', 'wp-mail-smtp' ), + array( + 'strong' => true, + ) + ), + esc_html( 'WP Mail SMTP v' . WPMS_PLUGIN_VER ) + ); + + if ( Options::init()->is_const_defined( 'general', 'do_not_send' ) ) { + $notices[] = sprintf( + wp_kses( /* translators: %1$s - constant name; %2$s - constant value. */ + __( 'To send emails, change the value of the %1$s constant to %2$s.', 'wp-mail-smtp' ), + array( + 'code' => true, + ) + ), + 'WPMS_DO_NOT_SEND', + 'false' + ); + } else { + $notices[] = sprintf( + wp_kses( /* translators: %s - plugin Misc settings page URL. */ + __( 'To send emails, go to plugin Misc settings and disable the "Do Not Send" option.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => true, + ), + ) + ), + esc_url( add_query_arg( 'tab', 'misc', wp_mail_smtp()->get_admin()->get_admin_page_url() ) ) + ); + } + + echo implode( ' ', $notices ); + ?> +

        +
        + + get_admin()->is_error_delivery_notice_enabled() ) { + + $notice = Debug::get_last(); + + if ( ! empty( $notice ) ) { + ?> + +
        +

        + EMAIL DELIVERY ERROR: the plugin %s logged this error during the last time it tried to send an email:', 'wp-mail-smtp' ), + array( + 'strong' => array(), + ) + ), + esc_html( 'WP Mail SMTP v' . WPMS_PLUGIN_VER ) + ); + ?> +

        + +
        +
        +
        + +

        + get_admin()->is_admin_page() ) { + printf( + wp_kses( /* translators: %s - plugin admin page URL. */ + __( 'Please review your WP Mail SMTP settings in plugin admin area.' ) . ' ', + array( + 'a' => array( + 'href' => array(), + ), + ) + ), + esc_url( wp_mail_smtp()->get_admin()->get_admin_page_url() ) + ); + } + + esc_html_e( 'Consider running an email test after fixing it.', 'wp-mail-smtp' ); + ?> +

        +
        + + is_detected() ) { + $conflicts->notify(); + } + } + + /** + * Init the \PHPMailer replacement. + * + * @since 1.0.0 + * + * @return \WPMailSMTP\MailCatcher + */ + public function replace_phpmailer() { + + global $phpmailer; + + return $this->replace_w_fake_phpmailer( $phpmailer ); + } + + /** + * Overwrite default PhpMailer with our MailCatcher. + * + * @since 1.0.0 + * @since 1.5.0 Throw external PhpMailer exceptions, inherits default WP behavior. + * + * @param null $obj PhpMailer object to override with own implementation. + * + * @return \WPMailSMTP\MailCatcher + */ + protected function replace_w_fake_phpmailer( &$obj = null ) { + + $obj = new MailCatcher( true ); + + return $obj; + } + + /** + * What to do on plugin activation. + * + * @since 1.0.0 + * + * @param string $plugin Path to the plugin file relative to the plugins directory. + * @param bool $network_wide Whether to enable the plugin for all sites in the network + * or just the current site. Multisite only. Default is false. + */ + public function activate( $plugin, $network_wide ) { + + // Store the plugin version when initial install occurred. + add_option( 'wp_mail_smtp_initial_version', WPMS_PLUGIN_VER, '', false ); + + // Store the plugin version activated to reference with upgrades. + update_option( 'wp_mail_smtp_version', WPMS_PLUGIN_VER, false ); + + // Save default options, only once. + Options::init()->set( Options::get_defaults(), true ); + } + + /** + * Whether this is a Pro version of a plugin. + * + * @since 1.5.0 + * + * @return bool + */ + public function is_pro() { + + return apply_filters( 'wp_mail_smtp_core_is_pro', ! empty( $this->pro ) ); + } + + /** + * Get the current license type. + * + * @since 1.5.0 + * + * @return string Default value: lite. + */ + public function get_license_type() { + + $type = Options::init()->get( 'license', 'type' ); + + if ( empty( $type ) ) { + $type = 'lite'; + } + + return strtolower( $type ); + } + + /** + * Get the current license key. + * + * @since 1.5.0 + * + * @return string + */ + public function get_license_key() { + + $key = Options::init()->get( 'license', 'key' ); + + if ( empty( $key ) ) { + $key = ''; + } + + return $key; + } + + /** + * Upgrade link used within the various admin pages. + * + * @since 1.5.0 + * @since 1.5.1 Support all UTM params. + * + * @param array|string $utm Array of UTM params, or if string provided - utm_content URL parameter. + * + * @return string + */ + public function get_upgrade_link( $utm ) { + + // Defaults. + $source = 'WordPress'; + $medium = 'plugin-settings'; + $campaign = 'liteplugin'; + $content = 'general'; + + if ( is_array( $utm ) ) { + if ( isset( $utm['source'] ) ) { + $source = $utm['source']; + } + if ( isset( $utm['medium'] ) ) { + $medium = $utm['medium']; + } + if ( isset( $utm['campaign'] ) ) { + $campaign = $utm['campaign']; + } + if ( isset( $utm['content'] ) ) { + $content = $utm['content']; + } + } elseif ( is_string( $utm ) ) { + $content = $utm; + } + + return apply_filters( + 'wp_mail_smtp_core_get_upgrade_link', + 'https://wpmailsmtp.com/lite-upgrade/?utm_source=' . esc_attr( $source ) . '&utm_medium=' . esc_attr( $medium ) . '&utm_campaign=' . esc_attr( $campaign ) . '&utm_content=' . esc_attr( $content ) + ); + } + + /** + * Whether the emailing functionality is blocked, with either an option or a constatnt. + * + * @since 1.7.0 + * + * @return bool + */ + public function is_blocked() { + + return (bool) Options::init()->get( 'general', 'do_not_send' ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Debug.php b/wp-content/plugins/wp-mail-smtp/src/Debug.php new file mode 100644 index 0000000..9eddfb9 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Debug.php @@ -0,0 +1,122 @@ + $e->getMessage() ); + * $debug = Debug::get(); // array + * $debug = Debug::get_last(); // string + * + * @since 1.2.0 + */ +class Debug { + + /** + * Key for options table where all messages will be saved to. + */ + const OPTION_KEY = 'wp_mail_smtp_debug'; + + /** + * Save unique debug message to a debug log. + * Adds one more to a list, at the end. + * + * @since 1.2.0 + * + * @param mixed $message + */ + public static function set( $message ) { + + if ( empty( $message ) ) { + return; + } + + if ( ! is_string( $message ) ) { + $message = wp_json_encode( $message ); + } else { + $message = wp_strip_all_tags( $message, false ); + } + + $all = self::get(); + + array_push( $all, $message ); + + update_option( self::OPTION_KEY, array_unique( $all ), false ); + } + + /** + * Remove all messages for a debug log. + * + * @since 1.2.0 + */ + public static function clear() { + update_option( self::OPTION_KEY, array(), false ); + } + + /** + * Retrieve all messages from a debug log. + * + * @since 1.2.0 + * + * @return array + */ + public static function get() { + + $all = get_option( self::OPTION_KEY, array() ); + + if ( ! is_array( $all ) ) { + $all = (array) $all; + } + + return $all; + } + + /** + * Get the last message that was saved to a debug log. + * + * @since 1.2.0 + * + * @return string + */ + public static function get_last() { + + $all = self::get(); + + if ( ! empty( $all ) && is_array( $all ) ) { + return (string) end( $all ); + } + + return ''; + } + + /** + * Get the proper variable content output to debug. + * + * @since 1.2.0 + * + * @param mixed $var + * + * @return string + */ + public static function pvar( $var = '' ) { + + ob_start(); + + echo ''; + + if ( is_bool( $var ) || empty( $var ) ) { + var_dump( $var ); + } else { + print_r( $var ); + } + + echo ''; + + $output = ob_get_clean(); + + return str_replace( array( "\r\n", "\r", "\n" ), '', $output ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Geo.php b/wp-content/plugins/wp-mail-smtp/src/Geo.php new file mode 100644 index 0000000..e2cb71f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Geo.php @@ -0,0 +1,163 @@ + sanitize_text_field( $request['latitude'] ), + 'longitude' => sanitize_text_field( $request['longitude'] ), + 'city' => sanitize_text_field( $request['city'] ), + 'region' => sanitize_text_field( $request['region_name'] ), + 'country' => sanitize_text_field( $request['country_code'] ), + 'postal' => sanitize_text_field( $request['zip_code'] ), + ); + + return $data; + } + } + + $request = wp_remote_get( 'https://ipapi.co/' . $ip . '/json' ); + + if ( ! is_wp_error( $request ) ) { + + $request = json_decode( wp_remote_retrieve_body( $request ), true ); + + if ( ! empty( $request['latitude'] ) && ! empty( $request['longitude'] ) ) { + + $data = array( + 'latitude' => sanitize_text_field( $request['latitude'] ), + 'longitude' => sanitize_text_field( $request['longitude'] ), + 'city' => sanitize_text_field( $request['city'] ), + 'region' => sanitize_text_field( $request['region'] ), + 'country' => sanitize_text_field( $request['country'] ), + 'postal' => sanitize_text_field( $request['postal'] ), + ); + + return $data; + } + } + + $request = wp_remote_get( 'https://tools.keycdn.com/geo.json?host=' . $ip ); + + if ( ! is_wp_error( $request ) ) { + + $request = json_decode( wp_remote_retrieve_body( $request ), true ); + + if ( ! empty( $request['data']['geo']['latitude'] ) && ! empty( $request['data']['geo']['longitude'] ) ) { + + $data = array( + 'latitude' => sanitize_text_field( $request['data']['geo']['latitude'] ), + 'longitude' => sanitize_text_field( $request['data']['geo']['longitude'] ), + 'city' => sanitize_text_field( $request['data']['geo']['city'] ), + 'region' => sanitize_text_field( $request['data']['geo']['region_name'] ), + 'country' => sanitize_text_field( $request['data']['geo']['country_code'] ), + 'postal' => sanitize_text_field( $request['data']['geo']['postal_code'] ), + ); + + return $data; + } + } + + return array(); + } + + /** + * This routine calculates the distance between two points (given the latitude/longitude of those points). + * Definitions: South latitudes are negative, east longitudes are positive. + * + * @see https://www.geodatasource.com/developers/php + * + * @since 1.5.0 + * + * @param float $lat1 Latitude of point 1 (in decimal degrees). + * @param float $lon1 Longitude of point 1 (in decimal degrees). + * @param float $lat2 Latitude of point 2 (in decimal degrees). + * @param float $lon2 Longitude of point 2 (in decimal degrees). + * @param string $unit Supported values: M, K, N. Miles by default. + * + * @return float|int + */ + public static function get_distance_between( $lat1, $lon1, $lat2, $lon2, $unit = 'M' ) { + + if ( ( $lat1 === $lat2 ) && ( $lon1 === $lon2 ) ) { + return 0; + } + + $theta = $lon1 - $lon2; + $dist = sin( deg2rad( $lat1 ) ) * sin( deg2rad( $lat2 ) ) + cos( deg2rad( $lat1 ) ) * cos( deg2rad( $lat2 ) ) * cos( deg2rad( $theta ) ); + $dist = acos( $dist ); + $dist = rad2deg( $dist ); + $miles = $dist * 60 * 1.1515; + $unit = strtoupper( $unit ); + + if ( $unit === 'K' ) { + return ( $miles * 1.609344 ); + } elseif ( $unit === 'N' ) { + return ( $miles * 0.8684 ); + } + + return $miles; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/MailCatcher.php b/wp-content/plugins/wp-mail-smtp/src/MailCatcher.php new file mode 100644 index 0000000..72efda3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/MailCatcher.php @@ -0,0 +1,145 @@ +get( 'mail', 'mailer' ) ); + + $is_emailing_blocked = false; + + if ( wp_mail_smtp()->is_blocked() ) { + $is_emailing_blocked = true; + } + + // Always allow a test email - check for the specific header. + foreach ( (array) $this->getCustomHeaders() as $header ) { + if ( + ! empty( $header[0] ) && + ! empty( $header[1] ) && + $header[0] === 'X-Mailer-Type' && + trim( $header[1] ) === 'WPMailSMTP/Admin/Test' + ) { + $is_emailing_blocked = false; + } + }; + + // Do not send emails if admin desired that. + if ( $is_emailing_blocked ) { + return false; + } + + // Define a custom header, that will be used to identify the plugin and the mailer. + $this->XMailer = 'WPMailSMTP/Mailer/' . $mail_mailer . ' ' . WPMS_PLUGIN_VER; + + // Use the default PHPMailer, as we inject our settings there for certain providers. + if ( + $mail_mailer === 'mail' || + $mail_mailer === 'smtp' || + $mail_mailer === 'pepipost' + ) { + try { + // Prepare all the headers. + if ( ! $this->preSend() ) { + return false; + } + + // Allow to hook after all the preparation before the actual sending. + do_action( 'wp_mail_smtp_mailcatcher_smtp_send_before', $this ); + + return $this->postSend(); + } catch ( \phpmailerException $e ) { + $this->mailHeader = ''; + $this->setError( $e->getMessage() ); + if ( $this->exceptions ) { + throw $e; + } + + return false; + } + } + + // We need this so that the \PHPMailer class will correctly prepare all the headers. + $this->Mailer = 'mail'; + + // Prepare everything (including the message) for sending. + if ( ! $this->preSend() ) { + return false; + } + + $mailer = wp_mail_smtp()->get_providers()->get_mailer( $mail_mailer, $this ); + + if ( ! $mailer ) { + return false; + } + + if ( ! $mailer->is_php_compatible() ) { + return false; + } + + /* + * Send the actual email. + * We reuse everything, that was preprocessed for usage in \PHPMailer. + */ + $mailer->send(); + + $is_sent = $mailer->is_email_sent(); + + // Allow to perform any actions with the data. + do_action( 'wp_mail_smtp_mailcatcher_send_after', $mailer, $this ); + + return $is_sent; + } + + /** + * Returns all custom headers. + * In older versions of \PHPMailer class this method didn't exist. + * As we support WordPress 3.6+ - we need to make sure this method is always present. + * + * @since 1.5.0 + * + * @return array + */ + public function getCustomHeaders() { + + return $this->CustomHeader; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Migration.php b/wp-content/plugins/wp-mail-smtp/src/Migration.php new file mode 100644 index 0000000..80cdaa0 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Migration.php @@ -0,0 +1,257 @@ +is_migrated() ) { + return; + } + + $this->old_values = $this->get_old_values(); + $this->new_values = $this->get_converted_options(); + + Options::init()->set( $this->new_values, true ); + + // Removing all old options will be enabled some time in the future. + // $this->clean_deprecated_data(); + } + + /** + * Whether we already migrated or not. + * + * @since 1.0.0 + * + * @return bool + */ + protected function is_migrated() { + + $is_migrated = false; + $new_values = get_option( Options::META_KEY, array() ); + + if ( ! empty( $new_values ) ) { + $is_migrated = true; + } + + return $is_migrated; + } + + /** + * Get all old values from DB. + * + * @since 1.0.0 + * + * @return array + */ + protected function get_old_values() { + + $old_values = array(); + + foreach ( $this->old_keys as $old_key ) { + $value = get_option( $old_key, '' ); + + if ( ! empty( $value ) ) { + $old_values[ $old_key ] = $value; + } + } + + return $old_values; + } + + /** + * Convert old values from key=>value to a multidimensional array of data. + * + * @since 1.0.0 + */ + protected function get_converted_options() { + + $converted = array(); + + foreach ( $this->old_keys as $old_key ) { + + $old_value = isset( $this->old_values[ $old_key ] ) ? $this->old_values[ $old_key ] : ''; + + switch ( $old_key ) { + case 'pepipost_user': + case 'pepipost_pass': + case 'pepipost_port': + case 'pepipost_ssl': + // Do not migrate pepipost options if it's not activated at the moment. + if ( isset( $this->old_values['mailer'] ) && $this->old_values['mailer'] === 'pepipost' ) { + $shortcut = explode( '_', $old_key ); + + if ( $old_key === 'pepipost_ssl' ) { + $converted[ $shortcut[0] ]['encryption'] = $old_value; + } else { + $converted[ $shortcut[0] ][ $shortcut[1] ] = $old_value; + } + } + break; + + case 'smtp_host': + case 'smtp_port': + case 'smtp_ssl': + case 'smtp_auth': + case 'smtp_user': + case 'smtp_pass': + $shortcut = explode( '_', $old_key ); + + if ( $old_key === 'smtp_ssl' ) { + $converted[ $shortcut[0] ]['encryption'] = $old_value; + } elseif ( $old_key === 'smtp_auth' ) { + $converted[ $shortcut[0] ][ $shortcut[1] ] = ( $old_value === 'true' ? 'yes' : 'no' ); + } else { + $converted[ $shortcut[0] ][ $shortcut[1] ] = $old_value; + } + + break; + + case 'mail_from': + $converted['mail']['from_email'] = $old_value; + break; + case 'mail_from_name': + $converted['mail']['from_name'] = $old_value; + break; + case 'mail_set_return_path': + $converted['mail']['return_path'] = ( $old_value === 'true' ); + break; + case 'mailer': + $converted['mail']['mailer'] = $old_value; + break; + case 'wp_mail_smtp_am_notifications_hidden': + $converted['general']['am_notifications_hidden'] = ( isset( $old_value ) && $old_value === 'true' ); + break; + } + } + + $converted = $this->get_converted_constants_options( $converted ); + + return $converted; + } + + /** + * Some users use constants in wp-config.php to define values. + * We need to prioritize them and reapply data to options. + * Use only those that are actually defined. + * + * @since 1.0.0 + * + * @param array $converted + * + * @return array + */ + protected function get_converted_constants_options( $converted ) { + + // Are we configured via constants? + if ( ! defined( 'WPMS_ON' ) || ! WPMS_ON ) { + return $converted; + } + + /* + * Mail settings. + */ + if ( defined( 'WPMS_MAIL_FROM' ) ) { + $converted['mail']['from_email'] = WPMS_MAIL_FROM; + } + if ( defined( 'WPMS_MAIL_FROM_NAME' ) ) { + $converted['mail']['from_name'] = WPMS_MAIL_FROM_NAME; + } + if ( defined( 'WPMS_MAILER' ) ) { + $converted['mail']['mailer'] = WPMS_MAILER; + } + if ( defined( 'WPMS_SET_RETURN_PATH' ) ) { + $converted['mail']['return_path'] = WPMS_SET_RETURN_PATH; + } + + /* + * SMTP settings. + */ + if ( defined( 'WPMS_SMTP_HOST' ) ) { + $converted['smtp']['host'] = WPMS_SMTP_HOST; + } + if ( defined( 'WPMS_SMTP_PORT' ) ) { + $converted['smtp']['port'] = WPMS_SMTP_PORT; + } + if ( defined( 'WPMS_SSL' ) ) { + $converted['smtp']['ssl'] = WPMS_SSL; + } + if ( defined( 'WPMS_SMTP_AUTH' ) ) { + $converted['smtp']['auth'] = WPMS_SMTP_AUTH; + } + if ( defined( 'WPMS_SMTP_USER' ) ) { + $converted['smtp']['user'] = WPMS_SMTP_USER; + } + if ( defined( 'WPMS_SMTP_PASS' ) ) { + $converted['smtp']['pass'] = WPMS_SMTP_PASS; + } + + return $converted; + } + + /** + * Delete all old values that are stored separately each. + * + * @since 1.0.0 + */ + protected function clean_deprecated_data() { + + foreach ( $this->old_keys as $old_key ) { + delete_option( $old_key ); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Options.php b/wp-content/plugins/wp-mail-smtp/src/Options.php new file mode 100644 index 0000000..81800d1 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Options.php @@ -0,0 +1,937 @@ + array( + 'from_name', + 'from_email', + 'mailer', + 'return_path', + 'from_name_force', + 'from_email_force', + ), + 'smtp' => array( + 'host', + 'port', + 'encryption', + 'autotls', + 'auth', + 'user', + 'pass', + ), + 'gmail' => array( + 'client_id', + 'client_secret', + ), + 'outlook' => array( + 'client_id', + 'client_secret', + ), + 'amazonses' => array( + 'client_id', + 'client_secret', + 'region', + 'emails_pending', + ), + 'mailgun' => array( + 'api_key', + 'domain', + 'region', + ), + 'sendgrid' => array( + 'api_key', + ), + 'sendinblue' => array( + 'api_key', + ), + 'pepipostapi' => array( + 'api_key', + ), + 'pepipost' => array( + 'host', + 'port', + 'encryption', + 'auth', + 'user', + 'pass', + ), + 'license' => array( + 'key', + ), + ); + + /** + * That's where plugin options are saved in wp_options table. + * + * @var string + */ + const META_KEY = 'wp_mail_smtp'; + + /** + * All the plugin options. + * + * @var array + */ + private $_options = array(); + + /** + * Init the Options class. + * TODO: add a flag to process without retrieving const values. + * + * @since 1.0.0 + */ + public function __construct() { + $this->populate_options(); + } + + /** + * Initialize all the options, used for chaining. + * + * One-liner: + * Options::init()->get('smtp', 'host'); + * Options::init()->is_pepipost_active(); + * + * Or multiple-usage: + * $options = new Options(); + * $options->get('smtp', 'host'); + * + * @since 1.0.0 + * + * @return Options + */ + public static function init() { + + static $instance; + + if ( ! $instance ) { + $instance = new self(); + } + + return $instance; + } + + /** + * Default options that are saved on plugin activation. + * + * @since 1.3.0 + * + * @return array + */ + public static function get_defaults() { + + return array( + 'mail' => array( + 'from_email' => get_option( 'admin_email' ), + 'from_name' => get_bloginfo( 'name' ), + 'mailer' => 'mail', + 'return_path' => false, + 'from_email_force' => false, + 'from_name_force' => false, + ), + 'smtp' => array( + 'autotls' => true, + 'auth' => true, + ), + ); + } + + /** + * Retrieve all options of the plugin. + * + * @since 1.0.0 + */ + protected function populate_options() { + $this->_options = get_option( self::META_KEY, array() ); + } + + /** + * Get all the options. + * + * Options::init()->get_all(); + * + * @since 1.0.0 + * + * @return array + */ + public function get_all() { + + $options = $this->_options; + + foreach ( $options as $group => $g_value ) { + foreach ( $g_value as $key => $value ) { + $options[ $group ][ $key ] = $this->get( $group, $key ); + } + } + + return apply_filters( 'wp_mail_smtp_options_get_all', $options ); + } + + /** + * Get all the options for a group. + * + * Options::init()->get_group('smtp') - will return the array of options for the group, including defaults and constants. + * + * @since 1.0.0 + * @since 1.5.0 Process values through the get() method which is aware of constants. + * + * @param string $group + * + * @return array + */ + public function get_group( $group ) { + + // Just to feel safe. + $group = sanitize_key( $group ); + + /* + * Get the values saved in DB. + * If plugin is configured with constants right from the start - this will not have all the values. + */ + $options = isset( $this->_options[ $group ] ) ? $this->_options[ $group ] : array(); + + // We need to process certain constants-aware options through actual constants. + if ( isset( self::$map[ $group ] ) ) { + foreach ( self::$map[ $group ] as $key ) { + $options[ $key ] = $this->get( $group, $key ); + } + } + + return apply_filters( 'wp_mail_smtp_options_get_group', $options, $group ); + } + + /** + * Get options by a group and a key. + * + * Options::init()->get( 'smtp', 'host' ) - will return only SMTP 'host' option. + * + * @since 1.0.0 + * + * @param string $group + * @param string $key + * + * @return mixed|null Null if value doesn't exist anywhere: in constants, in DB, in a map. So it's completely custom or a typo. + */ + public function get( $group, $key ) { + + // Just to feel safe. + $group = sanitize_key( $group ); + $key = sanitize_key( $key ); + $value = null; + + // Get the const value if we have one. + $value = $this->get_const_value( $group, $key, $value ); + + // We don't have a const value. + if ( $value === null ) { + // Ordinary database or default values. + if ( isset( $this->_options[ $group ] ) ) { + // Get the options key of a group. + if ( isset( $this->_options[ $group ][ $key ] ) ) { + $value = $this->_options[ $group ][ $key ]; + } else { + $value = $this->postprocess_key_defaults( $group, $key ); + } + } else { + /* + * Fallback to default if it doesn't exist in a map. + * Allow to retrieve only values from a map. + */ + if ( + isset( self::$map[ $group ] ) && + in_array( $key, self::$map[ $group ], true ) + ) { + $value = $this->postprocess_key_defaults( $group, $key ); + } + } + } + + // Strip slashes only from values saved in DB. Constants should be processed as is. + if ( is_string( $value ) && ! $this->is_const_defined( $group, $key ) ) { + $value = stripslashes( $value ); + } + + return apply_filters( 'wp_mail_smtp_options_get', $value, $group, $key ); + } + + /** + * Some options may be non-empty by default, + * so we need to postprocess them to convert. + * + * @since 1.0.0 + * @since 1.4.0 Added Mailgun:region. + * @since 1.5.0 Added Outlook/AmazonSES, license key support. + * + * @param string $group + * @param string $key + * + * @return mixed + */ + protected function postprocess_key_defaults( $group, $key ) { + + $value = ''; + + switch ( $key ) { + case 'from_email_force': + case 'from_name_force': + case 'return_path': + $value = $group === 'mail' ? false : true; + break; + + case 'mailer': + $value = 'mail'; + break; + + case 'encryption': + $value = in_array( $group, array( 'smtp', 'pepipost' ), true ) ? 'none' : $value; + break; + + case 'region': + $value = $group === 'mailgun' ? 'US' : $value; + break; + + case 'emails_pending': + $value = array(); + break; + + case 'auth': + case 'autotls': + $value = in_array( $group, array( 'smtp', 'pepipost' ), true ) ? false : true; + break; + + case 'pass': + $value = $this->get_const_value( $group, $key, $value ); + break; + + case 'type': + $value = $group === 'license' ? 'lite' : ''; + break; + } + + return apply_filters( 'wp_mail_smtp_options_postprocess_key_defaults', $value, $group, $key ); + } + + /** + * Process the options values through the constants check. + * If we have defined associated constant - use it instead of a DB value. + * Backward compatibility is hard. + * General section of options won't have constants, so we are omitting those checks and just return default value. + * + * @since 1.0.0 + * @since 1.4.0 Added WPMS_MAILGUN_REGION. + * @since 1.5.0 Added Outlook/AmazonSES, license key support. + * @since 1.6.0 Added Sendinblue. + * @since 1.7.0 Added Do Not Send. + * @since 1.8.0 Added Pepipost API. + * + * @param string $group + * @param string $key + * @param mixed $value + * + * @return mixed + */ + protected function get_const_value( $group, $key, $value ) { + + if ( ! $this->is_const_enabled() ) { + return $value; + } + + $return = null; + + switch ( $group ) { + case 'mail': + switch ( $key ) { + case 'from_name': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_MAIL_FROM_NAME : $value; + break; + case 'from_email': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_MAIL_FROM : $value; + break; + case 'mailer': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_MAILER : $value; + break; + case 'return_path': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_SET_RETURN_PATH : $value; + break; + case 'from_name_force': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_MAIL_FROM_NAME_FORCE : $value; + break; + case 'from_email_force': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_MAIL_FROM_FORCE : $value; + break; + } + + break; + + case 'smtp': + switch ( $key ) { + case 'host': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_HOST : $value; + break; + case 'port': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_PORT : $value; + break; + case 'encryption': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? ( WPMS_SSL === '' ? 'none' : WPMS_SSL ) : $value; + break; + case 'auth': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_AUTH : $value; + break; + case 'autotls': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_AUTOTLS : $value; + break; + case 'user': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_USER : $value; + break; + case 'pass': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_SMTP_PASS : $value; + break; + } + + break; + + case 'gmail': + switch ( $key ) { + case 'client_id': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_GMAIL_CLIENT_ID : $value; + break; + case 'client_secret': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_GMAIL_CLIENT_SECRET : $value; + break; + } + + break; + + case 'outlook': + switch ( $key ) { + case 'client_id': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_OUTLOOK_CLIENT_ID : $value; + break; + case 'client_secret': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_OUTLOOK_CLIENT_SECRET : $value; + break; + } + + break; + + case 'amazonses': + switch ( $key ) { + case 'client_id': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_AMAZONSES_CLIENT_ID : $value; + break; + case 'client_secret': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_AMAZONSES_CLIENT_SECRET : $value; + break; + case 'region': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_AMAZONSES_REGION : $value; + break; + } + + break; + + case 'mailgun': + switch ( $key ) { + case 'api_key': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_MAILGUN_API_KEY : $value; + break; + case 'domain': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_MAILGUN_DOMAIN : $value; + break; + case 'region': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_MAILGUN_REGION : $value; + break; + } + + break; + + case 'sendgrid': + switch ( $key ) { + case 'api_key': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_SENDGRID_API_KEY : $value; + break; + } + + break; + + case 'sendinblue': + switch ( $key ) { + case 'api_key': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_SENDINBLUE_API_KEY : $value; + break; + } + + break; + + case 'pepipostapi': + switch ( $key ) { + case 'api_key': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_PEPIPOST_API_KEY : $value; + break; + } + + break; + + case 'license': + switch ( $key ) { + case 'key': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_LICENSE_KEY : $value; + break; + } + + break; + + case 'general': + switch ( $key ) { + case 'do_not_send': + /** @noinspection PhpUndefinedConstantInspection */ + $return = $this->is_const_defined( $group, $key ) ? WPMS_DO_NOT_SEND : $value; + break; + } + + break; + + default: + // Always return the default value if nothing from above matches the request. + $return = $value; + } + + return apply_filters( 'wp_mail_smtp_options_get_const_value', $return, $group, $key, $value ); + } + + /** + * Whether constants redefinition is enabled or not. + * + * @since 1.0.0 + * @since 1.5.0 Added filter to redefine the value. + * + * @return bool + */ + public function is_const_enabled() { + + $return = defined( 'WPMS_ON' ) && WPMS_ON === true; + + return apply_filters( 'wp_mail_smtp_options_is_const_enabled', $return ); + } + + /** + * We need this check to reuse later in admin area, + * to distinguish settings fields that were redefined, + * and display them differently. + * + * @since 1.0.0 + * @since 1.5.0 Added a filter, Outlook/AmazonSES, license key support. + * @since 1.6.0 Added Sendinblue. + * @since 1.7.0 Added Do Not Send. + * @since 1.8.0 Added Pepipost API. + * + * @param string $group + * @param string $key + * + * @return bool + */ + public function is_const_defined( $group, $key ) { + + if ( ! $this->is_const_enabled() ) { + return false; + } + + // Just to feel safe. + $group = sanitize_key( $group ); + $key = sanitize_key( $key ); + $return = false; + + switch ( $group ) { + case 'mail': + switch ( $key ) { + case 'from_name': + $return = defined( 'WPMS_MAIL_FROM_NAME' ) && WPMS_MAIL_FROM_NAME; + break; + case 'from_email': + $return = defined( 'WPMS_MAIL_FROM' ) && WPMS_MAIL_FROM; + break; + case 'mailer': + $return = defined( 'WPMS_MAILER' ) && WPMS_MAILER; + break; + case 'return_path': + $return = defined( 'WPMS_SET_RETURN_PATH' ) && ( WPMS_SET_RETURN_PATH === 'true' || WPMS_SET_RETURN_PATH === true ); + break; + case 'from_name_force': + $return = defined( 'WPMS_MAIL_FROM_NAME_FORCE' ) && ( WPMS_MAIL_FROM_NAME_FORCE === 'true' || WPMS_MAIL_FROM_NAME_FORCE === true ); + break; + case 'from_email_force': + $return = defined( 'WPMS_MAIL_FROM_FORCE' ) && ( WPMS_MAIL_FROM_FORCE === 'true' || WPMS_MAIL_FROM_FORCE === true ); + break; + } + + break; + + case 'smtp': + switch ( $key ) { + case 'host': + $return = defined( 'WPMS_SMTP_HOST' ) && WPMS_SMTP_HOST; + break; + case 'port': + $return = defined( 'WPMS_SMTP_PORT' ) && WPMS_SMTP_PORT; + break; + case 'encryption': + $return = defined( 'WPMS_SSL' ); + break; + case 'auth': + $return = defined( 'WPMS_SMTP_AUTH' ) && WPMS_SMTP_AUTH; + break; + case 'autotls': + $return = defined( 'WPMS_SMTP_AUTOTLS' ) && ( WPMS_SMTP_AUTOTLS === 'true' || WPMS_SMTP_AUTOTLS === true ); + break; + case 'user': + $return = defined( 'WPMS_SMTP_USER' ) && WPMS_SMTP_USER; + break; + case 'pass': + $return = defined( 'WPMS_SMTP_PASS' ) && WPMS_SMTP_PASS; + break; + } + + break; + + case 'gmail': + switch ( $key ) { + case 'client_id': + $return = defined( 'WPMS_GMAIL_CLIENT_ID' ) && WPMS_GMAIL_CLIENT_ID; + break; + case 'client_secret': + $return = defined( 'WPMS_GMAIL_CLIENT_SECRET' ) && WPMS_GMAIL_CLIENT_SECRET; + break; + } + + break; + + case 'outlook': + switch ( $key ) { + case 'client_id': + $return = defined( 'WPMS_OUTLOOK_CLIENT_ID' ) && WPMS_OUTLOOK_CLIENT_ID; + break; + case 'client_secret': + $return = defined( 'WPMS_OUTLOOK_CLIENT_SECRET' ) && WPMS_OUTLOOK_CLIENT_SECRET; + break; + } + + break; + + case 'amazonses': + switch ( $key ) { + case 'client_id': + $return = defined( 'WPMS_AMAZONSES_CLIENT_ID' ) && WPMS_AMAZONSES_CLIENT_ID; + break; + case 'client_secret': + $return = defined( 'WPMS_AMAZONSES_CLIENT_SECRET' ) && WPMS_AMAZONSES_CLIENT_SECRET; + break; + case 'region': + $return = defined( 'WPMS_AMAZONSES_REGION' ) && WPMS_AMAZONSES_REGION; + break; + } + + break; + + case 'mailgun': + switch ( $key ) { + case 'api_key': + $return = defined( 'WPMS_MAILGUN_API_KEY' ) && WPMS_MAILGUN_API_KEY; + break; + case 'domain': + $return = defined( 'WPMS_MAILGUN_DOMAIN' ) && WPMS_MAILGUN_DOMAIN; + break; + case 'region': + $return = defined( 'WPMS_MAILGUN_REGION' ) && WPMS_MAILGUN_REGION; + break; + } + + break; + + case 'sendgrid': + switch ( $key ) { + case 'api_key': + $return = defined( 'WPMS_SENDGRID_API_KEY' ) && WPMS_SENDGRID_API_KEY; + break; + } + + break; + + case 'sendinblue': + switch ( $key ) { + case 'api_key': + $return = defined( 'WPMS_SENDINBLUE_API_KEY' ) && WPMS_SENDINBLUE_API_KEY; + break; + } + + break; + + case 'pepipostapi': + switch ( $key ) { + case 'api_key': + $return = defined( 'WPMS_PEPIPOST_API_KEY' ) && WPMS_PEPIPOST_API_KEY; + break; + } + + break; + + case 'license': + switch ( $key ) { + case 'key': + $return = defined( 'WPMS_LICENSE_KEY' ) && WPMS_LICENSE_KEY; + break; + } + + break; + + case 'general': + switch ( $key ) { + case 'do_not_send': + /** @noinspection PhpUndefinedConstantInspection */ + $return = defined( 'WPMS_DO_NOT_SEND' ) && WPMS_DO_NOT_SEND; + break; + } + + break; + } + + return apply_filters( 'wp_mail_smtp_options_is_const_defined', $return, $group, $key ); + } + + /** + * Set plugin options, all at once. + * + * @since 1.0.0 + * @since 1.3.0 Added $once argument to save options only if they don't exist already. + * @since 1.4.0 Added Mailgun:region. + * @since 1.5.0 Added Outlook/AmazonSES, Email Log. Stop saving const values into DB. + * + * @param array $options Plugin options to save. + * @param bool $once Whether to update existing options or to add these options only once. + */ + public function set( $options, $once = false ) { + /* + * Process generic options. + */ + foreach ( (array) $options as $group => $keys ) { + foreach ( $keys as $option_name => $option_value ) { + switch ( $group ) { + case 'mail': + switch ( $option_name ) { + case 'from_name': + case 'mailer': + $options[ $group ][ $option_name ] = sanitize_text_field( $option_value ); + break; + case 'from_email': + if ( filter_var( $option_value, FILTER_VALIDATE_EMAIL ) ) { + $options[ $group ][ $option_name ] = sanitize_email( $option_value ); + } else { + $options[ $group ][ $option_name ] = sanitize_email( + wp_mail_smtp()->get_processor()->get_default_email() + ); + } + break; + case 'return_path': + case 'from_name_force': + case 'from_email_force': + $options[ $group ][ $option_name ] = (bool) $option_value; + break; + } + break; + + case 'general': + switch ( $option_name ) { + case 'do_not_send': + case 'am_notifications_hidden': + case 'email_delivery_errors_hidden': + case 'uninstall': + $options[ $group ][ $option_name ] = (bool) $option_value; + break; + } + } + } + } + + /* + * Process mailers-specific options. + */ + if ( + ! empty( $options['mail']['mailer'] ) && + isset( $options[ $options['mail']['mailer'] ] ) && + in_array( $options['mail']['mailer'], array( 'pepipost', 'pepipostapi', 'smtp', 'sendgrid', 'sendinblue', 'mailgun', 'gmail', 'outlook' ), true ) + ) { + + $mailer = $options['mail']['mailer']; + + foreach ( $options[ $mailer ] as $option_name => $option_value ) { + switch ( $option_name ) { + case 'host': // smtp. + case 'user': // smtp. + case 'encryption': // smtp. + case 'region': // mailgun/amazonses. + $options[ $mailer ][ $option_name ] = $this->is_const_defined( $mailer, $option_name ) ? '' : sanitize_text_field( $option_value ); + break; // smtp. + case 'port': + $options[ $mailer ][ $option_name ] = $this->is_const_defined( $mailer, $option_name ) ? 25 : (int) $option_value; + break; + case 'auth': // smtp. + case 'autotls': // smtp. + $option_value = (bool) $option_value; + + $options[ $mailer ][ $option_name ] = $this->is_const_defined( $mailer, $option_name ) ? false : $option_value; + break; + + case 'pass': // smtp. + // Do not process as they may contain certain special characters, but allow to be overwritten using constants. + $options[ $mailer ][ $option_name ] = $this->is_const_defined( $mailer, $option_name ) ? '' : trim( (string) $option_value ); + break; + + case 'api_key': // mailgun/sendgrid/sendinblue/pepipostapi. + case 'domain': // mailgun. + case 'client_id': // gmail/outlook/amazonses. + case 'client_secret': // gmail/outlook/amazonses. + case 'auth_code': // gmail/outlook. + $options[ $mailer ][ $option_name ] = $this->is_const_defined( $mailer, $option_name ) ? '' : sanitize_text_field( $option_value ); + break; + + case 'access_token': // gmail/outlook, array(). + case 'user_details': // outlook, array(). + case 'emails_pending': // amazonses, array(). + // These options don't support constants. + $options[ $mailer ][ $option_name ] = $option_value; + break; + } + } + } + + $options = apply_filters( 'wp_mail_smtp_options_set', $options ); + + // Whether to update existing options or to add these options only once if they don't exist yet. + if ( $once ) { + add_option( self::META_KEY, $options, '', 'no' ); // Do not autoload these options. + } else { + update_option( self::META_KEY, $options, 'no' ); + } + + // Now we need to re-cache values. + $this->populate_options(); + } + + /** + * Merge recursively, including a proper substitution of values in sub-arrays when keys are the same. + * It's more like array_merge() and array_merge_recursive() combined. + * + * @since 1.0.0 + * + * @return array + */ + public static function array_merge_recursive() { + + $arrays = func_get_args(); + + if ( count( $arrays ) < 2 ) { + return isset( $arrays[0] ) ? $arrays[0] : array(); + } + + $merged = array(); + + while ( $arrays ) { + $array = array_shift( $arrays ); + + if ( ! is_array( $array ) ) { + return array(); + } + + if ( empty( $array ) ) { + continue; + } + + foreach ( $array as $key => $value ) { + if ( is_string( $key ) ) { + if ( + is_array( $value ) && + array_key_exists( $key, $merged ) && + is_array( $merged[ $key ] ) + ) { + $merged[ $key ] = call_user_func( __METHOD__, $merged[ $key ], $value ); + } else { + $merged[ $key ] = $value; + } + } else { + $merged[] = $value; + } + } + } + + return $merged; + } + + /** + * Check whether the site is using Pepipost SMTP or not. + * + * @since 1.0.0 + * + * @return bool + */ + public function is_pepipost_active() { + return apply_filters( 'wp_mail_smtp_options_is_pepipost_active', $this->get( 'mail', 'mailer' ) === 'pepipost' ); + } + + /** + * Check whether the site is using Pepipost/SMTP as a mailer or not. + * + * @since 1.1.0 + * + * @return bool + */ + public function is_mailer_smtp() { + return apply_filters( 'wp_mail_smtp_options_is_mailer_smtp', in_array( $this->get( 'mail', 'mailer' ), array( 'pepipost', 'smtp' ), true ) ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Processor.php b/wp-content/plugins/wp-mail-smtp/src/Processor.php new file mode 100644 index 0000000..96b15d4 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Processor.php @@ -0,0 +1,252 @@ +hooks(); + } + + /** + * Assign all hooks to proper places. + * + * @since 1.0.0 + */ + public function hooks() { + + add_action( 'phpmailer_init', array( $this, 'phpmailer_init' ) ); + + add_filter( 'wp_mail_from', array( $this, 'filter_mail_from_email' ), 1000 ); + add_filter( 'wp_mail_from_name', array( $this, 'filter_mail_from_name' ), 1000 ); + } + + /** + * Redefine certain PHPMailer options with our custom ones. + * + * @since 1.0.0 + * + * @param \PHPMailer $phpmailer It's passed by reference, so no need to return anything. + */ + public function phpmailer_init( $phpmailer ) { + + $options = new Options(); + $mailer = $options->get( 'mail', 'mailer' ); + + // Check that mailer is not blank, and if mailer=smtp, host is not blank. + if ( + ! $mailer || + ( 'smtp' === $mailer && ! $options->get( 'smtp', 'host' ) ) + ) { + return; + } + + // If the mailer is pepipost, make sure we have a username and password. + if ( + 'pepipost' === $mailer && + ( ! $options->get( 'pepipost', 'user' ) && ! $options->get( 'pepipost', 'pass' ) ) + ) { + return; + } + + // Set the mailer type as per config above, this overrides the already called isMail method. + // It's basically always 'smtp'. + $phpmailer->Mailer = $mailer; + + // Set the Sender (return-path) if required. + if ( $options->get( 'mail', 'return_path' ) ) { + $phpmailer->Sender = $phpmailer->From; + } + + // Set the SMTPSecure value, if set to none, leave this blank. Possible values: 'ssl', 'tls', ''. + if ( 'none' === $options->get( $mailer, 'encryption' ) ) { + $phpmailer->SMTPSecure = ''; + } else { + $phpmailer->SMTPSecure = $options->get( $mailer, 'encryption' ); + } + + // Check if user has disabled SMTPAutoTLS. + if ( $options->get( $mailer, 'encryption' ) !== 'tls' && ! $options->get( $mailer, 'autotls' ) ) { + $phpmailer->SMTPAutoTLS = false; + } + + // If we're sending via SMTP, set the host. + if ( 'smtp' === $mailer ) { + // Set the other options. + $phpmailer->Host = $options->get( $mailer, 'host' ); + $phpmailer->Port = $options->get( $mailer, 'port' ); + + // If we're using smtp auth, set the username & password. + if ( $options->get( $mailer, 'auth' ) ) { + $phpmailer->SMTPAuth = true; + $phpmailer->Username = $options->get( $mailer, 'user' ); + $phpmailer->Password = $options->get( $mailer, 'pass' ); + } + } elseif ( 'pepipost' === $mailer ) { + // Set the Pepipost settings for BC. + $phpmailer->Mailer = 'smtp'; + $phpmailer->Host = 'smtp.pepipost.com'; + $phpmailer->Port = $options->get( $mailer, 'port' ); + $phpmailer->SMTPSecure = $options->get( $mailer, 'encryption' ) === 'none' ? '' : $options->get( $mailer, 'encryption' ); + $phpmailer->SMTPAuth = true; + $phpmailer->Username = $options->get( $mailer, 'user' ); + $phpmailer->Password = $options->get( $mailer, 'pass' ); + } + + // You can add your own options here. + // See the phpmailer documentation for more info: https://github.com/PHPMailer/PHPMailer/tree/5.2-stable. + /** @noinspection PhpUnusedLocalVariableInspection It's passed by reference. */ + $phpmailer = apply_filters( 'wp_mail_smtp_custom_options', $phpmailer ); + } + + /** + * This method will be called every time 'smtp' and 'mail' mailers will be used to send emails. + * + * @since 1.3.0 + * @since 1.5.0 Added a do_action() to be able to hook into. + * + * @param bool $is_sent + * @param array $to + * @param array $cc + * @param array $bcc + * @param string $subject + * @param string $body + * @param string $from + */ + public static function send_callback( $is_sent, $to, $cc, $bcc, $subject, $body, $from ) { + + if ( ! $is_sent ) { + // Add mailer to the beginning and save to display later. + Debug::set( + 'Mailer: ' . esc_html( wp_mail_smtp()->get_providers()->get_options( Options::init()->get( 'mail', 'mailer' ) )->get_title() ) . "\r\n" . + 'PHPMailer was able to connect to SMTP server but failed while trying to send an email.' + ); + } else { + Debug::clear(); + } + + do_action( 'wp_mail_smtp_mailcatcher_smtp_send_after', $is_sent, $to, $cc, $bcc, $subject, $body, $from ); + } + + /** + * Modify the email address that is used for sending emails. + * + * @since 1.0.0 + * @since 1.3.0 Forcing email rewrite if option is selected. + * @since 1.7.0 Default email may be empty, so pay attention to that as well. + * + * @param string $wp_email + * + * @return string + */ + public function filter_mail_from_email( $wp_email ) { + + $options = new Options(); + $forced = $options->get( 'mail', 'from_email_force' ); + $from_email = $options->get( 'mail', 'from_email' ); + $def_email = $this->get_default_email(); + + // Return FROM EMAIL if forced in settings. + if ( $forced & ! empty( $from_email ) ) { + return $from_email; + } + + // If the FROM EMAIL is not the default, return it unchanged. + if ( ! empty( $def_email ) && $wp_email !== $def_email ) { + return $wp_email; + } + + return ! empty( $from_email ) ? $from_email : $wp_email; + } + + /** + * Modify the sender name that is used for sending emails. + * + * @since 1.0.0 + * @since 1.3.0 Forcing name rewrite if option is selected. + * + * @param string $name + * + * @return string + */ + public function filter_mail_from_name( $name ) { + + $options = new Options(); + $force = $options->get( 'mail', 'from_name_force' ); + + // If the FROM NAME is not the default and not forced, return it unchanged. + if ( ! $force && $name !== $this->get_default_name() ) { + return $name; + } + + $name = $options->get( 'mail', 'from_name' ); + + return $name; + } + + /** + * Get the default email address based on domain name. + * + * @since 1.0.0 + * @since 1.7.0 May return an empty string. + * + * @return string Empty string when we aren't able to get the site domain (CLI, misconfigured server etc). + */ + public function get_default_email() { + + $server_name = Geo::get_site_domain(); + + if ( empty( $server_name ) ) { + return ''; + } + + // Get rid of www. + $sitename = strtolower( $server_name ); + if ( substr( $sitename, 0, 4 ) === 'www.' ) { + $sitename = substr( $sitename, 4 ); + } + + return 'wordpress@' . $sitename; + } + + /** + * Get the default email FROM NAME generated by WordPress. + * + * @since 1.3.0 + * + * @return string + */ + public function get_default_name() { + return 'WordPress'; + } + + /** + * Get or create the phpmailer. + * + * @since {VERSION} + * + * @return \WPMailSMTP\MailCatcher + */ + public function get_phpmailer() { + + global $phpmailer; + + // Make sure the PHPMailer class has been instantiated. + if ( ! is_object( $phpmailer ) || ! is_a( $phpmailer, 'PHPMailer' ) ) { + require_once ABSPATH . WPINC . '/class-phpmailer.php'; + $phpmailer = new MailCatcher( true ); // phpcs:ignore + } + + return $phpmailer; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/AmazonSES/Options.php b/wp-content/plugins/wp-mail-smtp/src/Providers/AmazonSES/Options.php new file mode 100644 index 0000000..0266633 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/AmazonSES/Options.php @@ -0,0 +1,44 @@ + wp_mail_smtp()->assets_url . '/images/providers/aws.svg', + 'slug' => 'amazonses', + 'title' => esc_html__( 'Amazon SES', 'wp-mail-smtp' ), + 'disabled' => true, + ) + ); + } + + /** + * @inheritdoc + */ + public function display_options() { + + ?> + +

        + +

        + + plugin_path . '/vendor/autoload.php'; + } + + /** + * Get the url, that users will be redirected back to finish the OAuth process. + * + * @since 1.0.0 + * + * @return string + */ + public static function get_plugin_auth_url() { + + return add_query_arg( 'tab', 'auth', wp_mail_smtp()->get_admin()->get_admin_page_url() ); + } + + /** + * Update auth code in our DB. + * + * @since 1.0.0 + * + * @param string $code + */ + protected function update_auth_code( $code ) { + + $options = new PluginOptions(); + $all = $options->get_all(); + + // To save in DB. + $all[ $this->mailer_slug ]['auth_code'] = $code; + + // To save in currently retrieved options array. + $this->options['auth_code'] = $code; + + $options->set( $all ); + } + + /** + * Update access token in our DB. + * + * @since 1.0.0 + * + * @param mixed $token + */ + protected function update_access_token( $token ) { + + $options = new PluginOptions(); + $all = $options->get_all(); + + // To save in DB. + $all[ $this->mailer_slug ]['access_token'] = $token; + + // To save in currently retrieved options array. + $this->options['access_token'] = $token; + + $options->set( $all ); + } + + /** + * Update refresh token in our DB. + * + * @since 1.0.0 + * + * @param mixed $token + */ + protected function update_refresh_token( $token ) { + + $options = new PluginOptions(); + $all = $options->get_all(); + + // To save in DB. + $all[ $this->mailer_slug ]['refresh_token'] = $token; + + // To save in currently retrieved options array. + $this->options['refresh_token'] = $token; + + $options->set( $all ); + } + + /** + * @inheritdoc + */ + public function is_clients_saved() { + + return ! empty( $this->options['client_id'] ) && ! empty( $this->options['client_secret'] ); + } + + /** + * @inheritdoc + */ + public function is_auth_required() { + + return empty( $this->options['access_token'] ) || empty( $this->options['refresh_token'] ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/AuthInterface.php b/wp-content/plugins/wp-mail-smtp/src/Providers/AuthInterface.php new file mode 100644 index 0000000..24369ab --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/AuthInterface.php @@ -0,0 +1,30 @@ +mailer_slug = $options->get( 'mail', 'mailer' ); + + if ( $this->mailer_slug !== Options::SLUG ) { + return; + } + + $this->options = $options->get_group( $this->mailer_slug ); + + if ( $this->is_clients_saved() ) { + + $this->include_vendor_lib(); + + $this->client = $this->get_client(); + } + } + + /** + * Get the url, that users will be redirected back to finish the OAuth process. + * + * @since 1.5.2 Returned to the old, pre-1.5, structure of the link to preserve BC. + * + * @return string + */ + public static function get_plugin_auth_url() { + + return add_query_arg( + array( + 'page' => Area::SLUG, + 'tab' => 'auth', + ), + admin_url( 'options-general.php' ) + ); + } + + /** + * Init and get the Google Client object. + * + * @since 1.0.0 + * @since 1.5.0 Add ability to apply custom options to the client via a filter. + * + * @return \Google_Client + */ + public function get_client() { + + // Doesn't load client twice + gives ability to overwrite. + if ( ! empty( $this->client ) ) { + return $this->client; + } + + $this->include_vendor_lib(); + + $client = new \Google_Client( + array( + 'client_id' => $this->options['client_id'], + 'client_secret' => $this->options['client_secret'], + 'redirect_uris' => array( + self::get_plugin_auth_url(), + ), + ) + ); + $client->setApplicationName( 'WP Mail SMTP v' . WPMS_PLUGIN_VER ); + $client->setAccessType( 'offline' ); + $client->setApprovalPrompt( 'force' ); + $client->setIncludeGrantedScopes( true ); + // We request only the sending capability, as it's what we only need to do. + $client->setScopes( array( \Google_Service_Gmail::MAIL_GOOGLE_COM ) ); + $client->setRedirectUri( self::get_plugin_auth_url() ); + + // Apply custom options to the client. + $client = apply_filters( 'wp_mail_smtp_providers_gmail_auth_get_client_custom_options', $client ); + + if ( + $this->is_auth_required() && + ! empty( $this->options['auth_code'] ) + ) { + try { + $creds = $client->fetchAccessTokenWithAuthCode( $this->options['auth_code'] ); + } catch ( \Exception $e ) { + $creds['error'] = $e->getMessage(); + Debug::set( + 'Mailer: Gmail' . "\r\n" . + $creds['error'] + ); + } + + // Bail if we have an error. + if ( ! empty( $creds['error'] ) ) { + return $client; + } + + $this->update_access_token( $client->getAccessToken() ); + $this->update_refresh_token( $client->getRefreshToken() ); + } + + if ( ! empty( $this->options['access_token'] ) ) { + $client->setAccessToken( $this->options['access_token'] ); + } + + // Refresh the token if it's expired. + if ( $client->isAccessTokenExpired() ) { + $refresh = $client->getRefreshToken(); + if ( empty( $refresh ) && isset( $this->options['refresh_token'] ) ) { + $refresh = $this->options['refresh_token']; + } + + if ( ! empty( $refresh ) ) { + try { + $creds = $client->fetchAccessTokenWithRefreshToken( $refresh ); + } catch ( \Exception $e ) { + $creds['error'] = $e->getMessage(); + Debug::set( + 'Mailer: Gmail' . "\r\n" . + $e->getMessage() + ); + } + + // Bail if we have an error. + if ( ! empty( $creds['error'] ) ) { + return $client; + } + + $this->update_access_token( $client->getAccessToken() ); + $this->update_refresh_token( $client->getRefreshToken() ); + } + } + + return $client; + } + + /** + * Get the auth code from the $_GET and save it. + * Redirect user back to settings with an error message, if failed. + * + * @since 1.0.0 + */ + public function process() { + + if ( ! ( isset( $_GET['tab'] ) && $_GET['tab'] === 'auth' ) ) { + wp_safe_redirect( wp_mail_smtp()->get_admin()->get_admin_page_url() ); + exit; + } + + // We can't process without saved client_id/secret. + if ( ! $this->is_clients_saved() ) { + Debug::set( + esc_html__( 'There was an error while processing the Google authentication request. Please make sure that you have Client ID and Client Secret both valid and saved.', 'wp-mail-smtp' ) + ); + wp_safe_redirect( + add_query_arg( + 'error', + 'google_no_clients', + wp_mail_smtp()->get_admin()->get_admin_page_url() + ) + ); + exit; + } + + $this->include_vendor_lib(); + + $code = ''; + $scope = ''; + $error = ''; + + if ( isset( $_GET['error'] ) ) { + $error = sanitize_key( $_GET['error'] ); + } + + // In case of any error: display a message to a user. + if ( ! empty( $error ) ) { + wp_safe_redirect( + add_query_arg( + 'error', + 'google_' . $error, + wp_mail_smtp()->get_admin()->get_admin_page_url() + ) + ); + exit; + } + + if ( isset( $_GET['code'] ) ) { + $code = $_GET['code']; + } + if ( isset( $_GET['scope'] ) ) { + $scope = urldecode( $_GET['scope'] ); + } + + // Let's try to get the access token. + if ( + ! empty( $code ) && + ( + $scope === \Google_Service_Gmail::MAIL_GOOGLE_COM . ' ' . \Google_Service_Gmail::GMAIL_SEND || + $scope === \Google_Service_Gmail::GMAIL_SEND . ' ' . \Google_Service_Gmail::MAIL_GOOGLE_COM || + $scope === \Google_Service_Gmail::GMAIL_SEND || + $scope === \Google_Service_Gmail::MAIL_GOOGLE_COM + ) + ) { + // Save the auth code. So \Google_Client can reuse it to retrieve the access token. + $this->update_auth_code( $code ); + } else { + wp_safe_redirect( + add_query_arg( + 'error', + 'google_no_code_scope', + wp_mail_smtp()->get_admin()->get_admin_page_url() + ) + ); + exit; + } + + wp_safe_redirect( + add_query_arg( + 'success', + 'google_site_linked', + wp_mail_smtp()->get_admin()->get_admin_page_url() + ) + ); + exit; + } + + /** + * Get the auth URL used to proceed to Provider to request access to send emails. + * + * @since 1.0.0 + * + * @return string + */ + public function get_auth_url() { + + if ( + ! empty( $this->client ) && + class_exists( 'Google_Client', false ) && + $this->client instanceof \Google_Client + ) { + return filter_var( $this->client->createAuthUrl(), FILTER_SANITIZE_URL ); + } + + return '#'; + } + + /** + * Get user information (like email etc) that is associated with the current connection. + * + * @since 1.5.0 + * + * @return array + */ + public function get_user_info() { + + $gmail = new \Google_Service_Gmail( $this->get_client() ); + + try { + $email = $gmail->users->getProfile( 'me' )->getEmailAddress(); + } catch ( \Exception $e ) { + $email = ''; + } + + return array( 'email' => $email ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/Gmail/Mailer.php b/wp-content/plugins/wp-mail-smtp/src/Providers/Gmail/Mailer.php new file mode 100644 index 0000000..d3e81b7 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/Gmail/Mailer.php @@ -0,0 +1,222 @@ +is_php_compatible() ) { + return; + } + } + + /** + * Re-use the MailCatcher class methods and properties. + * + * @since 1.2.0 + * + * @param \WPMailSMTP\MailCatcher $phpmailer + */ + public function process_phpmailer( $phpmailer ) { + // Make sure that we have access to MailCatcher class methods. + if ( + ! $phpmailer instanceof MailCatcher && + ! $phpmailer instanceof \PHPMailer + ) { + return; + } + + $this->phpmailer = $phpmailer; + } + + /** + * Use Google API Services to send emails. + * + * @since 1.0.0 + */ + public function send() { + + // Include the Google library. + require_once wp_mail_smtp()->plugin_path . '/vendor/autoload.php'; + + $auth = new Auth(); + $message = new \Google_Service_Gmail_Message(); + + /* + * Right now Gmail doesn't allow to redefine From and Sender email headers. + * It always uses the email address that was used to connect to its API. + * With code below we are making sure that Email Log archive and single Email Log + * have the save value for From email header. + */ + $gmail_creds = $auth->get_user_info(); + + if ( ! empty( $gmail_creds['email'] ) ) { + $this->phpmailer->From = $gmail_creds['email']; + $this->phpmailer->Sender = $gmail_creds['email']; + } + + // Get the raw MIME email using MailCatcher data. + // We need here to make base64URL-safe string. + $base64 = str_replace( + array( '+', '/', '=' ), + array( '-', '_', '' ), + base64_encode( $this->phpmailer->getSentMIMEMessage() ) + ); + + $message->setRaw( $base64 ); + + $service = new \Google_Service_Gmail( $auth->get_client() ); + + try { + $response = $service->users_messages->send( 'me', $message ); + + $this->process_response( $response ); + } catch ( \Exception $e ) { + Debug::set( + 'Mailer: Gmail' . "\r\n" . + $e->getMessage() + ); + + return; + } + } + + /** + * Save response from the API to use it later. + * + * @since 1.0.0 + * @since 1.5.0 Added action "wp_mail_smtp_providers_gmail_mailer_process_response" with $response. + * + * @param \Google_Service_Gmail_Message $response + */ + protected function process_response( $response ) { + + $this->response = $response; + + do_action( 'wp_mail_smtp_providers_gmail_mailer_process_response', $this->response, $this->phpmailer ); + } + + /** + * Check whether the email was sent. + * + * @since 1.0.0 + * + * @return bool + */ + public function is_email_sent() { + + $is_sent = false; + + if ( method_exists( $this->response, 'getId' ) ) { + $message_id = $this->response->getId(); + if ( ! empty( $message_id ) ) { + $is_sent = true; + } + } + + // Clear debug messages if email is successfully sent. + if ( $is_sent ) { + Debug::clear(); + } + + return $is_sent; + } + + /** + * @inheritdoc + */ + public function get_debug_info() { + + $gmail_text = array(); + + $options = new \WPMailSMTP\Options(); + $gmail = $options->get_group( 'gmail' ); + $curl_ver = 'No'; + if ( function_exists( 'curl_version' ) ) { + $curl = curl_version(); // phpcs:ignore + $curl_ver = $curl['version']; + } + + $gmail_text[] = 'Client ID/Secret: ' . ( ! empty( $gmail['client_id'] ) && ! empty( $gmail['client_secret'] ) ? 'Yes' : 'No' ); + $gmail_text[] = 'Auth Code: ' . ( ! empty( $gmail['auth_code'] ) ? 'Yes' : 'No' ); + $gmail_text[] = 'Access Token: ' . ( ! empty( $gmail['access_token'] ) ? 'Yes' : 'No' ); + + $gmail_text[] = '
        Server:'; + + $gmail_text[] = 'OpenSSL: ' . ( extension_loaded( 'openssl' ) && defined( 'OPENSSL_VERSION_TEXT' ) ? OPENSSL_VERSION_TEXT : 'No' ); + $gmail_text[] = 'PHP.allow_url_fopen: ' . ( ini_get( 'allow_url_fopen' ) ? 'Yes' : 'No' ); + $gmail_text[] = 'PHP.stream_socket_client(): ' . ( function_exists( 'stream_socket_client' ) ? 'Yes' : 'No' ); + $gmail_text[] = 'PHP.fsockopen(): ' . ( function_exists( 'fsockopen' ) ? 'Yes' : 'No' ); + $gmail_text[] = 'PHP.curl_version(): ' . $curl_ver; // phpcs:ignore + if ( function_exists( 'apache_get_modules' ) ) { + $modules = apache_get_modules(); + $gmail_text[] = 'Apache.mod_security: ' . ( in_array( 'mod_security', $modules, true ) || in_array( 'mod_security2', $modules, true ) ? 'Yes' : 'No' ); + } + if ( function_exists( 'selinux_is_enabled' ) ) { + $gmail_text[] = 'OS.SELinux: ' . ( selinux_is_enabled() ? 'Yes' : 'No' ); + } + if ( function_exists( 'grsecurity_is_enabled' ) ) { + $gmail_text[] = 'OS.grsecurity: ' . ( grsecurity_is_enabled() ? 'Yes' : 'No' ); + } + + return implode( '
        ', $gmail_text ); + } + + /** + * @inheritdoc + */ + public function is_mailer_complete() { + + if ( ! $this->is_php_compatible() ) { + return false; + } + + $auth = new Auth(); + + if ( + $auth->is_clients_saved() && + ! $auth->is_auth_required() + ) { + return true; + } + + return false; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/Gmail/Options.php b/wp-content/plugins/wp-mail-smtp/src/Providers/Gmail/Options.php new file mode 100644 index 0000000..563712c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/Gmail/Options.php @@ -0,0 +1,234 @@ + wp_mail_smtp()->assets_url . '/images/providers/google.svg', + 'slug' => self::SLUG, + 'title' => esc_html__( 'Gmail', 'wp-mail-smtp' ), + 'description' => sprintf( + wp_kses( /* translators: %s - URL to our Gmail doc. */ + __( 'Send emails using your Gmail or G Suite (formerly Google Apps) account, all while keeping your login credentials safe. Other Google SMTP methods require enabling less secure apps in your account and entering your password. However, this integration uses the Google API to improve email delivery issues while keeping your site secure.

        Read our Gmail documentation to learn how to configure Gmail or G Suite.', 'wp-mail-smtp' ), + array( + 'br' => array(), + 'a' => array( + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + ) + ), + 'https://wpmailsmtp.com/docs/how-to-set-up-the-gmail-mailer-in-wp-mail-smtp/' + ), + 'notices' => array( + 'educational' => esc_html__( 'The Gmail mailer works well for sites that send low numbers of emails. However, Gmail\'s API has rate limitations and a number of additional restrictions that can lead to challenges during setup. If you expect to send a high volume of emails, or if you find that your web host is not compatible with the Gmail API restrictions, then we recommend considering a different mailer option.', 'wp-mail-smtp' ), + ), + 'php' => '5.5', + ) + ); + } + + /** + * @inheritdoc + */ + public function display_options() { + + // Do not display options if PHP version is not correct. + if ( ! $this->is_php_correct() ) { + $this->display_php_warning(); + + return; + } + ?> + + +
        +
        + +
        +
        + options->is_const_defined( $this->get_slug(), 'client_id' ) ? 'disabled' : ''; ?> + id="wp-mail-smtp-setting-get_slug() ); ?>-client_id" spellcheck="false" + /> +
        +
        + + +
        +
        + +
        +
        + options->is_const_defined( $this->get_slug(), 'client_secret' ) ) : ?> + + display_const_set_message( 'WPMS_GMAIL_CLIENT_SECRET' ); ?> + + + +
        +
        + + +
        +
        + +
        +
        + + +

        + +

        +
        +
        + + +
        +
        + +
        +
        + display_auth_setting_action(); ?> +
        +
        + + process_provider_remove(); + + $auth = new Auth(); + ?> + + is_clients_saved() ) : ?> + + is_auth_required() ) : ?> + + + + +

        + +

        + + + + + + + + get_user_info(); + + if ( ! empty( $user['email'] ) ) { + printf( + /* translators: %s - email address, as received from Google API. */ + esc_html__( 'Connected as %s', 'wp-mail-smtp' ), + '' . esc_html( $user['email'] ) . '' + ); + } + ?> + +

        + +

        + + + + + +

        + +

        + + get( 'mail', 'mailer' ) !== $this->get_slug() ) { + return; + } + + $old_opt = $options->get_all(); + + foreach ( $old_opt[ $this->get_slug() ] as $key => $value ) { + // Unset everything except Client ID and Secret. + if ( ! in_array( $key, array( 'client_id', 'client_secret' ), true ) ) { + unset( $old_opt[ $this->get_slug() ][ $key ] ); + } + } + + $options->set( $old_opt ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/Loader.php b/wp-content/plugins/wp-mail-smtp/src/Providers/Loader.php new file mode 100644 index 0000000..7a4983c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/Loader.php @@ -0,0 +1,205 @@ + 'WPMailSMTP\Providers\Mail\\', + 'pepipostapi' => 'WPMailSMTP\Providers\PepipostAPI\\', + 'sendinblue' => 'WPMailSMTP\Providers\Sendinblue\\', + 'mailgun' => 'WPMailSMTP\Providers\Mailgun\\', + 'sendgrid' => 'WPMailSMTP\Providers\Sendgrid\\', + 'amazonses' => 'WPMailSMTP\Providers\AmazonSES\\', + 'gmail' => 'WPMailSMTP\Providers\Gmail\\', + 'outlook' => 'WPMailSMTP\Providers\Outlook\\', + 'smtp' => 'WPMailSMTP\Providers\SMTP\\', + 'pepipost' => 'WPMailSMTP\Providers\Pepipost\\', + ); + + /** + * @since 1.0.0 + * + * @var MailCatcher + */ + private $phpmailer; + + /** + * Get all the supported providers. + * + * @since 1.0.0 + * + * @return array + */ + public function get_providers() { + + if ( ! Options::init()->is_pepipost_active() ) { + unset( $this->providers['pepipost'] ); + } + + return apply_filters( 'wp_mail_smtp_providers_loader_get_providers', $this->providers ); + } + + /** + * Get a single provider FQN-path based on its name. + * + * @since 1.0.0 + * + * @param string $provider + * + * @return string|null + */ + public function get_provider_path( $provider ) { + + $provider = sanitize_key( $provider ); + + $providers = $this->get_providers(); + + return apply_filters( + 'wp_mail_smtp_providers_loader_get_provider_path', + isset( $providers[ $provider ] ) ? $providers[ $provider ] : null, + $provider + ); + } + + /** + * Get the provider options, if exists. + * + * @since 1.0.0 + * + * @param string $provider + * + * @return OptionsAbstract|null + */ + public function get_options( $provider ) { + + return $this->get_entity( $provider, 'Options' ); + } + + /** + * Get all options of all providers. + * + * @since 1.0.0 + * + * @return OptionsAbstract[] + */ + public function get_options_all() { + + $options = array(); + + foreach ( $this->get_providers() as $provider => $path ) { + + $option = $this->get_options( $provider ); + + if ( ! $option instanceof OptionsAbstract ) { + continue; + } + + $slug = $option->get_slug(); + $title = $option->get_title(); + + if ( empty( $title ) || empty( $slug ) ) { + continue; + } + + $options[] = $option; + } + + return apply_filters( 'wp_mail_smtp_providers_loader_get_providers_all', $options ); + } + + /** + * Get the provider mailer, if exists. + * + * @since 1.0.0 + * + * @param string $provider + * @param MailCatcher $phpmailer + * + * @return MailerAbstract|null + */ + public function get_mailer( $provider, $phpmailer ) { + + if ( + $phpmailer instanceof MailCatcher || + $phpmailer instanceof \PHPMailer + ) { + $this->phpmailer = $phpmailer; + } + + return $this->get_entity( $provider, 'Mailer' ); + } + + /** + * Get the provider auth, if exists. + * + * @param string $provider + * + * @return AuthAbstract|null + */ + public function get_auth( $provider ) { + + return $this->get_entity( $provider, 'Auth' ); + } + + /** + * Get a generic entity based on the request. + * + * @uses \ReflectionClass + * + * @since 1.0.0 + * + * @param string $provider + * @param string $request + * + * @return OptionsAbstract|MailerAbstract|AuthAbstract|null + */ + protected function get_entity( $provider, $request ) { + + $provider = sanitize_key( $provider ); + $request = sanitize_text_field( $request ); + $path = $this->get_provider_path( $provider ); + $entity = null; + + if ( empty( $path ) ) { + return $entity; + } + + try { + $reflection = new \ReflectionClass( $path . $request ); + + if ( file_exists( $reflection->getFileName() ) ) { + $class = $path . $request; + if ( $this->phpmailer ) { + $entity = new $class( $this->phpmailer ); + } else { + $entity = new $class(); + } + } + } + catch ( \Exception $e ) { + Debug::set( "There was a problem while retrieving {$request} for {$provider}: {$e->getMessage()}" ); + $entity = null; + } + + return apply_filters( 'wp_mail_smtp_providers_loader_get_entity', $entity, $provider, $request ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/Mail/Mailer.php b/wp-content/plugins/wp-mail-smtp/src/Providers/Mail/Mailer.php new file mode 100644 index 0000000..072c6db --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/Mail/Mailer.php @@ -0,0 +1,49 @@ +Server:'; + + $disabled_functions = ini_get( 'disable_functions' ); + $disabled = (array) explode( ',', trim( $disabled_functions ) ); + + $mail_text[] = 'PHP.mail(): ' . ( in_array( 'mail', $disabled, true ) || ! function_exists( 'mail' ) ? 'No' : 'Yes' ); + if ( function_exists( 'apache_get_modules' ) ) { + $modules = apache_get_modules(); + $mail_text[] = 'Apache.mod_security: ' . ( in_array( 'mod_security', $modules, true ) || in_array( 'mod_security2', $modules, true ) ? 'Yes' : 'No' ); + } + if ( function_exists( 'selinux_is_enabled' ) ) { + $mail_text[] = 'OS.SELinux: ' . ( selinux_is_enabled() ? 'Yes' : 'No' ); + } + if ( function_exists( 'grsecurity_is_enabled' ) ) { + $mail_text[] = 'OS.grsecurity: ' . ( grsecurity_is_enabled() ? 'Yes' : 'No' ); + } + + return implode( '
        ', $mail_text ); + } + + /** + * @inheritdoc + */ + public function is_mailer_complete() { + + return true; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/Mail/Options.php b/wp-content/plugins/wp-mail-smtp/src/Providers/Mail/Options.php new file mode 100644 index 0000000..f5eda44 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/Mail/Options.php @@ -0,0 +1,42 @@ + wp_mail_smtp()->assets_url . '/images/providers/php.svg', + 'slug' => 'mail', + 'title' => esc_html__( 'Default (none)', 'wp-mail-smtp' ), + ) + ); + } + + /** + * @inheritdoc + */ + public function display_options() { + ?> + +
        + +
        + + options = new Options(); + $this->mailer = $this->options->get( 'mail', 'mailer' ); + + // Only non-SMTP mailers need URL and extra processing for PHPMailer class. + if ( ! $this->options->is_mailer_smtp() && empty( $this->url ) ) { + return; + } + + $this->process_phpmailer( $phpmailer ); + } + + /** + * Re-use the MailCatcher class methods and properties. + * + * @since 1.0.0 + * + * @param MailCatcher $phpmailer + */ + public function process_phpmailer( $phpmailer ) { + + // Make sure that we have access to MailCatcher class methods. + if ( + ! $phpmailer instanceof MailCatcher && + ! $phpmailer instanceof \PHPMailer + ) { + return; + } + + $this->phpmailer = $phpmailer; + + // Prevent working with those methods, as they are not needed for SMTP-like mailers. + if ( $this->options->is_mailer_smtp() ) { + return; + } + + $this->set_headers( $this->phpmailer->getCustomHeaders() ); + $this->set_from( $this->phpmailer->From, $this->phpmailer->FromName ); + $this->set_recipients( + array( + 'to' => $this->phpmailer->getToAddresses(), + 'cc' => $this->phpmailer->getCcAddresses(), + 'bcc' => $this->phpmailer->getBccAddresses(), + ) + ); + $this->set_subject( $this->phpmailer->Subject ); + if ( $this->phpmailer->ContentType === 'text/plain' ) { + $this->set_content( $this->phpmailer->Body ); + } else { + $this->set_content( + array( + 'text' => $this->phpmailer->AltBody, + 'html' => $this->phpmailer->Body, + ) + ); + } + $this->set_return_path( $this->phpmailer->From ); + $this->set_reply_to( $this->phpmailer->getReplyToAddresses() ); + + /* + * In some cases we will need to modify the internal structure + * of the body content, if attachments are present. + * So lets make this call the last one. + */ + $this->set_attachments( $this->phpmailer->getAttachments() ); + } + + /** + * Set the email headers. + * + * @since 1.0.0 + * + * @param array $headers List of key=>value pairs. + */ + public function set_headers( $headers ) { + + foreach ( $headers as $header ) { + $name = isset( $header[0] ) ? $header[0] : false; + $value = isset( $header[1] ) ? $header[1] : false; + + if ( empty( $name ) || empty( $value ) ) { + continue; + } + + $this->set_header( $name, $value ); + } + } + + /** + * Set individual header key=>value pair for the email. + * + * @since 1.0.0 + * + * @param string $name + * @param string $value + */ + public function set_header( $name, $value ) { + + $name = sanitize_text_field( $name ); + + $this->headers[ $name ] = WP::sanitize_value( $value ); + } + + /** + * Set email subject. + * + * @since 1.0.0 + * + * @param string $subject + */ + public function set_subject( $subject ) { + + $this->set_body_param( + array( + 'subject' => $subject, + ) + ); + } + + /** + * Set the request params, that goes to the body of the HTTP request. + * + * @since 1.0.0 + * + * @param array $param Key=>value of what should be sent to a 3rd party API. + * + * @internal param array $params + */ + protected function set_body_param( $param ) { + + $this->body = Options::array_merge_recursive( $this->body, $param ); + } + + /** + * Get the email body. + * + * @since 1.0.0 + * + * @return string|array + */ + public function get_body() { + + return apply_filters( 'wp_mail_smtp_providers_mailer_get_body', $this->body, $this->mailer ); + } + + /** + * Get the email headers. + * + * @since 1.0.0 + * + * @return array + */ + public function get_headers() { + + return apply_filters( 'wp_mail_smtp_providers_mailer_get_headers', $this->headers, $this->mailer ); + } + + /** + * Send the email. + * + * @since 1.0.0 + * @since 1.8.0 Added timeout for requests, same as max_execution_time. + */ + public function send() { + + $timeout = (int) ini_get( 'max_execution_time' ); + + $params = Options::array_merge_recursive( + $this->get_default_params(), + array( + 'headers' => $this->get_headers(), + 'body' => $this->get_body(), + 'timeout' => $timeout ? $timeout : 30, + ) + ); + + $response = wp_safe_remote_post( $this->url, $params ); + + $this->process_response( $response ); + } + + /** + * We might need to do something after the email was sent to the API. + * In this method we preprocess the response from the API. + * + * @since 1.0.0 + * + * @param mixed $response + */ + protected function process_response( $response ) { + + if ( is_wp_error( $response ) ) { + // Save the error text. + $errors = $response->get_error_messages(); + foreach ( $errors as $error ) { + Debug::set( $error ); + } + + return; + } + + if ( isset( $response['body'] ) && WP::is_json( $response['body'] ) ) { + $response['body'] = \json_decode( $response['body'] ); + } + + $this->response = $response; + } + + /** + * Get the default params, required for wp_safe_remote_post(). + * + * @since 1.0.0 + * + * @return array + */ + protected function get_default_params() { + + return apply_filters( + 'wp_mail_smtp_providers_mailer_get_default_params', + array( + 'timeout' => 15, + 'httpversion' => '1.1', + 'blocking' => true, + ), + $this->mailer + ); + } + + /** + * Whether the email is sent or not. + * We basically check the response code from a request to provider. + * Might not be 100% correct, not guarantees that email is delivered. + * + * @since 1.0.0 + * + * @return bool + */ + public function is_email_sent() { + + $is_sent = false; + + if ( wp_remote_retrieve_response_code( $this->response ) === $this->email_sent_code ) { + $is_sent = true; + } else { + $error = $this->get_response_error(); + + if ( ! empty( $error ) ) { + // Add mailer to the beginning and save to display later. + $message = 'Mailer: ' . esc_html( wp_mail_smtp()->get_providers()->get_options( $this->mailer )->get_title() ) . "\r\n"; + + $conflicts = new Conflicts(); + if ( $conflicts->is_detected() ) { + $message .= 'Conflicts: ' . esc_html( $conflicts->get_conflict_name() ) . "\r\n"; + } + + Debug::set( $message . $error ); + } + } + + // Clear debug messages if email is successfully sent. + if ( $is_sent ) { + Debug::clear(); + } + + return apply_filters( 'wp_mail_smtp_providers_mailer_is_email_sent', $is_sent, $this->mailer ); + } + + /** + * Should be overwritten when appropriate. + * + * @since 1.2.0 + * + * @return string + */ + protected function get_response_error() { + + return ''; + } + + /** + * Whether the mailer supports the current PHP version or not. + * + * @since 1.0.0 + * + * @return bool + */ + public function is_php_compatible() { + + $options = wp_mail_smtp()->get_providers()->get_options( $this->mailer ); + + return version_compare( phpversion(), $options->get_php_version(), '>=' ); + } + + /** + * This method is relevant to SMTP and Pepipost. + * All other custom mailers should override it with own information. + * + * @since 1.2.0 + * + * @return string + */ + public function get_debug_info() { + + global $phpmailer; + + $smtp_text = array(); + + // Mail mailer has nothing to return. + if ( $this->options->is_mailer_smtp() ) { + // phpcs:disable + $smtp_text[] = 'ErrorInfo: ' . make_clickable( wp_strip_all_tags( $phpmailer->ErrorInfo ) ); + $smtp_text[] = 'Host: ' . $phpmailer->Host; + $smtp_text[] = 'Port: ' . $phpmailer->Port; + $smtp_text[] = 'SMTPSecure: ' . Debug::pvar( $phpmailer->SMTPSecure ); + $smtp_text[] = 'SMTPAutoTLS: ' . Debug::pvar( $phpmailer->SMTPAutoTLS ); + $smtp_text[] = 'SMTPAuth: ' . Debug::pvar( $phpmailer->SMTPAuth ); + if ( ! empty( $phpmailer->SMTPOptions ) ) { + $smtp_text[] = 'SMTPOptions: ' . wp_json_encode( $phpmailer->SMTPOptions ) . ''; + } + // phpcs:enable + } + + $smtp_text[] = '
        Server:'; + $smtp_text[] = 'OpenSSL: ' . ( extension_loaded( 'openssl' ) && defined( 'OPENSSL_VERSION_TEXT' ) ? OPENSSL_VERSION_TEXT : 'No' ); + if ( function_exists( 'apache_get_modules' ) ) { + $modules = apache_get_modules(); + $smtp_text[] = 'Apache.mod_security: ' . ( in_array( 'mod_security', $modules, true ) || in_array( 'mod_security2', $modules, true ) ? 'Yes' : 'No' ); + } + if ( function_exists( 'selinux_is_enabled' ) ) { + $smtp_text[] = 'OS.SELinux: ' . ( selinux_is_enabled() ? 'Yes' : 'No' ); + } + if ( function_exists( 'grsecurity_is_enabled' ) ) { + $smtp_text[] = 'OS.grsecurity: ' . ( grsecurity_is_enabled() ? 'Yes' : 'No' ); + } + + return implode( '
        ', $smtp_text ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/MailerInterface.php b/wp-content/plugins/wp-mail-smtp/src/Providers/MailerInterface.php new file mode 100644 index 0000000..a2aea08 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/MailerInterface.php @@ -0,0 +1,83 @@ +url = self::API_BASE_US; + + // We want to prefill everything from \WPMailSMTP\MailCatcher class, which extends \PHPMailer. + parent::__construct( $phpmailer ); + + // We have a special API URL to query in case of EU region. + if ( 'EU' === $this->options->get( $this->mailer, 'region' ) ) { + $this->url = self::API_BASE_EU; + } + + /* + * Append the url with a domain, + * to avoid passing the domain name as a query parameter with all requests. + */ + $this->url .= sanitize_text_field( $this->options->get( $this->mailer, 'domain' ) . '/messages' ); + + $this->set_header( 'Authorization', 'Basic ' . base64_encode( 'api:' . $this->options->get( $this->mailer, 'api_key' ) ) ); + } + + /** + * @inheritdoc + */ + public function set_from( $email, $name = '' ) { + + if ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) { + return; + } + + if ( ! empty( $name ) ) { + $this->set_body_param( + array( + 'from' => $name . ' <' . $email . '>', + ) + ); + } else { + $this->set_body_param( + array( + 'from' => $email, + ) + ); + } + } + + /** + * @inheritdoc + */ + public function set_recipients( $recipients ) { + + if ( empty( $recipients ) ) { + return; + } + + $default = array( 'to', 'cc', 'bcc' ); + + foreach ( $recipients as $kind => $emails ) { + if ( + ! in_array( $kind, $default, true ) || + empty( $emails ) || + ! is_array( $emails ) + ) { + continue; + } + + $data = array(); + + foreach ( $emails as $email ) { + $addr = isset( $email[0] ) ? $email[0] : false; + $name = isset( $email[1] ) ? $email[1] : false; + + if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) { + continue; + } + + if ( ! empty( $name ) ) { + $data[] = $name . ' <' . $addr . '>'; + } else { + $data[] = $addr; + } + } + + if ( ! empty( $data ) ) { + $this->set_body_param( + array( + $kind => implode( ', ', $data ), + ) + ); + } + } + } + + /** + * @inheritdoc + */ + public function set_content( $content ) { + + if ( is_array( $content ) ) { + + $default = array( 'text', 'html' ); + + foreach ( $content as $type => $mail ) { + if ( + ! in_array( $type, $default, true ) || + empty( $mail ) + ) { + continue; + } + + $this->set_body_param( + array( + $type => $mail, + ) + ); + } + } else { + + $type = 'html'; + + if ( $this->phpmailer->ContentType === 'text/plain' ) { + $type = 'text'; + } + + if ( ! empty( $content ) ) { + $this->set_body_param( + array( + $type => $content, + ) + ); + } + } + } + + /** + * Redefine the way custom headers are process for this mailer - they should be in body. + * + * @since 1.5.0 + * + * @param array $headers + */ + public function set_headers( $headers ) { + + foreach ( $headers as $header ) { + $name = isset( $header[0] ) ? $header[0] : false; + $value = isset( $header[1] ) ? $header[1] : false; + + $this->set_body_header( $name, $value ); + } + + // Add custom PHPMailer-specific header. + $this->set_body_header( 'X-Mailer', 'WPMailSMTP/Mailer/' . $this->mailer . ' ' . WPMS_PLUGIN_VER ); + } + + /** + * This mailer supports email-related custom headers inside a body of the message with a special prefix "h:". + * + * @since 1.5.0 + */ + public function set_body_header( $name, $value ) { + + $name = sanitize_text_field( $name ); + + $this->set_body_param( + array( + 'h:' . $name => WP::sanitize_value( $value ), + ) + ); + } + + /** + * It's the last one, so we can modify the whole body. + * + * @since 1.0.0 + * + * @param array $attachments + */ + public function set_attachments( $attachments ) { + + if ( empty( $attachments ) ) { + return; + } + + $payload = ''; + $data = array(); + + foreach ( $attachments as $attachment ) { + $file = false; + + /* + * We are not using WP_Filesystem API as we can't reliably work with it. + * It is not always available, same as credentials for FTP. + */ + try { + if ( is_file( $attachment[0] ) && is_readable( $attachment[0] ) ) { + $file = file_get_contents( $attachment[0] ); + } + } + catch ( \Exception $e ) { + $file = false; + } + + if ( $file === false ) { + continue; + } + + $data[] = array( + 'content' => $file, + 'name' => $attachment[2], + ); + } + + if ( ! empty( $data ) ) { + + // First, generate a boundary for the multipart message. + $boundary = base_convert( uniqid( 'boundary', true ), 10, 36 ); + + // Iterate through pre-built params and build a payload. + foreach ( $this->body as $key => $value ) { + if ( is_array( $value ) ) { + foreach ( $value as $child_key => $child_value ) { + $payload .= '--' . $boundary; + $payload .= "\r\n"; + $payload .= 'Content-Disposition: form-data; name="' . $key . "\"\r\n\r\n"; + $payload .= $child_value; + $payload .= "\r\n"; + } + } else { + $payload .= '--' . $boundary; + $payload .= "\r\n"; + $payload .= 'Content-Disposition: form-data; name="' . $key . '"' . "\r\n\r\n"; + $payload .= $value; + $payload .= "\r\n"; + } + } + + // Now iterate through our attachments, and add them too. + foreach ( $data as $key => $attachment ) { + $payload .= '--' . $boundary; + $payload .= "\r\n"; + $payload .= 'Content-Disposition: form-data; name="attachment[' . $key . ']"; filename="' . $attachment['name'] . '"' . "\r\n\r\n"; + $payload .= $attachment['content']; + $payload .= "\r\n"; + } + + $payload .= '--' . $boundary . '--'; + + // Redefine the body the "dirty way". + $this->body = $payload; + + $this->set_header( 'Content-Type', 'multipart/form-data; boundary=' . $boundary ); + } + } + + /** + * @inheritdoc + */ + public function set_reply_to( $reply_to ) { + + if ( empty( $reply_to ) ) { + return; + } + + $data = array(); + + foreach ( $reply_to as $key => $emails ) { + if ( + empty( $emails ) || + ! is_array( $emails ) + ) { + continue; + } + + $addr = isset( $emails[0] ) ? $emails[0] : false; + $name = isset( $emails[1] ) ? $emails[1] : false; + + if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) { + continue; + } + + if ( ! empty( $name ) ) { + $data[] = $name . ' <' . $addr . '>'; + } else { + $data[] = $addr; + } + } + + if ( ! empty( $data ) ) { + $this->set_body_param( + array( + 'h:Reply-To' => implode( ',', $data ), + ) + ); + } + } + + /** + * @inheritdoc + */ + public function set_return_path( $email ) { + + if ( + $this->options->get( 'mail', 'return_path' ) !== true || + ! filter_var( $email, FILTER_VALIDATE_EMAIL ) + ) { + return; + } + + $this->set_body_param( + array( + 'sender' => $email, + ) + ); + } + + /** + * Get a Mailgun-specific response with a helpful error. + * + * @since 1.2.0 + * + * @return string + */ + protected function get_response_error() { + + $body = (array) wp_remote_retrieve_body( $this->response ); + + $error_text = array(); + + if ( ! empty( $body['message'] ) ) { + if ( is_string( $body['message'] ) ) { + $error_text[] = $body['message']; + } else { + $error_text[] = \json_encode( $body['message'] ); + } + } elseif ( ! empty( $body[0] ) ) { + if ( is_string( $body[0] ) ) { + $error_text[] = $body[0]; + } else { + $error_text[] = \json_encode( $body[0] ); + } + } + + return implode( '
        ', array_map( 'esc_textarea', $error_text ) ); + } + + /** + * @inheritdoc + */ + public function get_debug_info() { + + $mg_text = array(); + + $options = new \WPMailSMTP\Options(); + $mailgun = $options->get_group( 'mailgun' ); + + $mg_text[] = 'Api Key / Domain: ' . ( ! empty( $mailgun['api_key'] ) && ! empty( $mailgun['domain'] ) ? 'Yes' : 'No' ); + + return implode( '
        ', $mg_text ); + } + + /** + * @inheritdoc + */ + public function is_mailer_complete() { + + $options = $this->options->get_group( $this->mailer ); + + // API key is the only required option. + if ( + ! empty( $options['api_key'] ) && + ! empty( $options['domain'] ) + ) { + return true; + } + + return false; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/Mailgun/Options.php b/wp-content/plugins/wp-mail-smtp/src/Providers/Mailgun/Options.php new file mode 100644 index 0000000..2619487 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/Mailgun/Options.php @@ -0,0 +1,161 @@ + wp_mail_smtp()->assets_url . '/images/providers/mailgun.svg', + 'slug' => 'mailgun', + 'title' => esc_html__( 'Mailgun', 'wp-mail-smtp' ), + 'description' => sprintf( + wp_kses( + /* translators: %1$s - opening link tag; %2$s - closing link tag; %3$s - opening link tag; %4$s - closing link tag. */ + __( '%1$sMailgun%2$s is one of the leading transactional email services trusted by over 150,000+ businesses. They provide 5,000 free emails per month for 3 months.

        Read our %3$sMailgun documentation%4$s to learn how to configure Mailgun and improve your email deliverability.', 'wp-mail-smtp' ), + array( + 'br' => array(), + 'a' => array( + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + ) + ), + '', + '', + '', + '' + ), + ) + ); + } + + /** + * @inheritdoc + */ + public function display_options() { + ?> + + +
        +
        + +
        +
        + options->is_const_defined( $this->get_slug(), 'api_key' ) ) : ?> + + display_const_set_message( 'WPMS_MAILGUN_API_KEY' ); ?> + + + +

        + ' . + esc_html__( 'Get a Private API Key', 'wp-mail-smtp' ) . + '' + ); + ?> +

        +
        +
        + + +
        +
        + +
        +
        + options->is_const_defined( $this->get_slug(), 'domain' ) ? 'disabled' : ''; ?> + id="wp-mail-smtp-setting-get_slug() ); ?>-domain" spellcheck="false" + /> +

        + ' . + esc_html__( 'Get a Domain Name', 'wp-mail-smtp' ) . + '' + ); + ?> +

        +
        +
        + + +
        +
        + +
        +
        + + + + + +

        +
        + + More information on Mailgun.com.', 'wp-mail-smtp' ), + array( + 'a' => array( + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + ) + ), + 'https://www.mailgun.com/regions' + ); + ?> +

        +
        +
        + + slug = sanitize_key( $params['slug'] ); + $this->title = sanitize_text_field( $params['title'] ); + + if ( ! empty( $params['description'] ) ) { + $this->description = wp_kses_post( $params['description'] ); + } + + if ( ! empty( $params['notices'] ) ) { + foreach ( (array) $params['notices'] as $key => $notice ) { + $key = sanitize_key( $key ); + if ( empty( $key ) ) { + continue; + } + + $notice = wp_kses( + $notice, + array( + 'br' => true, + 'strong' => true, + 'em' => true, + 'a' => array( + 'href' => true, + 'rel' => true, + 'target' => true, + ), + ) + ); + if ( empty( $notice ) ) { + continue; + } + + $this->notices[ $key ] = $notice; + } + } + + if ( isset( $params['recommended'] ) ) { + $this->recommended = (bool) $params['recommended']; + } + if ( isset( $params['disabled'] ) ) { + $this->disabled = (bool) $params['disabled']; + } + + if ( ! empty( $params['php'] ) ) { + $this->php = sanitize_text_field( $params['php'] ); + } + + if ( ! empty( $params['logo_url'] ) ) { + $this->logo_url = esc_url_raw( $params['logo_url'] ); + } + + $this->options = new Options(); + } + + /** + * @inheritdoc + */ + public function get_logo_url() { + return apply_filters( 'wp_mail_smtp_providers_provider_get_logo_url', $this->logo_url, $this ); + } + + /** + * @inheritdoc + */ + public function get_slug() { + return apply_filters( 'wp_mail_smtp_providers_provider_get_slug', $this->slug, $this ); + } + + /** + * @inheritdoc + */ + public function get_title() { + return apply_filters( 'wp_mail_smtp_providers_provider_get_title', $this->title, $this ); + } + + /** + * @inheritdoc + */ + public function get_description() { + return apply_filters( 'wp_mail_smtp_providers_provider_get_description', $this->description, $this ); + } + + /** + * Some mailers may display a notice above its options. + * + * @since 1.6.0 + * + * @param string $type + * + * @return string + */ + public function get_notice( $type ) { + + $type = sanitize_key( $type ); + + return apply_filters( 'wp_mail_smtp_providers_provider_get_notice', isset( $this->notices[ $type ] ) ? $this->notices[ $type ] : '', $this ); + } + + /** + * @inheritdoc + */ + public function get_php_version() { + return apply_filters( 'wp_mail_smtp_providers_provider_get_php_version', $this->php, $this ); + } + + /** + * @inheritdoc + */ + public function display_options() { + ?> + + +
        +
        + +
        +
        + options->is_const_defined( $this->get_slug(), 'host' ) ? 'disabled' : ''; ?> + id="wp-mail-smtp-setting-get_slug() ); ?>-host" spellcheck="false" + /> +
        +
        + + +
        +
        + +
        +
        + + + + + + + +

        + +

        +
        +
        + + +
        +
        + +
        +
        + options->is_const_defined( $this->get_slug(), 'port' ) ? 'disabled' : ''; ?> + id="wp-mail-smtp-setting-get_slug() ); ?>-port" class="small-text" spellcheck="false" + /> +
        +
        + + +
        +
        + +
        +
        + +

        + +

        +
        +
        + + +
        +
        + +
        +
        + +
        +
        + + +
        +
        + +
        +
        + options->is_const_defined( $this->get_slug(), 'user' ) ? 'disabled' : ''; ?> + id="wp-mail-smtp-setting-get_slug() ); ?>-user" spellcheck="false" autocomplete="new-password" + /> +
        +
        + + +
        +
        + +
        +
        + options->is_const_defined( $this->get_slug(), 'pass' ) ) : ?> + + + display_const_set_message( 'WPMS_SMTP_PASS' ); ?> + +

        + define( \'WPMS_SMTP_PASS\', \'your_old_password\' );' + ); + ?> +
        + wp-config.php', + 'WPMS_ON' + ); + ?> +

        +
        +						define( 'WPMS_ON', false );
        +					
        +

        + +

        + + +

        + +
        + wp-config.php' + ); + ?> +

        +
        +						define( 'WPMS_ON', true );
        +						define( 'WPMS_SMTP_PASS', 'your_password' );
        +					
        + +
        +
        + + recommended, $this ); + } + + /** + * Whether this mailer is disabled or not. + * Used for displaying Pro mailers inside Lite plugin. + * + * @since 1.7.0 + * + * @return bool + */ + public function is_disabled() { + + return (bool) apply_filters( 'wp_mail_smtp_providers_provider_is_disabled', $this->disabled, $this ); + } + + /** + * Check whether we can use this provider based on the PHP version. + * Valid for those, that use SDK. + * + * @since 1.0.0 + * + * @return bool + */ + public function is_php_correct() { + return version_compare( phpversion(), $this->php, '>=' ); + } + + /** + * Display a helpful message to those users, that are using an outdated version of PHP, + * which is not supported by the currently selected Provider. + * + * @since 1.0.0 + */ + protected function display_php_warning() { + ?> + +
        + get_title() ), + esc_html( $this->php ), + esc_html( phpversion() ) + ); + ?> +
        + +
        + + + +
        + get_title() ) + ); + ?> +
        + +
        + + + +

        + ' . esc_attr( $constant ) . '', + 'wp-config.php' + ); + ?> +

        + + wp_mail_smtp()->assets_url . '/images/providers/microsoft.svg', + 'slug' => 'outlook', + 'title' => esc_html__( 'Outlook', 'wp-mail-smtp' ), + 'disabled' => true, + ) + ); + } + + /** + * @inheritdoc + */ + public function display_options() { + + ?> + +

        + +

        + + options->get_group( $this->mailer ); + + // Host and Port are the only really required options. + if ( + ! empty( $options['host'] ) && + ! empty( $options['port'] ) + ) { + return true; + } + + return false; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/Pepipost/Options.php b/wp-content/plugins/wp-mail-smtp/src/Providers/Pepipost/Options.php new file mode 100644 index 0000000..e886ce3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/Pepipost/Options.php @@ -0,0 +1,29 @@ + wp_mail_smtp()->assets_url . '/images/providers/pepipost-smtp.png', + 'slug' => 'pepipost', + 'title' => esc_html__( 'Pepipost SMTP', 'wp-mail-smtp' ), + ) + ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/PepipostAPI/Mailer.php b/wp-content/plugins/wp-mail-smtp/src/Providers/PepipostAPI/Mailer.php new file mode 100644 index 0000000..c1c4476 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/PepipostAPI/Mailer.php @@ -0,0 +1,440 @@ +set_header( 'Authorization', 'Bearer ' . $this->options->get( $this->mailer, 'api_key' ) ); + $this->set_header( 'content-type', 'application/json' ); + } + + /** + * Redefine the way email body is returned. + * By default we are sending an array of data. + * Pepipost requires a JSON, so we encode the body. + * + * @since 1.8.0 + * + * @return string + */ + public function get_body() { + + $body = parent::get_body(); + + return wp_json_encode( $body ); + } + + /** + * Set the FROM header of the email. + * + * @since 1.8.0 + * + * @param string $email From mail. + * @param string $name From name. + */ + public function set_from( $email, $name = '' ) { + + if ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) { + return; + } + + $from['email'] = $email; + + if ( ! empty( $name ) ) { + $from['name'] = $name; + } + + $this->set_body_param( + array( + 'from' => $from, + ) + ); + } + + /** + * Set the names/emails of people who will receive the email. + * + * @since 1.8.0 + * + * @param array $recipients List of recipients: cc/bcc/to. + */ + public function set_recipients( $recipients ) { + + if ( empty( $recipients ) ) { + return; + } + + // Allow for now only these recipient types. + $default = array( 'to', 'cc', 'bcc' ); + $data = array(); + + foreach ( $recipients as $type => $emails ) { + if ( + ! in_array( $type, $default, true ) || + empty( $emails ) || + ! is_array( $emails ) + ) { + continue; + } + + $data[ $type ] = array(); + + // Iterate over all emails for each type. + // There might be multiple cc/to/bcc emails. + foreach ( $emails as $email ) { + $holder = array(); + $addr = isset( $email[0] ) ? $email[0] : false; + $name = isset( $email[1] ) ? $email[1] : false; + + if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) { + continue; + } + + $holder['email'] = $addr; + if ( ! empty( $name ) ) { + $holder['name'] = $name; + } + + array_push( $data[ $type ], $holder ); + } + } + + if ( ! empty( $data ) ) { + $this->set_body_param( + array( + 'personalizations' => array( $data ), + ) + ); + + if ( ! empty( $data['bcc'] ) ) { + // Only the 1st BCC email address, ignore the rest - is not supported by Pepipost. + $bcc['mail_settings']['bcc']['email'] = $data['bcc'][0]['email']; + $this->set_body_param( + $bcc + ); + } + } + } + + /** + * Set the email content. + * + * @since 1.8.0 + * + * @param array|string $content Email content. + */ + public function set_content( $content ) { + + if ( empty( $content ) ) { + return; + } + + if ( is_array( $content ) ) { + + $default = array( 'text', 'html' ); + $data = array(); + + foreach ( $content as $type => $body ) { + if ( + ! in_array( $type, $default, true ) || + empty( $body ) + ) { + continue; + } + + $content_type = 'text/plain'; + $content_value = $body; + + if ( $type === 'html' ) { + $content_type = 'text/html'; + } + + $data[] = array( + 'type' => $content_type, + 'value' => $content_value, + ); + } + + $this->set_body_param( + array( + 'content' => $data, + ) + ); + } else { + $data['type'] = 'text/html'; + $data['value'] = $content; + + if ( $this->phpmailer->ContentType === 'text/plain' ) { + $data['type'] = 'text/plain'; + } + + $this->set_body_param( + array( + 'content' => array( $data ), + ) + ); + } + } + + /** + * Redefine the way custom headers are processed for this mailer - they should be in body. + * + * @since 1.8.0 + * + * @param array $headers + */ + public function set_headers( $headers ) { + + foreach ( $headers as $header ) { + $name = isset( $header[0] ) ? $header[0] : false; + $value = isset( $header[1] ) ? $header[1] : false; + + $this->set_body_header( $name, $value ); + } + + // Add custom PHPMailer-specific header. + $this->set_body_header( 'X-Mailer', 'WPMailSMTP/Mailer/' . $this->mailer . ' ' . WPMS_PLUGIN_VER ); + } + + /** + * This mailer supports email-related custom headers inside a body of the message. + * + * @since 1.8.0 + * + * @param string $name + * @param string $value + */ + public function set_body_header( $name, $value ) { + + $name = sanitize_text_field( $name ); + if ( empty( $name ) ) { + return; + } + + $headers = isset( $this->body['headers'] ) ? (array) $this->body['headers'] : array(); + + $headers[ $name ] = WP::sanitize_value( $value ); + + $this->set_body_param( + array( + 'headers' => $headers, + ) + ); + } + + /** + * Pepipost accepts an array of files content in body, so we will include all files and send. + * Doesn't handle exceeding the limits etc, as this is done and reported by SendGrid API. + * + * @since 1.8.0 + * + * @param array $attachments + */ + public function set_attachments( $attachments ) { + + if ( empty( $attachments ) ) { + return; + } + + $data = array(); + + foreach ( $attachments as $attachment ) { + $file = false; + + /* + * We are not using WP_Filesystem API as we can't reliably work with it. + * It is not always available, same as credentials for FTP. + */ + try { + if ( is_file( $attachment[0] ) && is_readable( $attachment[0] ) ) { + $file = file_get_contents( $attachment[0] ); // phpcs:ignore + } + } + catch ( \Exception $e ) { + $file = false; + } + + if ( $file === false ) { + continue; + } + + $data[] = array( + 'content' => base64_encode( $file ), + 'type' => $attachment[4], + 'filename' => $attachment[2], + 'disposition' => $attachment[6], + ); + } + + if ( ! empty( $data ) ) { + $this->set_body_param( + array( + 'attachments' => $data, + ) + ); + } + } + + /** + * Set the reply-to property of the email. + * + * @since 1.8.0 + * + * @param array $reply_to Name/email for reply-to feature. + */ + public function set_reply_to( $reply_to ) { + + if ( empty( $reply_to ) ) { + return; + } + + $data = array(); + + foreach ( $reply_to as $key => $emails ) { + if ( + empty( $emails ) || + ! is_array( $emails ) + ) { + continue; + } + + $addr = isset( $emails[0] ) ? $emails[0] : false; + $name = isset( $emails[1] ) ? $emails[1] : false; + + if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) { + continue; + } + + $data['email'] = $addr; + if ( ! empty( $name ) ) { + $data['name'] = $name; + } + } + + if ( ! empty( $data ) ) { + $this->set_body_param( + array( + 'reply_to' => $data, + ) + ); + } + } + + /** + * Pepipost doesn't support sender or return_path params. + * So we do nothing. + * + * @since 1.8.0 + * + * @param string $from_email + */ + public function set_return_path( $from_email ) {} + + /** + * Get a Pepipost-specific response with a helpful error. + * + * @see https://developers.pepipost.com/migration-api/new-subpage/errorcodes + * + * @since 1.8.0 + * + * @return string + */ + protected function get_response_error() { + + $body = (array) wp_remote_retrieve_body( $this->response ); + + $error_text = array(); + + if ( ! empty( $body['errors'] ) ) { + foreach ( $body['errors'] as $error ) { + if ( property_exists( $error, 'message' ) ) { + // Prepare additional information from SendGrid API. + $extra = ''; + if ( property_exists( $error, 'field' ) && ! empty( $error->field ) ) { + $extra .= $error->field . '; '; + } + if ( property_exists( $error, 'help' ) && ! empty( $error->help ) ) { + $extra .= $error->help; + } + + // Assign both the main message and perhaps extra information, if exists. + $error_text[] = $error->message . ( ! empty( $extra ) ? ' - ' . $extra : '' ); + } + } + } + + return implode( '
        ', array_map( 'esc_textarea', $error_text ) ); + } + + /** + * Get mailer debug information, that is helpful during support. + * + * @since 1.8.0 + * + * @return string + */ + public function get_debug_info() { + + $sendgrid_text[] = 'Api Key: ' . ( $this->is_mailer_complete() ? 'Yes' : 'No' ); + + return implode( '
        ', $sendgrid_text ); + } + + /** + * Whether the mailer has all its settings correctly set up and saved. + * + * @since 1.8.0 + * + * @return bool + */ + public function is_mailer_complete() { + + $options = $this->options->get_group( $this->mailer ); + + // API key is the only required option. + if ( ! empty( $options['api_key'] ) ) { + return true; + } + + return false; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/PepipostAPI/Options.php b/wp-content/plugins/wp-mail-smtp/src/Providers/PepipostAPI/Options.php new file mode 100644 index 0000000..b4196eb --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/PepipostAPI/Options.php @@ -0,0 +1,119 @@ +Pepipost is a recommended transactional email service. Every month Pepipost delivers over 8 billion emails from 20,000+ customers. Their mission is to reliably send emails in the most efficient way and at the most disruptive pricing ever. Pepipost provides users 30,000 free emails the first 30 days.', 'wp-mail-smtp' ) . + '

        ' . + /* translators: %1$s - URL to wpmailsmtp.com doc. */ + __( 'Read our Pepipost documentation to learn how to configure Pepipost and improve your email deliverability.', 'wp-mail-smtp' ), + array( + 'br' => true, + 'strong' => true, + 'a' => array( + 'href' => true, + 'rel' => true, + 'target' => true, + ), + ) + ), + 'https://wpmailsmtp.com/go/pepipost/', + 'https://wpmailsmtp.com/docs/how-to-set-up-the-pepipost-mailer-in-wp-mail-smtp' + ); + + $api_key = PluginOptions::init()->get( self::SLUG, 'api_key' ); + + if ( empty( $api_key ) ) { + $description .= '

        ' . + esc_html__( 'Get Pepipost Now (Free)', 'wp-mail-smtp' ) . + '

        '; + } + + parent::__construct( + array( + 'logo_url' => wp_mail_smtp()->assets_url . '/images/providers/pepipost.png', + 'slug' => self::SLUG, + 'title' => esc_html__( 'Pepipost', 'wp-mail-smtp' ), + 'description' => $description, + 'recommended' => true, + 'php' => '5.3', + ) + ); + } + + /** + * Output the mailer provider options. + * + * @since 1.8.0 + */ + public function display_options() { + + // Do not display options if PHP version is not correct. + if ( ! $this->is_php_correct() ) { + $this->display_php_warning(); + + return; + } + ?> + + +
        +
        + +
        +
        + options->is_const_defined( $this->get_slug(), 'api_key' ) ) : ?> + + display_const_set_message( 'WPMS_PEPIPOST_API_KEY' ); ?> + + + + +

        + ' . + esc_html__( 'Get the API Key', 'wp-mail-smtp' ) . + '' + ); + ?> +

        +
        +
        + + options->get_group( $this->mailer ); + + // Host and Port are the only really required options. + if ( + ! empty( $options['host'] ) && + ! empty( $options['port'] ) + ) { + return true; + } + + return false; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/SMTP/Options.php b/wp-content/plugins/wp-mail-smtp/src/Providers/SMTP/Options.php new file mode 100644 index 0000000..5553e35 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/SMTP/Options.php @@ -0,0 +1,44 @@ + wp_mail_smtp()->assets_url . '/images/providers/smtp.svg', + 'slug' => 'smtp', + 'title' => esc_html__( 'Other SMTP', 'wp-mail-smtp' ), + 'description' => sprintf( + wp_kses( + /* translators: %s - URL to a related article on WPForms.com. */ + __( 'Use the SMTP details provided by your hosting provider or email service.

        To see recommended settings for the popular services as well as troubleshooting tips, check out our SMTP documentation.', 'wp-mail-smtp' ), + array( + 'br' => array(), + 'a' => array( + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + ) + ), + 'https://wpmailsmtp.com/docs/how-to-set-up-the-other-smtp-mailer-in-wp-mail-smtp/' + ), + ) + ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/Sendgrid/Mailer.php b/wp-content/plugins/wp-mail-smtp/src/Providers/Sendgrid/Mailer.php new file mode 100644 index 0000000..b4b48a9 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/Sendgrid/Mailer.php @@ -0,0 +1,409 @@ +set_header( 'Authorization', 'Bearer ' . $this->options->get( $this->mailer, 'api_key' ) ); + $this->set_header( 'content-type', 'application/json' ); + } + + /** + * Redefine the way email body is returned. + * By default we are sending an array of data. + * SendGrid requires a JSON, so we encode the body. + * + * @since 1.0.0 + */ + public function get_body() { + + $body = parent::get_body(); + + return wp_json_encode( $body ); + } + + /** + * @inheritdoc + */ + public function set_from( $email, $name = '' ) { + + if ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) { + return; + } + + $from['email'] = $email; + + if ( ! empty( $name ) ) { + $from['name'] = $name; + } + + $this->set_body_param( + array( + 'from' => $from, + ) + ); + } + + /** + * @inheritdoc + */ + public function set_recipients( $recipients ) { + + if ( empty( $recipients ) ) { + return; + } + + // Allow for now only these recipient types. + $default = array( 'to', 'cc', 'bcc' ); + $data = array(); + + foreach ( $recipients as $type => $emails ) { + if ( + ! in_array( $type, $default, true ) || + empty( $emails ) || + ! is_array( $emails ) + ) { + continue; + } + + $data[ $type ] = array(); + + // Iterate over all emails for each type. + // There might be multiple cc/to/bcc emails. + foreach ( $emails as $email ) { + $holder = array(); + $addr = isset( $email[0] ) ? $email[0] : false; + $name = isset( $email[1] ) ? $email[1] : false; + + if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) { + continue; + } + + $holder['email'] = $addr; + if ( ! empty( $name ) ) { + $holder['name'] = $name; + } + + array_push( $data[ $type ], $holder ); + } + } + + if ( ! empty( $data ) ) { + $this->set_body_param( + array( + 'personalizations' => array( $data ), + ) + ); + } + } + + /** + * @inheritdoc + */ + public function set_content( $content ) { + + if ( empty( $content ) ) { + return; + } + + if ( is_array( $content ) ) { + + $default = array( 'text', 'html' ); + $data = array(); + + foreach ( $content as $type => $body ) { + if ( + ! in_array( $type, $default, true ) || + empty( $body ) + ) { + continue; + } + + $content_type = 'text/plain'; + $content_value = $body; + + if ( $type === 'html' ) { + $content_type = 'text/html'; + } + + $data[] = array( + 'type' => $content_type, + 'value' => $content_value, + ); + } + + $this->set_body_param( + array( + 'content' => $data, + ) + ); + } else { + $data['type'] = 'text/html'; + $data['value'] = $content; + + if ( $this->phpmailer->ContentType === 'text/plain' ) { + $data['type'] = 'text/plain'; + } + + $this->set_body_param( + array( + 'content' => array( $data ), + ) + ); + } + } + + /** + * Redefine the way custom headers are processed for this mailer - they should be in body. + * + * @since 1.5.0 + * + * @param array $headers + */ + public function set_headers( $headers ) { + + foreach ( $headers as $header ) { + $name = isset( $header[0] ) ? $header[0] : false; + $value = isset( $header[1] ) ? $header[1] : false; + + $this->set_body_header( $name, $value ); + } + + // Add custom PHPMailer-specific header. + $this->set_body_header( 'X-Mailer', 'WPMailSMTP/Mailer/' . $this->mailer . ' ' . WPMS_PLUGIN_VER ); + } + + /** + * This mailer supports email-related custom headers inside a body of the message. + * + * @since 1.5.0 + * + * @param string $name + * @param string $value + */ + public function set_body_header( $name, $value ) { + + $name = sanitize_text_field( $name ); + if ( empty( $name ) ) { + return; + } + + $headers = isset( $this->body['headers'] ) ? (array) $this->body['headers'] : array(); + + $headers[ $name ] = WP::sanitize_value( $value ); + + $this->set_body_param( + array( + 'headers' => $headers, + ) + ); + } + + /** + * SendGrid accepts an array of files content in body, so we will include all files and send. + * Doesn't handle exceeding the limits etc, as this is done and reported by SendGrid API. + * + * @since 1.0.0 + * + * @param array $attachments + */ + public function set_attachments( $attachments ) { + + if ( empty( $attachments ) ) { + return; + } + + $data = array(); + + foreach ( $attachments as $attachment ) { + $file = false; + + /* + * We are not using WP_Filesystem API as we can't reliably work with it. + * It is not always available, same as credentials for FTP. + */ + try { + if ( is_file( $attachment[0] ) && is_readable( $attachment[0] ) ) { + $file = file_get_contents( $attachment[0] ); // phpcs:ignore + } + } + catch ( \Exception $e ) { + $file = false; + } + + if ( $file === false ) { + continue; + } + + $filetype = str_replace( ';', '', trim( $attachment[4] ) ); + + $data[] = array( + 'content' => base64_encode( $file ), // string, 1 character. + 'type' => $filetype, // string, no ;, no CRLF. + 'filename' => empty( $attachment[2] ) ? 'file-' . wp_hash( microtime() ) . '.' . $filetype : trim( $attachment[2] ), // required string, no CRLF. + 'disposition' => in_array( $attachment[6], array( 'inline', 'attachment' ), true ) ? $attachment[6] : 'attachment', // either inline or attachment. + 'content_id' => empty( $attachment[7] ) ? '' : trim( (string) $attachment[7] ), // string, no CRLF. + ); + } + + if ( ! empty( $data ) ) { + $this->set_body_param( + array( + 'attachments' => $data, + ) + ); + } + } + + /** + * @inheritdoc + */ + public function set_reply_to( $reply_to ) { + + if ( empty( $reply_to ) ) { + return; + } + + $data = array(); + + foreach ( $reply_to as $key => $emails ) { + if ( + empty( $emails ) || + ! is_array( $emails ) + ) { + continue; + } + + $addr = isset( $emails[0] ) ? $emails[0] : false; + $name = isset( $emails[1] ) ? $emails[1] : false; + + if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) { + continue; + } + + $data['email'] = $addr; + if ( ! empty( $name ) ) { + $data['name'] = $name; + } + } + + if ( ! empty( $data ) ) { + $this->set_body_param( + array( + 'reply_to' => $data, + ) + ); + } + } + + /** + * SendGrid doesn't support sender or return_path params. + * So we do nothing. + * + * @since 1.0.0 + * + * @param string $from_email + */ + public function set_return_path( $from_email ) {} + + /** + * Get a SendGrid-specific response with a helpful error. + * + * @since 1.2.0 + * + * @return string + */ + protected function get_response_error() { + + $body = (array) wp_remote_retrieve_body( $this->response ); + + $error_text = array(); + + if ( ! empty( $body['errors'] ) ) { + foreach ( $body['errors'] as $error ) { + if ( property_exists( $error, 'message' ) ) { + // Prepare additional information from SendGrid API. + $extra = ''; + if ( property_exists( $error, 'field' ) && ! empty( $error->field ) ) { + $extra .= $error->field . '; '; + } + if ( property_exists( $error, 'help' ) && ! empty( $error->help ) ) { + $extra .= $error->help; + } + + // Assign both the main message and perhaps extra information, if exists. + $error_text[] = $error->message . ( ! empty( $extra ) ? ' - ' . $extra : '' ); + } + } + } + + return implode( '
        ', array_map( 'esc_textarea', $error_text ) ); + } + + /** + * Get mailer debug information, that is helpful during support. + * + * @since 1.2.0 + * + * @return string + */ + public function get_debug_info() { + + $sendgrid_text[] = 'Api Key: ' . ( $this->is_mailer_complete() ? 'Yes' : 'No' ); + + return implode( '
        ', $sendgrid_text ); + } + + /** + * @inheritdoc + */ + public function is_mailer_complete() { + + $options = $this->options->get_group( $this->mailer ); + + // API key is the only required option. + if ( ! empty( $options['api_key'] ) ) { + return true; + } + + return false; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/Sendgrid/Options.php b/wp-content/plugins/wp-mail-smtp/src/Providers/Sendgrid/Options.php new file mode 100644 index 0000000..70e2f19 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/Sendgrid/Options.php @@ -0,0 +1,96 @@ + wp_mail_smtp()->assets_url . '/images/providers/sendgrid.svg', + 'slug' => 'sendgrid', + 'title' => esc_html__( 'SendGrid', 'wp-mail-smtp' ), + 'description' => sprintf( + wp_kses( + /* translators: %1$s - opening link tag; %2$s - closing link tag; %3$s - opening link tag; %4$s - closing link tag. */ + __( '%1$sSendGrid%2$s is one of the leading transactional email services, sending over 35 billion emails every month. They provide users 100 free emails per day.

        Read our %3$sSendGrid documentation%4$s to learn how to set up SendGrid and improve your email deliverability.', 'wp-mail-smtp' ), + array( + 'br' => array(), + 'a' => array( + 'href' => array(), + 'rel' => array(), + 'target' => array(), + ), + ) + ), + '', + '', + '', + '' + ), + ) + ); + } + + /** + * @inheritdoc + */ + public function display_options() { + ?> + + +
        +
        + +
        +
        + options->is_const_defined( $this->get_slug(), 'api_key' ) ) : ?> + + display_const_set_message( 'WPMS_SENDGRID_API_KEY' ); ?> + + + +

        + ' . + esc_html__( 'Create API Key', 'wp-mail-smtp' ) . + '' + ); + ?> +
        + Mail Send' + ); + ?> +

        +
        +
        + + options = \WPMailSMTP\Options::init()->get_group( Options::SLUG ); + } + + /** + * Configure API key authorization: api-key. + * + * @since 1.6.0 + * + * @return \SendinBlue\Client\Configuration + */ + protected function get_api_config() { + + return \SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey( 'api-key', isset( $this->options['api_key'] ) ? $this->options['api_key'] : '' ); + } + + /** + * Get the mailer client instance for Account API. + * + * @since 1.6.0 + */ + public function get_account_client() { + + // Include the library. + require_once wp_mail_smtp()->plugin_path . '/vendor/autoload.php'; + + return new \SendinBlue\Client\Api\AccountApi( null, $this->get_api_config() ); + } + + /** + * Get the mailer client instance for Sender API. + * + * @since 1.6.0 + */ + public function get_sender_client() { + + // Include the library. + require_once wp_mail_smtp()->plugin_path . '/vendor/autoload.php'; + + return new \SendinBlue\Client\Api\SendersApi( null, $this->get_api_config() ); + } + + /** + * Get the mailer client instance for SMTP API. + * + * @since 1.6.0 + */ + public function get_smtp_client() { + + // Include the library. + require_once wp_mail_smtp()->plugin_path . '/vendor/autoload.php'; + + return new \SendinBlue\Client\Api\SMTPApi( null, $this->get_api_config() ); + } + + /** + * Whether the mailer is ready to be used in API calls. + * + * @since 1.6.0 + * + * @return bool + */ + public function is_ready() { + + return ! empty( $this->options['api_key'] ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/Sendinblue/Mailer.php b/wp-content/plugins/wp-mail-smtp/src/Providers/Sendinblue/Mailer.php new file mode 100644 index 0000000..8459085 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/Sendinblue/Mailer.php @@ -0,0 +1,393 @@ +is_php_compatible() ) { + return; + } + } + + /** + * @inheritDoc + * + * @since 1.6.0 + */ + public function set_header( $name, $value ) { + + $name = sanitize_text_field( $name ); + + $this->body['headers'][ $name ] = WP::sanitize_value( $value ); + } + + /** + * Set the From information for an email. + * + * @since 1.6.0 + * + * @param string $email + * @param string $name + */ + public function set_from( $email, $name ) { + + if ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) { + return; + } + + $this->body['sender'] = array( + 'email' => $email, + 'name' => ! empty( $name ) ? WP::sanitize_value( $name ) : '', + ); + } + + /** + * Set email recipients: to, cc, bcc. + * + * @since 1.6.0 + * + * @param array $recipients + */ + public function set_recipients( $recipients ) { + + if ( empty( $recipients ) ) { + return; + } + + // Allow for now only these recipient types. + $default = array( 'to', 'cc', 'bcc' ); + $data = array(); + + foreach ( $recipients as $type => $emails ) { + + if ( + ! in_array( $type, $default, true ) || + empty( $emails ) || + ! is_array( $emails ) + ) { + continue; + } + + $data[ $type ] = array(); + + // Iterate over all emails for each type. + // There might be multiple cc/to/bcc emails. + foreach ( $emails as $email ) { + $holder = array(); + $addr = isset( $email[0] ) ? $email[0] : false; + $name = isset( $email[1] ) ? $email[1] : false; + + if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) { + continue; + } + + $holder['email'] = $addr; + if ( ! empty( $name ) ) { + $holder['name'] = $name; + } + + array_push( $data[ $type ], $holder ); + } + } + + foreach ( $data as $type => $type_recipients ) { + $this->body[ $type ] = $type_recipients; + } + } + + /** + * @inheritDoc + * + * @since 1.6.0 + */ + public function set_subject( $subject ) { + + $this->body['subject'] = $subject; + } + + /** + * Set email content. + * + * @since 1.6.0 + * + * @param string|array $content + */ + public function set_content( $content ) { + + if ( empty( $content ) ) { + return; + } + + if ( is_array( $content ) ) { + + if ( ! empty( $content['text'] ) ) { + $this->body['textContent'] = $content['text']; + } + + if ( ! empty( $content['html'] ) ) { + $this->body['htmlContent'] = $content['html']; + } + } else { + if ( $this->phpmailer->ContentType === 'text/plain' ) { + $this->body['textContent'] = $content; + } else { + $this->body['htmlContent'] = $content; + } + } + } + + /** + * Doesn't support this. + * + * @since 1.6.0 + * + * @param string $email + */ + public function set_return_path( $email ) { + + } + + /** + * Set the Reply To headers if not set already. + * + * @since 1.6.0 + * + * @param array $emails + */ + public function set_reply_to( $emails ) { + + if ( empty( $emails ) ) { + return; + } + + $data = array(); + + foreach ( $emails as $user ) { + $holder = array(); + $addr = isset( $user[0] ) ? $user[0] : false; + $name = isset( $user[1] ) ? $user[1] : false; + + if ( ! filter_var( $addr, FILTER_VALIDATE_EMAIL ) ) { + continue; + } + + $holder['email'] = $addr; + if ( ! empty( $name ) ) { + $holder['name'] = $name; + } + + $data[] = $holder; + } + + if ( ! empty( $data ) ) { + $this->body['replyTo'] = $data[0]; + } + } + + /** + * Set attachments for an email. + * + * @since 1.6.0 + * + * @param array $attachments + */ + public function set_attachments( $attachments ) { + + if ( empty( $attachments ) ) { + return; + } + + foreach ( $attachments as $attachment ) { + $file = false; + + /* + * We are not using WP_Filesystem API as we can't reliably work with it. + * It is not always available, same as credentials for FTP. + */ + try { + if ( is_file( $attachment[0] ) && is_readable( $attachment[0] ) ) { + $ext = pathinfo( $attachment[0], PATHINFO_EXTENSION ); + + if ( in_array( $ext, $this->allowed_attach_ext, true ) ) { + $file = file_get_contents( $attachment[0] ); // phpcs:ignore + } + } + } + catch ( \Exception $e ) { + $file = false; + } + + if ( $file === false ) { + continue; + } + + $this->body['attachment'][] = array( + 'name' => $attachment[2], + 'content' => base64_encode( $file ), + ); + } + } + + /** + * @inheritDoc + * + * @since 1.6.0 + * + * @return \SendinBlue\Client\Model\SendSmtpEmail + */ + public function get_body() { + + return new \SendinBlue\Client\Model\SendSmtpEmail( $this->body ); + } + + /** + * Use a library to send emails. + * + * @since 1.6.0 + */ + public function send() { + + try { + $api = new Api(); + + $response = $api->get_smtp_client()->sendTransacEmail( $this->get_body() ); + + $this->process_response( $response ); + } + catch ( \SendinBlue\Client\ApiException $e ) { + $error = json_decode( $e->getResponseBody() ); + if ( json_last_error() === JSON_ERROR_NONE ) { + Debug::set( + 'Mailer: Sendinblue' . "\r\n" . + '[' . sanitize_key( $error->code ) . ']: ' . esc_html( $error->message ) + ); + } + } + catch ( \Exception $e ) { + Debug::set( + 'Mailer: Sendinblue' . "\r\n" . + $e->getMessage() + ); + + return; + } + } + + /** + * Save response from the API to use it later. + * All the actually response processing is done in send() method, + * because SendinBlue throws exception if any error occurs. + * + * @since 1.6.0 + * + * @param \SendinBlue\Client\Model\CreateSmtpEmail $response + */ + protected function process_response( $response ) { + + $this->response = $response; + } + + /** + * Check whether the email was sent. + * + * @since 1.6.0 + * + * @return bool + */ + public function is_email_sent() { + + $is_sent = false; + + if ( $this->response instanceof \SendinBlue\Client\Model\CreateSmtpEmail ) { + $is_sent = $this->response->valid(); + } + + // Clear debug messages if email is successfully sent. + if ( $is_sent ) { + Debug::clear(); + } + + return $is_sent; + } + + /** + * @inheritdoc + * + * @since 1.6.0 + */ + public function get_debug_info() { + + $mailjet_text[] = 'API Key: ' . ( $this->is_mailer_complete() ? 'Yes' : 'No' ); + + return implode( '
        ', $mailjet_text ); + } + + /** + * @inheritdoc + * + * @since 1.6.0 + */ + public function is_mailer_complete() { + + $options = $this->options->get_group( $this->mailer ); + + // API key is the only required option. + if ( ! empty( $options['api_key'] ) ) { + return true; + } + + return false; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Providers/Sendinblue/Options.php b/wp-content/plugins/wp-mail-smtp/src/Providers/Sendinblue/Options.php new file mode 100644 index 0000000..2287c72 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Providers/Sendinblue/Options.php @@ -0,0 +1,119 @@ +Sendinblue is a recommended transactional email service. Founded in 2012, they serve 80,000+ growing companies around the world and send over 30 million emails each day. They understand that transactional emails are the heart of your customer relationships. Their email deliverability experts are constantly at work optimizing the reliability and speed of their SMTP infrastructure. Sendinblue provides users 300 free emails per day.', 'wp-mail-smtp' ) . + '

        ' . + /* translators: %2$s - URL to wpmailsmtp.com doc. */ + __( 'Read our Sendinblue documentation to learn how to configure Sendinblue and improve your email deliverability.', 'wp-mail-smtp' ), + array( + 'br' => true, + 'strong' => true, + 'a' => array( + 'href' => true, + 'rel' => true, + 'target' => true, + ), + ) + ), + 'https://wpmailsmtp.com/go/sendinblue/', + 'https://wpmailsmtp.com/docs/how-to-set-up-the-sendinblue-mailer-in-wp-mail-smtp' + ); + + $api_key = PluginOptions::init()->get( self::SLUG, 'api_key' ); + + if ( empty( $api_key ) ) { + $description .= '

        ' . + esc_html__( 'Get Sendinblue Now (Free)', 'wp-mail-smtp' ) . + '

        '; + } + + parent::__construct( + array( + 'logo_url' => wp_mail_smtp()->assets_url . '/images/providers/sendinblue.svg', + 'slug' => self::SLUG, + 'title' => esc_html__( 'Sendinblue', 'wp-mail-smtp' ), + 'description' => $description, + 'recommended' => true, + 'php' => '5.6', + ) + ); + } + + /** + * Output the mailer provider options. + * + * @since 1.6.0 + */ + public function display_options() { + + // Do not display options if PHP version is not correct. + if ( ! $this->is_php_correct() ) { + $this->display_php_warning(); + + return; + } + ?> + + +
        +
        + +
        +
        + options->is_const_defined( $this->get_slug(), 'api_key' ) ) : ?> + + display_const_set_message( 'WPMS_SENDINBLUE_API_KEY' ); ?> + + + + +

        + ' . + esc_html__( 'Get v3 API Key', 'wp-mail-smtp' ) . + '' + ); + ?> +

        +
        +
        + + esc_html__( 'Is WP Mail SMTP mailer setup complete?', 'wp-mail-smtp' ), + 'test' => array( $this, 'mailer_setup_complete_test' ), + ); + + return $tests; + } + + /** + * Register plugin WP Site Health debug information. + * This will be displayed in the "Info" tab of the WP Site Health page. + * + * @since {VERSION} + * + * @param array $debug_info Array of existing debug information. + * + * @return array + */ + public function register_debug_information( $debug_info ) { + + $debug_notices = Debug::get(); + + $debug_info[ self::DEBUG_INFO_SLUG ] = array( + 'label' => $this->get_label(), + 'fields' => array( + 'version' => array( + 'label' => esc_html__( 'Version', 'wp-mail-smtp' ), + 'value' => WPMS_PLUGIN_VER, + ), + 'license_key_type' => array( + 'label' => esc_html__( 'License key type', 'wp-mail-smtp' ), + 'value' => wp_mail_smtp()->get_license_type(), + ), + 'debug' => array( + 'label' => esc_html__( 'Debug', 'wp-mail-smtp' ), + 'value' => ! empty( $debug_notices ) ? implode( '. ', $debug_notices ) : esc_html__( 'No debug notices found.', 'wp-mail-smtp' ), + ), + ), + ); + + return $debug_info; + } + + /** + * Perform the WP site health test for checking, if the mailer setup is complete. + * + * @since {VERSION} + */ + public function mailer_setup_complete_test() { + + $mailer = Options::init()->get( 'mail', 'mailer' ); + $mailer_complete = wp_mail_smtp() + ->get_providers() + ->get_mailer( + $mailer, + wp_mail_smtp()->get_processor()->get_phpmailer() + )->is_mailer_complete(); + + // The default mailer should be considered as a non-complete mailer. + if ( $mailer === 'mail' ) { + $mailer_complete = false; + } + + $mailer_text = sprintf( + '%s: %s', + esc_html__( 'Current mailer', 'wp-mail-smtp' ), + esc_html( wp_mail_smtp()->get_providers()->get_options( $mailer )->get_title() ) + ); + + $result = array( + 'label' => esc_html__( 'WP Mail SMTP mailer setup is complete', 'wp-mail-smtp' ), + 'status' => 'good', + 'badge' => array( + 'label' => $this->get_label(), + 'color' => self::BADGE_COLOR, + ), + 'description' => sprintf( + '

        %s

        %s

        ', + $mailer_text, + esc_html__( 'The WP Mail SMTP plugin mailer setup is complete. You can send a test email, to make sure it\'s working properly.', 'wp-mail-smtp' ) + ), + 'actions' => sprintf( + '

        %s

        ', + esc_url( add_query_arg( 'tab', 'test', wp_mail_smtp()->get_admin()->get_admin_page_url() ) ), + esc_html__( 'Test email sending', 'wp-mail-smtp' ) + ), + 'test' => 'wp_mail_smtp_mailer_setup_complete', + ); + + if ( $mailer === 'mail' ) { + $mailer_text .= sprintf( /* translators: %s - explanation why default mailer is not a valid mailer option. */ + '

        %s

        ', + esc_html__( 'You currently have the default mailer selected, which means that you haven’t set up SMTP yet.', 'wp-mail-smtp' ) + ); + } + + if ( $mailer_complete === false ) { + $result['label'] = esc_html__( 'WP Mail SMTP mailer setup is incomplete', 'wp-mail-smtp' ); + $result['status'] = 'recommended'; + $result['badge']['color'] = 'orange'; + $result['description'] = sprintf( + '

        %s

        %s

        ', + $mailer_text, + esc_html__( 'The WP Mail SMTP plugin mailer setup is incomplete. Please click on the link below to access plugin settings and configure the mailer.', 'wp-mail-smtp' ) + ); + $result['actions'] = sprintf( + '

        %s

        ', + esc_url( wp_mail_smtp()->get_admin()->get_admin_page_url() ), + esc_html__( 'Configure mailer', 'wp-mail-smtp' ) + ); + } + + return $result; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/Upgrade.php b/wp-content/plugins/wp-mail-smtp/src/Upgrade.php new file mode 100644 index 0000000..cea152a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/Upgrade.php @@ -0,0 +1,71 @@ +upgrades(); + + if ( empty( $upgrades ) ) { + return; + } + + // Run any available upgrades. + foreach ( $upgrades as $upgrade ) { + $this->{$upgrade}(); + } + + // Update version post upgrade(s). + update_option( 'wp_mail_smtp_version', WPMS_PLUGIN_VER ); + } + + /** + * Whether we need to perform an upgrade. + * + * @since 1.1.0 + * + * @return array + */ + protected function upgrades() { + + $version = get_option( 'wp_mail_smtp_version' ); + $upgrades = array(); + + // Version 1.1.0 upgrade; prior to this the option was not available. + if ( empty( $version ) ) { + $upgrades[] = 'v110_upgrade'; + } + + return $upgrades; + } + + /** + * Upgrade routine for v1.1.0. + * + * Set SMTPAutoTLS to true. + * + * @since 1.1.0 + */ + public function v110_upgrade() { + + $values = Options::init()->get_all(); + + // Enable SMTPAutoTLS option. + $values['smtp']['autotls'] = true; + + Options::init()->set( $values ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/src/WP.php b/wp-content/plugins/wp-mail-smtp/src/WP.php new file mode 100644 index 0000000..58960fc --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/src/WP.php @@ -0,0 +1,234 @@ + $message, + 'class' => $class, + 'is_dismissible' => (bool) $is_dismissible, + ); + } + + /** + * Display all notices. + * + * @since 1.0.0 + * @since 1.5.0 Allow the notice to be dismissible, remove the id attribute, which is not unique. + */ + public static function display_admin_notices() { + + foreach ( (array) self::$admin_notices as $notice ) : + $dismissible = $notice['is_dismissible'] ? 'is-dismissible' : ''; + ?> + +
        +

        + +

        +
        + + for non-HTML tags. + * + * @since 1.5.0 + * + * @param string $value + * + * @return mixed|string|string[]|null + */ + public static function sanitize_value( $value ) { + + // Remove HTML tags. + $filtered = wp_strip_all_tags( $value, false ); + // Remove multi-lines/tabs. + $filtered = preg_replace( '/[\r\n\t ]+/', ' ', $filtered ); + // Remove whitespaces. + $filtered = trim( $filtered ); + + // Remove octets. + $found = false; + while ( preg_match( '/%[a-f0-9]{2}/i', $filtered, $match ) ) { + $filtered = str_replace( $match[0], '', $filtered ); + $found = true; + } + + if ( $found ) { + // Strip out the whitespace that may now exist after removing the octets. + $filtered = trim( preg_replace( '/ +/', ' ', $filtered ) ); + } + + return $filtered; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/uninstall.php b/wp-content/plugins/wp-mail-smtp/uninstall.php new file mode 100644 index 0000000..466101c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/uninstall.php @@ -0,0 +1,80 @@ + array( 'amn_smtp' ), + 'post_status' => 'any', + 'numberposts' => - 1, + 'fields' => 'ids', + ) +); +if ( ! empty( $announcements ) ) { + foreach ( $announcements as $announcement ) { + wp_delete_post( $announcement, true ); + } +} + +/* + * Logs for Pro plugin only. + */ +if ( function_exists( 'wp_mail_smtp' ) && wp_mail_smtp()->is_pro() ) { + // DB version. + delete_option( 'wp_mail_smtp_logs_db_version' ); + // DB table. + global $wpdb; + $table = \WPMailSMTP\Pro\Emails\Logs\Logs::get_table_name(); + $wpdb->query( "DROP TABLE $table;" ); // phpcs:ignore +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/autoload.php b/wp-content/plugins/wp-mail-smtp/vendor/autoload.php new file mode 100644 index 0000000..3db465d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/autoload.php @@ -0,0 +1,7 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see http://www.php-fig.org/psr/psr-0/ + * @see http://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + // PSR-4 + private $prefixLengthsPsr4 = array(); + private $prefixDirsPsr4 = array(); + private $fallbackDirsPsr4 = array(); + + // PSR-0 + private $prefixesPsr0 = array(); + private $fallbackDirsPsr0 = array(); + + private $useIncludePath = false; + private $classMap = array(); + private $classMapAuthoritative = false; + private $missingClasses = array(); + private $apcuPrefix; + + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', $this->prefixesPsr0); + } + + return array(); + } + + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + } + + /** + * Unregisters this instance as an autoloader. + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return bool|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + */ +function includeFile($file) +{ + include $file; +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_classmap.php b/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_classmap.php new file mode 100644 index 0000000..b6d8155 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_classmap.php @@ -0,0 +1,11 @@ + $vendorDir . '/google/apiclient/src/Google/Service/Exception.php', + 'Google_Service_Resource' => $vendorDir . '/google/apiclient/src/Google/Service/Resource.php', +); diff --git a/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_files.php b/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_files.php new file mode 100644 index 0000000..020463c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_files.php @@ -0,0 +1,14 @@ + $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', + 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', + 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', + 'decc78cc4436b1292c6c0d151b19445c' => $vendorDir . '/phpseclib/phpseclib/phpseclib/bootstrap.php', +); diff --git a/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_namespaces.php b/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_namespaces.php new file mode 100644 index 0000000..aed9f84 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_namespaces.php @@ -0,0 +1,11 @@ + array($vendorDir . '/google/apiclient-services/src'), + 'Google_' => array($vendorDir . '/google/apiclient/src'), +); diff --git a/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_psr4.php b/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_psr4.php new file mode 100644 index 0000000..a361555 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_psr4.php @@ -0,0 +1,22 @@ + array($vendorDir . '/phpseclib/phpseclib/phpseclib'), + 'WPMailSMTP\\' => array($baseDir . '/src'), + 'SendinBlue\\Client\\' => array($vendorDir . '/sendinblue/api-v3-sdk/lib'), + 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), + 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), + 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), + 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), + 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), + 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), + 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), + 'Google\\Auth\\' => array($vendorDir . '/google/auth/src'), + 'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'), + 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'), +); diff --git a/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_real.php b/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_real.php new file mode 100644 index 0000000..60e0b6e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_real.php @@ -0,0 +1,70 @@ += 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require_once __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } + + $loader->register(true); + + if ($useStaticLoader) { + $includeFiles = Composer\Autoload\ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$files; + } else { + $includeFiles = require __DIR__ . '/autoload_files.php'; + } + foreach ($includeFiles as $fileIdentifier => $file) { + composerRequire4589a9f05a03f0a29add21e0e493a064($fileIdentifier, $file); + } + + return $loader; + } +} + +function composerRequire4589a9f05a03f0a29add21e0e493a064($fileIdentifier, $file) +{ + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + require $file; + + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_static.php b/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_static.php new file mode 100644 index 0000000..05d9ad3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_static.php @@ -0,0 +1,141 @@ + __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', + 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', + 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', + 'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php', + ); + + public static $prefixLengthsPsr4 = array ( + 'p' => + array ( + 'phpseclib\\' => 10, + ), + 'W' => + array ( + 'WPMailSMTP\\' => 11, + ), + 'S' => + array ( + 'SendinBlue\\Client\\' => 18, + ), + 'P' => + array ( + 'Psr\\Log\\' => 8, + 'Psr\\Http\\Message\\' => 17, + 'Psr\\Cache\\' => 10, + ), + 'M' => + array ( + 'Monolog\\' => 8, + ), + 'G' => + array ( + 'GuzzleHttp\\Psr7\\' => 16, + 'GuzzleHttp\\Promise\\' => 19, + 'GuzzleHttp\\' => 11, + 'Google\\Auth\\' => 12, + ), + 'F' => + array ( + 'Firebase\\JWT\\' => 13, + ), + 'C' => + array ( + 'Composer\\Installers\\' => 20, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'phpseclib\\' => + array ( + 0 => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib', + ), + 'WPMailSMTP\\' => + array ( + 0 => __DIR__ . '/../..' . '/src', + ), + 'SendinBlue\\Client\\' => + array ( + 0 => __DIR__ . '/..' . '/sendinblue/api-v3-sdk/lib', + ), + 'Psr\\Log\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', + ), + 'Psr\\Http\\Message\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/http-message/src', + ), + 'Psr\\Cache\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/cache/src', + ), + 'Monolog\\' => + array ( + 0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog', + ), + 'GuzzleHttp\\Psr7\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', + ), + 'GuzzleHttp\\Promise\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', + ), + 'GuzzleHttp\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', + ), + 'Google\\Auth\\' => + array ( + 0 => __DIR__ . '/..' . '/google/auth/src', + ), + 'Firebase\\JWT\\' => + array ( + 0 => __DIR__ . '/..' . '/firebase/php-jwt/src', + ), + 'Composer\\Installers\\' => + array ( + 0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers', + ), + ); + + public static $prefixesPsr0 = array ( + 'G' => + array ( + 'Google_Service_' => + array ( + 0 => __DIR__ . '/..' . '/google/apiclient-services/src', + ), + 'Google_' => + array ( + 0 => __DIR__ . '/..' . '/google/apiclient/src', + ), + ), + ); + + public static $classMap = array ( + 'Google_Service_Exception' => __DIR__ . '/..' . '/google/apiclient/src/Google/Service/Exception.php', + 'Google_Service_Resource' => __DIR__ . '/..' . '/google/apiclient/src/Google/Service/Resource.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$prefixDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$prefixesPsr0; + $loader->classMap = ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/LICENSE b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/LICENSE new file mode 100644 index 0000000..a148ba5 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/LICENSE @@ -0,0 +1,203 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all +other entities that control, are controlled by, or are under common +control with that entity. For the purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the +direction or management of such entity, whether by contract or +otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation +source, and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or +Object form, made available under the License, as indicated by a +copyright notice that is included in or attached to the work +(an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, +the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including +the original version of the Work and any modifications or additions +to that Work or Derivative Works thereof, that is intentionally +submitted to Licensor for inclusion in the Work by the copyright owner +or by an individual or Legal Entity authorized to submit on behalf of +the copyright owner. For the purposes of this definition, "submitted" +means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, +and issue tracking systems that are managed by, or on behalf of, the +Licensor for the purpose of discussing and improving the Work, but +excluding communication that is conspicuously marked or otherwise +designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work, +where such license applies only to those patent claims licensable +by such Contributor that are necessarily infringed by their +Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You +institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work +or a Contribution incorporated within the Work constitutes direct +or contributory patent infringement, then any patent licenses +granted to You under this License for that Work shall terminate +as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You +meet the following conditions: + +(a) You must give any other recipients of the Work or +Derivative Works a copy of this License; and + +(b) You must cause any modified files to carry prominent notices +stating that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works +that You distribute, all copyright, patent, trademark, and +attribution notices from the Source form of the Work, +excluding those notices that do not pertain to any part of +the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must +include a readable copy of the attribution notices contained +within such NOTICE file, excluding those notices that do not +pertain to any part of the Derivative Works, in at least one +of the following places: within a NOTICE text file distributed +as part of the Derivative Works; within the Source form or +documentation, if provided along with the Derivative Works; or, +within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents +of the NOTICE file are for informational purposes only and +do not modify the License. You may add Your own attribution +notices within Derivative Works that You distribute, alongside +or as an addendum to the NOTICE text from the Work, provided +that such additional attribution notices cannot be construed +as modifying the License. + +You may add Your own copyright statement to Your modifications and +may provide additional or different license terms and conditions +for use, reproduction, or distribution of Your modifications, or +for any such Derivative Works as a whole, provided Your use, +reproduction, and distribution of the Work otherwise complies with +the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "[]" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail.php new file mode 100644 index 0000000..d63d83d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail.php @@ -0,0 +1,1219 @@ + + * Access Gmail mailboxes including sending user email.

        + * + *

        + * For more information about this service, see the API + * Documentation + *

        + * + * @author Google, Inc. + */ +class Google_Service_Gmail extends Google_Service +{ + /** Read, compose, send, and permanently delete all your email from Gmail. */ + const MAIL_GOOGLE_COM = + "https://mail.google.com/"; + /** Manage drafts and send emails. */ + const GMAIL_COMPOSE = + "https://www.googleapis.com/auth/gmail.compose"; + /** Insert mail into your mailbox. */ + const GMAIL_INSERT = + "https://www.googleapis.com/auth/gmail.insert"; + /** Manage mailbox labels. */ + const GMAIL_LABELS = + "https://www.googleapis.com/auth/gmail.labels"; + /** View your email message metadata such as labels and headers, but not the email body. */ + const GMAIL_METADATA = + "https://www.googleapis.com/auth/gmail.metadata"; + /** View and modify but not delete your email. */ + const GMAIL_MODIFY = + "https://www.googleapis.com/auth/gmail.modify"; + /** View your email messages and settings. */ + const GMAIL_READONLY = + "https://www.googleapis.com/auth/gmail.readonly"; + /** Send email on your behalf. */ + const GMAIL_SEND = + "https://www.googleapis.com/auth/gmail.send"; + /** Manage your basic mail settings. */ + const GMAIL_SETTINGS_BASIC = + "https://www.googleapis.com/auth/gmail.settings.basic"; + /** Manage your sensitive mail settings, including who can manage your mail. */ + const GMAIL_SETTINGS_SHARING = + "https://www.googleapis.com/auth/gmail.settings.sharing"; + + public $users; + public $users_drafts; + public $users_history; + public $users_labels; + public $users_messages; + public $users_messages_attachments; + public $users_settings; + public $users_settings_delegates; + public $users_settings_filters; + public $users_settings_forwardingAddresses; + public $users_settings_sendAs; + public $users_settings_sendAs_smimeInfo; + public $users_threads; + + /** + * Constructs the internal representation of the Gmail service. + * + * @param Google_Client $client The client used to deliver requests. + * @param string $rootUrl The root URL used for requests to the service. + */ + public function __construct(Google_Client $client, $rootUrl = null) + { + parent::__construct($client); + $this->rootUrl = $rootUrl ?: 'https://www.googleapis.com/'; + $this->servicePath = 'gmail/v1/users/'; + $this->batchPath = 'batch/gmail/v1'; + $this->version = 'v1'; + $this->serviceName = 'gmail'; + + $this->users = new Google_Service_Gmail_Resource_Users( + $this, + $this->serviceName, + 'users', + array( + 'methods' => array( + 'getProfile' => array( + 'path' => '{userId}/profile', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'stop' => array( + 'path' => '{userId}/stop', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'watch' => array( + 'path' => '{userId}/watch', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ), + ) + ) + ); + $this->users_drafts = new Google_Service_Gmail_Resource_UsersDrafts( + $this, + $this->serviceName, + 'drafts', + array( + 'methods' => array( + 'create' => array( + 'path' => '{userId}/drafts', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'delete' => array( + 'path' => '{userId}/drafts/{id}', + 'httpMethod' => 'DELETE', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'get' => array( + 'path' => '{userId}/drafts/{id}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'format' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ),'list' => array( + 'path' => '{userId}/drafts', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'includeSpamTrash' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'maxResults' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'pageToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'q' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ),'send' => array( + 'path' => '{userId}/drafts/send', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'update' => array( + 'path' => '{userId}/drafts/{id}', + 'httpMethod' => 'PUT', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ), + ) + ) + ); + $this->users_history = new Google_Service_Gmail_Resource_UsersHistory( + $this, + $this->serviceName, + 'history', + array( + 'methods' => array( + 'list' => array( + 'path' => '{userId}/history', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'historyTypes' => array( + 'location' => 'query', + 'type' => 'string', + 'repeated' => true, + ), + 'labelId' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'maxResults' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'pageToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'startHistoryId' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ), + ) + ) + ); + $this->users_labels = new Google_Service_Gmail_Resource_UsersLabels( + $this, + $this->serviceName, + 'labels', + array( + 'methods' => array( + 'create' => array( + 'path' => '{userId}/labels', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'delete' => array( + 'path' => '{userId}/labels/{id}', + 'httpMethod' => 'DELETE', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'get' => array( + 'path' => '{userId}/labels/{id}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'list' => array( + 'path' => '{userId}/labels', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'patch' => array( + 'path' => '{userId}/labels/{id}', + 'httpMethod' => 'PATCH', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'update' => array( + 'path' => '{userId}/labels/{id}', + 'httpMethod' => 'PUT', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ), + ) + ) + ); + $this->users_messages = new Google_Service_Gmail_Resource_UsersMessages( + $this, + $this->serviceName, + 'messages', + array( + 'methods' => array( + 'batchDelete' => array( + 'path' => '{userId}/messages/batchDelete', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'batchModify' => array( + 'path' => '{userId}/messages/batchModify', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'delete' => array( + 'path' => '{userId}/messages/{id}', + 'httpMethod' => 'DELETE', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'get' => array( + 'path' => '{userId}/messages/{id}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'format' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'metadataHeaders' => array( + 'location' => 'query', + 'type' => 'string', + 'repeated' => true, + ), + ), + ),'import' => array( + 'path' => '{userId}/messages/import', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'deleted' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'internalDateSource' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'neverMarkSpam' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'processForCalendar' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + ), + ),'insert' => array( + 'path' => '{userId}/messages', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'deleted' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'internalDateSource' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ),'list' => array( + 'path' => '{userId}/messages', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'includeSpamTrash' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'labelIds' => array( + 'location' => 'query', + 'type' => 'string', + 'repeated' => true, + ), + 'maxResults' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'pageToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'q' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ),'modify' => array( + 'path' => '{userId}/messages/{id}/modify', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'send' => array( + 'path' => '{userId}/messages/send', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'trash' => array( + 'path' => '{userId}/messages/{id}/trash', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'untrash' => array( + 'path' => '{userId}/messages/{id}/untrash', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ), + ) + ) + ); + $this->users_messages_attachments = new Google_Service_Gmail_Resource_UsersMessagesAttachments( + $this, + $this->serviceName, + 'attachments', + array( + 'methods' => array( + 'get' => array( + 'path' => '{userId}/messages/{messageId}/attachments/{id}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'messageId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ), + ) + ) + ); + $this->users_settings = new Google_Service_Gmail_Resource_UsersSettings( + $this, + $this->serviceName, + 'settings', + array( + 'methods' => array( + 'getAutoForwarding' => array( + 'path' => '{userId}/settings/autoForwarding', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'getImap' => array( + 'path' => '{userId}/settings/imap', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'getLanguage' => array( + 'path' => '{userId}/settings/language', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'getPop' => array( + 'path' => '{userId}/settings/pop', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'getVacation' => array( + 'path' => '{userId}/settings/vacation', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'updateAutoForwarding' => array( + 'path' => '{userId}/settings/autoForwarding', + 'httpMethod' => 'PUT', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'updateImap' => array( + 'path' => '{userId}/settings/imap', + 'httpMethod' => 'PUT', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'updateLanguage' => array( + 'path' => '{userId}/settings/language', + 'httpMethod' => 'PUT', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'updatePop' => array( + 'path' => '{userId}/settings/pop', + 'httpMethod' => 'PUT', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'updateVacation' => array( + 'path' => '{userId}/settings/vacation', + 'httpMethod' => 'PUT', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ), + ) + ) + ); + $this->users_settings_delegates = new Google_Service_Gmail_Resource_UsersSettingsDelegates( + $this, + $this->serviceName, + 'delegates', + array( + 'methods' => array( + 'create' => array( + 'path' => '{userId}/settings/delegates', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'delete' => array( + 'path' => '{userId}/settings/delegates/{delegateEmail}', + 'httpMethod' => 'DELETE', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'delegateEmail' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'get' => array( + 'path' => '{userId}/settings/delegates/{delegateEmail}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'delegateEmail' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'list' => array( + 'path' => '{userId}/settings/delegates', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ), + ) + ) + ); + $this->users_settings_filters = new Google_Service_Gmail_Resource_UsersSettingsFilters( + $this, + $this->serviceName, + 'filters', + array( + 'methods' => array( + 'create' => array( + 'path' => '{userId}/settings/filters', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'delete' => array( + 'path' => '{userId}/settings/filters/{id}', + 'httpMethod' => 'DELETE', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'get' => array( + 'path' => '{userId}/settings/filters/{id}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'list' => array( + 'path' => '{userId}/settings/filters', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ), + ) + ) + ); + $this->users_settings_forwardingAddresses = new Google_Service_Gmail_Resource_UsersSettingsForwardingAddresses( + $this, + $this->serviceName, + 'forwardingAddresses', + array( + 'methods' => array( + 'create' => array( + 'path' => '{userId}/settings/forwardingAddresses', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'delete' => array( + 'path' => '{userId}/settings/forwardingAddresses/{forwardingEmail}', + 'httpMethod' => 'DELETE', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'forwardingEmail' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'get' => array( + 'path' => '{userId}/settings/forwardingAddresses/{forwardingEmail}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'forwardingEmail' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'list' => array( + 'path' => '{userId}/settings/forwardingAddresses', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ), + ) + ) + ); + $this->users_settings_sendAs = new Google_Service_Gmail_Resource_UsersSettingsSendAs( + $this, + $this->serviceName, + 'sendAs', + array( + 'methods' => array( + 'create' => array( + 'path' => '{userId}/settings/sendAs', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'delete' => array( + 'path' => '{userId}/settings/sendAs/{sendAsEmail}', + 'httpMethod' => 'DELETE', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'sendAsEmail' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'get' => array( + 'path' => '{userId}/settings/sendAs/{sendAsEmail}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'sendAsEmail' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'list' => array( + 'path' => '{userId}/settings/sendAs', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'patch' => array( + 'path' => '{userId}/settings/sendAs/{sendAsEmail}', + 'httpMethod' => 'PATCH', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'sendAsEmail' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'update' => array( + 'path' => '{userId}/settings/sendAs/{sendAsEmail}', + 'httpMethod' => 'PUT', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'sendAsEmail' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'verify' => array( + 'path' => '{userId}/settings/sendAs/{sendAsEmail}/verify', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'sendAsEmail' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ), + ) + ) + ); + $this->users_settings_sendAs_smimeInfo = new Google_Service_Gmail_Resource_UsersSettingsSendAsSmimeInfo( + $this, + $this->serviceName, + 'smimeInfo', + array( + 'methods' => array( + 'delete' => array( + 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}', + 'httpMethod' => 'DELETE', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'sendAsEmail' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'get' => array( + 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'sendAsEmail' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'insert' => array( + 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'sendAsEmail' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'list' => array( + 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'sendAsEmail' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'setDefault' => array( + 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'sendAsEmail' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ), + ) + ) + ); + $this->users_threads = new Google_Service_Gmail_Resource_UsersThreads( + $this, + $this->serviceName, + 'threads', + array( + 'methods' => array( + 'delete' => array( + 'path' => '{userId}/threads/{id}', + 'httpMethod' => 'DELETE', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'get' => array( + 'path' => '{userId}/threads/{id}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'format' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'metadataHeaders' => array( + 'location' => 'query', + 'type' => 'string', + 'repeated' => true, + ), + ), + ),'list' => array( + 'path' => '{userId}/threads', + 'httpMethod' => 'GET', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'includeSpamTrash' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'labelIds' => array( + 'location' => 'query', + 'type' => 'string', + 'repeated' => true, + ), + 'maxResults' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'pageToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'q' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ),'modify' => array( + 'path' => '{userId}/threads/{id}/modify', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'trash' => array( + 'path' => '{userId}/threads/{id}/trash', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'untrash' => array( + 'path' => '{userId}/threads/{id}/untrash', + 'httpMethod' => 'POST', + 'parameters' => array( + 'userId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'id' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ), + ) + ) + ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/AutoForwarding.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/AutoForwarding.php new file mode 100644 index 0000000..86afef2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/AutoForwarding.php @@ -0,0 +1,48 @@ +disposition = $disposition; + } + public function getDisposition() + { + return $this->disposition; + } + public function setEmailAddress($emailAddress) + { + $this->emailAddress = $emailAddress; + } + public function getEmailAddress() + { + return $this->emailAddress; + } + public function setEnabled($enabled) + { + $this->enabled = $enabled; + } + public function getEnabled() + { + return $this->enabled; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/BatchDeleteMessagesRequest.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/BatchDeleteMessagesRequest.php new file mode 100644 index 0000000..136acf6 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/BatchDeleteMessagesRequest.php @@ -0,0 +1,31 @@ +ids = $ids; + } + public function getIds() + { + return $this->ids; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/BatchModifyMessagesRequest.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/BatchModifyMessagesRequest.php new file mode 100644 index 0000000..911c221 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/BatchModifyMessagesRequest.php @@ -0,0 +1,49 @@ +addLabelIds = $addLabelIds; + } + public function getAddLabelIds() + { + return $this->addLabelIds; + } + public function setIds($ids) + { + $this->ids = $ids; + } + public function getIds() + { + return $this->ids; + } + public function setRemoveLabelIds($removeLabelIds) + { + $this->removeLabelIds = $removeLabelIds; + } + public function getRemoveLabelIds() + { + return $this->removeLabelIds; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Delegate.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Delegate.php new file mode 100644 index 0000000..72d6a4d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Delegate.php @@ -0,0 +1,39 @@ +delegateEmail = $delegateEmail; + } + public function getDelegateEmail() + { + return $this->delegateEmail; + } + public function setVerificationStatus($verificationStatus) + { + $this->verificationStatus = $verificationStatus; + } + public function getVerificationStatus() + { + return $this->verificationStatus; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Draft.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Draft.php new file mode 100644 index 0000000..b2f9cc6 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Draft.php @@ -0,0 +1,46 @@ +id = $id; + } + public function getId() + { + return $this->id; + } + /** + * @param Google_Service_Gmail_Message + */ + public function setMessage(Google_Service_Gmail_Message $message) + { + $this->message = $message; + } + /** + * @return Google_Service_Gmail_Message + */ + public function getMessage() + { + return $this->message; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Filter.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Filter.php new file mode 100644 index 0000000..ee40b18 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Filter.php @@ -0,0 +1,62 @@ +action = $action; + } + /** + * @return Google_Service_Gmail_FilterAction + */ + public function getAction() + { + return $this->action; + } + /** + * @param Google_Service_Gmail_FilterCriteria + */ + public function setCriteria(Google_Service_Gmail_FilterCriteria $criteria) + { + $this->criteria = $criteria; + } + /** + * @return Google_Service_Gmail_FilterCriteria + */ + public function getCriteria() + { + return $this->criteria; + } + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/FilterAction.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/FilterAction.php new file mode 100644 index 0000000..e11c467 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/FilterAction.php @@ -0,0 +1,49 @@ +addLabelIds = $addLabelIds; + } + public function getAddLabelIds() + { + return $this->addLabelIds; + } + public function setForward($forward) + { + $this->forward = $forward; + } + public function getForward() + { + return $this->forward; + } + public function setRemoveLabelIds($removeLabelIds) + { + $this->removeLabelIds = $removeLabelIds; + } + public function getRemoveLabelIds() + { + return $this->removeLabelIds; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/FilterCriteria.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/FilterCriteria.php new file mode 100644 index 0000000..1b26c4d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/FilterCriteria.php @@ -0,0 +1,102 @@ +excludeChats = $excludeChats; + } + public function getExcludeChats() + { + return $this->excludeChats; + } + public function setFrom($from) + { + $this->from = $from; + } + public function getFrom() + { + return $this->from; + } + public function setHasAttachment($hasAttachment) + { + $this->hasAttachment = $hasAttachment; + } + public function getHasAttachment() + { + return $this->hasAttachment; + } + public function setNegatedQuery($negatedQuery) + { + $this->negatedQuery = $negatedQuery; + } + public function getNegatedQuery() + { + return $this->negatedQuery; + } + public function setQuery($query) + { + $this->query = $query; + } + public function getQuery() + { + return $this->query; + } + public function setSize($size) + { + $this->size = $size; + } + public function getSize() + { + return $this->size; + } + public function setSizeComparison($sizeComparison) + { + $this->sizeComparison = $sizeComparison; + } + public function getSizeComparison() + { + return $this->sizeComparison; + } + public function setSubject($subject) + { + $this->subject = $subject; + } + public function getSubject() + { + return $this->subject; + } + public function setTo($to) + { + $this->to = $to; + } + public function getTo() + { + return $this->to; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ForwardingAddress.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ForwardingAddress.php new file mode 100644 index 0000000..f2ea60e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ForwardingAddress.php @@ -0,0 +1,39 @@ +forwardingEmail = $forwardingEmail; + } + public function getForwardingEmail() + { + return $this->forwardingEmail; + } + public function setVerificationStatus($verificationStatus) + { + $this->verificationStatus = $verificationStatus; + } + public function getVerificationStatus() + { + return $this->verificationStatus; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/History.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/History.php new file mode 100644 index 0000000..35b65fa --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/History.php @@ -0,0 +1,111 @@ +id = $id; + } + public function getId() + { + return $this->id; + } + /** + * @param Google_Service_Gmail_HistoryLabelAdded + */ + public function setLabelsAdded($labelsAdded) + { + $this->labelsAdded = $labelsAdded; + } + /** + * @return Google_Service_Gmail_HistoryLabelAdded + */ + public function getLabelsAdded() + { + return $this->labelsAdded; + } + /** + * @param Google_Service_Gmail_HistoryLabelRemoved + */ + public function setLabelsRemoved($labelsRemoved) + { + $this->labelsRemoved = $labelsRemoved; + } + /** + * @return Google_Service_Gmail_HistoryLabelRemoved + */ + public function getLabelsRemoved() + { + return $this->labelsRemoved; + } + /** + * @param Google_Service_Gmail_Message + */ + public function setMessages($messages) + { + $this->messages = $messages; + } + /** + * @return Google_Service_Gmail_Message + */ + public function getMessages() + { + return $this->messages; + } + /** + * @param Google_Service_Gmail_HistoryMessageAdded + */ + public function setMessagesAdded($messagesAdded) + { + $this->messagesAdded = $messagesAdded; + } + /** + * @return Google_Service_Gmail_HistoryMessageAdded + */ + public function getMessagesAdded() + { + return $this->messagesAdded; + } + /** + * @param Google_Service_Gmail_HistoryMessageDeleted + */ + public function setMessagesDeleted($messagesDeleted) + { + $this->messagesDeleted = $messagesDeleted; + } + /** + * @return Google_Service_Gmail_HistoryMessageDeleted + */ + public function getMessagesDeleted() + { + return $this->messagesDeleted; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryLabelAdded.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryLabelAdded.php new file mode 100644 index 0000000..8292377 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryLabelAdded.php @@ -0,0 +1,47 @@ +labelIds = $labelIds; + } + public function getLabelIds() + { + return $this->labelIds; + } + /** + * @param Google_Service_Gmail_Message + */ + public function setMessage(Google_Service_Gmail_Message $message) + { + $this->message = $message; + } + /** + * @return Google_Service_Gmail_Message + */ + public function getMessage() + { + return $this->message; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryLabelRemoved.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryLabelRemoved.php new file mode 100644 index 0000000..873f6da --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryLabelRemoved.php @@ -0,0 +1,47 @@ +labelIds = $labelIds; + } + public function getLabelIds() + { + return $this->labelIds; + } + /** + * @param Google_Service_Gmail_Message + */ + public function setMessage(Google_Service_Gmail_Message $message) + { + $this->message = $message; + } + /** + * @return Google_Service_Gmail_Message + */ + public function getMessage() + { + return $this->message; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryMessageAdded.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryMessageAdded.php new file mode 100644 index 0000000..5f86357 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryMessageAdded.php @@ -0,0 +1,37 @@ +message = $message; + } + /** + * @return Google_Service_Gmail_Message + */ + public function getMessage() + { + return $this->message; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryMessageDeleted.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryMessageDeleted.php new file mode 100644 index 0000000..0afa797 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryMessageDeleted.php @@ -0,0 +1,37 @@ +message = $message; + } + /** + * @return Google_Service_Gmail_Message + */ + public function getMessage() + { + return $this->message; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ImapSettings.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ImapSettings.php new file mode 100644 index 0000000..df939b7 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ImapSettings.php @@ -0,0 +1,57 @@ +autoExpunge = $autoExpunge; + } + public function getAutoExpunge() + { + return $this->autoExpunge; + } + public function setEnabled($enabled) + { + $this->enabled = $enabled; + } + public function getEnabled() + { + return $this->enabled; + } + public function setExpungeBehavior($expungeBehavior) + { + $this->expungeBehavior = $expungeBehavior; + } + public function getExpungeBehavior() + { + return $this->expungeBehavior; + } + public function setMaxFolderSize($maxFolderSize) + { + $this->maxFolderSize = $maxFolderSize; + } + public function getMaxFolderSize() + { + return $this->maxFolderSize; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Label.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Label.php new file mode 100644 index 0000000..f428a93 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Label.php @@ -0,0 +1,118 @@ +color = $color; + } + /** + * @return Google_Service_Gmail_LabelColor + */ + public function getColor() + { + return $this->color; + } + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } + public function setLabelListVisibility($labelListVisibility) + { + $this->labelListVisibility = $labelListVisibility; + } + public function getLabelListVisibility() + { + return $this->labelListVisibility; + } + public function setMessageListVisibility($messageListVisibility) + { + $this->messageListVisibility = $messageListVisibility; + } + public function getMessageListVisibility() + { + return $this->messageListVisibility; + } + public function setMessagesTotal($messagesTotal) + { + $this->messagesTotal = $messagesTotal; + } + public function getMessagesTotal() + { + return $this->messagesTotal; + } + public function setMessagesUnread($messagesUnread) + { + $this->messagesUnread = $messagesUnread; + } + public function getMessagesUnread() + { + return $this->messagesUnread; + } + public function setName($name) + { + $this->name = $name; + } + public function getName() + { + return $this->name; + } + public function setThreadsTotal($threadsTotal) + { + $this->threadsTotal = $threadsTotal; + } + public function getThreadsTotal() + { + return $this->threadsTotal; + } + public function setThreadsUnread($threadsUnread) + { + $this->threadsUnread = $threadsUnread; + } + public function getThreadsUnread() + { + return $this->threadsUnread; + } + public function setType($type) + { + $this->type = $type; + } + public function getType() + { + return $this->type; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/LabelColor.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/LabelColor.php new file mode 100644 index 0000000..10c3187 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/LabelColor.php @@ -0,0 +1,39 @@ +backgroundColor = $backgroundColor; + } + public function getBackgroundColor() + { + return $this->backgroundColor; + } + public function setTextColor($textColor) + { + $this->textColor = $textColor; + } + public function getTextColor() + { + return $this->textColor; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/LanguageSettings.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/LanguageSettings.php new file mode 100644 index 0000000..077bd85 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/LanguageSettings.php @@ -0,0 +1,30 @@ +displayLanguage = $displayLanguage; + } + public function getDisplayLanguage() + { + return $this->displayLanguage; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListDelegatesResponse.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListDelegatesResponse.php new file mode 100644 index 0000000..b0f19c1 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListDelegatesResponse.php @@ -0,0 +1,38 @@ +delegates = $delegates; + } + /** + * @return Google_Service_Gmail_Delegate + */ + public function getDelegates() + { + return $this->delegates; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListDraftsResponse.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListDraftsResponse.php new file mode 100644 index 0000000..dbfce46 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListDraftsResponse.php @@ -0,0 +1,56 @@ +drafts = $drafts; + } + /** + * @return Google_Service_Gmail_Draft + */ + public function getDrafts() + { + return $this->drafts; + } + public function setNextPageToken($nextPageToken) + { + $this->nextPageToken = $nextPageToken; + } + public function getNextPageToken() + { + return $this->nextPageToken; + } + public function setResultSizeEstimate($resultSizeEstimate) + { + $this->resultSizeEstimate = $resultSizeEstimate; + } + public function getResultSizeEstimate() + { + return $this->resultSizeEstimate; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListFiltersResponse.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListFiltersResponse.php new file mode 100644 index 0000000..589d782 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListFiltersResponse.php @@ -0,0 +1,38 @@ +filter = $filter; + } + /** + * @return Google_Service_Gmail_Filter + */ + public function getFilter() + { + return $this->filter; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListForwardingAddressesResponse.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListForwardingAddressesResponse.php new file mode 100644 index 0000000..477f861 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListForwardingAddressesResponse.php @@ -0,0 +1,38 @@ +forwardingAddresses = $forwardingAddresses; + } + /** + * @return Google_Service_Gmail_ForwardingAddress + */ + public function getForwardingAddresses() + { + return $this->forwardingAddresses; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListHistoryResponse.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListHistoryResponse.php new file mode 100644 index 0000000..a0d7d67 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListHistoryResponse.php @@ -0,0 +1,56 @@ +history = $history; + } + /** + * @return Google_Service_Gmail_History + */ + public function getHistory() + { + return $this->history; + } + public function setHistoryId($historyId) + { + $this->historyId = $historyId; + } + public function getHistoryId() + { + return $this->historyId; + } + public function setNextPageToken($nextPageToken) + { + $this->nextPageToken = $nextPageToken; + } + public function getNextPageToken() + { + return $this->nextPageToken; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListLabelsResponse.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListLabelsResponse.php new file mode 100644 index 0000000..9075e9c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListLabelsResponse.php @@ -0,0 +1,38 @@ +labels = $labels; + } + /** + * @return Google_Service_Gmail_Label + */ + public function getLabels() + { + return $this->labels; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListMessagesResponse.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListMessagesResponse.php new file mode 100644 index 0000000..e246fe1 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListMessagesResponse.php @@ -0,0 +1,56 @@ +messages = $messages; + } + /** + * @return Google_Service_Gmail_Message + */ + public function getMessages() + { + return $this->messages; + } + public function setNextPageToken($nextPageToken) + { + $this->nextPageToken = $nextPageToken; + } + public function getNextPageToken() + { + return $this->nextPageToken; + } + public function setResultSizeEstimate($resultSizeEstimate) + { + $this->resultSizeEstimate = $resultSizeEstimate; + } + public function getResultSizeEstimate() + { + return $this->resultSizeEstimate; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListSendAsResponse.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListSendAsResponse.php new file mode 100644 index 0000000..6048c42 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListSendAsResponse.php @@ -0,0 +1,38 @@ +sendAs = $sendAs; + } + /** + * @return Google_Service_Gmail_SendAs + */ + public function getSendAs() + { + return $this->sendAs; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListSmimeInfoResponse.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListSmimeInfoResponse.php new file mode 100644 index 0000000..277907a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListSmimeInfoResponse.php @@ -0,0 +1,38 @@ +smimeInfo = $smimeInfo; + } + /** + * @return Google_Service_Gmail_SmimeInfo + */ + public function getSmimeInfo() + { + return $this->smimeInfo; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListThreadsResponse.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListThreadsResponse.php new file mode 100644 index 0000000..347a39c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListThreadsResponse.php @@ -0,0 +1,56 @@ +nextPageToken = $nextPageToken; + } + public function getNextPageToken() + { + return $this->nextPageToken; + } + public function setResultSizeEstimate($resultSizeEstimate) + { + $this->resultSizeEstimate = $resultSizeEstimate; + } + public function getResultSizeEstimate() + { + return $this->resultSizeEstimate; + } + /** + * @param Google_Service_Gmail_Thread + */ + public function setThreads($threads) + { + $this->threads = $threads; + } + /** + * @return Google_Service_Gmail_Thread + */ + public function getThreads() + { + return $this->threads; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Message.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Message.php new file mode 100644 index 0000000..b5d0bc8 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Message.php @@ -0,0 +1,110 @@ +historyId = $historyId; + } + public function getHistoryId() + { + return $this->historyId; + } + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } + public function setInternalDate($internalDate) + { + $this->internalDate = $internalDate; + } + public function getInternalDate() + { + return $this->internalDate; + } + public function setLabelIds($labelIds) + { + $this->labelIds = $labelIds; + } + public function getLabelIds() + { + return $this->labelIds; + } + /** + * @param Google_Service_Gmail_MessagePart + */ + public function setPayload(Google_Service_Gmail_MessagePart $payload) + { + $this->payload = $payload; + } + /** + * @return Google_Service_Gmail_MessagePart + */ + public function getPayload() + { + return $this->payload; + } + public function setRaw($raw) + { + $this->raw = $raw; + } + public function getRaw() + { + return $this->raw; + } + public function setSizeEstimate($sizeEstimate) + { + $this->sizeEstimate = $sizeEstimate; + } + public function getSizeEstimate() + { + return $this->sizeEstimate; + } + public function setSnippet($snippet) + { + $this->snippet = $snippet; + } + public function getSnippet() + { + return $this->snippet; + } + public function setThreadId($threadId) + { + $this->threadId = $threadId; + } + public function getThreadId() + { + return $this->threadId; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePart.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePart.php new file mode 100644 index 0000000..e8270e1 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePart.php @@ -0,0 +1,97 @@ +body = $body; + } + /** + * @return Google_Service_Gmail_MessagePartBody + */ + public function getBody() + { + return $this->body; + } + public function setFilename($filename) + { + $this->filename = $filename; + } + public function getFilename() + { + return $this->filename; + } + /** + * @param Google_Service_Gmail_MessagePartHeader + */ + public function setHeaders($headers) + { + $this->headers = $headers; + } + /** + * @return Google_Service_Gmail_MessagePartHeader + */ + public function getHeaders() + { + return $this->headers; + } + public function setMimeType($mimeType) + { + $this->mimeType = $mimeType; + } + public function getMimeType() + { + return $this->mimeType; + } + public function setPartId($partId) + { + $this->partId = $partId; + } + public function getPartId() + { + return $this->partId; + } + /** + * @param Google_Service_Gmail_MessagePart + */ + public function setParts($parts) + { + $this->parts = $parts; + } + /** + * @return Google_Service_Gmail_MessagePart + */ + public function getParts() + { + return $this->parts; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePartBody.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePartBody.php new file mode 100644 index 0000000..89323ef --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePartBody.php @@ -0,0 +1,48 @@ +attachmentId = $attachmentId; + } + public function getAttachmentId() + { + return $this->attachmentId; + } + public function setData($data) + { + $this->data = $data; + } + public function getData() + { + return $this->data; + } + public function setSize($size) + { + $this->size = $size; + } + public function getSize() + { + return $this->size; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePartHeader.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePartHeader.php new file mode 100644 index 0000000..8789faf --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePartHeader.php @@ -0,0 +1,39 @@ +name = $name; + } + public function getName() + { + return $this->name; + } + public function setValue($value) + { + $this->value = $value; + } + public function getValue() + { + return $this->value; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ModifyMessageRequest.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ModifyMessageRequest.php new file mode 100644 index 0000000..7f37a47 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ModifyMessageRequest.php @@ -0,0 +1,40 @@ +addLabelIds = $addLabelIds; + } + public function getAddLabelIds() + { + return $this->addLabelIds; + } + public function setRemoveLabelIds($removeLabelIds) + { + $this->removeLabelIds = $removeLabelIds; + } + public function getRemoveLabelIds() + { + return $this->removeLabelIds; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ModifyThreadRequest.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ModifyThreadRequest.php new file mode 100644 index 0000000..a8fec01 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ModifyThreadRequest.php @@ -0,0 +1,40 @@ +addLabelIds = $addLabelIds; + } + public function getAddLabelIds() + { + return $this->addLabelIds; + } + public function setRemoveLabelIds($removeLabelIds) + { + $this->removeLabelIds = $removeLabelIds; + } + public function getRemoveLabelIds() + { + return $this->removeLabelIds; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/PopSettings.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/PopSettings.php new file mode 100644 index 0000000..6069dc8 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/PopSettings.php @@ -0,0 +1,39 @@ +accessWindow = $accessWindow; + } + public function getAccessWindow() + { + return $this->accessWindow; + } + public function setDisposition($disposition) + { + $this->disposition = $disposition; + } + public function getDisposition() + { + return $this->disposition; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Profile.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Profile.php new file mode 100644 index 0000000..7dda18c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Profile.php @@ -0,0 +1,57 @@ +emailAddress = $emailAddress; + } + public function getEmailAddress() + { + return $this->emailAddress; + } + public function setHistoryId($historyId) + { + $this->historyId = $historyId; + } + public function getHistoryId() + { + return $this->historyId; + } + public function setMessagesTotal($messagesTotal) + { + $this->messagesTotal = $messagesTotal; + } + public function getMessagesTotal() + { + return $this->messagesTotal; + } + public function setThreadsTotal($threadsTotal) + { + $this->threadsTotal = $threadsTotal; + } + public function getThreadsTotal() + { + return $this->threadsTotal; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/Users.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/Users.php new file mode 100644 index 0000000..947fc56 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/Users.php @@ -0,0 +1,71 @@ + + * $gmailService = new Google_Service_Gmail(...); + * $users = $gmailService->users; + * + */ +class Google_Service_Gmail_Resource_Users extends Google_Service_Resource +{ + /** + * Gets the current user's Gmail profile. (users.getProfile) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Profile + */ + public function getProfile($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('getProfile', array($params), "Google_Service_Gmail_Profile"); + } + /** + * Stop receiving push notifications for the given user mailbox. (users.stop) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + */ + public function stop($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('stop', array($params)); + } + /** + * Set up or update a push notification watch on the given user mailbox. + * (users.watch) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_WatchRequest $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_WatchResponse + */ + public function watch($userId, Google_Service_Gmail_WatchRequest $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('watch', array($params), "Google_Service_Gmail_WatchResponse"); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersDrafts.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersDrafts.php new file mode 100644 index 0000000..d0ec543 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersDrafts.php @@ -0,0 +1,130 @@ + + * $gmailService = new Google_Service_Gmail(...); + * $drafts = $gmailService->drafts; + * + */ +class Google_Service_Gmail_Resource_UsersDrafts extends Google_Service_Resource +{ + /** + * Creates a new draft with the DRAFT label. (drafts.create) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_Draft $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Draft + */ + public function create($userId, Google_Service_Gmail_Draft $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('create', array($params), "Google_Service_Gmail_Draft"); + } + /** + * Immediately and permanently deletes the specified draft. Does not simply + * trash it. (drafts.delete) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the draft to delete. + * @param array $optParams Optional parameters. + */ + public function delete($userId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('delete', array($params)); + } + /** + * Gets the specified draft. (drafts.get) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the draft to retrieve. + * @param array $optParams Optional parameters. + * + * @opt_param string format The format to return the draft in. + * @return Google_Service_Gmail_Draft + */ + public function get($userId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Gmail_Draft"); + } + /** + * Lists the drafts in the user's mailbox. (drafts.listUsersDrafts) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * + * @opt_param bool includeSpamTrash Include drafts from SPAM and TRASH in the + * results. + * @opt_param string maxResults Maximum number of drafts to return. + * @opt_param string pageToken Page token to retrieve a specific page of results + * in the list. + * @opt_param string q Only return draft messages matching the specified query. + * Supports the same query format as the Gmail search box. For example, + * "from:someuser@example.com rfc822msgid: is:unread". + * @return Google_Service_Gmail_ListDraftsResponse + */ + public function listUsersDrafts($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('list', array($params), "Google_Service_Gmail_ListDraftsResponse"); + } + /** + * Sends the specified, existing draft to the recipients in the To, Cc, and Bcc + * headers. (drafts.send) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_Draft $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Message + */ + public function send($userId, Google_Service_Gmail_Draft $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('send', array($params), "Google_Service_Gmail_Message"); + } + /** + * Replaces a draft's content. (drafts.update) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the draft to update. + * @param Google_Service_Gmail_Draft $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Draft + */ + public function update($userId, $id, Google_Service_Gmail_Draft $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('update', array($params), "Google_Service_Gmail_Draft"); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersHistory.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersHistory.php new file mode 100644 index 0000000..128bd17 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersHistory.php @@ -0,0 +1,61 @@ + + * $gmailService = new Google_Service_Gmail(...); + * $history = $gmailService->history; + * + */ +class Google_Service_Gmail_Resource_UsersHistory extends Google_Service_Resource +{ + /** + * Lists the history of all changes to the given mailbox. History results are + * returned in chronological order (increasing historyId). + * (history.listUsersHistory) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * + * @opt_param string historyTypes History types to be returned by the function + * @opt_param string labelId Only return messages with a label matching the ID. + * @opt_param string maxResults The maximum number of history records to return. + * @opt_param string pageToken Page token to retrieve a specific page of results + * in the list. + * @opt_param string startHistoryId Required. Returns history records after the + * specified startHistoryId. The supplied startHistoryId should be obtained from + * the historyId of a message, thread, or previous list response. History IDs + * increase chronologically but are not contiguous with random gaps in between + * valid IDs. Supplying an invalid or out of date startHistoryId typically + * returns an HTTP 404 error code. A historyId is typically valid for at least a + * week, but in some rare circumstances may be valid for only a few hours. If + * you receive an HTTP 404 error response, your application should perform a + * full sync. If you receive no nextPageToken in the response, there are no + * updates to retrieve and you can store the returned historyId for a future + * request. + * @return Google_Service_Gmail_ListHistoryResponse + */ + public function listUsersHistory($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('list', array($params), "Google_Service_Gmail_ListHistoryResponse"); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersLabels.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersLabels.php new file mode 100644 index 0000000..88b33ce --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersLabels.php @@ -0,0 +1,120 @@ + + * $gmailService = new Google_Service_Gmail(...); + * $labels = $gmailService->labels; + * + */ +class Google_Service_Gmail_Resource_UsersLabels extends Google_Service_Resource +{ + /** + * Creates a new label. (labels.create) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_Label $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Label + */ + public function create($userId, Google_Service_Gmail_Label $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('create', array($params), "Google_Service_Gmail_Label"); + } + /** + * Immediately and permanently deletes the specified label and removes it from + * any messages and threads that it is applied to. (labels.delete) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the label to delete. + * @param array $optParams Optional parameters. + */ + public function delete($userId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('delete', array($params)); + } + /** + * Gets the specified label. (labels.get) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the label to retrieve. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Label + */ + public function get($userId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Gmail_Label"); + } + /** + * Lists all labels in the user's mailbox. (labels.listUsersLabels) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_ListLabelsResponse + */ + public function listUsersLabels($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('list', array($params), "Google_Service_Gmail_ListLabelsResponse"); + } + /** + * Updates the specified label. This method supports patch semantics. + * (labels.patch) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the label to update. + * @param Google_Service_Gmail_Label $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Label + */ + public function patch($userId, $id, Google_Service_Gmail_Label $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('patch', array($params), "Google_Service_Gmail_Label"); + } + /** + * Updates the specified label. (labels.update) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the label to update. + * @param Google_Service_Gmail_Label $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Label + */ + public function update($userId, $id, Google_Service_Gmail_Label $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('update', array($params), "Google_Service_Gmail_Label"); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersMessages.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersMessages.php new file mode 100644 index 0000000..67c737b --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersMessages.php @@ -0,0 +1,229 @@ + + * $gmailService = new Google_Service_Gmail(...); + * $messages = $gmailService->messages; + * + */ +class Google_Service_Gmail_Resource_UsersMessages extends Google_Service_Resource +{ + /** + * Deletes many messages by message ID. Provides no guarantees that messages + * were not already deleted or even existed at all. (messages.batchDelete) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_BatchDeleteMessagesRequest $postBody + * @param array $optParams Optional parameters. + */ + public function batchDelete($userId, Google_Service_Gmail_BatchDeleteMessagesRequest $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('batchDelete', array($params)); + } + /** + * Modifies the labels on the specified messages. (messages.batchModify) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_BatchModifyMessagesRequest $postBody + * @param array $optParams Optional parameters. + */ + public function batchModify($userId, Google_Service_Gmail_BatchModifyMessagesRequest $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('batchModify', array($params)); + } + /** + * Immediately and permanently deletes the specified message. This operation + * cannot be undone. Prefer messages.trash instead. (messages.delete) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the message to delete. + * @param array $optParams Optional parameters. + */ + public function delete($userId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('delete', array($params)); + } + /** + * Gets the specified message. (messages.get) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the message to retrieve. + * @param array $optParams Optional parameters. + * + * @opt_param string format The format to return the message in. + * @opt_param string metadataHeaders When given and format is METADATA, only + * include headers specified. + * @return Google_Service_Gmail_Message + */ + public function get($userId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Gmail_Message"); + } + /** + * Imports a message into only this user's mailbox, with standard email delivery + * scanning and classification similar to receiving via SMTP. Does not send a + * message. (messages.import) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_Message $postBody + * @param array $optParams Optional parameters. + * + * @opt_param bool deleted Mark the email as permanently deleted (not TRASH) and + * only visible in Google Vault to a Vault administrator. Only used for G Suite + * accounts. + * @opt_param string internalDateSource Source for Gmail's internal date of the + * message. + * @opt_param bool neverMarkSpam Ignore the Gmail spam classifier decision and + * never mark this email as SPAM in the mailbox. + * @opt_param bool processForCalendar Process calendar invites in the email and + * add any extracted meetings to the Google Calendar for this user. + * @return Google_Service_Gmail_Message + */ + public function import($userId, Google_Service_Gmail_Message $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('import', array($params), "Google_Service_Gmail_Message"); + } + /** + * Directly inserts a message into only this user's mailbox similar to IMAP + * APPEND, bypassing most scanning and classification. Does not send a message. + * (messages.insert) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_Message $postBody + * @param array $optParams Optional parameters. + * + * @opt_param bool deleted Mark the email as permanently deleted (not TRASH) and + * only visible in Google Vault to a Vault administrator. Only used for G Suite + * accounts. + * @opt_param string internalDateSource Source for Gmail's internal date of the + * message. + * @return Google_Service_Gmail_Message + */ + public function insert($userId, Google_Service_Gmail_Message $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('insert', array($params), "Google_Service_Gmail_Message"); + } + /** + * Lists the messages in the user's mailbox. (messages.listUsersMessages) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * + * @opt_param bool includeSpamTrash Include messages from SPAM and TRASH in the + * results. + * @opt_param string labelIds Only return messages with labels that match all of + * the specified label IDs. + * @opt_param string maxResults Maximum number of messages to return. + * @opt_param string pageToken Page token to retrieve a specific page of results + * in the list. + * @opt_param string q Only return messages matching the specified query. + * Supports the same query format as the Gmail search box. For example, + * "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used + * when accessing the api using the gmail.metadata scope. + * @return Google_Service_Gmail_ListMessagesResponse + */ + public function listUsersMessages($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('list', array($params), "Google_Service_Gmail_ListMessagesResponse"); + } + /** + * Modifies the labels on the specified message. (messages.modify) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the message to modify. + * @param Google_Service_Gmail_ModifyMessageRequest $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Message + */ + public function modify($userId, $id, Google_Service_Gmail_ModifyMessageRequest $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('modify', array($params), "Google_Service_Gmail_Message"); + } + /** + * Sends the specified message to the recipients in the To, Cc, and Bcc headers. + * (messages.send) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_Message $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Message + */ + public function send($userId, Google_Service_Gmail_Message $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('send', array($params), "Google_Service_Gmail_Message"); + } + /** + * Moves the specified message to the trash. (messages.trash) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the message to Trash. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Message + */ + public function trash($userId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('trash', array($params), "Google_Service_Gmail_Message"); + } + /** + * Removes the specified message from the trash. (messages.untrash) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the message to remove from Trash. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Message + */ + public function untrash($userId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('untrash', array($params), "Google_Service_Gmail_Message"); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersMessagesAttachments.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersMessagesAttachments.php new file mode 100644 index 0000000..6c3a5e4 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersMessagesAttachments.php @@ -0,0 +1,44 @@ + + * $gmailService = new Google_Service_Gmail(...); + * $attachments = $gmailService->attachments; + * + */ +class Google_Service_Gmail_Resource_UsersMessagesAttachments extends Google_Service_Resource +{ + /** + * Gets the specified message attachment. (attachments.get) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $messageId The ID of the message containing the attachment. + * @param string $id The ID of the attachment. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_MessagePartBody + */ + public function get($userId, $messageId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'messageId' => $messageId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Gmail_MessagePartBody"); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettings.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettings.php new file mode 100644 index 0000000..ccf5d9b --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettings.php @@ -0,0 +1,184 @@ + + * $gmailService = new Google_Service_Gmail(...); + * $settings = $gmailService->settings; + * + */ +class Google_Service_Gmail_Resource_UsersSettings extends Google_Service_Resource +{ + /** + * Gets the auto-forwarding setting for the specified account. + * (settings.getAutoForwarding) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_AutoForwarding + */ + public function getAutoForwarding($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('getAutoForwarding', array($params), "Google_Service_Gmail_AutoForwarding"); + } + /** + * Gets IMAP settings. (settings.getImap) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_ImapSettings + */ + public function getImap($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('getImap', array($params), "Google_Service_Gmail_ImapSettings"); + } + /** + * Gets language settings. (settings.getLanguage) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_LanguageSettings + */ + public function getLanguage($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('getLanguage', array($params), "Google_Service_Gmail_LanguageSettings"); + } + /** + * Gets POP settings. (settings.getPop) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_PopSettings + */ + public function getPop($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('getPop', array($params), "Google_Service_Gmail_PopSettings"); + } + /** + * Gets vacation responder settings. (settings.getVacation) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_VacationSettings + */ + public function getVacation($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('getVacation', array($params), "Google_Service_Gmail_VacationSettings"); + } + /** + * Updates the auto-forwarding setting for the specified account. A verified + * forwarding address must be specified when auto-forwarding is enabled. + * + * This method is only available to service account clients that have been + * delegated domain-wide authority. (settings.updateAutoForwarding) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_AutoForwarding $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_AutoForwarding + */ + public function updateAutoForwarding($userId, Google_Service_Gmail_AutoForwarding $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('updateAutoForwarding', array($params), "Google_Service_Gmail_AutoForwarding"); + } + /** + * Updates IMAP settings. (settings.updateImap) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_ImapSettings $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_ImapSettings + */ + public function updateImap($userId, Google_Service_Gmail_ImapSettings $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('updateImap', array($params), "Google_Service_Gmail_ImapSettings"); + } + /** + * Updates language settings. + * + * If successful, the return object contains the displayLanguage that was saved + * for the user, which may differ from the value passed into the request. This + * is because the requested displayLanguage may not be directly supported by + * Gmail but have a close variant that is, and so the variant may be chosen and + * saved instead. (settings.updateLanguage) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_LanguageSettings $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_LanguageSettings + */ + public function updateLanguage($userId, Google_Service_Gmail_LanguageSettings $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('updateLanguage', array($params), "Google_Service_Gmail_LanguageSettings"); + } + /** + * Updates POP settings. (settings.updatePop) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_PopSettings $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_PopSettings + */ + public function updatePop($userId, Google_Service_Gmail_PopSettings $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('updatePop', array($params), "Google_Service_Gmail_PopSettings"); + } + /** + * Updates vacation responder settings. (settings.updateVacation) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_VacationSettings $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_VacationSettings + */ + public function updateVacation($userId, Google_Service_Gmail_VacationSettings $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('updateVacation', array($params), "Google_Service_Gmail_VacationSettings"); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsDelegates.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsDelegates.php new file mode 100644 index 0000000..1b363b5 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsDelegates.php @@ -0,0 +1,119 @@ + + * $gmailService = new Google_Service_Gmail(...); + * $delegates = $gmailService->delegates; + * + */ +class Google_Service_Gmail_Resource_UsersSettingsDelegates extends Google_Service_Resource +{ + /** + * Adds a delegate with its verification status set directly to accepted, + * without sending any verification email. The delegate user must be a member of + * the same G Suite organization as the delegator user. + * + * Gmail imposes limtations on the number of delegates and delegators each user + * in a G Suite organization can have. These limits depend on your organization, + * but in general each user can have up to 25 delegates and up to 10 delegators. + * + * Note that a delegate user must be referred to by their primary email address, + * and not an email alias. + * + * Also note that when a new delegate is created, there may be up to a one + * minute delay before the new delegate is available for use. + * + * This method is only available to service account clients that have been + * delegated domain-wide authority. (delegates.create) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_Delegate $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Delegate + */ + public function create($userId, Google_Service_Gmail_Delegate $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('create', array($params), "Google_Service_Gmail_Delegate"); + } + /** + * Removes the specified delegate (which can be of any verification status), and + * revokes any verification that may have been required for using it. + * + * Note that a delegate user must be referred to by their primary email address, + * and not an email alias. + * + * This method is only available to service account clients that have been + * delegated domain-wide authority. (delegates.delete) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param string $delegateEmail The email address of the user to be removed as a + * delegate. + * @param array $optParams Optional parameters. + */ + public function delete($userId, $delegateEmail, $optParams = array()) + { + $params = array('userId' => $userId, 'delegateEmail' => $delegateEmail); + $params = array_merge($params, $optParams); + return $this->call('delete', array($params)); + } + /** + * Gets the specified delegate. + * + * Note that a delegate user must be referred to by their primary email address, + * and not an email alias. + * + * This method is only available to service account clients that have been + * delegated domain-wide authority. (delegates.get) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param string $delegateEmail The email address of the user whose delegate + * relationship is to be retrieved. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Delegate + */ + public function get($userId, $delegateEmail, $optParams = array()) + { + $params = array('userId' => $userId, 'delegateEmail' => $delegateEmail); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Gmail_Delegate"); + } + /** + * Lists the delegates for the specified account. + * + * This method is only available to service account clients that have been + * delegated domain-wide authority. (delegates.listUsersSettingsDelegates) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_ListDelegatesResponse + */ + public function listUsersSettingsDelegates($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('list', array($params), "Google_Service_Gmail_ListDelegatesResponse"); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsFilters.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsFilters.php new file mode 100644 index 0000000..d142bc2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsFilters.php @@ -0,0 +1,86 @@ + + * $gmailService = new Google_Service_Gmail(...); + * $filters = $gmailService->filters; + * + */ +class Google_Service_Gmail_Resource_UsersSettingsFilters extends Google_Service_Resource +{ + /** + * Creates a filter. (filters.create) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_Filter $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Filter + */ + public function create($userId, Google_Service_Gmail_Filter $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('create', array($params), "Google_Service_Gmail_Filter"); + } + /** + * Deletes a filter. (filters.delete) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param string $id The ID of the filter to be deleted. + * @param array $optParams Optional parameters. + */ + public function delete($userId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('delete', array($params)); + } + /** + * Gets a filter. (filters.get) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param string $id The ID of the filter to be fetched. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Filter + */ + public function get($userId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Gmail_Filter"); + } + /** + * Lists the message filters of a Gmail user. (filters.listUsersSettingsFilters) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_ListFiltersResponse + */ + public function listUsersSettingsFilters($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('list', array($params), "Google_Service_Gmail_ListFiltersResponse"); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsForwardingAddresses.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsForwardingAddresses.php new file mode 100644 index 0000000..b0e2508 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsForwardingAddresses.php @@ -0,0 +1,97 @@ + + * $gmailService = new Google_Service_Gmail(...); + * $forwardingAddresses = $gmailService->forwardingAddresses; + * + */ +class Google_Service_Gmail_Resource_UsersSettingsForwardingAddresses extends Google_Service_Resource +{ + /** + * Creates a forwarding address. If ownership verification is required, a + * message will be sent to the recipient and the resource's verification status + * will be set to pending; otherwise, the resource will be created with + * verification status set to accepted. + * + * This method is only available to service account clients that have been + * delegated domain-wide authority. (forwardingAddresses.create) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_ForwardingAddress $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_ForwardingAddress + */ + public function create($userId, Google_Service_Gmail_ForwardingAddress $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('create', array($params), "Google_Service_Gmail_ForwardingAddress"); + } + /** + * Deletes the specified forwarding address and revokes any verification that + * may have been required. + * + * This method is only available to service account clients that have been + * delegated domain-wide authority. (forwardingAddresses.delete) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param string $forwardingEmail The forwarding address to be deleted. + * @param array $optParams Optional parameters. + */ + public function delete($userId, $forwardingEmail, $optParams = array()) + { + $params = array('userId' => $userId, 'forwardingEmail' => $forwardingEmail); + $params = array_merge($params, $optParams); + return $this->call('delete', array($params)); + } + /** + * Gets the specified forwarding address. (forwardingAddresses.get) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param string $forwardingEmail The forwarding address to be retrieved. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_ForwardingAddress + */ + public function get($userId, $forwardingEmail, $optParams = array()) + { + $params = array('userId' => $userId, 'forwardingEmail' => $forwardingEmail); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Gmail_ForwardingAddress"); + } + /** + * Lists the forwarding addresses for the specified account. + * (forwardingAddresses.listUsersSettingsForwardingAddresses) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_ListForwardingAddressesResponse + */ + public function listUsersSettingsForwardingAddresses($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('list', array($params), "Google_Service_Gmail_ListForwardingAddressesResponse"); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsSendAs.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsSendAs.php new file mode 100644 index 0000000..f3c45cf --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsSendAs.php @@ -0,0 +1,162 @@ + + * $gmailService = new Google_Service_Gmail(...); + * $sendAs = $gmailService->sendAs; + * + */ +class Google_Service_Gmail_Resource_UsersSettingsSendAs extends Google_Service_Resource +{ + /** + * Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail + * will attempt to connect to the SMTP service to validate the configuration + * before creating the alias. If ownership verification is required for the + * alias, a message will be sent to the email address and the resource's + * verification status will be set to pending; otherwise, the resource will be + * created with verification status set to accepted. If a signature is provided, + * Gmail will sanitize the HTML before saving it with the alias. + * + * This method is only available to service account clients that have been + * delegated domain-wide authority. (sendAs.create) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param Google_Service_Gmail_SendAs $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_SendAs + */ + public function create($userId, Google_Service_Gmail_SendAs $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('create', array($params), "Google_Service_Gmail_SendAs"); + } + /** + * Deletes the specified send-as alias. Revokes any verification that may have + * been required for using it. + * + * This method is only available to service account clients that have been + * delegated domain-wide authority. (sendAs.delete) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param string $sendAsEmail The send-as alias to be deleted. + * @param array $optParams Optional parameters. + */ + public function delete($userId, $sendAsEmail, $optParams = array()) + { + $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail); + $params = array_merge($params, $optParams); + return $this->call('delete', array($params)); + } + /** + * Gets the specified send-as alias. Fails with an HTTP 404 error if the + * specified address is not a member of the collection. (sendAs.get) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param string $sendAsEmail The send-as alias to be retrieved. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_SendAs + */ + public function get($userId, $sendAsEmail, $optParams = array()) + { + $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Gmail_SendAs"); + } + /** + * Lists the send-as aliases for the specified account. The result includes the + * primary send-as address associated with the account as well as any custom + * "from" aliases. (sendAs.listUsersSettingsSendAs) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_ListSendAsResponse + */ + public function listUsersSettingsSendAs($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('list', array($params), "Google_Service_Gmail_ListSendAsResponse"); + } + /** + * Updates a send-as alias. If a signature is provided, Gmail will sanitize the + * HTML before saving it with the alias. + * + * Addresses other than the primary address for the account can only be updated + * by service account clients that have been delegated domain-wide authority. + * This method supports patch semantics. (sendAs.patch) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param string $sendAsEmail The send-as alias to be updated. + * @param Google_Service_Gmail_SendAs $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_SendAs + */ + public function patch($userId, $sendAsEmail, Google_Service_Gmail_SendAs $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('patch', array($params), "Google_Service_Gmail_SendAs"); + } + /** + * Updates a send-as alias. If a signature is provided, Gmail will sanitize the + * HTML before saving it with the alias. + * + * Addresses other than the primary address for the account can only be updated + * by service account clients that have been delegated domain-wide authority. + * (sendAs.update) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param string $sendAsEmail The send-as alias to be updated. + * @param Google_Service_Gmail_SendAs $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_SendAs + */ + public function update($userId, $sendAsEmail, Google_Service_Gmail_SendAs $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('update', array($params), "Google_Service_Gmail_SendAs"); + } + /** + * Sends a verification email to the specified send-as alias address. The + * verification status must be pending. + * + * This method is only available to service account clients that have been + * delegated domain-wide authority. (sendAs.verify) + * + * @param string $userId User's email address. The special value "me" can be + * used to indicate the authenticated user. + * @param string $sendAsEmail The send-as alias to be verified. + * @param array $optParams Optional parameters. + */ + public function verify($userId, $sendAsEmail, $optParams = array()) + { + $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail); + $params = array_merge($params, $optParams); + return $this->call('verify', array($params)); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsSendAsSmimeInfo.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsSendAsSmimeInfo.php new file mode 100644 index 0000000..ffb17fa --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsSendAsSmimeInfo.php @@ -0,0 +1,115 @@ + + * $gmailService = new Google_Service_Gmail(...); + * $smimeInfo = $gmailService->smimeInfo; + * + */ +class Google_Service_Gmail_Resource_UsersSettingsSendAsSmimeInfo extends Google_Service_Resource +{ + /** + * Deletes the specified S/MIME config for the specified send-as alias. + * (smimeInfo.delete) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $sendAsEmail The email address that appears in the "From:" + * header for mail sent using this alias. + * @param string $id The immutable ID for the SmimeInfo. + * @param array $optParams Optional parameters. + */ + public function delete($userId, $sendAsEmail, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('delete', array($params)); + } + /** + * Gets the specified S/MIME config for the specified send-as alias. + * (smimeInfo.get) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $sendAsEmail The email address that appears in the "From:" + * header for mail sent using this alias. + * @param string $id The immutable ID for the SmimeInfo. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_SmimeInfo + */ + public function get($userId, $sendAsEmail, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Gmail_SmimeInfo"); + } + /** + * Insert (upload) the given S/MIME config for the specified send-as alias. Note + * that pkcs12 format is required for the key. (smimeInfo.insert) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $sendAsEmail The email address that appears in the "From:" + * header for mail sent using this alias. + * @param Google_Service_Gmail_SmimeInfo $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_SmimeInfo + */ + public function insert($userId, $sendAsEmail, Google_Service_Gmail_SmimeInfo $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('insert', array($params), "Google_Service_Gmail_SmimeInfo"); + } + /** + * Lists S/MIME configs for the specified send-as alias. + * (smimeInfo.listUsersSettingsSendAsSmimeInfo) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $sendAsEmail The email address that appears in the "From:" + * header for mail sent using this alias. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_ListSmimeInfoResponse + */ + public function listUsersSettingsSendAsSmimeInfo($userId, $sendAsEmail, $optParams = array()) + { + $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail); + $params = array_merge($params, $optParams); + return $this->call('list', array($params), "Google_Service_Gmail_ListSmimeInfoResponse"); + } + /** + * Sets the default S/MIME config for the specified send-as alias. + * (smimeInfo.setDefault) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $sendAsEmail The email address that appears in the "From:" + * header for mail sent using this alias. + * @param string $id The immutable ID for the SmimeInfo. + * @param array $optParams Optional parameters. + */ + public function setDefault($userId, $sendAsEmail, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('setDefault', array($params)); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersThreads.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersThreads.php new file mode 100644 index 0000000..b8909c4 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersThreads.php @@ -0,0 +1,135 @@ + + * $gmailService = new Google_Service_Gmail(...); + * $threads = $gmailService->threads; + * + */ +class Google_Service_Gmail_Resource_UsersThreads extends Google_Service_Resource +{ + /** + * Immediately and permanently deletes the specified thread. This operation + * cannot be undone. Prefer threads.trash instead. (threads.delete) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id ID of the Thread to delete. + * @param array $optParams Optional parameters. + */ + public function delete($userId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('delete', array($params)); + } + /** + * Gets the specified thread. (threads.get) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the thread to retrieve. + * @param array $optParams Optional parameters. + * + * @opt_param string format The format to return the messages in. + * @opt_param string metadataHeaders When given and format is METADATA, only + * include headers specified. + * @return Google_Service_Gmail_Thread + */ + public function get($userId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Gmail_Thread"); + } + /** + * Lists the threads in the user's mailbox. (threads.listUsersThreads) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param array $optParams Optional parameters. + * + * @opt_param bool includeSpamTrash Include threads from SPAM and TRASH in the + * results. + * @opt_param string labelIds Only return threads with labels that match all of + * the specified label IDs. + * @opt_param string maxResults Maximum number of threads to return. + * @opt_param string pageToken Page token to retrieve a specific page of results + * in the list. + * @opt_param string q Only return threads matching the specified query. + * Supports the same query format as the Gmail search box. For example, + * "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used + * when accessing the api using the gmail.metadata scope. + * @return Google_Service_Gmail_ListThreadsResponse + */ + public function listUsersThreads($userId, $optParams = array()) + { + $params = array('userId' => $userId); + $params = array_merge($params, $optParams); + return $this->call('list', array($params), "Google_Service_Gmail_ListThreadsResponse"); + } + /** + * Modifies the labels applied to the thread. This applies to all messages in + * the thread. (threads.modify) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the thread to modify. + * @param Google_Service_Gmail_ModifyThreadRequest $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Thread + */ + public function modify($userId, $id, Google_Service_Gmail_ModifyThreadRequest $postBody, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('modify', array($params), "Google_Service_Gmail_Thread"); + } + /** + * Moves the specified thread to the trash. (threads.trash) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the thread to Trash. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Thread + */ + public function trash($userId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('trash', array($params), "Google_Service_Gmail_Thread"); + } + /** + * Removes the specified thread from the trash. (threads.untrash) + * + * @param string $userId The user's email address. The special value me can be + * used to indicate the authenticated user. + * @param string $id The ID of the thread to remove from Trash. + * @param array $optParams Optional parameters. + * @return Google_Service_Gmail_Thread + */ + public function untrash($userId, $id, $optParams = array()) + { + $params = array('userId' => $userId, 'id' => $id); + $params = array_merge($params, $optParams); + return $this->call('untrash', array($params), "Google_Service_Gmail_Thread"); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/SendAs.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/SendAs.php new file mode 100644 index 0000000..82f96cd --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/SendAs.php @@ -0,0 +1,109 @@ +displayName = $displayName; + } + public function getDisplayName() + { + return $this->displayName; + } + public function setIsDefault($isDefault) + { + $this->isDefault = $isDefault; + } + public function getIsDefault() + { + return $this->isDefault; + } + public function setIsPrimary($isPrimary) + { + $this->isPrimary = $isPrimary; + } + public function getIsPrimary() + { + return $this->isPrimary; + } + public function setReplyToAddress($replyToAddress) + { + $this->replyToAddress = $replyToAddress; + } + public function getReplyToAddress() + { + return $this->replyToAddress; + } + public function setSendAsEmail($sendAsEmail) + { + $this->sendAsEmail = $sendAsEmail; + } + public function getSendAsEmail() + { + return $this->sendAsEmail; + } + public function setSignature($signature) + { + $this->signature = $signature; + } + public function getSignature() + { + return $this->signature; + } + /** + * @param Google_Service_Gmail_SmtpMsa + */ + public function setSmtpMsa(Google_Service_Gmail_SmtpMsa $smtpMsa) + { + $this->smtpMsa = $smtpMsa; + } + /** + * @return Google_Service_Gmail_SmtpMsa + */ + public function getSmtpMsa() + { + return $this->smtpMsa; + } + public function setTreatAsAlias($treatAsAlias) + { + $this->treatAsAlias = $treatAsAlias; + } + public function getTreatAsAlias() + { + return $this->treatAsAlias; + } + public function setVerificationStatus($verificationStatus) + { + $this->verificationStatus = $verificationStatus; + } + public function getVerificationStatus() + { + return $this->verificationStatus; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/SmimeInfo.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/SmimeInfo.php new file mode 100644 index 0000000..0e21802 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/SmimeInfo.php @@ -0,0 +1,84 @@ +encryptedKeyPassword = $encryptedKeyPassword; + } + public function getEncryptedKeyPassword() + { + return $this->encryptedKeyPassword; + } + public function setExpiration($expiration) + { + $this->expiration = $expiration; + } + public function getExpiration() + { + return $this->expiration; + } + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } + public function setIsDefault($isDefault) + { + $this->isDefault = $isDefault; + } + public function getIsDefault() + { + return $this->isDefault; + } + public function setIssuerCn($issuerCn) + { + $this->issuerCn = $issuerCn; + } + public function getIssuerCn() + { + return $this->issuerCn; + } + public function setPem($pem) + { + $this->pem = $pem; + } + public function getPem() + { + return $this->pem; + } + public function setPkcs12($pkcs12) + { + $this->pkcs12 = $pkcs12; + } + public function getPkcs12() + { + return $this->pkcs12; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/SmtpMsa.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/SmtpMsa.php new file mode 100644 index 0000000..c019138 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/SmtpMsa.php @@ -0,0 +1,66 @@ +host = $host; + } + public function getHost() + { + return $this->host; + } + public function setPassword($password) + { + $this->password = $password; + } + public function getPassword() + { + return $this->password; + } + public function setPort($port) + { + $this->port = $port; + } + public function getPort() + { + return $this->port; + } + public function setSecurityMode($securityMode) + { + $this->securityMode = $securityMode; + } + public function getSecurityMode() + { + return $this->securityMode; + } + public function setUsername($username) + { + $this->username = $username; + } + public function getUsername() + { + return $this->username; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Thread.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Thread.php new file mode 100644 index 0000000..74a0f0a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Thread.php @@ -0,0 +1,65 @@ +historyId = $historyId; + } + public function getHistoryId() + { + return $this->historyId; + } + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } + /** + * @param Google_Service_Gmail_Message + */ + public function setMessages($messages) + { + $this->messages = $messages; + } + /** + * @return Google_Service_Gmail_Message + */ + public function getMessages() + { + return $this->messages; + } + public function setSnippet($snippet) + { + $this->snippet = $snippet; + } + public function getSnippet() + { + return $this->snippet; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/VacationSettings.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/VacationSettings.php new file mode 100644 index 0000000..1e990db --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/VacationSettings.php @@ -0,0 +1,93 @@ +enableAutoReply = $enableAutoReply; + } + public function getEnableAutoReply() + { + return $this->enableAutoReply; + } + public function setEndTime($endTime) + { + $this->endTime = $endTime; + } + public function getEndTime() + { + return $this->endTime; + } + public function setResponseBodyHtml($responseBodyHtml) + { + $this->responseBodyHtml = $responseBodyHtml; + } + public function getResponseBodyHtml() + { + return $this->responseBodyHtml; + } + public function setResponseBodyPlainText($responseBodyPlainText) + { + $this->responseBodyPlainText = $responseBodyPlainText; + } + public function getResponseBodyPlainText() + { + return $this->responseBodyPlainText; + } + public function setResponseSubject($responseSubject) + { + $this->responseSubject = $responseSubject; + } + public function getResponseSubject() + { + return $this->responseSubject; + } + public function setRestrictToContacts($restrictToContacts) + { + $this->restrictToContacts = $restrictToContacts; + } + public function getRestrictToContacts() + { + return $this->restrictToContacts; + } + public function setRestrictToDomain($restrictToDomain) + { + $this->restrictToDomain = $restrictToDomain; + } + public function getRestrictToDomain() + { + return $this->restrictToDomain; + } + public function setStartTime($startTime) + { + $this->startTime = $startTime; + } + public function getStartTime() + { + return $this->startTime; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/WatchRequest.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/WatchRequest.php new file mode 100644 index 0000000..5fa9144 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/WatchRequest.php @@ -0,0 +1,49 @@ +labelFilterAction = $labelFilterAction; + } + public function getLabelFilterAction() + { + return $this->labelFilterAction; + } + public function setLabelIds($labelIds) + { + $this->labelIds = $labelIds; + } + public function getLabelIds() + { + return $this->labelIds; + } + public function setTopicName($topicName) + { + $this->topicName = $topicName; + } + public function getTopicName() + { + return $this->topicName; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/WatchResponse.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/WatchResponse.php new file mode 100644 index 0000000..d7dc3bf --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/WatchResponse.php @@ -0,0 +1,39 @@ +expiration = $expiration; + } + public function getExpiration() + { + return $this->expiration; + } + public function setHistoryId($historyId) + { + $this->historyId = $historyId; + } + public function getHistoryId() + { + return $this->historyId; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/LICENSE b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/LICENSE new file mode 100644 index 0000000..a148ba5 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/LICENSE @@ -0,0 +1,203 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all +other entities that control, are controlled by, or are under common +control with that entity. For the purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the +direction or management of such entity, whether by contract or +otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation +source, and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or +Object form, made available under the License, as indicated by a +copyright notice that is included in or attached to the work +(an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, +the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including +the original version of the Work and any modifications or additions +to that Work or Derivative Works thereof, that is intentionally +submitted to Licensor for inclusion in the Work by the copyright owner +or by an individual or Legal Entity authorized to submit on behalf of +the copyright owner. For the purposes of this definition, "submitted" +means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, +and issue tracking systems that are managed by, or on behalf of, the +Licensor for the purpose of discussing and improving the Work, but +excluding communication that is conspicuously marked or otherwise +designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work, +where such license applies only to those patent claims licensable +by such Contributor that are necessarily infringed by their +Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You +institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work +or a Contribution incorporated within the Work constitutes direct +or contributory patent infringement, then any patent licenses +granted to You under this License for that Work shall terminate +as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You +meet the following conditions: + +(a) You must give any other recipients of the Work or +Derivative Works a copy of this License; and + +(b) You must cause any modified files to carry prominent notices +stating that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works +that You distribute, all copyright, patent, trademark, and +attribution notices from the Source form of the Work, +excluding those notices that do not pertain to any part of +the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must +include a readable copy of the attribution notices contained +within such NOTICE file, excluding those notices that do not +pertain to any part of the Derivative Works, in at least one +of the following places: within a NOTICE text file distributed +as part of the Derivative Works; within the Source form or +documentation, if provided along with the Derivative Works; or, +within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents +of the NOTICE file are for informational purposes only and +do not modify the License. You may add Your own attribution +notices within Derivative Works that You distribute, alongside +or as an addendum to the NOTICE text from the Work, provided +that such additional attribution notices cannot be construed +as modifying the License. + +You may add Your own copyright statement to Your modifications and +may provide additional or different license terms and conditions +for use, reproduction, or distribution of Your modifications, or +for any such Derivative Works as a whole, provided Your use, +reproduction, and distribution of the Work otherwise complies with +the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "[]" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AccessToken/Revoke.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AccessToken/Revoke.php new file mode 100644 index 0000000..29eb3fb --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AccessToken/Revoke.php @@ -0,0 +1,78 @@ +http = $http; + } + + /** + * Revoke an OAuth2 access token or refresh token. This method will revoke the current access + * token, if a token isn't provided. + * + * @param string|array $token The token (access token or a refresh token) that should be revoked. + * @return boolean Returns True if the revocation was successful, otherwise False. + */ + public function revokeToken($token) + { + if (is_array($token)) { + if (isset($token['refresh_token'])) { + $token = $token['refresh_token']; + } else { + $token = $token['access_token']; + } + } + + $body = Psr7\stream_for(http_build_query(array('token' => $token))); + $request = new Request( + 'POST', + Google_Client::OAUTH2_REVOKE_URI, + [ + 'Cache-Control' => 'no-store', + 'Content-Type' => 'application/x-www-form-urlencoded', + ], + $body + ); + + $httpHandler = HttpHandlerFactory::build($this->http); + + $response = $httpHandler($request); + + return $response->getStatusCode() == 200; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AccessToken/Verify.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AccessToken/Verify.php new file mode 100644 index 0000000..bc0afcb --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AccessToken/Verify.php @@ -0,0 +1,273 @@ +http = $http; + $this->cache = $cache; + $this->jwt = $jwt ?: $this->getJwtService(); + } + + /** + * Verifies an id token and returns the authenticated apiLoginTicket. + * Throws an exception if the id token is not valid. + * The audience parameter can be used to control which id tokens are + * accepted. By default, the id token must have been issued to this OAuth2 client. + * + * @param $audience + * @return array the token payload, if successful + */ + public function verifyIdToken($idToken, $audience = null) + { + if (empty($idToken)) { + throw new LogicException('id_token cannot be null'); + } + + // set phpseclib constants if applicable + $this->setPhpsecConstants(); + + // Check signature + $certs = $this->getFederatedSignOnCerts(); + foreach ($certs as $cert) { + $bigIntClass = $this->getBigIntClass(); + $rsaClass = $this->getRsaClass(); + $modulus = new $bigIntClass($this->jwt->urlsafeB64Decode($cert['n']), 256); + $exponent = new $bigIntClass($this->jwt->urlsafeB64Decode($cert['e']), 256); + + $rsa = new $rsaClass(); + $rsa->loadKey(array('n' => $modulus, 'e' => $exponent)); + + try { + $payload = $this->jwt->decode( + $idToken, + $rsa->getPublicKey(), + array('RS256') + ); + + if (property_exists($payload, 'aud')) { + if ($audience && $payload->aud != $audience) { + return false; + } + } + + // support HTTP and HTTPS issuers + // @see https://developers.google.com/identity/sign-in/web/backend-auth + $issuers = array(self::OAUTH2_ISSUER, self::OAUTH2_ISSUER_HTTPS); + if (!isset($payload->iss) || !in_array($payload->iss, $issuers)) { + return false; + } + + return (array) $payload; + } catch (ExpiredException $e) { + return false; + } catch (ExpiredExceptionV3 $e) { + return false; + } catch (SignatureInvalidException $e) { + // continue + } catch (DomainException $e) { + // continue + } + } + + return false; + } + + private function getCache() + { + return $this->cache; + } + + /** + * Retrieve and cache a certificates file. + * + * @param $url string location + * @throws Google_Exception + * @return array certificates + */ + private function retrieveCertsFromLocation($url) + { + // If we're retrieving a local file, just grab it. + if (0 !== strpos($url, 'http')) { + if (!$file = file_get_contents($url)) { + throw new Google_Exception( + "Failed to retrieve verification certificates: '" . + $url . "'." + ); + } + + return json_decode($file, true); + } + + $response = $this->http->get($url); + + if ($response->getStatusCode() == 200) { + return json_decode((string) $response->getBody(), true); + } + throw new Google_Exception( + sprintf( + 'Failed to retrieve verification certificates: "%s".', + $response->getBody()->getContents() + ), + $response->getStatusCode() + ); + } + + // Gets federated sign-on certificates to use for verifying identity tokens. + // Returns certs as array structure, where keys are key ids, and values + // are PEM encoded certificates. + private function getFederatedSignOnCerts() + { + $certs = null; + if ($cache = $this->getCache()) { + $cacheItem = $cache->getItem('federated_signon_certs_v3'); + $certs = $cacheItem->get(); + } + + + if (!$certs) { + $certs = $this->retrieveCertsFromLocation( + self::FEDERATED_SIGNON_CERT_URL + ); + + if ($cache) { + $cacheItem->expiresAt(new DateTime('+1 hour')); + $cacheItem->set($certs); + $cache->save($cacheItem); + } + } + + if (!isset($certs['keys'])) { + throw new InvalidArgumentException( + 'federated sign-on certs expects "keys" to be set' + ); + } + + return $certs['keys']; + } + + private function getJwtService() + { + $jwtClass = 'JWT'; + if (class_exists('\Firebase\JWT\JWT')) { + $jwtClass = 'Firebase\JWT\JWT'; + } + + if (property_exists($jwtClass, 'leeway') && $jwtClass::$leeway < 1) { + // Ensures JWT leeway is at least 1 + // @see https://github.com/google/google-api-php-client/issues/827 + $jwtClass::$leeway = 1; + } + + return new $jwtClass; + } + + private function getRsaClass() + { + if (class_exists('phpseclib\Crypt\RSA')) { + return 'phpseclib\Crypt\RSA'; + } + + return 'Crypt_RSA'; + } + + private function getBigIntClass() + { + if (class_exists('phpseclib\Math\BigInteger')) { + return 'phpseclib\Math\BigInteger'; + } + + return 'Math_BigInteger'; + } + + private function getOpenSslConstant() + { + if (class_exists('phpseclib\Crypt\RSA')) { + return 'phpseclib\Crypt\RSA::MODE_OPENSSL'; + } + + if (class_exists('Crypt_RSA')) { + return 'CRYPT_RSA_MODE_OPENSSL'; + } + + throw new \Exception('Cannot find RSA class'); + } + + /** + * phpseclib calls "phpinfo" by default, which requires special + * whitelisting in the AppEngine VM environment. This function + * sets constants to bypass the need for phpseclib to check phpinfo + * + * @see phpseclib/Math/BigInteger + * @see https://github.com/GoogleCloudPlatform/getting-started-php/issues/85 + */ + private function setPhpsecConstants() + { + if (filter_var(getenv('GAE_VM'), FILTER_VALIDATE_BOOLEAN)) { + if (!defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) { + define('MATH_BIGINTEGER_OPENSSL_ENABLED', true); + } + if (!defined('CRYPT_RSA_MODE')) { + define('CRYPT_RSA_MODE', constant($this->getOpenSslConstant())); + } + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AuthHandler/AuthHandlerFactory.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AuthHandler/AuthHandlerFactory.php new file mode 100644 index 0000000..f1a3229 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AuthHandler/AuthHandlerFactory.php @@ -0,0 +1,42 @@ +cache = $cache; + $this->cacheConfig = $cacheConfig; + } + + public function attachCredentials( + ClientInterface $http, + CredentialsLoader $credentials, + callable $tokenCallback = null + ) { + // use the provided cache + if ($this->cache) { + $credentials = new FetchAuthTokenCache( + $credentials, + $this->cacheConfig, + $this->cache + ); + } + // if we end up needing to make an HTTP request to retrieve credentials, we + // can use our existing one, but we need to throw exceptions so the error + // bubbles up. + $authHttp = $this->createAuthHttp($http); + $authHttpHandler = HttpHandlerFactory::build($authHttp); + $subscriber = new AuthTokenSubscriber( + $credentials, + $authHttpHandler, + $tokenCallback + ); + + $http->setDefaultOption('auth', 'google_auth'); + $http->getEmitter()->attach($subscriber); + + return $http; + } + + public function attachToken(ClientInterface $http, array $token, array $scopes) + { + $tokenFunc = function ($scopes) use ($token) { + return $token['access_token']; + }; + + $subscriber = new ScopedAccessTokenSubscriber( + $tokenFunc, + $scopes, + $this->cacheConfig, + $this->cache + ); + + $http->setDefaultOption('auth', 'scoped'); + $http->getEmitter()->attach($subscriber); + + return $http; + } + + public function attachKey(ClientInterface $http, $key) + { + $subscriber = new SimpleSubscriber(['key' => $key]); + + $http->setDefaultOption('auth', 'simple'); + $http->getEmitter()->attach($subscriber); + + return $http; + } + + private function createAuthHttp(ClientInterface $http) + { + return new Client( + [ + 'base_url' => $http->getBaseUrl(), + 'defaults' => [ + 'exceptions' => true, + 'verify' => $http->getDefaultOption('verify'), + 'proxy' => $http->getDefaultOption('proxy'), + ] + ] + ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AuthHandler/Guzzle6AuthHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AuthHandler/Guzzle6AuthHandler.php new file mode 100644 index 0000000..fcdfb3b --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AuthHandler/Guzzle6AuthHandler.php @@ -0,0 +1,106 @@ +cache = $cache; + $this->cacheConfig = $cacheConfig; + } + + public function attachCredentials( + ClientInterface $http, + CredentialsLoader $credentials, + callable $tokenCallback = null + ) { + // use the provided cache + if ($this->cache) { + $credentials = new FetchAuthTokenCache( + $credentials, + $this->cacheConfig, + $this->cache + ); + } + // if we end up needing to make an HTTP request to retrieve credentials, we + // can use our existing one, but we need to throw exceptions so the error + // bubbles up. + $authHttp = $this->createAuthHttp($http); + $authHttpHandler = HttpHandlerFactory::build($authHttp); + $middleware = new AuthTokenMiddleware( + $credentials, + $authHttpHandler, + $tokenCallback + ); + + $config = $http->getConfig(); + $config['handler']->remove('google_auth'); + $config['handler']->push($middleware, 'google_auth'); + $config['auth'] = 'google_auth'; + $http = new Client($config); + + return $http; + } + + public function attachToken(ClientInterface $http, array $token, array $scopes) + { + $tokenFunc = function ($scopes) use ($token) { + return $token['access_token']; + }; + + $middleware = new ScopedAccessTokenMiddleware( + $tokenFunc, + $scopes, + $this->cacheConfig, + $this->cache + ); + + $config = $http->getConfig(); + $config['handler']->remove('google_auth'); + $config['handler']->push($middleware, 'google_auth'); + $config['auth'] = 'scoped'; + $http = new Client($config); + + return $http; + } + + public function attachKey(ClientInterface $http, $key) + { + $middleware = new SimpleMiddleware(['key' => $key]); + + $config = $http->getConfig(); + $config['handler']->remove('google_auth'); + $config['handler']->push($middleware, 'google_auth'); + $config['auth'] = 'simple'; + $http = new Client($config); + + return $http; + } + + private function createAuthHttp(ClientInterface $http) + { + return new Client( + [ + 'base_uri' => $http->getConfig('base_uri'), + 'exceptions' => true, + 'verify' => $http->getConfig('verify'), + 'proxy' => $http->getConfig('proxy'), + ] + ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Client.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Client.php new file mode 100644 index 0000000..e1acef1 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Client.php @@ -0,0 +1,1139 @@ +config = array_merge( + [ + 'application_name' => '', + + // Don't change these unless you're working against a special development + // or testing environment. + 'base_path' => self::API_BASE_PATH, + + // https://developers.google.com/console + 'client_id' => '', + 'client_secret' => '', + 'redirect_uri' => null, + 'state' => null, + + // Simple API access key, also from the API console. Ensure you get + // a Server key, and not a Browser key. + 'developer_key' => '', + + // For use with Google Cloud Platform + // fetch the ApplicationDefaultCredentials, if applicable + // @see https://developers.google.com/identity/protocols/application-default-credentials + 'use_application_default_credentials' => false, + 'signing_key' => null, + 'signing_algorithm' => null, + 'subject' => null, + + // Other OAuth2 parameters. + 'hd' => '', + 'prompt' => '', + 'openid.realm' => '', + 'include_granted_scopes' => null, + 'login_hint' => '', + 'request_visible_actions' => '', + 'access_type' => 'online', + 'approval_prompt' => 'auto', + + // Task Runner retry configuration + // @see Google_Task_Runner + 'retry' => array(), + 'retry_map' => null, + + // cache config for downstream auth caching + 'cache_config' => [], + + // function to be called when an access token is fetched + // follows the signature function ($cacheKey, $accessToken) + 'token_callback' => null, + + // Service class used in Google_Client::verifyIdToken. + // Explicitly pass this in to avoid setting JWT::$leeway + 'jwt' => null, + ], + $config + ); + } + + /** + * Get a string containing the version of the library. + * + * @return string + */ + public function getLibraryVersion() + { + return self::LIBVER; + } + + /** + * For backwards compatibility + * alias for fetchAccessTokenWithAuthCode + * + * @param $code string code from accounts.google.com + * @return array access token + * @deprecated + */ + public function authenticate($code) + { + return $this->fetchAccessTokenWithAuthCode($code); + } + + /** + * Attempt to exchange a code for an valid authentication token. + * Helper wrapped around the OAuth 2.0 implementation. + * + * @param $code string code from accounts.google.com + * @return array access token + */ + public function fetchAccessTokenWithAuthCode($code) + { + if (strlen($code) == 0) { + throw new InvalidArgumentException("Invalid code"); + } + + $auth = $this->getOAuth2Service(); + $auth->setCode($code); + $auth->setRedirectUri($this->getRedirectUri()); + + $httpHandler = HttpHandlerFactory::build($this->getHttpClient()); + $creds = $auth->fetchAuthToken($httpHandler); + if ($creds && isset($creds['access_token'])) { + $creds['created'] = time(); + $this->setAccessToken($creds); + } + + return $creds; + } + + /** + * For backwards compatibility + * alias for fetchAccessTokenWithAssertion + * + * @return array access token + * @deprecated + */ + public function refreshTokenWithAssertion() + { + return $this->fetchAccessTokenWithAssertion(); + } + + /** + * Fetches a fresh access token with a given assertion token. + * @param ClientInterface $authHttp optional. + * @return array access token + */ + public function fetchAccessTokenWithAssertion(ClientInterface $authHttp = null) + { + if (!$this->isUsingApplicationDefaultCredentials()) { + throw new DomainException( + 'set the JSON service account credentials using' + . ' Google_Client::setAuthConfig or set the path to your JSON file' + . ' with the "GOOGLE_APPLICATION_CREDENTIALS" environment variable' + . ' and call Google_Client::useApplicationDefaultCredentials to' + . ' refresh a token with assertion.' + ); + } + + $this->getLogger()->log( + 'info', + 'OAuth2 access token refresh with Signed JWT assertion grants.' + ); + + $credentials = $this->createApplicationDefaultCredentials(); + + $httpHandler = HttpHandlerFactory::build($authHttp); + $creds = $credentials->fetchAuthToken($httpHandler); + if ($creds && isset($creds['access_token'])) { + $creds['created'] = time(); + $this->setAccessToken($creds); + } + + return $creds; + } + + /** + * For backwards compatibility + * alias for fetchAccessTokenWithRefreshToken + * + * @param string $refreshToken + * @return array access token + */ + public function refreshToken($refreshToken) + { + return $this->fetchAccessTokenWithRefreshToken($refreshToken); + } + + /** + * Fetches a fresh OAuth 2.0 access token with the given refresh token. + * @param string $refreshToken + * @return array access token + */ + public function fetchAccessTokenWithRefreshToken($refreshToken = null) + { + if (null === $refreshToken) { + if (!isset($this->token['refresh_token'])) { + throw new LogicException( + 'refresh token must be passed in or set as part of setAccessToken' + ); + } + $refreshToken = $this->token['refresh_token']; + } + $this->getLogger()->info('OAuth2 access token refresh'); + $auth = $this->getOAuth2Service(); + $auth->setRefreshToken($refreshToken); + + $httpHandler = HttpHandlerFactory::build($this->getHttpClient()); + $creds = $auth->fetchAuthToken($httpHandler); + if ($creds && isset($creds['access_token'])) { + $creds['created'] = time(); + if (!isset($creds['refresh_token'])) { + $creds['refresh_token'] = $refreshToken; + } + $this->setAccessToken($creds); + } + + return $creds; + } + + /** + * Create a URL to obtain user authorization. + * The authorization endpoint allows the user to first + * authenticate, and then grant/deny the access request. + * @param string|array $scope The scope is expressed as an array or list of space-delimited strings. + * @return string + */ + public function createAuthUrl($scope = null) + { + if (empty($scope)) { + $scope = $this->prepareScopes(); + } + if (is_array($scope)) { + $scope = implode(' ', $scope); + } + + // only accept one of prompt or approval_prompt + $approvalPrompt = $this->config['prompt'] + ? null + : $this->config['approval_prompt']; + + // include_granted_scopes should be string "true", string "false", or null + $includeGrantedScopes = $this->config['include_granted_scopes'] === null + ? null + : var_export($this->config['include_granted_scopes'], true); + + $params = array_filter( + [ + 'access_type' => $this->config['access_type'], + 'approval_prompt' => $approvalPrompt, + 'hd' => $this->config['hd'], + 'include_granted_scopes' => $includeGrantedScopes, + 'login_hint' => $this->config['login_hint'], + 'openid.realm' => $this->config['openid.realm'], + 'prompt' => $this->config['prompt'], + 'response_type' => 'code', + 'scope' => $scope, + 'state' => $this->config['state'], + ] + ); + + // If the list of scopes contains plus.login, add request_visible_actions + // to auth URL. + $rva = $this->config['request_visible_actions']; + if (strlen($rva) > 0 && false !== strpos($scope, 'plus.login')) { + $params['request_visible_actions'] = $rva; + } + + $auth = $this->getOAuth2Service(); + + return (string) $auth->buildFullAuthorizationUri($params); + } + + /** + * Adds auth listeners to the HTTP client based on the credentials + * set in the Google API Client object + * + * @param GuzzleHttp\ClientInterface $http the http client object. + * @return GuzzleHttp\ClientInterface the http client object + */ + public function authorize(ClientInterface $http = null) + { + $credentials = null; + $token = null; + $scopes = null; + if (null === $http) { + $http = $this->getHttpClient(); + } + + // These conditionals represent the decision tree for authentication + // 1. Check for Application Default Credentials + // 2. Check for API Key + // 3a. Check for an Access Token + // 3b. If access token exists but is expired, try to refresh it + if ($this->isUsingApplicationDefaultCredentials()) { + $credentials = $this->createApplicationDefaultCredentials(); + } elseif ($token = $this->getAccessToken()) { + $scopes = $this->prepareScopes(); + // add refresh subscriber to request a new token + if (isset($token['refresh_token']) && $this->isAccessTokenExpired()) { + $credentials = $this->createUserRefreshCredentials( + $scopes, + $token['refresh_token'] + ); + } + } + + $authHandler = $this->getAuthHandler(); + + if ($credentials) { + $callback = $this->config['token_callback']; + $http = $authHandler->attachCredentials($http, $credentials, $callback); + } elseif ($token) { + $http = $authHandler->attachToken($http, $token, (array) $scopes); + } elseif ($key = $this->config['developer_key']) { + $http = $authHandler->attachKey($http, $key); + } + + return $http; + } + + /** + * Set the configuration to use application default credentials for + * authentication + * + * @see https://developers.google.com/identity/protocols/application-default-credentials + * @param boolean $useAppCreds + */ + public function useApplicationDefaultCredentials($useAppCreds = true) + { + $this->config['use_application_default_credentials'] = $useAppCreds; + } + + /** + * To prevent useApplicationDefaultCredentials from inappropriately being + * called in a conditional + * + * @see https://developers.google.com/identity/protocols/application-default-credentials + */ + public function isUsingApplicationDefaultCredentials() + { + return $this->config['use_application_default_credentials']; + } + + /** + * @param string|array $token + * @throws InvalidArgumentException + */ + public function setAccessToken($token) + { + if (is_string($token)) { + if ($json = json_decode($token, true)) { + $token = $json; + } else { + // assume $token is just the token string + $token = array( + 'access_token' => $token, + ); + } + } + if ($token == null) { + throw new InvalidArgumentException('invalid json token'); + } + if (!isset($token['access_token'])) { + throw new InvalidArgumentException("Invalid token format"); + } + $this->token = $token; + } + + public function getAccessToken() + { + return $this->token; + } + + /** + * @return string|null + */ + public function getRefreshToken() + { + if (isset($this->token['refresh_token'])) { + return $this->token['refresh_token']; + } + + return null; + } + + /** + * Returns if the access_token is expired. + * @return bool Returns True if the access_token is expired. + */ + public function isAccessTokenExpired() + { + if (!$this->token) { + return true; + } + + $created = 0; + if (isset($this->token['created'])) { + $created = $this->token['created']; + } elseif (isset($this->token['id_token'])) { + // check the ID token for "iat" + // signature verification is not required here, as we are just + // using this for convenience to save a round trip request + // to the Google API server + $idToken = $this->token['id_token']; + if (substr_count($idToken, '.') == 2) { + $parts = explode('.', $idToken); + $payload = json_decode(base64_decode($parts[1]), true); + if ($payload && isset($payload['iat'])) { + $created = $payload['iat']; + } + } + } + + // If the token is set to expire in the next 30 seconds. + return ($created + ($this->token['expires_in'] - 30)) < time(); + } + + /** + * @deprecated See UPGRADING.md for more information + */ + public function getAuth() + { + throw new BadMethodCallException( + 'This function no longer exists. See UPGRADING.md for more information' + ); + } + + /** + * @deprecated See UPGRADING.md for more information + */ + public function setAuth($auth) + { + throw new BadMethodCallException( + 'This function no longer exists. See UPGRADING.md for more information' + ); + } + + /** + * Set the OAuth 2.0 Client ID. + * @param string $clientId + */ + public function setClientId($clientId) + { + $this->config['client_id'] = $clientId; + } + + public function getClientId() + { + return $this->config['client_id']; + } + + /** + * Set the OAuth 2.0 Client Secret. + * @param string $clientSecret + */ + public function setClientSecret($clientSecret) + { + $this->config['client_secret'] = $clientSecret; + } + + public function getClientSecret() + { + return $this->config['client_secret']; + } + + /** + * Set the OAuth 2.0 Redirect URI. + * @param string $redirectUri + */ + public function setRedirectUri($redirectUri) + { + $this->config['redirect_uri'] = $redirectUri; + } + + public function getRedirectUri() + { + return $this->config['redirect_uri']; + } + + /** + * Set OAuth 2.0 "state" parameter to achieve per-request customization. + * @see http://tools.ietf.org/html/draft-ietf-oauth-v2-22#section-3.1.2.2 + * @param string $state + */ + public function setState($state) + { + $this->config['state'] = $state; + } + + /** + * @param string $accessType Possible values for access_type include: + * {@code "offline"} to request offline access from the user. + * {@code "online"} to request online access from the user. + */ + public function setAccessType($accessType) + { + $this->config['access_type'] = $accessType; + } + + /** + * @param string $approvalPrompt Possible values for approval_prompt include: + * {@code "force"} to force the approval UI to appear. + * {@code "auto"} to request auto-approval when possible. (This is the default value) + */ + public function setApprovalPrompt($approvalPrompt) + { + $this->config['approval_prompt'] = $approvalPrompt; + } + + /** + * Set the login hint, email address or sub id. + * @param string $loginHint + */ + public function setLoginHint($loginHint) + { + $this->config['login_hint'] = $loginHint; + } + + /** + * Set the application name, this is included in the User-Agent HTTP header. + * @param string $applicationName + */ + public function setApplicationName($applicationName) + { + $this->config['application_name'] = $applicationName; + } + + /** + * If 'plus.login' is included in the list of requested scopes, you can use + * this method to define types of app activities that your app will write. + * You can find a list of available types here: + * @link https://developers.google.com/+/api/moment-types + * + * @param array $requestVisibleActions Array of app activity types + */ + public function setRequestVisibleActions($requestVisibleActions) + { + if (is_array($requestVisibleActions)) { + $requestVisibleActions = implode(" ", $requestVisibleActions); + } + $this->config['request_visible_actions'] = $requestVisibleActions; + } + + /** + * Set the developer key to use, these are obtained through the API Console. + * @see http://code.google.com/apis/console-help/#generatingdevkeys + * @param string $developerKey + */ + public function setDeveloperKey($developerKey) + { + $this->config['developer_key'] = $developerKey; + } + + /** + * Set the hd (hosted domain) parameter streamlines the login process for + * Google Apps hosted accounts. By including the domain of the user, you + * restrict sign-in to accounts at that domain. + * @param $hd string - the domain to use. + */ + public function setHostedDomain($hd) + { + $this->config['hd'] = $hd; + } + + /** + * Set the prompt hint. Valid values are none, consent and select_account. + * If no value is specified and the user has not previously authorized + * access, then the user is shown a consent screen. + * @param $prompt string + * {@code "none"} Do not display any authentication or consent screens. Must not be specified with other values. + * {@code "consent"} Prompt the user for consent. + * {@code "select_account"} Prompt the user to select an account. + */ + public function setPrompt($prompt) + { + $this->config['prompt'] = $prompt; + } + + /** + * openid.realm is a parameter from the OpenID 2.0 protocol, not from OAuth + * 2.0. It is used in OpenID 2.0 requests to signify the URL-space for which + * an authentication request is valid. + * @param $realm string - the URL-space to use. + */ + public function setOpenidRealm($realm) + { + $this->config['openid.realm'] = $realm; + } + + /** + * If this is provided with the value true, and the authorization request is + * granted, the authorization will include any previous authorizations + * granted to this user/application combination for other scopes. + * @param $include boolean - the URL-space to use. + */ + public function setIncludeGrantedScopes($include) + { + $this->config['include_granted_scopes'] = $include; + } + + /** + * sets function to be called when an access token is fetched + * @param callable $tokenCallback - function ($cacheKey, $accessToken) + */ + public function setTokenCallback(callable $tokenCallback) + { + $this->config['token_callback'] = $tokenCallback; + } + + /** + * Revoke an OAuth2 access token or refresh token. This method will revoke the current access + * token, if a token isn't provided. + * + * @param string|array|null $token The token (access token or a refresh token) that should be revoked. + * @return boolean Returns True if the revocation was successful, otherwise False. + */ + public function revokeToken($token = null) + { + $tokenRevoker = new Google_AccessToken_Revoke( + $this->getHttpClient() + ); + + return $tokenRevoker->revokeToken($token ?: $this->getAccessToken()); + } + + /** + * Verify an id_token. This method will verify the current id_token, if one + * isn't provided. + * + * @throws LogicException If no token was provided and no token was set using `setAccessToken`. + * @throws UnexpectedValueException If the token is not a valid JWT. + * @param string|null $idToken The token (id_token) that should be verified. + * @return array|false Returns the token payload as an array if the verification was + * successful, false otherwise. + */ + public function verifyIdToken($idToken = null) + { + $tokenVerifier = new Google_AccessToken_Verify( + $this->getHttpClient(), + $this->getCache(), + $this->config['jwt'] + ); + + if (null === $idToken) { + $token = $this->getAccessToken(); + if (!isset($token['id_token'])) { + throw new LogicException( + 'id_token must be passed in or set as part of setAccessToken' + ); + } + $idToken = $token['id_token']; + } + + return $tokenVerifier->verifyIdToken( + $idToken, + $this->getClientId() + ); + } + + /** + * Set the scopes to be requested. Must be called before createAuthUrl(). + * Will remove any previously configured scopes. + * @param string|array $scope_or_scopes, ie: array('https://www.googleapis.com/auth/plus.login', + * 'https://www.googleapis.com/auth/moderator') + */ + public function setScopes($scope_or_scopes) + { + $this->requestedScopes = array(); + $this->addScope($scope_or_scopes); + } + + /** + * This functions adds a scope to be requested as part of the OAuth2.0 flow. + * Will append any scopes not previously requested to the scope parameter. + * A single string will be treated as a scope to request. An array of strings + * will each be appended. + * @param $scope_or_scopes string|array e.g. "profile" + */ + public function addScope($scope_or_scopes) + { + if (is_string($scope_or_scopes) && !in_array($scope_or_scopes, $this->requestedScopes)) { + $this->requestedScopes[] = $scope_or_scopes; + } else if (is_array($scope_or_scopes)) { + foreach ($scope_or_scopes as $scope) { + $this->addScope($scope); + } + } + } + + /** + * Returns the list of scopes requested by the client + * @return array the list of scopes + * + */ + public function getScopes() + { + return $this->requestedScopes; + } + + /** + * @return string|null + * @visible For Testing + */ + public function prepareScopes() + { + if (empty($this->requestedScopes)) { + return null; + } + + return implode(' ', $this->requestedScopes); + } + + /** + * Helper method to execute deferred HTTP requests. + * + * @param $request Psr\Http\Message\RequestInterface|Google_Http_Batch + * @throws Google_Exception + * @return object of the type of the expected class or Psr\Http\Message\ResponseInterface. + */ + public function execute(RequestInterface $request, $expectedClass = null) + { + $request = $request->withHeader( + 'User-Agent', + $this->config['application_name'] + . " " . self::USER_AGENT_SUFFIX + . $this->getLibraryVersion() + ); + + // call the authorize method + // this is where most of the grunt work is done + $http = $this->authorize(); + + return Google_Http_REST::execute( + $http, + $request, + $expectedClass, + $this->config['retry'], + $this->config['retry_map'] + ); + } + + /** + * Declare whether batch calls should be used. This may increase throughput + * by making multiple requests in one connection. + * + * @param boolean $useBatch True if the batch support should + * be enabled. Defaults to False. + */ + public function setUseBatch($useBatch) + { + // This is actually an alias for setDefer. + $this->setDefer($useBatch); + } + + /** + * Are we running in Google AppEngine? + * return bool + */ + public function isAppEngine() + { + return (isset($_SERVER['SERVER_SOFTWARE']) && + strpos($_SERVER['SERVER_SOFTWARE'], 'Google App Engine') !== false); + } + + public function setConfig($name, $value) + { + $this->config[$name] = $value; + } + + public function getConfig($name, $default = null) + { + return isset($this->config[$name]) ? $this->config[$name] : $default; + } + + /** + * For backwards compatibility + * alias for setAuthConfig + * + * @param string $file the configuration file + * @throws Google_Exception + * @deprecated + */ + public function setAuthConfigFile($file) + { + $this->setAuthConfig($file); + } + + /** + * Set the auth config from new or deprecated JSON config. + * This structure should match the file downloaded from + * the "Download JSON" button on in the Google Developer + * Console. + * @param string|array $config the configuration json + * @throws Google_Exception + */ + public function setAuthConfig($config) + { + if (is_string($config)) { + if (!file_exists($config)) { + throw new InvalidArgumentException(sprintf('file "%s" does not exist', $config)); + } + + $json = file_get_contents($config); + + if (!$config = json_decode($json, true)) { + throw new LogicException('invalid json for auth config'); + } + } + + $key = isset($config['installed']) ? 'installed' : 'web'; + if (isset($config['type']) && $config['type'] == 'service_account') { + // application default credentials + $this->useApplicationDefaultCredentials(); + + // set the information from the config + $this->setClientId($config['client_id']); + $this->config['client_email'] = $config['client_email']; + $this->config['signing_key'] = $config['private_key']; + $this->config['signing_algorithm'] = 'HS256'; + } elseif (isset($config[$key])) { + // old-style + $this->setClientId($config[$key]['client_id']); + $this->setClientSecret($config[$key]['client_secret']); + if (isset($config[$key]['redirect_uris'])) { + $this->setRedirectUri($config[$key]['redirect_uris'][0]); + } + } else { + // new-style + $this->setClientId($config['client_id']); + $this->setClientSecret($config['client_secret']); + if (isset($config['redirect_uris'])) { + $this->setRedirectUri($config['redirect_uris'][0]); + } + } + } + + /** + * Use when the service account has been delegated domain wide access. + * + * @param string $subject an email address account to impersonate + */ + public function setSubject($subject) + { + $this->config['subject'] = $subject; + } + + /** + * Declare whether making API calls should make the call immediately, or + * return a request which can be called with ->execute(); + * + * @param boolean $defer True if calls should not be executed right away. + */ + public function setDefer($defer) + { + $this->deferExecution = $defer; + } + + /** + * Whether or not to return raw requests + * @return boolean + */ + public function shouldDefer() + { + return $this->deferExecution; + } + + /** + * @return Google\Auth\OAuth2 implementation + */ + public function getOAuth2Service() + { + if (!isset($this->auth)) { + $this->auth = $this->createOAuth2Service(); + } + + return $this->auth; + } + + /** + * create a default google auth object + */ + protected function createOAuth2Service() + { + $auth = new OAuth2( + [ + 'clientId' => $this->getClientId(), + 'clientSecret' => $this->getClientSecret(), + 'authorizationUri' => self::OAUTH2_AUTH_URL, + 'tokenCredentialUri' => self::OAUTH2_TOKEN_URI, + 'redirectUri' => $this->getRedirectUri(), + 'issuer' => $this->config['client_id'], + 'signingKey' => $this->config['signing_key'], + 'signingAlgorithm' => $this->config['signing_algorithm'], + ] + ); + + return $auth; + } + + /** + * Set the Cache object + * @param Psr\Cache\CacheItemPoolInterface $cache + */ + public function setCache(CacheItemPoolInterface $cache) + { + $this->cache = $cache; + } + + /** + * @return Psr\Cache\CacheItemPoolInterface Cache implementation + */ + public function getCache() + { + if (!$this->cache) { + $this->cache = $this->createDefaultCache(); + } + + return $this->cache; + } + + /** + * @param array $cacheConfig + */ + public function setCacheConfig(array $cacheConfig) + { + $this->config['cache_config'] = $cacheConfig; + } + + /** + * Set the Logger object + * @param Psr\Log\LoggerInterface $logger + */ + public function setLogger(LoggerInterface $logger) + { + $this->logger = $logger; + } + + /** + * @return Psr\Log\LoggerInterface implementation + */ + public function getLogger() + { + if (!isset($this->logger)) { + $this->logger = $this->createDefaultLogger(); + } + + return $this->logger; + } + + protected function createDefaultLogger() + { + $logger = new Logger('google-api-php-client'); + if ($this->isAppEngine()) { + $handler = new MonologSyslogHandler('app', LOG_USER, Logger::NOTICE); + } else { + $handler = new MonologStreamHandler('php://stderr', Logger::NOTICE); + } + $logger->pushHandler($handler); + + return $logger; + } + + protected function createDefaultCache() + { + return new MemoryCacheItemPool; + } + + /** + * Set the Http Client object + * @param GuzzleHttp\ClientInterface $http + */ + public function setHttpClient(ClientInterface $http) + { + $this->http = $http; + } + + /** + * @return GuzzleHttp\ClientInterface implementation + */ + public function getHttpClient() + { + if (null === $this->http) { + $this->http = $this->createDefaultHttpClient(); + } + + return $this->http; + } + + protected function createDefaultHttpClient() + { + $options = ['exceptions' => false]; + + $version = ClientInterface::VERSION; + if ('5' === $version[0]) { + $options = [ + 'base_url' => $this->config['base_path'], + 'defaults' => $options, + ]; + if ($this->isAppEngine()) { + // set StreamHandler on AppEngine by default + $options['handler'] = new StreamHandler(); + $options['defaults']['verify'] = '/etc/ca-certificates.crt'; + } + } else { + // guzzle 6 + $options['base_uri'] = $this->config['base_path']; + } + + return new Client($options); + } + + private function createApplicationDefaultCredentials() + { + $scopes = $this->prepareScopes(); + $sub = $this->config['subject']; + $signingKey = $this->config['signing_key']; + + // create credentials using values supplied in setAuthConfig + if ($signingKey) { + $serviceAccountCredentials = array( + 'client_id' => $this->config['client_id'], + 'client_email' => $this->config['client_email'], + 'private_key' => $signingKey, + 'type' => 'service_account', + ); + $credentials = CredentialsLoader::makeCredentials($scopes, $serviceAccountCredentials); + } else { + $credentials = ApplicationDefaultCredentials::getCredentials($scopes); + } + + // for service account domain-wide authority (impersonating a user) + // @see https://developers.google.com/identity/protocols/OAuth2ServiceAccount + if ($sub) { + if (!$credentials instanceof ServiceAccountCredentials) { + throw new DomainException('domain-wide authority requires service account credentials'); + } + + $credentials->setSub($sub); + } + + return $credentials; + } + + protected function getAuthHandler() + { + // Be very careful using the cache, as the underlying auth library's cache + // implementation is naive, and the cache keys do not account for user + // sessions. + // + // @see https://github.com/google/google-api-php-client/issues/821 + return Google_AuthHandler_AuthHandlerFactory::build( + $this->getCache(), + $this->config['cache_config'] + ); + } + + private function createUserRefreshCredentials($scope, $refreshToken) + { + $creds = array_filter( + array( + 'client_id' => $this->getClientId(), + 'client_secret' => $this->getClientSecret(), + 'refresh_token' => $refreshToken, + ) + ); + + return new UserRefreshCredentials($scope, $creds); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Collection.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Collection.php new file mode 100644 index 0000000..df8d444 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Collection.php @@ -0,0 +1,100 @@ +{$this->collection_key}) + && is_array($this->{$this->collection_key})) { + reset($this->{$this->collection_key}); + } + } + + public function current() + { + $this->coerceType($this->key()); + if (is_array($this->{$this->collection_key})) { + return current($this->{$this->collection_key}); + } + } + + public function key() + { + if (isset($this->{$this->collection_key}) + && is_array($this->{$this->collection_key})) { + return key($this->{$this->collection_key}); + } + } + + public function next() + { + return next($this->{$this->collection_key}); + } + + public function valid() + { + $key = $this->key(); + return $key !== null && $key !== false; + } + + public function count() + { + if (!isset($this->{$this->collection_key})) { + return 0; + } + return count($this->{$this->collection_key}); + } + + public function offsetExists($offset) + { + if (!is_numeric($offset)) { + return parent::offsetExists($offset); + } + return isset($this->{$this->collection_key}[$offset]); + } + + public function offsetGet($offset) + { + if (!is_numeric($offset)) { + return parent::offsetGet($offset); + } + $this->coerceType($offset); + return $this->{$this->collection_key}[$offset]; + } + + public function offsetSet($offset, $value) + { + if (!is_numeric($offset)) { + return parent::offsetSet($offset, $value); + } + $this->{$this->collection_key}[$offset] = $value; + } + + public function offsetUnset($offset) + { + if (!is_numeric($offset)) { + return parent::offsetUnset($offset); + } + unset($this->{$this->collection_key}[$offset]); + } + + private function coerceType($offset) + { + $keyType = $this->keyType($this->collection_key); + if ($keyType && !is_object($this->{$this->collection_key}[$offset])) { + $this->{$this->collection_key}[$offset] = + new $keyType($this->{$this->collection_key}[$offset]); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Exception.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Exception.php new file mode 100644 index 0000000..af80269 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Exception.php @@ -0,0 +1,20 @@ +client = $client; + $this->boundary = $boundary ?: mt_rand(); + $this->rootUrl = rtrim($rootUrl ?: $this->client->getConfig('base_path'), '/'); + $this->batchPath = $batchPath ?: self::BATCH_PATH; + } + + public function add(RequestInterface $request, $key = false) + { + if (false == $key) { + $key = mt_rand(); + } + + $this->requests[$key] = $request; + } + + public function execute() + { + $body = ''; + $classes = array(); + $batchHttpTemplate = <<requests as $key => $request) { + $firstLine = sprintf( + '%s %s HTTP/%s', + $request->getMethod(), + $request->getRequestTarget(), + $request->getProtocolVersion() + ); + + $content = (string) $request->getBody(); + + $headers = ''; + foreach ($request->getHeaders() as $name => $values) { + $headers .= sprintf("%s:%s\r\n", $name, implode(', ', $values)); + } + + $body .= sprintf( + $batchHttpTemplate, + $this->boundary, + $key, + $firstLine, + $headers, + $content ? "\n".$content : '' + ); + + $classes['response-' . $key] = $request->getHeaderLine('X-Php-Expected-Class'); + } + + $body .= "--{$this->boundary}--"; + $body = trim($body); + $url = $this->rootUrl . '/' . $this->batchPath; + $headers = array( + 'Content-Type' => sprintf('multipart/mixed; boundary=%s', $this->boundary), + 'Content-Length' => strlen($body), + ); + + $request = new Request( + 'POST', + $url, + $headers, + $body + ); + + $response = $this->client->execute($request); + + return $this->parseResponse($response, $classes); + } + + public function parseResponse(ResponseInterface $response, $classes = array()) + { + $contentType = $response->getHeaderLine('content-type'); + $contentType = explode(';', $contentType); + $boundary = false; + foreach ($contentType as $part) { + $part = explode('=', $part, 2); + if (isset($part[0]) && 'boundary' == trim($part[0])) { + $boundary = $part[1]; + } + } + + $body = (string) $response->getBody(); + if (!empty($body)) { + $body = str_replace("--$boundary--", "--$boundary", $body); + $parts = explode("--$boundary", $body); + $responses = array(); + $requests = array_values($this->requests); + + foreach ($parts as $i => $part) { + $part = trim($part); + if (!empty($part)) { + list($rawHeaders, $part) = explode("\r\n\r\n", $part, 2); + $headers = $this->parseRawHeaders($rawHeaders); + + $status = substr($part, 0, strpos($part, "\n")); + $status = explode(" ", $status); + $status = $status[1]; + + list($partHeaders, $partBody) = $this->parseHttpResponse($part, false); + $response = new Response( + $status, + $partHeaders, + Psr7\stream_for($partBody) + ); + + // Need content id. + $key = $headers['content-id']; + + try { + $response = Google_Http_REST::decodeHttpResponse($response, $requests[$i-1]); + } catch (Google_Service_Exception $e) { + // Store the exception as the response, so successful responses + // can be processed. + $response = $e; + } + + $responses[$key] = $response; + } + } + + return $responses; + } + + return null; + } + + private function parseRawHeaders($rawHeaders) + { + $headers = array(); + $responseHeaderLines = explode("\r\n", $rawHeaders); + foreach ($responseHeaderLines as $headerLine) { + if ($headerLine && strpos($headerLine, ':') !== false) { + list($header, $value) = explode(': ', $headerLine, 2); + $header = strtolower($header); + if (isset($headers[$header])) { + $headers[$header] .= "\n" . $value; + } else { + $headers[$header] = $value; + } + } + } + return $headers; + } + + /** + * Used by the IO lib and also the batch processing. + * + * @param $respData + * @param $headerSize + * @return array + */ + private function parseHttpResponse($respData, $headerSize) + { + // check proxy header + foreach (self::$CONNECTION_ESTABLISHED_HEADERS as $established_header) { + if (stripos($respData, $established_header) !== false) { + // existed, remove it + $respData = str_ireplace($established_header, '', $respData); + // Subtract the proxy header size unless the cURL bug prior to 7.30.0 + // is present which prevented the proxy header size from being taken into + // account. + // @TODO look into this + // if (!$this->needsQuirk()) { + // $headerSize -= strlen($established_header); + // } + break; + } + } + + if ($headerSize) { + $responseBody = substr($respData, $headerSize); + $responseHeaders = substr($respData, 0, $headerSize); + } else { + $responseSegments = explode("\r\n\r\n", $respData, 2); + $responseHeaders = $responseSegments[0]; + $responseBody = isset($responseSegments[1]) ? $responseSegments[1] : + null; + } + + $responseHeaders = $this->parseRawHeaders($responseHeaders); + + return array($responseHeaders, $responseBody); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Http/MediaFileUpload.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Http/MediaFileUpload.php new file mode 100644 index 0000000..600e678 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Http/MediaFileUpload.php @@ -0,0 +1,351 @@ +client = $client; + $this->request = $request; + $this->mimeType = $mimeType; + $this->data = $data; + $this->resumable = $resumable; + $this->chunkSize = $chunkSize; + $this->progress = 0; + + $this->process(); + } + + /** + * Set the size of the file that is being uploaded. + * @param $size - int file size in bytes + */ + public function setFileSize($size) + { + $this->size = $size; + } + + /** + * Return the progress on the upload + * @return int progress in bytes uploaded. + */ + public function getProgress() + { + return $this->progress; + } + + /** + * Send the next part of the file to upload. + * @param [$chunk] the next set of bytes to send. If false will used $data passed + * at construct time. + */ + public function nextChunk($chunk = false) + { + $resumeUri = $this->getResumeUri(); + + if (false == $chunk) { + $chunk = substr($this->data, $this->progress, $this->chunkSize); + } + + $lastBytePos = $this->progress + strlen($chunk) - 1; + $headers = array( + 'content-range' => "bytes $this->progress-$lastBytePos/$this->size", + 'content-length' => strlen($chunk), + 'expect' => '', + ); + + $request = new Request( + 'PUT', + $resumeUri, + $headers, + Psr7\stream_for($chunk) + ); + + return $this->makePutRequest($request); + } + + /** + * Return the HTTP result code from the last call made. + * @return int code + */ + public function getHttpResultCode() + { + return $this->httpResultCode; + } + + /** + * Sends a PUT-Request to google drive and parses the response, + * setting the appropiate variables from the response() + * + * @param Google_Http_Request $httpRequest the Reuqest which will be send + * + * @return false|mixed false when the upload is unfinished or the decoded http response + * + */ + private function makePutRequest(RequestInterface $request) + { + $response = $this->client->execute($request); + $this->httpResultCode = $response->getStatusCode(); + + if (308 == $this->httpResultCode) { + // Track the amount uploaded. + $range = $response->getHeaderLine('range'); + if ($range) { + $range_array = explode('-', $range); + $this->progress = $range_array[1] + 1; + } + + // Allow for changing upload URLs. + $location = $response->getHeaderLine('location'); + if ($location) { + $this->resumeUri = $location; + } + + // No problems, but upload not complete. + return false; + } + + return Google_Http_REST::decodeHttpResponse($response, $this->request); + } + + /** + * Resume a previously unfinished upload + * @param $resumeUri the resume-URI of the unfinished, resumable upload. + */ + public function resume($resumeUri) + { + $this->resumeUri = $resumeUri; + $headers = array( + 'content-range' => "bytes */$this->size", + 'content-length' => 0, + ); + $httpRequest = new Request( + 'PUT', + $this->resumeUri, + $headers + ); + + return $this->makePutRequest($httpRequest); + } + + /** + * @return Psr\Http\Message\RequestInterface $request + * @visible for testing + */ + private function process() + { + $this->transformToUploadUrl(); + $request = $this->request; + + $postBody = ''; + $contentType = false; + + $meta = (string) $request->getBody(); + $meta = is_string($meta) ? json_decode($meta, true) : $meta; + + $uploadType = $this->getUploadType($meta); + $request = $request->withUri( + Uri::withQueryValue($request->getUri(), 'uploadType', $uploadType) + ); + + $mimeType = $this->mimeType ?: $request->getHeaderLine('content-type'); + + if (self::UPLOAD_RESUMABLE_TYPE == $uploadType) { + $contentType = $mimeType; + $postBody = is_string($meta) ? $meta : json_encode($meta); + } else if (self::UPLOAD_MEDIA_TYPE == $uploadType) { + $contentType = $mimeType; + $postBody = $this->data; + } else if (self::UPLOAD_MULTIPART_TYPE == $uploadType) { + // This is a multipart/related upload. + $boundary = $this->boundary ?: mt_rand(); + $boundary = str_replace('"', '', $boundary); + $contentType = 'multipart/related; boundary=' . $boundary; + $related = "--$boundary\r\n"; + $related .= "Content-Type: application/json; charset=UTF-8\r\n"; + $related .= "\r\n" . json_encode($meta) . "\r\n"; + $related .= "--$boundary\r\n"; + $related .= "Content-Type: $mimeType\r\n"; + $related .= "Content-Transfer-Encoding: base64\r\n"; + $related .= "\r\n" . base64_encode($this->data) . "\r\n"; + $related .= "--$boundary--"; + $postBody = $related; + } + + $request = $request->withBody(Psr7\stream_for($postBody)); + + if (isset($contentType) && $contentType) { + $request = $request->withHeader('content-type', $contentType); + } + + return $this->request = $request; + } + + /** + * Valid upload types: + * - resumable (UPLOAD_RESUMABLE_TYPE) + * - media (UPLOAD_MEDIA_TYPE) + * - multipart (UPLOAD_MULTIPART_TYPE) + * @param $meta + * @return string + * @visible for testing + */ + public function getUploadType($meta) + { + if ($this->resumable) { + return self::UPLOAD_RESUMABLE_TYPE; + } + + if (false == $meta && $this->data) { + return self::UPLOAD_MEDIA_TYPE; + } + + return self::UPLOAD_MULTIPART_TYPE; + } + + public function getResumeUri() + { + if (null === $this->resumeUri) { + $this->resumeUri = $this->fetchResumeUri(); + } + + return $this->resumeUri; + } + + private function fetchResumeUri() + { + $body = $this->request->getBody(); + if ($body) { + $headers = array( + 'content-type' => 'application/json; charset=UTF-8', + 'content-length' => $body->getSize(), + 'x-upload-content-type' => $this->mimeType, + 'x-upload-content-length' => $this->size, + 'expect' => '', + ); + foreach ($headers as $key => $value) { + $this->request = $this->request->withHeader($key, $value); + } + } + + $response = $this->client->execute($this->request, false); + $location = $response->getHeaderLine('location'); + $code = $response->getStatusCode(); + + if (200 == $code && true == $location) { + return $location; + } + + $message = $code; + $body = json_decode((string) $this->request->getBody(), true); + if (isset($body['error']['errors'])) { + $message .= ': '; + foreach ($body['error']['errors'] as $error) { + $message .= "{$error['domain']}, {$error['message']};"; + } + $message = rtrim($message, ';'); + } + + $error = "Failed to start the resumable upload (HTTP {$message})"; + $this->client->getLogger()->error($error); + + throw new Google_Exception($error); + } + + private function transformToUploadUrl() + { + $parts = parse_url((string) $this->request->getUri()); + if (!isset($parts['path'])) { + $parts['path'] = ''; + } + $parts['path'] = '/upload' . $parts['path']; + $uri = Uri::fromParts($parts); + $this->request = $this->request->withUri($uri); + } + + public function setChunkSize($chunkSize) + { + $this->chunkSize = $chunkSize; + } + + public function getRequest() + { + return $this->request; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Http/REST.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Http/REST.php new file mode 100644 index 0000000..c2156a2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Http/REST.php @@ -0,0 +1,182 @@ +getMethod(), (string) $request->getUri()), + array(get_class(), 'doExecute'), + array($client, $request, $expectedClass) + ); + + if (null !== $retryMap) { + $runner->setRetryMap($retryMap); + } + + return $runner->run(); + } + + /** + * Executes a Psr\Http\Message\RequestInterface + * + * @param Google_Client $client + * @param Psr\Http\Message\RequestInterface $request + * @return array decoded result + * @throws Google_Service_Exception on server side error (ie: not authenticated, + * invalid or malformed post body, invalid url) + */ + public static function doExecute(ClientInterface $client, RequestInterface $request, $expectedClass = null) + { + try { + $httpHandler = HttpHandlerFactory::build($client); + $response = $httpHandler($request); + } catch (RequestException $e) { + // if Guzzle throws an exception, catch it and handle the response + if (!$e->hasResponse()) { + throw $e; + } + + $response = $e->getResponse(); + // specific checking for Guzzle 5: convert to PSR7 response + if ($response instanceof \GuzzleHttp\Message\ResponseInterface) { + $response = new Response( + $response->getStatusCode(), + $response->getHeaders() ?: [], + $response->getBody(), + $response->getProtocolVersion(), + $response->getReasonPhrase() + ); + } + } + + return self::decodeHttpResponse($response, $request, $expectedClass); + } + + /** + * Decode an HTTP Response. + * @static + * @throws Google_Service_Exception + * @param Psr\Http\Message\RequestInterface $response The http response to be decoded. + * @param Psr\Http\Message\ResponseInterface $response + * @return mixed|null + */ + public static function decodeHttpResponse( + ResponseInterface $response, + RequestInterface $request = null, + $expectedClass = null + ) { + $code = $response->getStatusCode(); + + // retry strategy + if (intVal($code) >= 400) { + // if we errored out, it should be safe to grab the response body + $body = (string) $response->getBody(); + + // Check if we received errors, and add those to the Exception for convenience + throw new Google_Service_Exception($body, $code, null, self::getResponseErrors($body)); + } + + // Ensure we only pull the entire body into memory if the request is not + // of media type + $body = self::decodeBody($response, $request); + + if ($expectedClass = self::determineExpectedClass($expectedClass, $request)) { + $json = json_decode($body, true); + + return new $expectedClass($json); + } + + return $response; + } + + private static function decodeBody(ResponseInterface $response, RequestInterface $request = null) + { + if (self::isAltMedia($request)) { + // don't decode the body, it's probably a really long string + return ''; + } + + return (string) $response->getBody(); + } + + private static function determineExpectedClass($expectedClass, RequestInterface $request = null) + { + // "false" is used to explicitly prevent an expected class from being returned + if (false === $expectedClass) { + return null; + } + + // if we don't have a request, we just use what's passed in + if (null === $request) { + return $expectedClass; + } + + // return what we have in the request header if one was not supplied + return $expectedClass ?: $request->getHeaderLine('X-Php-Expected-Class'); + } + + private static function getResponseErrors($body) + { + $json = json_decode($body, true); + + if (isset($json['error']['errors'])) { + return $json['error']['errors']; + } + + return null; + } + + private static function isAltMedia(RequestInterface $request = null) + { + if ($request && $qs = $request->getUri()->getQuery()) { + parse_str($qs, $query); + if (isset($query['alt']) && $query['alt'] == 'media') { + return true; + } + } + + return false; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Model.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Model.php new file mode 100644 index 0000000..1826260 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Model.php @@ -0,0 +1,317 @@ +mapTypes($array); + } + $this->gapiInit(); + } + + /** + * Getter that handles passthrough access to the data array, and lazy object creation. + * @param string $key Property name. + * @return mixed The value if any, or null. + */ + public function __get($key) + { + $keyType = $this->keyType($key); + $keyDataType = $this->dataType($key); + if ($keyType && !isset($this->processed[$key])) { + if (isset($this->modelData[$key])) { + $val = $this->modelData[$key]; + } elseif ($keyDataType == 'array' || $keyDataType == 'map') { + $val = array(); + } else { + $val = null; + } + + if ($this->isAssociativeArray($val)) { + if ($keyDataType && 'map' == $keyDataType) { + foreach ($val as $arrayKey => $arrayItem) { + $this->modelData[$key][$arrayKey] = + new $keyType($arrayItem); + } + } else { + $this->modelData[$key] = new $keyType($val); + } + } else if (is_array($val)) { + $arrayObject = array(); + foreach ($val as $arrayIndex => $arrayItem) { + $arrayObject[$arrayIndex] = new $keyType($arrayItem); + } + $this->modelData[$key] = $arrayObject; + } + $this->processed[$key] = true; + } + + return isset($this->modelData[$key]) ? $this->modelData[$key] : null; + } + + /** + * Initialize this object's properties from an array. + * + * @param array $array Used to seed this object's properties. + * @return void + */ + protected function mapTypes($array) + { + // Hard initialise simple types, lazy load more complex ones. + foreach ($array as $key => $val) { + if ($keyType = $this->keyType($key)) { + $dataType = $this->dataType($key); + if ($dataType == 'array' || $dataType == 'map') { + $this->$key = array(); + foreach ($val as $itemKey => $itemVal) { + if ($itemVal instanceof $keyType) { + $this->{$key}[$itemKey] = $itemVal; + } else { + $this->{$key}[$itemKey] = new $keyType($itemVal); + } + } + } elseif ($val instanceof $keyType) { + $this->$key = $val; + } else { + $this->$key = new $keyType($val); + } + unset($array[$key]); + } elseif (property_exists($this, $key)) { + $this->$key = $val; + unset($array[$key]); + } elseif (property_exists($this, $camelKey = $this->camelCase($key))) { + // This checks if property exists as camelCase, leaving it in array as snake_case + // in case of backwards compatibility issues. + $this->$camelKey = $val; + } + } + $this->modelData = $array; + } + + /** + * Blank initialiser to be used in subclasses to do post-construction initialisation - this + * avoids the need for subclasses to have to implement the variadics handling in their + * constructors. + */ + protected function gapiInit() + { + return; + } + + /** + * Create a simplified object suitable for straightforward + * conversion to JSON. This is relatively expensive + * due to the usage of reflection, but shouldn't be called + * a whole lot, and is the most straightforward way to filter. + */ + public function toSimpleObject() + { + $object = new stdClass(); + + // Process all other data. + foreach ($this->modelData as $key => $val) { + $result = $this->getSimpleValue($val); + if ($result !== null) { + $object->$key = $this->nullPlaceholderCheck($result); + } + } + + // Process all public properties. + $reflect = new ReflectionObject($this); + $props = $reflect->getProperties(ReflectionProperty::IS_PUBLIC); + foreach ($props as $member) { + $name = $member->getName(); + $result = $this->getSimpleValue($this->$name); + if ($result !== null) { + $name = $this->getMappedName($name); + $object->$name = $this->nullPlaceholderCheck($result); + } + } + + return $object; + } + + /** + * Handle different types of values, primarily + * other objects and map and array data types. + */ + private function getSimpleValue($value) + { + if ($value instanceof Google_Model) { + return $value->toSimpleObject(); + } else if (is_array($value)) { + $return = array(); + foreach ($value as $key => $a_value) { + $a_value = $this->getSimpleValue($a_value); + if ($a_value !== null) { + $key = $this->getMappedName($key); + $return[$key] = $this->nullPlaceholderCheck($a_value); + } + } + return $return; + } + return $value; + } + + /** + * Check whether the value is the null placeholder and return true null. + */ + private function nullPlaceholderCheck($value) + { + if ($value === self::NULL_VALUE) { + return null; + } + return $value; + } + + /** + * If there is an internal name mapping, use that. + */ + private function getMappedName($key) + { + if (isset($this->internal_gapi_mappings, $this->internal_gapi_mappings[$key])) { + $key = $this->internal_gapi_mappings[$key]; + } + return $key; + } + + /** + * Returns true only if the array is associative. + * @param array $array + * @return bool True if the array is associative. + */ + protected function isAssociativeArray($array) + { + if (!is_array($array)) { + return false; + } + $keys = array_keys($array); + foreach ($keys as $key) { + if (is_string($key)) { + return true; + } + } + return false; + } + + /** + * Verify if $obj is an array. + * @throws Google_Exception Thrown if $obj isn't an array. + * @param array $obj Items that should be validated. + * @param string $method Method expecting an array as an argument. + */ + public function assertIsArray($obj, $method) + { + if ($obj && !is_array($obj)) { + throw new Google_Exception( + "Incorrect parameter type passed to $method(). Expected an array." + ); + } + } + + public function offsetExists($offset) + { + return isset($this->$offset) || isset($this->modelData[$offset]); + } + + public function offsetGet($offset) + { + return isset($this->$offset) ? + $this->$offset : + $this->__get($offset); + } + + public function offsetSet($offset, $value) + { + if (property_exists($this, $offset)) { + $this->$offset = $value; + } else { + $this->modelData[$offset] = $value; + $this->processed[$offset] = true; + } + } + + public function offsetUnset($offset) + { + unset($this->modelData[$offset]); + } + + protected function keyType($key) + { + $keyType = $key . "Type"; + + // ensure keyType is a valid class + if (property_exists($this, $keyType) && class_exists($this->$keyType)) { + return $this->$keyType; + } + } + + protected function dataType($key) + { + $dataType = $key . "DataType"; + + if (property_exists($this, $dataType)) { + return $this->$dataType; + } + } + + public function __isset($key) + { + return isset($this->modelData[$key]); + } + + public function __unset($key) + { + unset($this->modelData[$key]); + } + + /** + * Convert a string to camelCase + * @param string $value + * @return string + */ + private function camelCase($value) + { + $value = ucwords(str_replace(array('-', '_'), ' ', $value)); + $value = str_replace(' ', '', $value); + $value[0] = strtolower($value[0]); + return $value; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service.php new file mode 100644 index 0000000..d3fd3b4 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service.php @@ -0,0 +1,56 @@ +client = $client; + } + + /** + * Return the associated Google_Client class. + * @return Google_Client + */ + public function getClient() + { + return $this->client; + } + + /** + * Create a new HTTP Batch handler for this service + * + * @return Google_Http_Batch + */ + public function createBatch() + { + return new Google_Http_Batch( + $this->client, + false, + $this->rootUrl, + $this->batchPath + ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service/Exception.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service/Exception.php new file mode 100644 index 0000000..abfd3f7 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service/Exception.php @@ -0,0 +1,68 @@ += 0) { + parent::__construct($message, $code, $previous); + } else { + parent::__construct($message, $code); + } + + $this->errors = $errors; + } + + /** + * An example of the possible errors returned. + * + * { + * "domain": "global", + * "reason": "authError", + * "message": "Invalid Credentials", + * "locationType": "header", + * "location": "Authorization", + * } + * + * @return [{string, string}] List of errors return in an HTTP response or []. + */ + public function getErrors() + { + return $this->errors; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service/Resource.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service/Resource.php new file mode 100644 index 0000000..1f3d371 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service/Resource.php @@ -0,0 +1,302 @@ + array('type' => 'string', 'location' => 'query'), + 'fields' => array('type' => 'string', 'location' => 'query'), + 'trace' => array('type' => 'string', 'location' => 'query'), + 'userIp' => array('type' => 'string', 'location' => 'query'), + 'quotaUser' => array('type' => 'string', 'location' => 'query'), + 'data' => array('type' => 'string', 'location' => 'body'), + 'mimeType' => array('type' => 'string', 'location' => 'header'), + 'uploadType' => array('type' => 'string', 'location' => 'query'), + 'mediaUpload' => array('type' => 'complex', 'location' => 'query'), + 'prettyPrint' => array('type' => 'string', 'location' => 'query'), + ); + + /** @var string $rootUrl */ + private $rootUrl; + + /** @var Google_Client $client */ + private $client; + + /** @var string $serviceName */ + private $serviceName; + + /** @var string $servicePath */ + private $servicePath; + + /** @var string $resourceName */ + private $resourceName; + + /** @var array $methods */ + private $methods; + + public function __construct($service, $serviceName, $resourceName, $resource) + { + $this->rootUrl = $service->rootUrl; + $this->client = $service->getClient(); + $this->servicePath = $service->servicePath; + $this->serviceName = $serviceName; + $this->resourceName = $resourceName; + $this->methods = is_array($resource) && isset($resource['methods']) ? + $resource['methods'] : + array($resourceName => $resource); + } + + /** + * TODO: This function needs simplifying. + * @param $name + * @param $arguments + * @param $expectedClass - optional, the expected class name + * @return Google_Http_Request|expectedClass + * @throws Google_Exception + */ + public function call($name, $arguments, $expectedClass = null) + { + if (! isset($this->methods[$name])) { + $this->client->getLogger()->error( + 'Service method unknown', + array( + 'service' => $this->serviceName, + 'resource' => $this->resourceName, + 'method' => $name + ) + ); + + throw new Google_Exception( + "Unknown function: " . + "{$this->serviceName}->{$this->resourceName}->{$name}()" + ); + } + $method = $this->methods[$name]; + $parameters = $arguments[0]; + + // postBody is a special case since it's not defined in the discovery + // document as parameter, but we abuse the param entry for storing it. + $postBody = null; + if (isset($parameters['postBody'])) { + if ($parameters['postBody'] instanceof Google_Model) { + // In the cases the post body is an existing object, we want + // to use the smart method to create a simple object for + // for JSONification. + $parameters['postBody'] = $parameters['postBody']->toSimpleObject(); + } else if (is_object($parameters['postBody'])) { + // If the post body is another kind of object, we will try and + // wrangle it into a sensible format. + $parameters['postBody'] = + $this->convertToArrayAndStripNulls($parameters['postBody']); + } + $postBody = (array) $parameters['postBody']; + unset($parameters['postBody']); + } + + // TODO: optParams here probably should have been + // handled already - this may well be redundant code. + if (isset($parameters['optParams'])) { + $optParams = $parameters['optParams']; + unset($parameters['optParams']); + $parameters = array_merge($parameters, $optParams); + } + + if (!isset($method['parameters'])) { + $method['parameters'] = array(); + } + + $method['parameters'] = array_merge( + $this->stackParameters, + $method['parameters'] + ); + + foreach ($parameters as $key => $val) { + if ($key != 'postBody' && ! isset($method['parameters'][$key])) { + $this->client->getLogger()->error( + 'Service parameter unknown', + array( + 'service' => $this->serviceName, + 'resource' => $this->resourceName, + 'method' => $name, + 'parameter' => $key + ) + ); + throw new Google_Exception("($name) unknown parameter: '$key'"); + } + } + + foreach ($method['parameters'] as $paramName => $paramSpec) { + if (isset($paramSpec['required']) && + $paramSpec['required'] && + ! isset($parameters[$paramName]) + ) { + $this->client->getLogger()->error( + 'Service parameter missing', + array( + 'service' => $this->serviceName, + 'resource' => $this->resourceName, + 'method' => $name, + 'parameter' => $paramName + ) + ); + throw new Google_Exception("($name) missing required param: '$paramName'"); + } + if (isset($parameters[$paramName])) { + $value = $parameters[$paramName]; + $parameters[$paramName] = $paramSpec; + $parameters[$paramName]['value'] = $value; + unset($parameters[$paramName]['required']); + } else { + // Ensure we don't pass nulls. + unset($parameters[$paramName]); + } + } + + $this->client->getLogger()->info( + 'Service Call', + array( + 'service' => $this->serviceName, + 'resource' => $this->resourceName, + 'method' => $name, + 'arguments' => $parameters, + ) + ); + + // build the service uri + $url = $this->createRequestUri( + $method['path'], + $parameters + ); + + // NOTE: because we're creating the request by hand, + // and because the service has a rootUrl property + // the "base_uri" of the Http Client is not accounted for + $request = new Request( + $method['httpMethod'], + $url, + ['content-type' => 'application/json'], + $postBody ? json_encode($postBody) : '' + ); + + // support uploads + if (isset($parameters['data'])) { + $mimeType = isset($parameters['mimeType']) + ? $parameters['mimeType']['value'] + : 'application/octet-stream'; + $data = $parameters['data']['value']; + $upload = new Google_Http_MediaFileUpload($this->client, $request, $mimeType, $data); + + // pull down the modified request + $request = $upload->getRequest(); + } + + // if this is a media type, we will return the raw response + // rather than using an expected class + if (isset($parameters['alt']) && $parameters['alt']['value'] == 'media') { + $expectedClass = null; + } + + // if the client is marked for deferring, rather than + // execute the request, return the response + if ($this->client->shouldDefer()) { + // @TODO find a better way to do this + $request = $request + ->withHeader('X-Php-Expected-Class', $expectedClass); + + return $request; + } + + return $this->client->execute($request, $expectedClass); + } + + protected function convertToArrayAndStripNulls($o) + { + $o = (array) $o; + foreach ($o as $k => $v) { + if ($v === null) { + unset($o[$k]); + } elseif (is_object($v) || is_array($v)) { + $o[$k] = $this->convertToArrayAndStripNulls($o[$k]); + } + } + return $o; + } + + /** + * Parse/expand request parameters and create a fully qualified + * request uri. + * @static + * @param string $restPath + * @param array $params + * @return string $requestUrl + */ + public function createRequestUri($restPath, $params) + { + // Override the default servicePath address if the $restPath use a / + if ('/' == substr($restPath, 0, 1)) { + $requestUrl = substr($restPath, 1); + } else { + $requestUrl = $this->servicePath . $restPath; + } + + // code for leading slash + if ($this->rootUrl) { + if ('/' !== substr($this->rootUrl, -1) && '/' !== substr($requestUrl, 0, 1)) { + $requestUrl = '/' . $requestUrl; + } + $requestUrl = $this->rootUrl . $requestUrl; + } + $uriTemplateVars = array(); + $queryVars = array(); + foreach ($params as $paramName => $paramSpec) { + if ($paramSpec['type'] == 'boolean') { + $paramSpec['value'] = $paramSpec['value'] ? 'true' : 'false'; + } + if ($paramSpec['location'] == 'path') { + $uriTemplateVars[$paramName] = $paramSpec['value']; + } else if ($paramSpec['location'] == 'query') { + if (is_array($paramSpec['value'])) { + foreach ($paramSpec['value'] as $value) { + $queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($value)); + } + } else { + $queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($paramSpec['value'])); + } + } + } + + if (count($uriTemplateVars)) { + $uriTemplateParser = new Google_Utils_UriTemplate(); + $requestUrl = $uriTemplateParser->parse($requestUrl, $uriTemplateVars); + } + + if (count($queryVars)) { + $requestUrl .= '?' . implode($queryVars, '&'); + } + + return $requestUrl; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Task/Exception.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Task/Exception.php new file mode 100644 index 0000000..5422e6f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Task/Exception.php @@ -0,0 +1,20 @@ + self::TASK_RETRY_ALWAYS, + '503' => self::TASK_RETRY_ALWAYS, + 'rateLimitExceeded' => self::TASK_RETRY_ALWAYS, + 'userRateLimitExceeded' => self::TASK_RETRY_ALWAYS, + 6 => self::TASK_RETRY_ALWAYS, // CURLE_COULDNT_RESOLVE_HOST + 7 => self::TASK_RETRY_ALWAYS, // CURLE_COULDNT_CONNECT + 28 => self::TASK_RETRY_ALWAYS, // CURLE_OPERATION_TIMEOUTED + 35 => self::TASK_RETRY_ALWAYS, // CURLE_SSL_CONNECT_ERROR + 52 => self::TASK_RETRY_ALWAYS // CURLE_GOT_NOTHING + ]; + + /** + * Creates a new task runner with exponential backoff support. + * + * @param array $config The task runner config + * @param string $name The name of the current task (used for logging) + * @param callable $action The task to run and possibly retry + * @param array $arguments The task arguments + * @throws Google_Task_Exception when misconfigured + */ + public function __construct( + $config, + $name, + $action, + array $arguments = array() + ) { + if (isset($config['initial_delay'])) { + if ($config['initial_delay'] < 0) { + throw new Google_Task_Exception( + 'Task configuration `initial_delay` must not be negative.' + ); + } + + $this->delay = $config['initial_delay']; + } + + if (isset($config['max_delay'])) { + if ($config['max_delay'] <= 0) { + throw new Google_Task_Exception( + 'Task configuration `max_delay` must be greater than 0.' + ); + } + + $this->maxDelay = $config['max_delay']; + } + + if (isset($config['factor'])) { + if ($config['factor'] <= 0) { + throw new Google_Task_Exception( + 'Task configuration `factor` must be greater than 0.' + ); + } + + $this->factor = $config['factor']; + } + + if (isset($config['jitter'])) { + if ($config['jitter'] <= 0) { + throw new Google_Task_Exception( + 'Task configuration `jitter` must be greater than 0.' + ); + } + + $this->jitter = $config['jitter']; + } + + if (isset($config['retries'])) { + if ($config['retries'] < 0) { + throw new Google_Task_Exception( + 'Task configuration `retries` must not be negative.' + ); + } + $this->maxAttempts += $config['retries']; + } + + if (!is_callable($action)) { + throw new Google_Task_Exception( + 'Task argument `$action` must be a valid callable.' + ); + } + + $this->action = $action; + $this->arguments = $arguments; + } + + /** + * Checks if a retry can be attempted. + * + * @return boolean + */ + public function canAttempt() + { + return $this->attempts < $this->maxAttempts; + } + + /** + * Runs the task and (if applicable) automatically retries when errors occur. + * + * @return mixed + * @throws Google_Task_Retryable on failure when no retries are available. + */ + public function run() + { + while ($this->attempt()) { + try { + return call_user_func_array($this->action, $this->arguments); + } catch (Google_Service_Exception $exception) { + $allowedRetries = $this->allowedRetries( + $exception->getCode(), + $exception->getErrors() + ); + + if (!$this->canAttempt() || !$allowedRetries) { + throw $exception; + } + + if ($allowedRetries > 0) { + $this->maxAttempts = min( + $this->maxAttempts, + $this->attempts + $allowedRetries + ); + } + } + } + } + + /** + * Runs a task once, if possible. This is useful for bypassing the `run()` + * loop. + * + * NOTE: If this is not the first attempt, this function will sleep in + * accordance to the backoff configurations before running the task. + * + * @return boolean + */ + public function attempt() + { + if (!$this->canAttempt()) { + return false; + } + + if ($this->attempts > 0) { + $this->backOff(); + } + + $this->attempts++; + return true; + } + + /** + * Sleeps in accordance to the backoff configurations. + */ + private function backOff() + { + $delay = $this->getDelay(); + + usleep($delay * 1000000); + } + + /** + * Gets the delay (in seconds) for the current backoff period. + * + * @return float + */ + private function getDelay() + { + $jitter = $this->getJitter(); + $factor = $this->attempts > 1 ? $this->factor + $jitter : 1 + abs($jitter); + + return $this->delay = min($this->maxDelay, $this->delay * $factor); + } + + /** + * Gets the current jitter (random number between -$this->jitter and + * $this->jitter). + * + * @return float + */ + private function getJitter() + { + return $this->jitter * 2 * mt_rand() / mt_getrandmax() - $this->jitter; + } + + /** + * Gets the number of times the associated task can be retried. + * + * NOTE: -1 is returned if the task can be retried indefinitely + * + * @return integer + */ + public function allowedRetries($code, $errors = array()) + { + if (isset($this->retryMap[$code])) { + return $this->retryMap[$code]; + } + + if ( + !empty($errors) && + isset($errors[0]['reason'], $this->retryMap[$errors[0]['reason']]) + ) { + return $this->retryMap[$errors[0]['reason']]; + } + + return 0; + } + + public function setRetryMap($retryMap) + { + $this->retryMap = $retryMap; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Utils/UriTemplate.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Utils/UriTemplate.php new file mode 100644 index 0000000..e59fe9f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Utils/UriTemplate.php @@ -0,0 +1,333 @@ + "reserved", + "/" => "segments", + "." => "dotprefix", + "#" => "fragment", + ";" => "semicolon", + "?" => "form", + "&" => "continuation" + ); + + /** + * @var reserved array + * These are the characters which should not be URL encoded in reserved + * strings. + */ + private $reserved = array( + "=", ",", "!", "@", "|", ":", "/", "?", "#", + "[", "]",'$', "&", "'", "(", ")", "*", "+", ";" + ); + private $reservedEncoded = array( + "%3D", "%2C", "%21", "%40", "%7C", "%3A", "%2F", "%3F", + "%23", "%5B", "%5D", "%24", "%26", "%27", "%28", "%29", + "%2A", "%2B", "%3B" + ); + + public function parse($string, array $parameters) + { + return $this->resolveNextSection($string, $parameters); + } + + /** + * This function finds the first matching {...} block and + * executes the replacement. It then calls itself to find + * subsequent blocks, if any. + */ + private function resolveNextSection($string, $parameters) + { + $start = strpos($string, "{"); + if ($start === false) { + return $string; + } + $end = strpos($string, "}"); + if ($end === false) { + return $string; + } + $string = $this->replace($string, $start, $end, $parameters); + return $this->resolveNextSection($string, $parameters); + } + + private function replace($string, $start, $end, $parameters) + { + // We know a data block will have {} round it, so we can strip that. + $data = substr($string, $start + 1, $end - $start - 1); + + // If the first character is one of the reserved operators, it effects + // the processing of the stream. + if (isset($this->operators[$data[0]])) { + $op = $this->operators[$data[0]]; + $data = substr($data, 1); + $prefix = ""; + $prefix_on_missing = false; + + switch ($op) { + case "reserved": + // Reserved means certain characters should not be URL encoded + $data = $this->replaceVars($data, $parameters, ",", null, true); + break; + case "fragment": + // Comma separated with fragment prefix. Bare values only. + $prefix = "#"; + $prefix_on_missing = true; + $data = $this->replaceVars($data, $parameters, ",", null, true); + break; + case "segments": + // Slash separated data. Bare values only. + $prefix = "/"; + $data =$this->replaceVars($data, $parameters, "/"); + break; + case "dotprefix": + // Dot separated data. Bare values only. + $prefix = "."; + $prefix_on_missing = true; + $data = $this->replaceVars($data, $parameters, "."); + break; + case "semicolon": + // Semicolon prefixed and separated. Uses the key name + $prefix = ";"; + $data = $this->replaceVars($data, $parameters, ";", "=", false, true, false); + break; + case "form": + // Standard URL format. Uses the key name + $prefix = "?"; + $data = $this->replaceVars($data, $parameters, "&", "="); + break; + case "continuation": + // Standard URL, but with leading ampersand. Uses key name. + $prefix = "&"; + $data = $this->replaceVars($data, $parameters, "&", "="); + break; + } + + // Add the initial prefix character if data is valid. + if ($data || ($data !== false && $prefix_on_missing)) { + $data = $prefix . $data; + } + + } else { + // If no operator we replace with the defaults. + $data = $this->replaceVars($data, $parameters); + } + // This is chops out the {...} and replaces with the new section. + return substr($string, 0, $start) . $data . substr($string, $end + 1); + } + + private function replaceVars( + $section, + $parameters, + $sep = ",", + $combine = null, + $reserved = false, + $tag_empty = false, + $combine_on_empty = true + ) { + if (strpos($section, ",") === false) { + // If we only have a single value, we can immediately process. + return $this->combine( + $section, + $parameters, + $sep, + $combine, + $reserved, + $tag_empty, + $combine_on_empty + ); + } else { + // If we have multiple values, we need to split and loop over them. + // Each is treated individually, then glued together with the + // separator character. + $vars = explode(",", $section); + return $this->combineList( + $vars, + $sep, + $parameters, + $combine, + $reserved, + false, // Never emit empty strings in multi-param replacements + $combine_on_empty + ); + } + } + + public function combine( + $key, + $parameters, + $sep, + $combine, + $reserved, + $tag_empty, + $combine_on_empty + ) { + $length = false; + $explode = false; + $skip_final_combine = false; + $value = false; + + // Check for length restriction. + if (strpos($key, ":") !== false) { + list($key, $length) = explode(":", $key); + } + + // Check for explode parameter. + if ($key[strlen($key) - 1] == "*") { + $explode = true; + $key = substr($key, 0, -1); + $skip_final_combine = true; + } + + // Define the list separator. + $list_sep = $explode ? $sep : ","; + + if (isset($parameters[$key])) { + $data_type = $this->getDataType($parameters[$key]); + switch ($data_type) { + case self::TYPE_SCALAR: + $value = $this->getValue($parameters[$key], $length); + break; + case self::TYPE_LIST: + $values = array(); + foreach ($parameters[$key] as $pkey => $pvalue) { + $pvalue = $this->getValue($pvalue, $length); + if ($combine && $explode) { + $values[$pkey] = $key . $combine . $pvalue; + } else { + $values[$pkey] = $pvalue; + } + } + $value = implode($list_sep, $values); + if ($value == '') { + return ''; + } + break; + case self::TYPE_MAP: + $values = array(); + foreach ($parameters[$key] as $pkey => $pvalue) { + $pvalue = $this->getValue($pvalue, $length); + if ($explode) { + $pkey = $this->getValue($pkey, $length); + $values[] = $pkey . "=" . $pvalue; // Explode triggers = combine. + } else { + $values[] = $pkey; + $values[] = $pvalue; + } + } + $value = implode($list_sep, $values); + if ($value == '') { + return false; + } + break; + } + } else if ($tag_empty) { + // If we are just indicating empty values with their key name, return that. + return $key; + } else { + // Otherwise we can skip this variable due to not being defined. + return false; + } + + if ($reserved) { + $value = str_replace($this->reservedEncoded, $this->reserved, $value); + } + + // If we do not need to include the key name, we just return the raw + // value. + if (!$combine || $skip_final_combine) { + return $value; + } + + // Else we combine the key name: foo=bar, if value is not the empty string. + return $key . ($value != '' || $combine_on_empty ? $combine . $value : ''); + } + + /** + * Return the type of a passed in value + */ + private function getDataType($data) + { + if (is_array($data)) { + reset($data); + if (key($data) !== 0) { + return self::TYPE_MAP; + } + return self::TYPE_LIST; + } + return self::TYPE_SCALAR; + } + + /** + * Utility function that merges multiple combine calls + * for multi-key templates. + */ + private function combineList( + $vars, + $sep, + $parameters, + $combine, + $reserved, + $tag_empty, + $combine_on_empty + ) { + $ret = array(); + foreach ($vars as $var) { + $response = $this->combine( + $var, + $parameters, + $sep, + $combine, + $reserved, + $tag_empty, + $combine_on_empty + ); + if ($response === false) { + continue; + } + $ret[] = $response; + } + return implode($sep, $ret); + } + + /** + * Utility function to encode and trim values + */ + private function getValue($value, $length) + { + if ($length) { + $value = substr($value, 0, $length); + } + $value = rawurlencode($value); + return $value; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/autoload.php b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/autoload.php new file mode 100644 index 0000000..8b49301 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/autoload.php @@ -0,0 +1,21 @@ + 3) { + // Maximum class file path depth in this project is 3. + $classPath = array_slice($classPath, 0, 3); + } + $filePath = dirname(__FILE__) . '/src/' . implode('/', $classPath) . '.php'; + if (file_exists($filePath)) { + require_once $filePath; + } +} + +spl_autoload_register('oauth2client_php_autoload'); diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/AccessToken.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/AccessToken.php new file mode 100644 index 0000000..a60494c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/AccessToken.php @@ -0,0 +1,320 @@ +httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + $this->cache = $cache ?: new MemoryCacheItemPool(); + $this->configureJwtService(); + + // set phpseclib constants if applicable + $this->setPhpsecConstants(); + } + + /** + * Verifies an id token and returns the authenticated apiLoginTicket. + * Throws an exception if the id token is not valid. + * The audience parameter can be used to control which id tokens are + * accepted. By default, the id token must have been issued to this OAuth2 client. + * + * @param string $token The JSON Web Token to be verified. + * @param array $options [optional] { + * Configuration options. + * + * @type string $audience The indended recipient of the token. + * @type string $certsLocation The location (remote or local) from which + * to retrieve certificates, if not cached. This value should only be + * provided in limited circumstances in which you are sure of the + * behavior. + * } + * @return array|bool the token payload, if successful, or false if not. + * @throws \InvalidArgumentException If certs could not be retrieved from a local file. + * @throws \InvalidArgumentException If received certs are in an invalid format. + * @throws \RuntimeException If certs could not be retrieved from a remote location. + */ + public function verify($token, array $options = []) + { + $audience = isset($options['audience']) + ? $options['audience'] + : null; + $certsLocation = isset($options['certsLocation']) + ? $options['certsLocation'] + : self::FEDERATED_SIGNON_CERT_URL; + + unset($options['audience'], $options['certsLocation']); + + // Check signature against each available cert. + // allow the loop to complete unless a known bad result is encountered. + $certs = $this->getFederatedSignOnCerts($certsLocation, $options); + foreach ($certs as $cert) { + $rsa = new RSA(); + $rsa->loadKey([ + 'n' => new BigInteger($this->callJwtStatic('urlsafeB64Decode', [ + $cert['n'] + ]), 256), + 'e' => new BigInteger($this->callJwtStatic('urlsafeB64Decode', [ + $cert['e'] + ]), 256) + ]); + + try { + $pubkey = $rsa->getPublicKey(); + $payload = $this->callJwtStatic('decode', [ + $token, + $pubkey, + ['RS256'] + ]); + + if (property_exists($payload, 'aud')) { + if ($audience && $payload->aud != $audience) { + return false; + } + } + + // support HTTP and HTTPS issuers + // @see https://developers.google.com/identity/sign-in/web/backend-auth + $issuers = [self::OAUTH2_ISSUER, self::OAUTH2_ISSUER_HTTPS]; + if (!isset($payload->iss) || !in_array($payload->iss, $issuers)) { + return false; + } + + return (array) $payload; + } catch (ExpiredException $e) { + return false; + } catch (\ExpiredException $e) { + // (firebase/php-jwt 2) + return false; + } catch (SignatureInvalidException $e) { + // continue + } catch (\SignatureInvalidException $e) { + // continue (firebase/php-jwt 2) + } catch (\DomainException $e) { + // continue + } + } + + return false; + } + + /** + * Revoke an OAuth2 access token or refresh token. This method will revoke the current access + * token, if a token isn't provided. + * + * @param string|array $token The token (access token or a refresh token) that should be revoked. + * @param array $options [optional] Configuration options. + * @return boolean Returns True if the revocation was successful, otherwise False. + */ + public function revoke($token, array $options = []) + { + if (is_array($token)) { + if (isset($token['refresh_token'])) { + $token = $token['refresh_token']; + } else { + $token = $token['access_token']; + } + } + + $body = Psr7\stream_for(http_build_query(['token' => $token])); + $request = new Request('POST', self::OAUTH2_REVOKE_URI, [ + 'Cache-Control' => 'no-store', + 'Content-Type' => 'application/x-www-form-urlencoded', + ], $body); + + $httpHandler = $this->httpHandler; + + $response = $httpHandler($request, $options); + + return $response->getStatusCode() == 200; + } + + /** + * Gets federated sign-on certificates to use for verifying identity tokens. + * Returns certs as array structure, where keys are key ids, and values + * are PEM encoded certificates. + * + * @param string $location The location from which to retrieve certs. + * @param array $options [optional] Configuration options. + * @return array + * @throws \InvalidArgumentException If received certs are in an invalid format. + */ + private function getFederatedSignOnCerts($location, array $options = []) + { + $cacheItem = $this->cache->getItem('federated_signon_certs_v3'); + $certs = $cacheItem ? $cacheItem->get() : null; + + $gotNewCerts = false; + if (!$certs) { + $certs = $this->retrieveCertsFromLocation($location, $options); + + $gotNewCerts = true; + } + + if (!isset($certs['keys'])) { + throw new \InvalidArgumentException( + 'federated sign-on certs expects "keys" to be set' + ); + } + + // Push caching off until after verifying certs are in a valid format. + // Don't want to cache bad data. + if ($gotNewCerts) { + $cacheItem->expiresAt(new \DateTime('+1 hour')); + $cacheItem->set($certs); + $this->cache->save($cacheItem); + } + + return $certs['keys']; + } + + /** + * Retrieve and cache a certificates file. + * + * @param $url string location + * @param array $options [optional] Configuration options. + * @throws \RuntimeException + * @return array certificates + * @throws \InvalidArgumentException If certs could not be retrieved from a local file. + * @throws \RuntimeException If certs could not be retrieved from a remote location. + */ + private function retrieveCertsFromLocation($url, array $options = []) + { + // If we're retrieving a local file, just grab it. + if (strpos($url, 'http') !== 0) { + if (!file_exists($url)) { + throw new \InvalidArgumentException(sprintf( + 'Failed to retrieve verification certificates from path: %s.', + $url + )); + } + + return json_decode(file_get_contents($url), true); + } + + $httpHandler = $this->httpHandler; + $response = $httpHandler(new Request('GET', $url), $options); + + if ($response->getStatusCode() == 200) { + return json_decode((string) $response->getBody(), true); + } + + throw new \RuntimeException(sprintf( + 'Failed to retrieve verification certificates: "%s".', + $response->getBody()->getContents() + ), $response->getStatusCode()); + } + + /** + * Set required defaults for JWT. + */ + private function configureJwtService() + { + $class = class_exists('Firebase\JWT\JWT') + ? 'Firebase\JWT\JWT' + : '\JWT'; + + if (property_exists($class, 'leeway') && $class::$leeway < 1) { + // Ensures JWT leeway is at least 1 + // @see https://github.com/google/google-api-php-client/issues/827 + $class::$leeway = 1; + } + } + + /** + * phpseclib calls "phpinfo" by default, which requires special + * whitelisting in the AppEngine VM environment. This function + * sets constants to bypass the need for phpseclib to check phpinfo + * + * @see phpseclib/Math/BigInteger + * @see https://github.com/GoogleCloudPlatform/getting-started-php/issues/85 + * @codeCoverageIgnore + */ + private function setPhpsecConstants() + { + if (filter_var(getenv('GAE_VM'), FILTER_VALIDATE_BOOLEAN)) { + if (!defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) { + define('MATH_BIGINTEGER_OPENSSL_ENABLED', true); + } + if (!defined('CRYPT_RSA_MODE')) { + define('CRYPT_RSA_MODE', RSA::MODE_OPENSSL); + } + } + } + + /** + * Provide a hook to mock calls to the JWT static methods. + * + * @param string $method + * @param array $args + * @return mixed + */ + protected function callJwtStatic($method, array $args = []) + { + $class = class_exists('Firebase\JWT\JWT') + ? 'Firebase\JWT\JWT' + : 'JWT'; + return call_user_func_array([$class, $method], $args); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/ApplicationDefaultCredentials.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/ApplicationDefaultCredentials.php new file mode 100644 index 0000000..1cfca8e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/ApplicationDefaultCredentials.php @@ -0,0 +1,185 @@ +push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'auth' => 'google_auth' // authorize all requests + * ]); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + */ +class ApplicationDefaultCredentials +{ + /** + * Obtains an AuthTokenSubscriber that uses the default FetchAuthTokenInterface + * implementation to use in this environment. + * + * If supplied, $scope is used to in creating the credentials instance if + * this does not fallback to the compute engine defaults. + * + * @param string|array scope the scope of the access request, expressed + * either as an Array or as a space-delimited String. + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache an implementation of CacheItemPoolInterface + * + * @return AuthTokenSubscriber + * + * @throws DomainException if no implementation can be obtained. + */ + public static function getSubscriber( + $scope = null, + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null + ) { + $creds = self::getCredentials($scope, $httpHandler, $cacheConfig, $cache); + + return new AuthTokenSubscriber($creds, $httpHandler); + } + + /** + * Obtains an AuthTokenMiddleware that uses the default FetchAuthTokenInterface + * implementation to use in this environment. + * + * If supplied, $scope is used to in creating the credentials instance if + * this does not fallback to the compute engine defaults. + * + * @param string|array scope the scope of the access request, expressed + * either as an Array or as a space-delimited String. + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache + * + * @return AuthTokenMiddleware + * + * @throws DomainException if no implementation can be obtained. + */ + public static function getMiddleware( + $scope = null, + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null + ) { + $creds = self::getCredentials($scope, $httpHandler, $cacheConfig, $cache); + + return new AuthTokenMiddleware($creds, $httpHandler); + } + + /** + * Obtains the default FetchAuthTokenInterface implementation to use + * in this environment. + * + * If supplied, $scope is used to in creating the credentials instance if + * this does not fallback to the Compute Engine defaults. + * + * @param string|array scope the scope of the access request, expressed + * either as an Array or as a space-delimited String. + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache + * + * @return CredentialsLoader + * + * @throws DomainException if no implementation can be obtained. + */ + public static function getCredentials( + $scope = null, + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null + ) { + $creds = null; + $jsonKey = CredentialsLoader::fromEnv() + ?: CredentialsLoader::fromWellKnownFile(); + + if (!$httpHandler) { + if (!($client = HttpClientCache::getHttpClient())) { + $client = new Client(); + HttpClientCache::setHttpClient($client); + } + + $httpHandler = HttpHandlerFactory::build($client); + } + + if (!is_null($jsonKey)) { + $creds = CredentialsLoader::makeCredentials($scope, $jsonKey); + } elseif (AppIdentityCredentials::onAppEngine() && !GCECredentials::onAppEngineFlexible()) { + $creds = new AppIdentityCredentials($scope); + } elseif (GCECredentials::onGce($httpHandler)) { + $creds = new GCECredentials(null, $scope); + } + + if (is_null($creds)) { + throw new \DomainException(self::notFound()); + } + if (!is_null($cache)) { + $creds = new FetchAuthTokenCache($creds, $cacheConfig, $cache); + } + return $creds; + } + + private static function notFound() + { + $msg = 'Could not load the default credentials. Browse to '; + $msg .= 'https://developers.google.com'; + $msg .= '/accounts/docs/application-default-credentials'; + $msg .= ' for more information'; + + return $msg; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/InvalidArgumentException.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/InvalidArgumentException.php new file mode 100644 index 0000000..331e561 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/InvalidArgumentException.php @@ -0,0 +1,24 @@ +key = $key; + } + + /** + * {@inheritdoc} + */ + public function getKey() + { + return $this->key; + } + + /** + * {@inheritdoc} + */ + public function get() + { + return $this->isHit() ? $this->value : null; + } + + /** + * {@inheritdoc} + */ + public function isHit() + { + if (!$this->isHit) { + return false; + } + + if ($this->expiration === null) { + return true; + } + + return $this->currentTime()->getTimestamp() < $this->expiration->getTimestamp(); + } + + /** + * {@inheritdoc} + */ + public function set($value) + { + $this->isHit = true; + $this->value = $value; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function expiresAt($expiration) + { + if ($this->isValidExpiration($expiration)) { + $this->expiration = $expiration; + + return $this; + } + + $implementationMessage = interface_exists('DateTimeInterface') + ? 'implement interface DateTimeInterface' + : 'be an instance of DateTime'; + + $error = sprintf( + 'Argument 1 passed to %s::expiresAt() must %s, %s given', + get_class($this), + $implementationMessage, + gettype($expiration) + ); + + $this->handleError($error); + } + + /** + * {@inheritdoc} + */ + public function expiresAfter($time) + { + if (is_int($time)) { + $this->expiration = $this->currentTime()->add(new \DateInterval("PT{$time}S")); + } elseif ($time instanceof \DateInterval) { + $this->expiration = $this->currentTime()->add($time); + } elseif ($time === null) { + $this->expiration = $time; + } else { + $message = 'Argument 1 passed to %s::expiresAfter() must be an ' . + 'instance of DateInterval or of the type integer, %s given'; + $error = sprintf($message, get_class($this), gettype($time)); + + $this->handleError($error); + } + + return $this; + } + + /** + * Handles an error. + * + * @param string $error + * @throws \TypeError + */ + private function handleError($error) + { + if (class_exists('TypeError')) { + throw new \TypeError($error); + } + + trigger_error($error, E_USER_ERROR); + } + + /** + * Determines if an expiration is valid based on the rules defined by PSR6. + * + * @param mixed $expiration + * @return bool + */ + private function isValidExpiration($expiration) + { + if ($expiration === null) { + return true; + } + + // We test for two types here due to the fact the DateTimeInterface + // was not introduced until PHP 5.5. Checking for the DateTime type as + // well allows us to support 5.4. + if ($expiration instanceof \DateTimeInterface) { + return true; + } + + if ($expiration instanceof \DateTime) { + return true; + } + + return false; + } + + protected function currentTime() + { + return new \DateTime('now', new \DateTimeZone('UTC')); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/MemoryCacheItemPool.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/MemoryCacheItemPool.php new file mode 100644 index 0000000..0af2930 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/MemoryCacheItemPool.php @@ -0,0 +1,154 @@ +getItems([$key])); + } + + /** + * {@inheritdoc} + */ + public function getItems(array $keys = []) + { + $items = []; + + foreach ($keys as $key) { + $items[$key] = $this->hasItem($key) ? clone $this->items[$key] : new Item($key); + } + + return $items; + } + + /** + * {@inheritdoc} + */ + public function hasItem($key) + { + $this->isValidKey($key); + + return isset($this->items[$key]) && $this->items[$key]->isHit(); + } + + /** + * {@inheritdoc} + */ + public function clear() + { + $this->items = []; + $this->deferredItems = []; + + return true; + } + + /** + * {@inheritdoc} + */ + public function deleteItem($key) + { + return $this->deleteItems([$key]); + } + + /** + * {@inheritdoc} + */ + public function deleteItems(array $keys) + { + array_walk($keys, [$this, 'isValidKey']); + + foreach ($keys as $key) { + unset($this->items[$key]); + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function save(CacheItemInterface $item) + { + $this->items[$item->getKey()] = $item; + + return true; + } + + /** + * {@inheritdoc} + */ + public function saveDeferred(CacheItemInterface $item) + { + $this->deferredItems[$item->getKey()] = $item; + + return true; + } + + /** + * {@inheritdoc} + */ + public function commit() + { + foreach ($this->deferredItems as $item) { + $this->save($item); + } + + $this->deferredItems = []; + + return true; + } + + /** + * Determines if the provided key is valid. + * + * @param string $key + * @return bool + * @throws InvalidArgumentException + */ + private function isValidKey($key) + { + $invalidCharacters = '{}()/\\\\@:'; + + if (!is_string($key) || preg_match("#[$invalidCharacters]#", $key)) { + throw new InvalidArgumentException('The provided key is not valid: ' . var_export($key, true)); + } + + return true; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/SysVCacheItemPool.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/SysVCacheItemPool.php new file mode 100644 index 0000000..361dcfb --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/SysVCacheItemPool.php @@ -0,0 +1,244 @@ +options = $options + [ + 'variableKey' => self::VAR_KEY, + 'proj' => self::DEFAULT_PROJ, + 'memsize' => self::DEFAULT_MEMSIZE, + 'perm' => self::DEFAULT_PERM + ]; + $this->items = []; + $this->deferredItems = []; + $this->sysvKey = ftok(__FILE__, $this->options['proj']); + } + + /** + * {@inheritdoc} + */ + public function getItem($key) + { + $this->loadItems(); + return current($this->getItems([$key])); + } + + /** + * {@inheritdoc} + */ + public function getItems(array $keys = []) + { + $this->loadItems(); + $items = []; + foreach ($keys as $key) { + $items[$key] = $this->hasItem($key) ? + clone $this->items[$key] : + new Item($key); + } + return $items; + } + + /** + * {@inheritdoc} + */ + public function hasItem($key) + { + $this->loadItems(); + return isset($this->items[$key]) && $this->items[$key]->isHit(); + } + + /** + * {@inheritdoc} + */ + public function clear() + { + $this->items = []; + $this->deferredItems = []; + return $this->saveCurrentItems(); + } + + /** + * {@inheritdoc} + */ + public function deleteItem($key) + { + return $this->deleteItems([$key]); + } + + /** + * {@inheritdoc} + */ + public function deleteItems(array $keys) + { + if (!$this->hasLoadedItems) { + $this->loadItems(); + } + + foreach ($keys as $key) { + unset($this->items[$key]); + } + return $this->saveCurrentItems(); + } + + /** + * {@inheritdoc} + */ + public function save(CacheItemInterface $item) + { + if (!$this->hasLoadedItems) { + $this->loadItems(); + } + + $this->items[$item->getKey()] = $item; + return $this->saveCurrentItems(); + } + + /** + * {@inheritdoc} + */ + public function saveDeferred(CacheItemInterface $item) + { + $this->deferredItems[$item->getKey()] = $item; + return true; + } + + /** + * {@inheritdoc} + */ + public function commit() + { + foreach ($this->deferredItems as $item) { + if ($this->save($item) === false) { + return false; + } + } + $this->deferredItems = []; + return true; + } + + /** + * Save the current items. + * + * @return bool true when success, false upon failure + */ + private function saveCurrentItems() + { + $shmid = shm_attach( + $this->sysvKey, + $this->options['memsize'], + $this->options['perm'] + ); + if ($shmid !== false) { + $ret = shm_put_var( + $shmid, + $this->options['variableKey'], + $this->items + ); + shm_detach($shmid); + return $ret; + } + return false; + } + + /** + * Load the items from the shared memory. + * + * @return bool true when success, false upon failure + */ + private function loadItems() + { + $shmid = shm_attach( + $this->sysvKey, + $this->options['memsize'], + $this->options['perm'] + ); + if ($shmid !== false) { + $data = @shm_get_var($shmid, $this->options['variableKey']); + if (!empty($data)) { + $this->items = $data; + } else { + $this->items = []; + } + shm_detach($shmid); + $this->hasLoadedItems = true; + return true; + } + return false; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/CacheTrait.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/CacheTrait.php new file mode 100644 index 0000000..217ce8e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/CacheTrait.php @@ -0,0 +1,83 @@ +cache)) { + return; + } + + $key = $this->getFullCacheKey($k); + if (is_null($key)) { + return; + } + + $cacheItem = $this->cache->getItem($key); + if ($cacheItem->isHit()) { + return $cacheItem->get(); + } + } + + /** + * Saves the value in the cache when that is available. + */ + private function setCachedValue($k, $v) + { + if (is_null($this->cache)) { + return; + } + + $key = $this->getFullCacheKey($k); + if (is_null($key)) { + return; + } + + $cacheItem = $this->cache->getItem($key); + $cacheItem->set($v); + $cacheItem->expiresAfter($this->cacheConfig['lifetime']); + return $this->cache->save($cacheItem); + } + + private function getFullCacheKey($key) + { + if (is_null($key)) { + return; + } + + $key = $this->cacheConfig['prefix'] . $key; + + // ensure we do not have illegal characters + $key = preg_replace('|[^a-zA-Z0-9_\.!]|', '', $key); + + // Hash keys if they exceed $maxKeyLength (defaults to 64) + if ($this->maxKeyLength && strlen($key) > $this->maxKeyLength) { + $key = substr(hash('sha256', $key), 0, $this->maxKeyLength); + } + + return $key; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/AppIdentityCredentials.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/AppIdentityCredentials.php new file mode 100644 index 0000000..31342e6 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/AppIdentityCredentials.php @@ -0,0 +1,201 @@ +push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/books/v1', + * 'auth' => 'google_auth' + * ]); + * + * $res = $client->get('volumes?q=Henry+David+Thoreau&country=US'); + */ +class AppIdentityCredentials extends CredentialsLoader implements SignBlobInterface +{ + /** + * Result of fetchAuthToken. + * + * @array + */ + protected $lastReceivedToken; + + /** + * Array of OAuth2 scopes to be requested. + */ + private $scope; + + /** + * @var string + */ + private $clientName; + + public function __construct($scope = array()) + { + $this->scope = $scope; + } + + /** + * Determines if this an App Engine instance, by accessing the + * SERVER_SOFTWARE environment variable (prod) or the APPENGINE_RUNTIME + * environment variable (dev). + * + * @return true if this an App Engine Instance, false otherwise + */ + public static function onAppEngine() + { + $appEngineProduction = isset($_SERVER['SERVER_SOFTWARE']) && + 0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Google App Engine'); + if ($appEngineProduction) { + return true; + } + $appEngineDevAppServer = isset($_SERVER['APPENGINE_RUNTIME']) && + $_SERVER['APPENGINE_RUNTIME'] == 'php'; + if ($appEngineDevAppServer) { + return true; + } + return false; + } + + /** + * Implements FetchAuthTokenInterface#fetchAuthToken. + * + * Fetches the auth tokens using the AppIdentityService if available. + * As the AppIdentityService uses protobufs to fetch the access token, + * the GuzzleHttp\ClientInterface instance passed in will not be used. + * + * @param callable $httpHandler callback which delivers psr7 request + * + * @return array A set of auth related metadata, containing the following + * keys: + * - access_token (string) + * - expiration_time (string) + */ + public function fetchAuthToken(callable $httpHandler = null) + { + try { + $this->checkAppEngineContext(); + } catch (\Exception $e) { + return []; + } + + // AppIdentityService expects an array when multiple scopes are supplied + $scope = is_array($this->scope) ? $this->scope : explode(' ', $this->scope); + + $token = AppIdentityService::getAccessToken($scope); + $this->lastReceivedToken = $token; + + return $token; + } + + /** + * Sign a string using AppIdentityService. + * + * @param string $stringToSign The string to sign. + * @param bool $forceOpenSsl [optional] Does not apply to this credentials + * type. + * @return string The signature, base64-encoded. + * @throws \Exception If AppEngine SDK or mock is not available. + */ + public function signBlob($stringToSign, $forceOpenSsl = false) + { + $this->checkAppEngineContext(); + + return base64_encode(AppIdentityService::signForApp($stringToSign)['signature']); + } + + /** + * Get the client name from AppIdentityService. + * + * Subsequent calls to this method will return a cached value. + * + * @param callable $httpHandler Not used in this implementation. + * @return string + * @throws \Exception If AppEngine SDK or mock is not available. + */ + public function getClientName(callable $httpHandler = null) + { + $this->checkAppEngineContext(); + + if (!$this->clientName) { + $this->clientName = AppIdentityService::getServiceAccountName(); + } + + return $this->clientName; + } + + /** + * @return array|null + */ + public function getLastReceivedToken() + { + if ($this->lastReceivedToken) { + return [ + 'access_token' => $this->lastReceivedToken['access_token'], + 'expires_at' => $this->lastReceivedToken['expiration_time'], + ]; + } + + return null; + } + + /** + * Caching is handled by the underlying AppIdentityService, return empty string + * to prevent caching. + * + * @return string + */ + public function getCacheKey() + { + return ''; + } + + private function checkAppEngineContext() + { + if (!self::onAppEngine() || !class_exists('google\appengine\api\app_identity\AppIdentityService')) { + throw new \Exception( + 'This class must be run in App Engine, or you must include the AppIdentityService ' + . 'mock class defined in tests/mocks/AppIdentityService.php' + ); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/GCECredentials.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/GCECredentials.php new file mode 100644 index 0000000..24cdd4a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/GCECredentials.php @@ -0,0 +1,373 @@ +push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'auth' => 'google_auth' + * ]); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + */ +class GCECredentials extends CredentialsLoader implements SignBlobInterface +{ + const cacheKey = 'GOOGLE_AUTH_PHP_GCE'; + + /** + * The metadata IP address on appengine instances. + * + * The IP is used instead of the domain 'metadata' to avoid slow responses + * when not on Compute Engine. + */ + const METADATA_IP = '169.254.169.254'; + + /** + * The metadata path of the default token. + */ + const TOKEN_URI_PATH = 'v1/instance/service-accounts/default/token'; + + /** + * The metadata path of the client ID. + */ + const CLIENT_ID_URI_PATH = 'v1/instance/service-accounts/default/email'; + + /** + * The header whose presence indicates GCE presence. + */ + const FLAVOR_HEADER = 'Metadata-Flavor'; + + /** + * Note: the explicit `timeout` and `tries` below is a workaround. The underlying + * issue is that resolving an unknown host on some networks will take + * 20-30 seconds; making this timeout short fixes the issue, but + * could lead to false negatives in the event that we are on GCE, but + * the metadata resolution was particularly slow. The latter case is + * "unlikely" since the expected 4-nines time is about 0.5 seconds. + * This allows us to limit the total ping maximum timeout to 1.5 seconds + * for developer desktop scenarios. + */ + const MAX_COMPUTE_PING_TRIES = 3; + const COMPUTE_PING_CONNECTION_TIMEOUT_S = 0.5; + + /** + * Flag used to ensure that the onGCE test is only done once;. + * + * @var bool + */ + private $hasCheckedOnGce = false; + + /** + * Flag that stores the value of the onGCE check. + * + * @var bool + */ + private $isOnGce = false; + + /** + * Result of fetchAuthToken. + */ + protected $lastReceivedToken; + + /** + * @var string + */ + private $clientName; + + /** + * @var Iam|null + */ + private $iam; + + /** + * @var string + */ + private $tokenUri; + + /** + * @param Iam $iam [optional] An IAM instance. + * @param string|array $scope [optional] the scope of the access request, + * expressed either as an array or as a space-delimited string. + */ + public function __construct(Iam $iam = null, $scope = null) + { + $this->iam = $iam; + + $tokenUri = self::getTokenUri(); + if ($scope) { + if (is_string($scope)) { + $scope = explode(' ', $scope); + } + + $scope = implode(',', $scope); + + $tokenUri = $tokenUri . '?scopes='. $scope; + } + + $this->tokenUri = $tokenUri; + } + + /** + * The full uri for accessing the default token. + * + * @return string + */ + public static function getTokenUri() + { + $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; + + return $base . self::TOKEN_URI_PATH; + } + + /** + * The full uri for accessing the default service account. + * + * @return string + */ + public static function getClientNameUri() + { + $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; + + return $base . self::CLIENT_ID_URI_PATH; + } + + /** + * Determines if this an App Engine Flexible instance, by accessing the + * GAE_INSTANCE environment variable. + * + * @return true if this an App Engine Flexible Instance, false otherwise + */ + public static function onAppEngineFlexible() + { + return substr(getenv('GAE_INSTANCE'), 0, 4) === 'aef-'; + } + + /** + * Determines if this a GCE instance, by accessing the expected metadata + * host. + * If $httpHandler is not specified a the default HttpHandler is used. + * + * @param callable $httpHandler callback which delivers psr7 request + * + * @return true if this a GCEInstance false otherwise + */ + public static function onGce(callable $httpHandler = null) + { + $httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + + $checkUri = 'http://' . self::METADATA_IP; + for ($i = 1; $i <= self::MAX_COMPUTE_PING_TRIES; $i++) { + try { + // Comment from: oauth2client/client.py + // + // Note: the explicit `timeout` below is a workaround. The underlying + // issue is that resolving an unknown host on some networks will take + // 20-30 seconds; making this timeout short fixes the issue, but + // could lead to false negatives in the event that we are on GCE, but + // the metadata resolution was particularly slow. The latter case is + // "unlikely". + $resp = $httpHandler( + new Request( + 'GET', + $checkUri, + [self::FLAVOR_HEADER => 'Google'] + ), + ['timeout' => self::COMPUTE_PING_CONNECTION_TIMEOUT_S] + ); + + return $resp->getHeaderLine(self::FLAVOR_HEADER) == 'Google'; + } catch (ClientException $e) { + } catch (ServerException $e) { + } catch (RequestException $e) { + } + } + return false; + } + + /** + * Implements FetchAuthTokenInterface#fetchAuthToken. + * + * Fetches the auth tokens from the GCE metadata host if it is available. + * If $httpHandler is not specified a the default HttpHandler is used. + * + * @param callable $httpHandler callback which delivers psr7 request + * + * @return array A set of auth related metadata, containing the following + * keys: + * - access_token (string) + * - expires_in (int) + * - token_type (string) + * + * @throws \Exception + */ + public function fetchAuthToken(callable $httpHandler = null) + { + $httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + + if (!$this->hasCheckedOnGce) { + $this->isOnGce = self::onGce($httpHandler); + $this->hasCheckedOnGce = true; + } + if (!$this->isOnGce) { + return array(); // return an empty array with no access token + } + + $json = $this->getFromMetadata($httpHandler, $this->tokenUri); + if (null === $json = json_decode($json, true)) { + throw new \Exception('Invalid JSON response'); + } + + // store this so we can retrieve it later + $this->lastReceivedToken = $json; + $this->lastReceivedToken['expires_at'] = time() + $json['expires_in']; + + return $json; + } + + /** + * @return string + */ + public function getCacheKey() + { + return self::cacheKey; + } + + /** + * @return array|null + */ + public function getLastReceivedToken() + { + if ($this->lastReceivedToken) { + return [ + 'access_token' => $this->lastReceivedToken['access_token'], + 'expires_at' => $this->lastReceivedToken['expires_at'], + ]; + } + + return null; + } + + /** + * Get the client name from GCE metadata. + * + * Subsequent calls will return a cached value. + * + * @param callable $httpHandler callback which delivers psr7 request + * @return string + */ + public function getClientName(callable $httpHandler = null) + { + if ($this->clientName) { + return $this->clientName; + } + + $httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + + if (!$this->hasCheckedOnGce) { + $this->isOnGce = self::onGce($httpHandler); + $this->hasCheckedOnGce = true; + } + + if (!$this->isOnGce) { + return ''; + } + + $this->clientName = $this->getFromMetadata($httpHandler, self::getClientNameUri()); + + return $this->clientName; + } + + /** + * Sign a string using the default service account private key. + * + * This implementation uses IAM's signBlob API. + * + * @see https://cloud.google.com/iam/credentials/reference/rest/v1/projects.serviceAccounts/signBlob SignBlob + * + * @param string $stringToSign The string to sign. + * @param bool $forceOpenSsl [optional] Does not apply to this credentials + * type. + * @return string + */ + public function signBlob($stringToSign, $forceOpenSsl = false) + { + $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + + // Providing a signer is useful for testing, but it's undocumented + // because it's not something a user would generally need to do. + $signer = $this->iam ?: new Iam($httpHandler); + + $email = $this->getClientName($httpHandler); + + $previousToken = $this->getLastReceivedToken(); + $accessToken = $previousToken + ? $previousToken['access_token'] + : $this->fetchAuthToken($httpHandler)['access_token']; + + return $signer->signBlob($email, $accessToken, $stringToSign); + } + + /** + * Fetch the value of a GCE metadata server URI. + * + * @param callable $httpHandler An HTTP Handler to deliver PSR7 requests. + * @param string $uri The metadata URI. + * @return string + */ + private function getFromMetadata(callable $httpHandler, $uri) + { + $resp = $httpHandler( + new Request( + 'GET', + $uri, + [self::FLAVOR_HEADER => 'Google'] + ) + ); + + return (string) $resp->getBody(); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/IAMCredentials.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/IAMCredentials.php new file mode 100644 index 0000000..0d2a37d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/IAMCredentials.php @@ -0,0 +1,89 @@ +selector = $selector; + $this->token = $token; + } + + /** + * export a callback function which updates runtime metadata. + * + * @return array updateMetadata function + */ + public function getUpdateMetadataFunc() + { + return array($this, 'updateMetadata'); + } + + /** + * Updates metadata with the appropriate header metadata. + * + * @param array $metadata metadata hashmap + * @param string $unusedAuthUri optional auth uri + * @param callable $httpHandler callback which delivers psr7 request + * Note: this param is unused here, only included here for + * consistency with other credentials class + * + * @return array updated metadata hashmap + */ + public function updateMetadata( + $metadata, + $unusedAuthUri = null, + callable $httpHandler = null + ) { + $metadata_copy = $metadata; + $metadata_copy[self::SELECTOR_KEY] = $this->selector; + $metadata_copy[self::TOKEN_KEY] = $this->token; + + return $metadata_copy; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/InsecureCredentials.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/InsecureCredentials.php new file mode 100644 index 0000000..dae894f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/InsecureCredentials.php @@ -0,0 +1,70 @@ + '' + ]; + + /** + * Fetches the auth token. In this case it returns an empty string. + * + * @param callable $httpHandler + * @return array A set of auth related metadata, containing the following + * keys: + * - access_token (string) + */ + public function fetchAuthToken(callable $httpHandler = null) + { + return $this->token; + } + + /** + * Returns the cache key. In this case it returns a null value, disabling + * caching. + * + * @return string|null + */ + public function getCacheKey() + { + return null; + } + + /** + * Fetches the last received token. In this case, it returns the same empty string + * auth token. + * + * @return array + */ + public function getLastReceivedToken() + { + return $this->token; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php new file mode 100644 index 0000000..7e801b7 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php @@ -0,0 +1,198 @@ +push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'auth' => 'google_auth' // authorize all requests + * ]); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + */ +class ServiceAccountCredentials extends CredentialsLoader implements SignBlobInterface +{ + use ServiceAccountSignerTrait; + + /** + * The OAuth2 instance used to conduct authorization. + * + * @var OAuth2 + */ + protected $auth; + + /** + * Create a new ServiceAccountCredentials. + * + * @param string|array $scope the scope of the access request, expressed + * either as an Array or as a space-delimited String. + * @param string|array $jsonKey JSON credential file path or JSON credentials + * as an associative array + * @param string $sub an email address account to impersonate, in situations when + * the service account has been delegated domain wide access. + */ + public function __construct( + $scope, + $jsonKey, + $sub = null + ) { + if (is_string($jsonKey)) { + if (!file_exists($jsonKey)) { + throw new \InvalidArgumentException('file does not exist'); + } + $jsonKeyStream = file_get_contents($jsonKey); + if (!$jsonKey = json_decode($jsonKeyStream, true)) { + throw new \LogicException('invalid json for auth config'); + } + } + if (!array_key_exists('client_email', $jsonKey)) { + throw new \InvalidArgumentException( + 'json key is missing the client_email field'); + } + if (!array_key_exists('private_key', $jsonKey)) { + throw new \InvalidArgumentException( + 'json key is missing the private_key field'); + } + $this->auth = new OAuth2([ + 'audience' => self::TOKEN_CREDENTIAL_URI, + 'issuer' => $jsonKey['client_email'], + 'scope' => $scope, + 'signingAlgorithm' => 'RS256', + 'signingKey' => $jsonKey['private_key'], + 'sub' => $sub, + 'tokenCredentialUri' => self::TOKEN_CREDENTIAL_URI, + ]); + } + + /** + * @param callable $httpHandler + * + * @return array A set of auth related metadata, containing the following + * keys: + * - access_token (string) + * - expires_in (int) + * - token_type (string) + */ + public function fetchAuthToken(callable $httpHandler = null) + { + return $this->auth->fetchAuthToken($httpHandler); + } + + /** + * @return string + */ + public function getCacheKey() + { + $key = $this->auth->getIssuer() . ':' . $this->auth->getCacheKey(); + if ($sub = $this->auth->getSub()) { + $key .= ':' . $sub; + } + + return $key; + } + + /** + * @return array + */ + public function getLastReceivedToken() + { + return $this->auth->getLastReceivedToken(); + } + + /** + * Updates metadata with the authorization token. + * + * @param array $metadata metadata hashmap + * @param string $authUri optional auth uri + * @param callable $httpHandler callback which delivers psr7 request + * + * @return array updated metadata hashmap + */ + public function updateMetadata( + $metadata, + $authUri = null, + callable $httpHandler = null + ) { + // scope exists. use oauth implementation + $scope = $this->auth->getScope(); + if (!is_null($scope)) { + return parent::updateMetadata($metadata, $authUri, $httpHandler); + } + + // no scope found. create jwt with the auth uri + $credJson = array( + 'private_key' => $this->auth->getSigningKey(), + 'client_email' => $this->auth->getIssuer(), + ); + $jwtCreds = new ServiceAccountJwtAccessCredentials($credJson); + + return $jwtCreds->updateMetadata($metadata, $authUri, $httpHandler); + } + + /** + * @param string $sub an email address account to impersonate, in situations when + * the service account has been delegated domain wide access. + */ + public function setSub($sub) + { + $this->auth->setSub($sub); + } + + /** + * Get the client name from the keyfile. + * + * In this case, it returns the keyfile's client_email key. + * + * @param callable $httpHandler Not used by this credentials type. + * @return string + */ + public function getClientName(callable $httpHandler = null) + { + return $this->auth->getIssuer(); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php new file mode 100644 index 0000000..cf9e06a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php @@ -0,0 +1,150 @@ +auth = new OAuth2([ + 'issuer' => $jsonKey['client_email'], + 'sub' => $jsonKey['client_email'], + 'signingAlgorithm' => 'RS256', + 'signingKey' => $jsonKey['private_key'], + ]); + } + + /** + * Updates metadata with the authorization token. + * + * @param array $metadata metadata hashmap + * @param string $authUri optional auth uri + * @param callable $httpHandler callback which delivers psr7 request + * + * @return array updated metadata hashmap + */ + public function updateMetadata( + $metadata, + $authUri = null, + callable $httpHandler = null + ) { + if (empty($authUri)) { + return $metadata; + } + + $this->auth->setAudience($authUri); + + return parent::updateMetadata($metadata, $authUri, $httpHandler); + } + + /** + * Implements FetchAuthTokenInterface#fetchAuthToken. + * + * @param callable $httpHandler + * + * @return array|void A set of auth related metadata, containing the + * following keys: + * - access_token (string) + */ + public function fetchAuthToken(callable $httpHandler = null) + { + $audience = $this->auth->getAudience(); + if (empty($audience)) { + return null; + } + + $access_token = $this->auth->toJwt(); + + return array('access_token' => $access_token); + } + + /** + * @return string + */ + public function getCacheKey() + { + return $this->auth->getCacheKey(); + } + + /** + * @return array + */ + public function getLastReceivedToken() + { + return $this->auth->getLastReceivedToken(); + } + + /** + * Get the client name from the keyfile. + * + * In this case, it returns the keyfile's client_email key. + * + * @param callable $httpHandler Not used by this credentials type. + * @return string + */ + public function getClientName(callable $httpHandler = null) + { + return $this->auth->getIssuer(); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/UserRefreshCredentials.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/UserRefreshCredentials.php new file mode 100644 index 0000000..74dcad8 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/UserRefreshCredentials.php @@ -0,0 +1,137 @@ +auth = new OAuth2([ + 'clientId' => $jsonKey['client_id'], + 'clientSecret' => $jsonKey['client_secret'], + 'refresh_token' => $jsonKey['refresh_token'], + 'scope' => $scope, + 'tokenCredentialUri' => self::TOKEN_CREDENTIAL_URI, + ]); + if ($jsonKey['client_id'] === self::CLOUD_SDK_CLIENT_ID + && getenv(self::SUPPRESS_CLOUD_SDK_CREDS_WARNING_ENV) !== 'true') { + trigger_error( + 'Your application has authenticated using end user credentials ' + . 'from Google Cloud SDK. We recommend that most server ' + . 'applications use service accounts instead. If your ' + . 'application continues to use end user credentials ' + . 'from Cloud SDK, you might receive a "quota exceeded" ' + . 'or "API not enabled" error. For more information about ' + . 'service accounts, see ' + . 'https://cloud.google.com/docs/authentication/. ' + . 'To disable this warning, set ' + . self::SUPPRESS_CLOUD_SDK_CREDS_WARNING_ENV + . ' environment variable to "true".', + E_USER_WARNING); + } + } + + /** + * @param callable $httpHandler + * + * @return array A set of auth related metadata, containing the following + * keys: + * - access_token (string) + * - expires_in (int) + * - scope (string) + * - token_type (string) + * - id_token (string) + */ + public function fetchAuthToken(callable $httpHandler = null) + { + return $this->auth->fetchAuthToken($httpHandler); + } + + /** + * @return string + */ + public function getCacheKey() + { + return $this->auth->getClientId() . ':' . $this->auth->getCacheKey(); + } + + /** + * @return array + */ + public function getLastReceivedToken() + { + return $this->auth->getLastReceivedToken(); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/CredentialsLoader.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/CredentialsLoader.php new file mode 100644 index 0000000..a81d88f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/CredentialsLoader.php @@ -0,0 +1,223 @@ +setDefaultOption('auth', 'google_auth'); + $subscriber = new Subscriber\AuthTokenSubscriber( + $fetcher, + $httpHandler, + $tokenCallback + ); + $client->getEmitter()->attach($subscriber); + return $client; + case '6': + $middleware = new Middleware\AuthTokenMiddleware( + $fetcher, + $httpHandler, + $tokenCallback + ); + $stack = \GuzzleHttp\HandlerStack::create(); + $stack->push($middleware); + + return new \GuzzleHttp\Client([ + 'handler' => $stack, + 'auth' => 'google_auth', + ] + $httpClientOptions); + default: + throw new \Exception('Version not supported'); + } + } + + /** + * Create a new instance of InsecureCredentials. + * + * @return InsecureCredentials + */ + public static function makeInsecureCredentials() + { + return new InsecureCredentials(); + } + + /** + * export a callback function which updates runtime metadata. + * + * @return array updateMetadata function + */ + public function getUpdateMetadataFunc() + { + return array($this, 'updateMetadata'); + } + + /** + * Updates metadata with the authorization token. + * + * @param array $metadata metadata hashmap + * @param string $authUri optional auth uri + * @param callable $httpHandler callback which delivers psr7 request + * + * @return array updated metadata hashmap + */ + public function updateMetadata( + $metadata, + $authUri = null, + callable $httpHandler = null + ) { + $result = $this->fetchAuthToken($httpHandler); + if (!isset($result['access_token'])) { + return $metadata; + } + $metadata_copy = $metadata; + $metadata_copy[self::AUTH_METADATA_KEY] = array('Bearer ' . $result['access_token']); + + return $metadata_copy; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/FetchAuthTokenCache.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/FetchAuthTokenCache.php new file mode 100644 index 0000000..7824d15 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/FetchAuthTokenCache.php @@ -0,0 +1,142 @@ +fetcher = $fetcher; + $this->cache = $cache; + $this->cacheConfig = array_merge([ + 'lifetime' => 1500, + 'prefix' => '', + ], (array) $cacheConfig); + } + + /** + * Implements FetchAuthTokenInterface#fetchAuthToken. + * + * Checks the cache for a valid auth token and fetches the auth tokens + * from the supplied fetcher. + * + * @param callable $httpHandler callback which delivers psr7 request + * + * @return array the response + * + * @throws \Exception + */ + public function fetchAuthToken(callable $httpHandler = null) + { + // Use the cached value if its available. + // + // TODO: correct caching; update the call to setCachedValue to set the expiry + // to the value returned with the auth token. + // + // TODO: correct caching; enable the cache to be cleared. + $cacheKey = $this->fetcher->getCacheKey(); + $cached = $this->getCachedValue($cacheKey); + if (!empty($cached)) { + return ['access_token' => $cached]; + } + + $auth_token = $this->fetcher->fetchAuthToken($httpHandler); + + if (isset($auth_token['access_token'])) { + $this->setCachedValue($cacheKey, $auth_token['access_token']); + } + + return $auth_token; + } + + /** + * @return string + */ + public function getCacheKey() + { + return $this->getFullCacheKey($this->fetcher->getCacheKey()); + } + + /** + * @return array|null + */ + public function getLastReceivedToken() + { + return $this->fetcher->getLastReceivedToken(); + } + + /** + * Get the client name from the fetcher. + * + * @param callable $httpHandler An HTTP handler to deliver PSR7 requests. + * @return string + */ + public function getClientName(callable $httpHandler = null) + { + return $this->fetcher->getClientName($httpHandler); + } + + /** + * Sign a blob using the fetcher. + * + * @param string $stringToSign The string to sign. + * @param bool $forceOpenssl Require use of OpenSSL for local signing. Does + * not apply to signing done using external services. **Defaults to** + * `false`. + * @return string The resulting signature. + * @throws \RuntimeException If the fetcher does not implement + * `Google\Auth\SignBlobInterface`. + */ + public function signBlob($stringToSign, $forceOpenSsl = false) + { + if (!$this->fetcher instanceof SignBlobInterface) { + throw new \RuntimeException( + 'Credentials fetcher does not implement ' . + 'Google\Auth\SignBlobInterface' + ); + } + + return $this->fetcher->signBlob($stringToSign, $forceOpenSsl); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/FetchAuthTokenInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/FetchAuthTokenInterface.php new file mode 100644 index 0000000..e3d8d28 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/FetchAuthTokenInterface.php @@ -0,0 +1,55 @@ +client = $client; + } + + /** + * Accepts a PSR-7 Request and an array of options and returns a PSR-7 response. + * + * @param RequestInterface $request + * @param array $options + * + * @return ResponseInterface + */ + public function __invoke(RequestInterface $request, array $options = []) + { + $response = $this->client->send( + $this->createGuzzle5Request($request, $options) + ); + + return $this->createPsr7Response($response); + } + + /** + * Accepts a PSR-7 request and an array of options and returns a PromiseInterface + * + * @param RequestInterface $request + * @param array $options + * + * @return Promise + */ + public function async(RequestInterface $request, array $options = []) + { + if (!class_exists('GuzzleHttp\Promise\Promise')) { + throw new Exception('Install guzzlehttp/promises to use async with Guzzle 5'); + } + + $futureResponse = $this->client->send( + $this->createGuzzle5Request( + $request, + ['future' => true] + $options + ) + ); + + $promise = new Promise( + function () use ($futureResponse) { + try { + $futureResponse->wait(); + } catch (Exception $e) { + // The promise is already delivered when the exception is + // thrown, so don't rethrow it. + } + }, + [$futureResponse, 'cancel'] + ); + + $futureResponse->then([$promise, 'resolve'], [$promise, 'reject']); + + return $promise->then( + function (Guzzle5ResponseInterface $response) { + // Adapt the Guzzle 5 Response to a PSR-7 Response. + return $this->createPsr7Response($response); + }, + function (Exception $e) { + return new RejectedPromise($e); + } + ); + } + + private function createGuzzle5Request(RequestInterface $request, array $options) + { + return $this->client->createRequest( + $request->getMethod(), + $request->getUri(), + array_merge_recursive([ + 'headers' => $request->getHeaders(), + 'body' => $request->getBody(), + ], $options) + ); + } + + private function createPsr7Response(Guzzle5ResponseInterface $response) + { + return new Response( + $response->getStatusCode(), + $response->getHeaders() ?: [], + $response->getBody(), + $response->getProtocolVersion(), + $response->getReasonPhrase() + ); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php new file mode 100644 index 0000000..6dfe9a8 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php @@ -0,0 +1,49 @@ +client = $client; + } + + /** + * Accepts a PSR-7 request and an array of options and returns a PSR-7 response. + * + * @param RequestInterface $request + * @param array $options + * + * @return ResponseInterface + */ + public function __invoke(RequestInterface $request, array $options = []) + { + return $this->client->send($request, $options); + } + + /** + * Accepts a PSR-7 request and an array of options and returns a PromiseInterface + * + * @param RequestInterface $request + * @param array $options + * + * @return \GuzzleHttp\Promise\Promise + */ + public function async(RequestInterface $request, array $options = []) + { + return $this->client->sendAsync($request, $options); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/HttpHandler/HttpClientCache.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/HttpHandler/HttpClientCache.php new file mode 100644 index 0000000..f4a62b9 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/HttpHandler/HttpClientCache.php @@ -0,0 +1,54 @@ +httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + } + + /** + * Sign a string using the IAM signBlob API. + * + * Note that signing using IAM requires your service account to have the + * `iam.serviceAccounts.signBlob` permission, part of the "Service Account + * Token Creator" IAM role. + * + * @param string $email The service account email. + * @param string $accessToken An access token from the service account. + * @param string $stringToSign The string to be signed. + * @param array $delegates [optional] A list of service account emails to + * add to the delegate chain. If omitted, the value of `$email` will + * be used. + * @return string The signed string, base64-encoded. + */ + public function signBlob($email, $accessToken, $stringToSign, array $delegates = []) + { + $httpHandler = $this->httpHandler; + $name = sprintf(self::SERVICE_ACCOUNT_NAME, $email); + $uri = self::IAM_API_ROOT . '/' . sprintf(self::SIGN_BLOB_PATH, $name); + + if ($delegates) { + foreach ($delegates as &$delegate) { + $delegate = sprintf(self::SERVICE_ACCOUNT_NAME, $delegate); + } + } else { + $delegates = [$name]; + } + + $body = [ + 'delegates' => $delegates, + 'payload' => base64_encode($stringToSign), + ]; + + $headers = [ + 'Authorization' => 'Bearer ' . $accessToken + ]; + + $request = new Psr7\Request( + 'POST', + $uri, + $headers, + Psr7\stream_for(json_encode($body)) + ); + + $res = $httpHandler($request); + $body = json_decode((string) $res->getBody(), true); + + return $body['signedBlob']; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php new file mode 100644 index 0000000..ee2cf94 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php @@ -0,0 +1,126 @@ +' + */ +class AuthTokenMiddleware +{ + /** + * @var callback + */ + private $httpHandler; + + /** + * @var FetchAuthTokenInterface + */ + private $fetcher; + + /** + * @var callable + */ + private $tokenCallback; + + /** + * Creates a new AuthTokenMiddleware. + * + * @param FetchAuthTokenInterface $fetcher is used to fetch the auth token + * @param callable $httpHandler (optional) callback which delivers psr7 request + * @param callable $tokenCallback (optional) function to be called when a new token is fetched. + */ + public function __construct( + FetchAuthTokenInterface $fetcher, + callable $httpHandler = null, + callable $tokenCallback = null + ) { + $this->fetcher = $fetcher; + $this->httpHandler = $httpHandler; + $this->tokenCallback = $tokenCallback; + } + + /** + * Updates the request with an Authorization header when auth is 'google_auth'. + * + * use Google\Auth\Middleware\AuthTokenMiddleware; + * use Google\Auth\OAuth2; + * use GuzzleHttp\Client; + * use GuzzleHttp\HandlerStack; + * + * $config = [...]; + * $oauth2 = new OAuth2($config) + * $middleware = new AuthTokenMiddleware($oauth2); + * $stack = HandlerStack::create(); + * $stack->push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'auth' => 'google_auth' // authorize all requests + * ]); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + * + * @param callable $handler + * + * @return \Closure + */ + public function __invoke(callable $handler) + { + return function (RequestInterface $request, array $options) use ($handler) { + // Requests using "auth"="google_auth" will be authorized. + if (!isset($options['auth']) || $options['auth'] !== 'google_auth') { + return $handler($request, $options); + } + + $request = $request->withHeader('authorization', 'Bearer ' . $this->fetchToken()); + + return $handler($request, $options); + }; + } + + /** + * Call fetcher to fetch the token. + * + * @return string + */ + private function fetchToken() + { + $auth_tokens = $this->fetcher->fetchAuthToken($this->httpHandler); + + if (array_key_exists('access_token', $auth_tokens)) { + // notify the callback if applicable + if ($this->tokenCallback) { + call_user_func($this->tokenCallback, $this->fetcher->getCacheKey(), $auth_tokens['access_token']); + } + + return $auth_tokens['access_token']; + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php new file mode 100644 index 0000000..55f04d1 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php @@ -0,0 +1,175 @@ +' + */ +class ScopedAccessTokenMiddleware +{ + use CacheTrait; + + const DEFAULT_CACHE_LIFETIME = 1500; + + /** + * @var CacheItemPoolInterface + */ + private $cache; + + /** + * @var array configuration + */ + private $cacheConfig; + + /** + * @var callable + */ + private $tokenFunc; + + /** + * @var array|string + */ + private $scopes; + + /** + * Creates a new ScopedAccessTokenMiddleware. + * + * @param callable $tokenFunc a token generator function + * @param array|string $scopes the token authentication scopes + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache an implementation of CacheItemPoolInterface + */ + public function __construct( + callable $tokenFunc, + $scopes, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null + ) { + $this->tokenFunc = $tokenFunc; + if (!(is_string($scopes) || is_array($scopes))) { + throw new \InvalidArgumentException( + 'wants scope should be string or array'); + } + $this->scopes = $scopes; + + if (!is_null($cache)) { + $this->cache = $cache; + $this->cacheConfig = array_merge([ + 'lifetime' => self::DEFAULT_CACHE_LIFETIME, + 'prefix' => '', + ], $cacheConfig); + } + } + + /** + * Updates the request with an Authorization header when auth is 'scoped'. + * + * E.g this could be used to authenticate using the AppEngine + * AppIdentityService. + * + * use google\appengine\api\app_identity\AppIdentityService; + * use Google\Auth\Middleware\ScopedAccessTokenMiddleware; + * use GuzzleHttp\Client; + * use GuzzleHttp\HandlerStack; + * + * $scope = 'https://www.googleapis.com/auth/taskqueue' + * $middleware = new ScopedAccessTokenMiddleware( + * 'AppIdentityService::getAccessToken', + * $scope, + * [ 'prefix' => 'Google\Auth\ScopedAccessToken::' ], + * $cache = new Memcache() + * ); + * $stack = HandlerStack::create(); + * $stack->push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_url' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'auth' => 'scoped' // authorize all requests + * ]); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + * + * @param callable $handler + * + * @return \Closure + */ + public function __invoke(callable $handler) + { + return function (RequestInterface $request, array $options) use ($handler) { + // Requests using "auth"="scoped" will be authorized. + if (!isset($options['auth']) || $options['auth'] !== 'scoped') { + return $handler($request, $options); + } + + $request = $request->withHeader('authorization', 'Bearer ' . $this->fetchToken()); + + return $handler($request, $options); + }; + } + + /** + * @return string + */ + private function getCacheKey() + { + $key = null; + + if (is_string($this->scopes)) { + $key .= $this->scopes; + } elseif (is_array($this->scopes)) { + $key .= implode(':', $this->scopes); + } + + return $key; + } + + /** + * Determine if token is available in the cache, if not call tokenFunc to + * fetch it. + * + * @return string + */ + private function fetchToken() + { + $cacheKey = $this->getCacheKey(); + $cached = $this->getCachedValue($cacheKey); + + if (!empty($cached)) { + return $cached; + } + + $token = call_user_func($this->tokenFunc, $this->scopes); + $this->setCachedValue($cacheKey, $token); + + return $token; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Middleware/SimpleMiddleware.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Middleware/SimpleMiddleware.php new file mode 100644 index 0000000..c31fc65 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Middleware/SimpleMiddleware.php @@ -0,0 +1,93 @@ +config = array_merge(['key' => null], $config); + } + + /** + * Updates the request query with the developer key if auth is set to simple. + * + * use Google\Auth\Middleware\SimpleMiddleware; + * use GuzzleHttp\Client; + * use GuzzleHttp\HandlerStack; + * + * $my_key = 'is not the same as yours'; + * $middleware = new SimpleMiddleware(['key' => $my_key]); + * $stack = HandlerStack::create(); + * $stack->push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/discovery/v1/', + * 'auth' => 'simple' + * ]); + * + * $res = $client->get('drive/v2/rest'); + * + * @param callable $handler + * + * @return \Closure + */ + public function __invoke(callable $handler) + { + return function (RequestInterface $request, array $options) use ($handler) { + // Requests using "auth"="scoped" will be authorized. + if (!isset($options['auth']) || $options['auth'] !== 'simple') { + return $handler($request, $options); + } + + $query = Psr7\parse_query($request->getUri()->getQuery()); + $params = array_merge($query, $this->config); + $uri = $request->getUri()->withQuery(Psr7\build_query($params)); + $request = $request->withUri($uri); + + return $handler($request, $options); + }; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/OAuth2.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/OAuth2.php new file mode 100644 index 0000000..fa3f593 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/OAuth2.php @@ -0,0 +1,1360 @@ + self::DEFAULT_EXPIRY_SECONDS, + 'extensionParams' => [], + 'authorizationUri' => null, + 'redirectUri' => null, + 'tokenCredentialUri' => null, + 'state' => null, + 'username' => null, + 'password' => null, + 'clientId' => null, + 'clientSecret' => null, + 'issuer' => null, + 'sub' => null, + 'audience' => null, + 'signingKey' => null, + 'signingAlgorithm' => null, + 'scope' => null, + 'additionalClaims' => [], + ], $config); + + $this->setAuthorizationUri($opts['authorizationUri']); + $this->setRedirectUri($opts['redirectUri']); + $this->setTokenCredentialUri($opts['tokenCredentialUri']); + $this->setState($opts['state']); + $this->setUsername($opts['username']); + $this->setPassword($opts['password']); + $this->setClientId($opts['clientId']); + $this->setClientSecret($opts['clientSecret']); + $this->setIssuer($opts['issuer']); + $this->setSub($opts['sub']); + $this->setExpiry($opts['expiry']); + $this->setAudience($opts['audience']); + $this->setSigningKey($opts['signingKey']); + $this->setSigningAlgorithm($opts['signingAlgorithm']); + $this->setScope($opts['scope']); + $this->setExtensionParams($opts['extensionParams']); + $this->setAdditionalClaims($opts['additionalClaims']); + $this->updateToken($opts); + } + + /** + * Verifies the idToken if present. + * + * - if none is present, return null + * - if present, but invalid, raises DomainException. + * - otherwise returns the payload in the idtoken as a PHP object. + * + * if $publicKey is null, the key is decoded without being verified. + * + * @param string $publicKey The public key to use to authenticate the token + * @param array $allowed_algs List of supported verification algorithms + * + * @return null|object + */ + public function verifyIdToken($publicKey = null, $allowed_algs = array()) + { + $idToken = $this->getIdToken(); + if (is_null($idToken)) { + return null; + } + + $resp = $this->jwtDecode($idToken, $publicKey, $allowed_algs); + if (!property_exists($resp, 'aud')) { + throw new \DomainException('No audience found the id token'); + } + if ($resp->aud != $this->getAudience()) { + throw new \DomainException('Wrong audience present in the id token'); + } + + return $resp; + } + + /** + * Obtains the encoded jwt from the instance data. + * + * @param array $config array optional configuration parameters + * + * @return string + */ + public function toJwt(array $config = []) + { + if (is_null($this->getSigningKey())) { + throw new \DomainException('No signing key available'); + } + if (is_null($this->getSigningAlgorithm())) { + throw new \DomainException('No signing algorithm specified'); + } + $now = time(); + + $opts = array_merge([ + 'skew' => self::DEFAULT_SKEW_SECONDS, + ], $config); + + $assertion = [ + 'iss' => $this->getIssuer(), + 'aud' => $this->getAudience(), + 'exp' => ($now + $this->getExpiry()), + 'iat' => ($now - $opts['skew']), + ]; + foreach ($assertion as $k => $v) { + if (is_null($v)) { + throw new \DomainException($k . ' should not be null'); + } + } + if (!(is_null($this->getScope()))) { + $assertion['scope'] = $this->getScope(); + } + if (!(is_null($this->getSub()))) { + $assertion['sub'] = $this->getSub(); + } + $assertion += $this->getAdditionalClaims(); + + return $this->jwtEncode($assertion, $this->getSigningKey(), + $this->getSigningAlgorithm()); + } + + /** + * Generates a request for token credentials. + * + * @return RequestInterface the authorization Url. + */ + public function generateCredentialsRequest() + { + $uri = $this->getTokenCredentialUri(); + if (is_null($uri)) { + throw new \DomainException('No token credential URI was set.'); + } + + $grantType = $this->getGrantType(); + $params = array('grant_type' => $grantType); + switch ($grantType) { + case 'authorization_code': + $params['code'] = $this->getCode(); + $params['redirect_uri'] = $this->getRedirectUri(); + $this->addClientCredentials($params); + break; + case 'password': + $params['username'] = $this->getUsername(); + $params['password'] = $this->getPassword(); + $this->addClientCredentials($params); + break; + case 'refresh_token': + $params['refresh_token'] = $this->getRefreshToken(); + $this->addClientCredentials($params); + break; + case self::JWT_URN: + $params['assertion'] = $this->toJwt(); + break; + default: + if (!is_null($this->getRedirectUri())) { + # Grant type was supposed to be 'authorization_code', as there + # is a redirect URI. + throw new \DomainException('Missing authorization code'); + } + unset($params['grant_type']); + if (!is_null($grantType)) { + $params['grant_type'] = $grantType; + } + $params = array_merge($params, $this->getExtensionParams()); + } + + $headers = [ + 'Cache-Control' => 'no-store', + 'Content-Type' => 'application/x-www-form-urlencoded', + ]; + + return new Request( + 'POST', + $uri, + $headers, + Psr7\build_query($params) + ); + } + + /** + * Fetches the auth tokens based on the current state. + * + * @param callable $httpHandler callback which delivers psr7 request + * + * @return array the response + */ + public function fetchAuthToken(callable $httpHandler = null) + { + if (is_null($httpHandler)) { + $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + } + + $response = $httpHandler($this->generateCredentialsRequest()); + $credentials = $this->parseTokenResponse($response); + $this->updateToken($credentials); + + return $credentials; + } + + /** + * Obtains a key that can used to cache the results of #fetchAuthToken. + * + * The key is derived from the scopes. + * + * @return string a key that may be used to cache the auth token. + */ + public function getCacheKey() + { + if (is_string($this->scope)) { + return $this->scope; + } + + if (is_array($this->scope)) { + return implode(':', $this->scope); + } + + // If scope has not set, return null to indicate no caching. + return null; + } + + /** + * Parses the fetched tokens. + * + * @param ResponseInterface $resp the response. + * + * @return array the tokens parsed from the response body. + * + * @throws \Exception + */ + public function parseTokenResponse(ResponseInterface $resp) + { + $body = (string)$resp->getBody(); + if ($resp->hasHeader('Content-Type') && + $resp->getHeaderLine('Content-Type') == 'application/x-www-form-urlencoded' + ) { + $res = array(); + parse_str($body, $res); + + return $res; + } + + // Assume it's JSON; if it's not throw an exception + if (null === $res = json_decode($body, true)) { + throw new \Exception('Invalid JSON response'); + } + + return $res; + } + + /** + * Updates an OAuth 2.0 client. + * + * @example + * client.updateToken([ + * 'refresh_token' => 'n4E9O119d', + * 'access_token' => 'FJQbwq9', + * 'expires_in' => 3600 + * ]) + * + * @param array $config + * The configuration parameters related to the token. + * + * - refresh_token + * The refresh token associated with the access token + * to be refreshed. + * + * - access_token + * The current access token for this client. + * + * - id_token + * The current ID token for this client. + * + * - expires_in + * The time in seconds until access token expiration. + * + * - expires_at + * The time as an integer number of seconds since the Epoch + * + * - issued_at + * The timestamp that the token was issued at. + */ + public function updateToken(array $config) + { + $opts = array_merge([ + 'extensionParams' => [], + 'access_token' => null, + 'id_token' => null, + 'expires_in' => null, + 'expires_at' => null, + 'issued_at' => null, + ], $config); + + $this->setExpiresAt($opts['expires_at']); + $this->setExpiresIn($opts['expires_in']); + // By default, the token is issued at `Time.now` when `expiresIn` is set, + // but this can be used to supply a more precise time. + if (!is_null($opts['issued_at'])) { + $this->setIssuedAt($opts['issued_at']); + } + + $this->setAccessToken($opts['access_token']); + $this->setIdToken($opts['id_token']); + // The refresh token should only be updated if a value is explicitly + // passed in, as some access token responses do not include a refresh + // token. + if (array_key_exists('refresh_token', $opts)) { + $this->setRefreshToken($opts['refresh_token']); + } + } + + /** + * Builds the authorization Uri that the user should be redirected to. + * + * @param array $config configuration options that customize the return url + * + * @return UriInterface the authorization Url. + * + * @throws InvalidArgumentException + */ + public function buildFullAuthorizationUri(array $config = []) + { + if (is_null($this->getAuthorizationUri())) { + throw new InvalidArgumentException( + 'requires an authorizationUri to have been set'); + } + + $params = array_merge([ + 'response_type' => 'code', + 'access_type' => 'offline', + 'client_id' => $this->clientId, + 'redirect_uri' => $this->redirectUri, + 'state' => $this->state, + 'scope' => $this->getScope(), + ], $config); + + // Validate the auth_params + if (is_null($params['client_id'])) { + throw new InvalidArgumentException( + 'missing the required client identifier'); + } + if (is_null($params['redirect_uri'])) { + throw new InvalidArgumentException('missing the required redirect URI'); + } + if (!empty($params['prompt']) && !empty($params['approval_prompt'])) { + throw new InvalidArgumentException( + 'prompt and approval_prompt are mutually exclusive'); + } + + // Construct the uri object; return it if it is valid. + $result = clone $this->authorizationUri; + $existingParams = Psr7\parse_query($result->getQuery()); + + $result = $result->withQuery( + Psr7\build_query(array_merge($existingParams, $params)) + ); + + if ($result->getScheme() != 'https') { + throw new InvalidArgumentException( + 'Authorization endpoint must be protected by TLS'); + } + + return $result; + } + + /** + * Sets the authorization server's HTTP endpoint capable of authenticating + * the end-user and obtaining authorization. + * + * @param string $uri + */ + public function setAuthorizationUri($uri) + { + $this->authorizationUri = $this->coerceUri($uri); + } + + /** + * Gets the authorization server's HTTP endpoint capable of authenticating + * the end-user and obtaining authorization. + * + * @return UriInterface + */ + public function getAuthorizationUri() + { + return $this->authorizationUri; + } + + /** + * Gets the authorization server's HTTP endpoint capable of issuing tokens + * and refreshing expired tokens. + * + * @return string + */ + public function getTokenCredentialUri() + { + return $this->tokenCredentialUri; + } + + /** + * Sets the authorization server's HTTP endpoint capable of issuing tokens + * and refreshing expired tokens. + * + * @param string $uri + */ + public function setTokenCredentialUri($uri) + { + $this->tokenCredentialUri = $this->coerceUri($uri); + } + + /** + * Gets the redirection URI used in the initial request. + * + * @return string + */ + public function getRedirectUri() + { + return $this->redirectUri; + } + + /** + * Sets the redirection URI used in the initial request. + * + * @param string $uri + */ + public function setRedirectUri($uri) + { + if (is_null($uri)) { + $this->redirectUri = null; + + return; + } + // redirect URI must be absolute + if (!$this->isAbsoluteUri($uri)) { + // "postmessage" is a reserved URI string in Google-land + // @see https://developers.google.com/identity/sign-in/web/server-side-flow + if ('postmessage' !== (string)$uri) { + throw new InvalidArgumentException( + 'Redirect URI must be absolute'); + } + } + $this->redirectUri = (string)$uri; + } + + /** + * Gets the scope of the access requests as a space-delimited String. + * + * @return string + */ + public function getScope() + { + if (is_null($this->scope)) { + return $this->scope; + } + + return implode(' ', $this->scope); + } + + /** + * Sets the scope of the access request, expressed either as an Array or as + * a space-delimited String. + * + * @param string|array $scope + * + * @throws InvalidArgumentException + */ + public function setScope($scope) + { + if (is_null($scope)) { + $this->scope = null; + } elseif (is_string($scope)) { + $this->scope = explode(' ', $scope); + } elseif (is_array($scope)) { + foreach ($scope as $s) { + $pos = strpos($s, ' '); + if ($pos !== false) { + throw new InvalidArgumentException( + 'array scope values should not contain spaces'); + } + } + $this->scope = $scope; + } else { + throw new InvalidArgumentException( + 'scopes should be a string or array of strings'); + } + } + + /** + * Gets the current grant type. + * + * @return string + */ + public function getGrantType() + { + if (!is_null($this->grantType)) { + return $this->grantType; + } + + // Returns the inferred grant type, based on the current object instance + // state. + if (!is_null($this->code)) { + return 'authorization_code'; + } + + if (!is_null($this->refreshToken)) { + return 'refresh_token'; + } + + if (!is_null($this->username) && !is_null($this->password)) { + return 'password'; + } + + if (!is_null($this->issuer) && !is_null($this->signingKey)) { + return self::JWT_URN; + } + + return null; + } + + /** + * Sets the current grant type. + * + * @param $grantType + * + * @throws InvalidArgumentException + */ + public function setGrantType($grantType) + { + if (in_array($grantType, self::$knownGrantTypes)) { + $this->grantType = $grantType; + } else { + // validate URI + if (!$this->isAbsoluteUri($grantType)) { + throw new InvalidArgumentException( + 'invalid grant type'); + } + $this->grantType = (string)$grantType; + } + } + + /** + * Gets an arbitrary string designed to allow the client to maintain state. + * + * @return string + */ + public function getState() + { + return $this->state; + } + + /** + * Sets an arbitrary string designed to allow the client to maintain state. + * + * @param string $state + */ + public function setState($state) + { + $this->state = $state; + } + + /** + * Gets the authorization code issued to this client. + */ + public function getCode() + { + return $this->code; + } + + /** + * Sets the authorization code issued to this client. + * + * @param string $code + */ + public function setCode($code) + { + $this->code = $code; + } + + /** + * Gets the resource owner's username. + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the resource owner's username. + * + * @param string $username + */ + public function setUsername($username) + { + $this->username = $username; + } + + /** + * Gets the resource owner's password. + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the resource owner's password. + * + * @param $password + */ + public function setPassword($password) + { + $this->password = $password; + } + + /** + * Sets a unique identifier issued to the client to identify itself to the + * authorization server. + */ + public function getClientId() + { + return $this->clientId; + } + + /** + * Sets a unique identifier issued to the client to identify itself to the + * authorization server. + * + * @param $clientId + */ + public function setClientId($clientId) + { + $this->clientId = $clientId; + } + + /** + * Gets a shared symmetric secret issued by the authorization server, which + * is used to authenticate the client. + */ + public function getClientSecret() + { + return $this->clientSecret; + } + + /** + * Sets a shared symmetric secret issued by the authorization server, which + * is used to authenticate the client. + * + * @param $clientSecret + */ + public function setClientSecret($clientSecret) + { + $this->clientSecret = $clientSecret; + } + + /** + * Gets the Issuer ID when using assertion profile. + */ + public function getIssuer() + { + return $this->issuer; + } + + /** + * Sets the Issuer ID when using assertion profile. + * + * @param string $issuer + */ + public function setIssuer($issuer) + { + $this->issuer = $issuer; + } + + /** + * Gets the target sub when issuing assertions. + */ + public function getSub() + { + return $this->sub; + } + + /** + * Sets the target sub when issuing assertions. + * + * @param string $sub + */ + public function setSub($sub) + { + $this->sub = $sub; + } + + /** + * Gets the target audience when issuing assertions. + */ + public function getAudience() + { + return $this->audience; + } + + /** + * Sets the target audience when issuing assertions. + * + * @param string $audience + */ + public function setAudience($audience) + { + $this->audience = $audience; + } + + /** + * Gets the signing key when using an assertion profile. + */ + public function getSigningKey() + { + return $this->signingKey; + } + + /** + * Sets the signing key when using an assertion profile. + * + * @param string $signingKey + */ + public function setSigningKey($signingKey) + { + $this->signingKey = $signingKey; + } + + /** + * Gets the signing algorithm when using an assertion profile. + * + * @return string + */ + public function getSigningAlgorithm() + { + return $this->signingAlgorithm; + } + + /** + * Sets the signing algorithm when using an assertion profile. + * + * @param string $signingAlgorithm + */ + public function setSigningAlgorithm($signingAlgorithm) + { + if (is_null($signingAlgorithm)) { + $this->signingAlgorithm = null; + } elseif (!in_array($signingAlgorithm, self::$knownSigningAlgorithms)) { + throw new InvalidArgumentException('unknown signing algorithm'); + } else { + $this->signingAlgorithm = $signingAlgorithm; + } + } + + /** + * Gets the set of parameters used by extension when using an extension + * grant type. + */ + public function getExtensionParams() + { + return $this->extensionParams; + } + + /** + * Sets the set of parameters used by extension when using an extension + * grant type. + * + * @param $extensionParams + */ + public function setExtensionParams($extensionParams) + { + $this->extensionParams = $extensionParams; + } + + /** + * Gets the number of seconds assertions are valid for. + */ + public function getExpiry() + { + return $this->expiry; + } + + /** + * Sets the number of seconds assertions are valid for. + * + * @param int $expiry + */ + public function setExpiry($expiry) + { + $this->expiry = $expiry; + } + + /** + * Gets the lifetime of the access token in seconds. + */ + public function getExpiresIn() + { + return $this->expiresIn; + } + + /** + * Sets the lifetime of the access token in seconds. + * + * @param int $expiresIn + */ + public function setExpiresIn($expiresIn) + { + if (is_null($expiresIn)) { + $this->expiresIn = null; + $this->issuedAt = null; + } else { + $this->issuedAt = time(); + $this->expiresIn = (int)$expiresIn; + } + } + + /** + * Gets the time the current access token expires at. + * + * @return int + */ + public function getExpiresAt() + { + if (!is_null($this->expiresAt)) { + return $this->expiresAt; + } + + if (!is_null($this->issuedAt) && !is_null($this->expiresIn)) { + return $this->issuedAt + $this->expiresIn; + } + + return null; + } + + /** + * Returns true if the acccess token has expired. + * + * @return bool + */ + public function isExpired() + { + $expiration = $this->getExpiresAt(); + $now = time(); + + return !is_null($expiration) && $now >= $expiration; + } + + /** + * Sets the time the current access token expires at. + * + * @param int $expiresAt + */ + public function setExpiresAt($expiresAt) + { + $this->expiresAt = $expiresAt; + } + + /** + * Gets the time the current access token was issued at. + */ + public function getIssuedAt() + { + return $this->issuedAt; + } + + /** + * Sets the time the current access token was issued at. + * + * @param int $issuedAt + */ + public function setIssuedAt($issuedAt) + { + $this->issuedAt = $issuedAt; + } + + /** + * Gets the current access token. + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets the current access token. + * + * @param string $accessToken + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + } + + /** + * Gets the current ID token. + */ + public function getIdToken() + { + return $this->idToken; + } + + /** + * Sets the current ID token. + * + * @param $idToken + */ + public function setIdToken($idToken) + { + $this->idToken = $idToken; + } + + /** + * Gets the refresh token associated with the current access token. + */ + public function getRefreshToken() + { + return $this->refreshToken; + } + + /** + * Sets the refresh token associated with the current access token. + * + * @param $refreshToken + */ + public function setRefreshToken($refreshToken) + { + $this->refreshToken = $refreshToken; + } + + /** + * Sets additional claims to be included in the JWT token + * + * @param array $additionalClaims + */ + public function setAdditionalClaims(array $additionalClaims) + { + $this->additionalClaims = $additionalClaims; + } + + /** + * Gets the additional claims to be included in the JWT token. + * + * @return array + */ + public function getAdditionalClaims() + { + return $this->additionalClaims; + } + + /** + * The expiration of the last received token. + * + * @return array + */ + public function getLastReceivedToken() + { + if ($token = $this->getAccessToken()) { + return [ + 'access_token' => $token, + 'expires_at' => $this->getExpiresAt(), + ]; + } + + return null; + } + + /** + * Get the client ID. + * + * Alias of {@see Google\Auth\OAuth2::getClientId()}. + * + * @param callable $httpHandler + * @return string + * @access private + */ + public function getClientName(callable $httpHandler = null) + { + return $this->getClientId(); + } + + /** + * @todo handle uri as array + * + * @param string $uri + * + * @return null|UriInterface + */ + private function coerceUri($uri) + { + if (is_null($uri)) { + return; + } + + return Psr7\uri_for($uri); + } + + /** + * @param string $idToken + * @param string|array|null $publicKey + * @param array $allowedAlgs + * + * @return object + */ + private function jwtDecode($idToken, $publicKey, $allowedAlgs) + { + if (class_exists('Firebase\JWT\JWT')) { + return \Firebase\JWT\JWT::decode($idToken, $publicKey, $allowedAlgs); + } + + return \JWT::decode($idToken, $publicKey, $allowedAlgs); + } + + private function jwtEncode($assertion, $signingKey, $signingAlgorithm) + { + if (class_exists('Firebase\JWT\JWT')) { + return \Firebase\JWT\JWT::encode($assertion, $signingKey, + $signingAlgorithm); + } + + return \JWT::encode($assertion, $signingKey, $signingAlgorithm); + } + + /** + * Determines if the URI is absolute based on its scheme and host or path + * (RFC 3986). + * + * @param string $uri + * + * @return bool + */ + private function isAbsoluteUri($uri) + { + $uri = $this->coerceUri($uri); + + return $uri->getScheme() && ($uri->getHost() || $uri->getPath()); + } + + /** + * @param array $params + * + * @return array + */ + private function addClientCredentials(&$params) + { + $clientId = $this->getClientId(); + $clientSecret = $this->getClientSecret(); + + if ($clientId && $clientSecret) { + $params['client_id'] = $clientId; + $params['client_secret'] = $clientSecret; + } + + return $params; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/ServiceAccountSignerTrait.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/ServiceAccountSignerTrait.php new file mode 100644 index 0000000..72fb142 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/ServiceAccountSignerTrait.php @@ -0,0 +1,57 @@ +auth->getSigningKey(); + + $signedString = ''; + if (class_exists('\\phpseclib\\Crypt\\RSA') && !$forceOpenssl) { + $rsa = new RSA; + $rsa->loadKey($privateKey); + $rsa->setSignatureMode(RSA::SIGNATURE_PKCS1); + $rsa->setHash('sha256'); + + $signedString = $rsa->sign($stringToSign); + } elseif (extension_loaded('openssl')) { + openssl_sign($stringToSign, $signedString, $privateKey, 'sha256WithRSAEncryption'); + } else { + // @codeCoverageIgnoreStart + throw new \RuntimeException('OpenSSL is not installed.'); + } + // @codeCoverageIgnoreEnd + + return base64_encode($signedString); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/SignBlobInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/SignBlobInterface.php new file mode 100644 index 0000000..5f2c944 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/SignBlobInterface.php @@ -0,0 +1,44 @@ +' + */ +class AuthTokenSubscriber implements SubscriberInterface +{ + /** + * @var callable + */ + private $httpHandler; + + /** + * @var FetchAuthTokenInterface + */ + private $fetcher; + + /** + * @var callable + */ + private $tokenCallback; + + /** + * Creates a new AuthTokenSubscriber. + * + * @param FetchAuthTokenInterface $fetcher is used to fetch the auth token + * @param callable $httpHandler (optional) http client to fetch the token. + * @param callable $tokenCallback (optional) function to be called when a new token is fetched. + */ + public function __construct( + FetchAuthTokenInterface $fetcher, + callable $httpHandler = null, + callable $tokenCallback = null + ) { + $this->fetcher = $fetcher; + $this->httpHandler = $httpHandler; + $this->tokenCallback = $tokenCallback; + } + + /** + * @return array + */ + public function getEvents() + { + return ['before' => ['onBefore', RequestEvents::SIGN_REQUEST]]; + } + + /** + * Updates the request with an Authorization header when auth is 'fetched_auth_token'. + * + * use GuzzleHttp\Client; + * use Google\Auth\OAuth2; + * use Google\Auth\Subscriber\AuthTokenSubscriber; + * + * $config = [...]; + * $oauth2 = new OAuth2($config) + * $subscriber = new AuthTokenSubscriber($oauth2); + * + * $client = new Client([ + * 'base_url' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'defaults' => ['auth' => 'google_auth'] + * ]); + * $client->getEmitter()->attach($subscriber); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + * + * @param BeforeEvent $event + */ + public function onBefore(BeforeEvent $event) + { + // Requests using "auth"="google_auth" will be authorized. + $request = $event->getRequest(); + if ($request->getConfig()['auth'] != 'google_auth') { + return; + } + + // Fetch the auth token. + $auth_tokens = $this->fetcher->fetchAuthToken($this->httpHandler); + if (array_key_exists('access_token', $auth_tokens)) { + $request->setHeader('authorization', 'Bearer ' . $auth_tokens['access_token']); + + // notify the callback if applicable + if ($this->tokenCallback) { + call_user_func($this->tokenCallback, $this->fetcher->getCacheKey(), $auth_tokens['access_token']); + } + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Subscriber/ScopedAccessTokenSubscriber.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Subscriber/ScopedAccessTokenSubscriber.php new file mode 100644 index 0000000..63b4ca2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Subscriber/ScopedAccessTokenSubscriber.php @@ -0,0 +1,177 @@ +' + */ +class ScopedAccessTokenSubscriber implements SubscriberInterface +{ + use CacheTrait; + + const DEFAULT_CACHE_LIFETIME = 1500; + + /** + * @var CacheItemPoolInterface + */ + private $cache; + + /** + * @var callable The access token generator function + */ + private $tokenFunc; + + /** + * @var array|string The scopes used to generate the token + */ + private $scopes; + + /** + * @var array + */ + private $cacheConfig; + + /** + * Creates a new ScopedAccessTokenSubscriber. + * + * @param callable $tokenFunc a token generator function + * @param array|string $scopes the token authentication scopes + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache an implementation of CacheItemPoolInterface + */ + public function __construct( + callable $tokenFunc, + $scopes, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null + ) { + $this->tokenFunc = $tokenFunc; + if (!(is_string($scopes) || is_array($scopes))) { + throw new \InvalidArgumentException( + 'wants scope should be string or array'); + } + $this->scopes = $scopes; + + if (!is_null($cache)) { + $this->cache = $cache; + $this->cacheConfig = array_merge([ + 'lifetime' => self::DEFAULT_CACHE_LIFETIME, + 'prefix' => '', + ], $cacheConfig); + } + } + + /** + * @return array + */ + public function getEvents() + { + return ['before' => ['onBefore', RequestEvents::SIGN_REQUEST]]; + } + + /** + * Updates the request with an Authorization header when auth is 'scoped'. + * + * E.g this could be used to authenticate using the AppEngine + * AppIdentityService. + * + * use google\appengine\api\app_identity\AppIdentityService; + * use Google\Auth\Subscriber\ScopedAccessTokenSubscriber; + * use GuzzleHttp\Client; + * + * $scope = 'https://www.googleapis.com/auth/taskqueue' + * $subscriber = new ScopedAccessToken( + * 'AppIdentityService::getAccessToken', + * $scope, + * ['prefix' => 'Google\Auth\ScopedAccessToken::'], + * $cache = new Memcache() + * ); + * + * $client = new Client([ + * 'base_url' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'defaults' => ['auth' => 'scoped'] + * ]); + * $client->getEmitter()->attach($subscriber); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + * + * @param BeforeEvent $event + */ + public function onBefore(BeforeEvent $event) + { + // Requests using "auth"="scoped" will be authorized. + $request = $event->getRequest(); + if ($request->getConfig()['auth'] != 'scoped') { + return; + } + $auth_header = 'Bearer ' . $this->fetchToken(); + $request->setHeader('authorization', $auth_header); + } + + /** + * @return string + */ + private function getCacheKey() + { + $key = null; + + if (is_string($this->scopes)) { + $key .= $this->scopes; + } elseif (is_array($this->scopes)) { + $key .= implode(':', $this->scopes); + } + + return $key; + } + + /** + * Determine if token is available in the cache, if not call tokenFunc to + * fetch it. + * + * @return string + */ + private function fetchToken() + { + $cacheKey = $this->getCacheKey(); + $cached = $this->getCachedValue($cacheKey); + + if (!empty($cached)) { + return $cached; + } + + $token = call_user_func($this->tokenFunc, $this->scopes); + $this->setCachedValue($cacheKey, $token); + + return $token; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Subscriber/SimpleSubscriber.php b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Subscriber/SimpleSubscriber.php new file mode 100644 index 0000000..0c56731 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Subscriber/SimpleSubscriber.php @@ -0,0 +1,90 @@ +config = array_merge([], $config); + } + + /** + * @return array + */ + public function getEvents() + { + return ['before' => ['onBefore', RequestEvents::SIGN_REQUEST]]; + } + + /** + * Updates the request query with the developer key if auth is set to simple. + * + * use Google\Auth\Subscriber\SimpleSubscriber; + * use GuzzleHttp\Client; + * + * $my_key = 'is not the same as yours'; + * $subscriber = new SimpleSubscriber(['key' => $my_key]); + * + * $client = new Client([ + * 'base_url' => 'https://www.googleapis.com/discovery/v1/', + * 'defaults' => ['auth' => 'simple'] + * ]); + * $client->getEmitter()->attach($subscriber); + * + * $res = $client->get('drive/v2/rest'); + * + * @param BeforeEvent $event + */ + public function onBefore(BeforeEvent $event) + { + // Requests using "auth"="simple" with the developer key. + $request = $event->getRequest(); + if ($request->getConfig()['auth'] != 'simple') { + return; + } + $request->getQuery()->overwriteWith($this->config); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/Dockerfile b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/Dockerfile new file mode 100644 index 0000000..f6a0952 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/Dockerfile @@ -0,0 +1,18 @@ +FROM composer:latest as setup + +RUN mkdir /guzzle + +WORKDIR /guzzle + +RUN set -xe \ + && composer init --name=guzzlehttp/test --description="Simple project for testing Guzzle scripts" --author="Márk Sági-Kazár " --no-interaction \ + && composer require guzzlehttp/guzzle + + +FROM php:7.3 + +RUN mkdir /guzzle + +WORKDIR /guzzle + +COPY --from=setup /guzzle /guzzle diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/LICENSE b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/LICENSE new file mode 100644 index 0000000..50a177b --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling + +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. diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Client.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Client.php new file mode 100644 index 0000000..0f43c71 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Client.php @@ -0,0 +1,422 @@ + 'http://www.foo.com/1.0/', + * 'timeout' => 0, + * 'allow_redirects' => false, + * 'proxy' => '192.168.16.1:10' + * ]); + * + * Client configuration settings include the following options: + * + * - handler: (callable) Function that transfers HTTP requests over the + * wire. The function is called with a Psr7\Http\Message\RequestInterface + * and array of transfer options, and must return a + * GuzzleHttp\Promise\PromiseInterface that is fulfilled with a + * Psr7\Http\Message\ResponseInterface on success. "handler" is a + * constructor only option that cannot be overridden in per/request + * options. If no handler is provided, a default handler will be created + * that enables all of the request options below by attaching all of the + * default middleware to the handler. + * - base_uri: (string|UriInterface) Base URI of the client that is merged + * into relative URIs. Can be a string or instance of UriInterface. + * - **: any request option + * + * @param array $config Client configuration settings. + * + * @see \GuzzleHttp\RequestOptions for a list of available request options. + */ + public function __construct(array $config = []) + { + if (!isset($config['handler'])) { + $config['handler'] = HandlerStack::create(); + } elseif (!is_callable($config['handler'])) { + throw new \InvalidArgumentException('handler must be a callable'); + } + + // Convert the base_uri to a UriInterface + if (isset($config['base_uri'])) { + $config['base_uri'] = Psr7\uri_for($config['base_uri']); + } + + $this->configureDefaults($config); + } + + public function __call($method, $args) + { + if (count($args) < 1) { + throw new \InvalidArgumentException('Magic request methods require a URI and optional options array'); + } + + $uri = $args[0]; + $opts = isset($args[1]) ? $args[1] : []; + + return substr($method, -5) === 'Async' + ? $this->requestAsync(substr($method, 0, -5), $uri, $opts) + : $this->request($method, $uri, $opts); + } + + public function sendAsync(RequestInterface $request, array $options = []) + { + // Merge the base URI into the request URI if needed. + $options = $this->prepareDefaults($options); + + return $this->transfer( + $request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')), + $options + ); + } + + public function send(RequestInterface $request, array $options = []) + { + $options[RequestOptions::SYNCHRONOUS] = true; + return $this->sendAsync($request, $options)->wait(); + } + + public function requestAsync($method, $uri = '', array $options = []) + { + $options = $this->prepareDefaults($options); + // Remove request modifying parameter because it can be done up-front. + $headers = isset($options['headers']) ? $options['headers'] : []; + $body = isset($options['body']) ? $options['body'] : null; + $version = isset($options['version']) ? $options['version'] : '1.1'; + // Merge the URI into the base URI. + $uri = $this->buildUri($uri, $options); + if (is_array($body)) { + $this->invalidBody(); + } + $request = new Psr7\Request($method, $uri, $headers, $body, $version); + // Remove the option so that they are not doubly-applied. + unset($options['headers'], $options['body'], $options['version']); + + return $this->transfer($request, $options); + } + + public function request($method, $uri = '', array $options = []) + { + $options[RequestOptions::SYNCHRONOUS] = true; + return $this->requestAsync($method, $uri, $options)->wait(); + } + + public function getConfig($option = null) + { + return $option === null + ? $this->config + : (isset($this->config[$option]) ? $this->config[$option] : null); + } + + private function buildUri($uri, array $config) + { + // for BC we accept null which would otherwise fail in uri_for + $uri = Psr7\uri_for($uri === null ? '' : $uri); + + if (isset($config['base_uri'])) { + $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri); + } + + return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri; + } + + /** + * Configures the default options for a client. + * + * @param array $config + */ + private function configureDefaults(array $config) + { + $defaults = [ + 'allow_redirects' => RedirectMiddleware::$defaultSettings, + 'http_errors' => true, + 'decode_content' => true, + 'verify' => true, + 'cookies' => false + ]; + + // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set. + + // We can only trust the HTTP_PROXY environment variable in a CLI + // process due to the fact that PHP has no reliable mechanism to + // get environment variables that start with "HTTP_". + if (php_sapi_name() == 'cli' && getenv('HTTP_PROXY')) { + $defaults['proxy']['http'] = getenv('HTTP_PROXY'); + } + + if ($proxy = getenv('HTTPS_PROXY')) { + $defaults['proxy']['https'] = $proxy; + } + + if ($noProxy = getenv('NO_PROXY')) { + $cleanedNoProxy = str_replace(' ', '', $noProxy); + $defaults['proxy']['no'] = explode(',', $cleanedNoProxy); + } + + $this->config = $config + $defaults; + + if (!empty($config['cookies']) && $config['cookies'] === true) { + $this->config['cookies'] = new CookieJar(); + } + + // Add the default user-agent header. + if (!isset($this->config['headers'])) { + $this->config['headers'] = ['User-Agent' => default_user_agent()]; + } else { + // Add the User-Agent header if one was not already set. + foreach (array_keys($this->config['headers']) as $name) { + if (strtolower($name) === 'user-agent') { + return; + } + } + $this->config['headers']['User-Agent'] = default_user_agent(); + } + } + + /** + * Merges default options into the array. + * + * @param array $options Options to modify by reference + * + * @return array + */ + private function prepareDefaults(array $options) + { + $defaults = $this->config; + + if (!empty($defaults['headers'])) { + // Default headers are only added if they are not present. + $defaults['_conditional'] = $defaults['headers']; + unset($defaults['headers']); + } + + // Special handling for headers is required as they are added as + // conditional headers and as headers passed to a request ctor. + if (array_key_exists('headers', $options)) { + // Allows default headers to be unset. + if ($options['headers'] === null) { + $defaults['_conditional'] = null; + unset($options['headers']); + } elseif (!is_array($options['headers'])) { + throw new \InvalidArgumentException('headers must be an array'); + } + } + + // Shallow merge defaults underneath options. + $result = $options + $defaults; + + // Remove null values. + foreach ($result as $k => $v) { + if ($v === null) { + unset($result[$k]); + } + } + + return $result; + } + + /** + * Transfers the given request and applies request options. + * + * The URI of the request is not modified and the request options are used + * as-is without merging in default options. + * + * @param RequestInterface $request + * @param array $options + * + * @return Promise\PromiseInterface + */ + private function transfer(RequestInterface $request, array $options) + { + // save_to -> sink + if (isset($options['save_to'])) { + $options['sink'] = $options['save_to']; + unset($options['save_to']); + } + + // exceptions -> http_errors + if (isset($options['exceptions'])) { + $options['http_errors'] = $options['exceptions']; + unset($options['exceptions']); + } + + $request = $this->applyOptions($request, $options); + $handler = $options['handler']; + + try { + return Promise\promise_for($handler($request, $options)); + } catch (\Exception $e) { + return Promise\rejection_for($e); + } + } + + /** + * Applies the array of request options to a request. + * + * @param RequestInterface $request + * @param array $options + * + * @return RequestInterface + */ + private function applyOptions(RequestInterface $request, array &$options) + { + $modify = [ + 'set_headers' => [], + ]; + + if (isset($options['headers'])) { + $modify['set_headers'] = $options['headers']; + unset($options['headers']); + } + + if (isset($options['form_params'])) { + if (isset($options['multipart'])) { + throw new \InvalidArgumentException('You cannot use ' + . 'form_params and multipart at the same time. Use the ' + . 'form_params option if you want to send application/' + . 'x-www-form-urlencoded requests, and the multipart ' + . 'option to send multipart/form-data requests.'); + } + $options['body'] = http_build_query($options['form_params'], '', '&'); + unset($options['form_params']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded'; + } + + if (isset($options['multipart'])) { + $options['body'] = new Psr7\MultipartStream($options['multipart']); + unset($options['multipart']); + } + + if (isset($options['json'])) { + $options['body'] = \GuzzleHttp\json_encode($options['json']); + unset($options['json']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/json'; + } + + if (!empty($options['decode_content']) + && $options['decode_content'] !== true + ) { + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Accept-Encoding'], $options['_conditional']); + $modify['set_headers']['Accept-Encoding'] = $options['decode_content']; + } + + if (isset($options['body'])) { + if (is_array($options['body'])) { + $this->invalidBody(); + } + $modify['body'] = Psr7\stream_for($options['body']); + unset($options['body']); + } + + if (!empty($options['auth']) && is_array($options['auth'])) { + $value = $options['auth']; + $type = isset($value[2]) ? strtolower($value[2]) : 'basic'; + switch ($type) { + case 'basic': + // Ensure that we don't have the header in different case and set the new value. + $modify['set_headers'] = Psr7\_caseless_remove(['Authorization'], $modify['set_headers']); + $modify['set_headers']['Authorization'] = 'Basic ' + . base64_encode("$value[0]:$value[1]"); + break; + case 'digest': + // @todo: Do not rely on curl + $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST; + $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + case 'ntlm': + $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_NTLM; + $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + } + } + + if (isset($options['query'])) { + $value = $options['query']; + if (is_array($value)) { + $value = http_build_query($value, null, '&', PHP_QUERY_RFC3986); + } + if (!is_string($value)) { + throw new \InvalidArgumentException('query must be a string or array'); + } + $modify['query'] = $value; + unset($options['query']); + } + + // Ensure that sink is not an invalid value. + if (isset($options['sink'])) { + // TODO: Add more sink validation? + if (is_bool($options['sink'])) { + throw new \InvalidArgumentException('sink must not be a boolean'); + } + } + + $request = Psr7\modify_request($request, $modify); + if ($request->getBody() instanceof Psr7\MultipartStream) { + // Use a multipart/form-data POST if a Content-Type is not set. + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary=' + . $request->getBody()->getBoundary(); + } + + // Merge in conditional headers if they are not present. + if (isset($options['_conditional'])) { + // Build up the changes so it's in a single clone of the message. + $modify = []; + foreach ($options['_conditional'] as $k => $v) { + if (!$request->hasHeader($k)) { + $modify['set_headers'][$k] = $v; + } + } + $request = Psr7\modify_request($request, $modify); + // Don't pass this internal value along to middleware/handlers. + unset($options['_conditional']); + } + + return $request; + } + + private function invalidBody() + { + throw new \InvalidArgumentException('Passing in the "body" request ' + . 'option as an array to send a POST request has been deprecated. ' + . 'Please use the "form_params" request option to send a ' + . 'application/x-www-form-urlencoded request, or the "multipart" ' + . 'request option to send a multipart/form-data request.'); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/ClientInterface.php new file mode 100644 index 0000000..5b37085 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/ClientInterface.php @@ -0,0 +1,84 @@ +strictMode = $strictMode; + + foreach ($cookieArray as $cookie) { + if (!($cookie instanceof SetCookie)) { + $cookie = new SetCookie($cookie); + } + $this->setCookie($cookie); + } + } + + /** + * Create a new Cookie jar from an associative array and domain. + * + * @param array $cookies Cookies to create the jar from + * @param string $domain Domain to set the cookies to + * + * @return self + */ + public static function fromArray(array $cookies, $domain) + { + $cookieJar = new self(); + foreach ($cookies as $name => $value) { + $cookieJar->setCookie(new SetCookie([ + 'Domain' => $domain, + 'Name' => $name, + 'Value' => $value, + 'Discard' => true + ])); + } + + return $cookieJar; + } + + /** + * @deprecated + */ + public static function getCookieValue($value) + { + return $value; + } + + /** + * Evaluate if this cookie should be persisted to storage + * that survives between requests. + * + * @param SetCookie $cookie Being evaluated. + * @param bool $allowSessionCookies If we should persist session cookies + * @return bool + */ + public static function shouldPersist( + SetCookie $cookie, + $allowSessionCookies = false + ) { + if ($cookie->getExpires() || $allowSessionCookies) { + if (!$cookie->getDiscard()) { + return true; + } + } + + return false; + } + + /** + * Finds and returns the cookie based on the name + * + * @param string $name cookie name to search for + * @return SetCookie|null cookie that was found or null if not found + */ + public function getCookieByName($name) + { + // don't allow a null name + if ($name === null) { + return null; + } + foreach ($this->cookies as $cookie) { + if ($cookie->getName() !== null && strcasecmp($cookie->getName(), $name) === 0) { + return $cookie; + } + } + } + + public function toArray() + { + return array_map(function (SetCookie $cookie) { + return $cookie->toArray(); + }, $this->getIterator()->getArrayCopy()); + } + + public function clear($domain = null, $path = null, $name = null) + { + if (!$domain) { + $this->cookies = []; + return; + } elseif (!$path) { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($domain) { + return !$cookie->matchesDomain($domain); + } + ); + } elseif (!$name) { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($path, $domain) { + return !($cookie->matchesPath($path) && + $cookie->matchesDomain($domain)); + } + ); + } else { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($path, $domain, $name) { + return !($cookie->getName() == $name && + $cookie->matchesPath($path) && + $cookie->matchesDomain($domain)); + } + ); + } + } + + public function clearSessionCookies() + { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) { + return !$cookie->getDiscard() && $cookie->getExpires(); + } + ); + } + + public function setCookie(SetCookie $cookie) + { + // If the name string is empty (but not 0), ignore the set-cookie + // string entirely. + $name = $cookie->getName(); + if (!$name && $name !== '0') { + return false; + } + + // Only allow cookies with set and valid domain, name, value + $result = $cookie->validate(); + if ($result !== true) { + if ($this->strictMode) { + throw new \RuntimeException('Invalid cookie: ' . $result); + } else { + $this->removeCookieIfEmpty($cookie); + return false; + } + } + + // Resolve conflicts with previously set cookies + foreach ($this->cookies as $i => $c) { + + // Two cookies are identical, when their path, and domain are + // identical. + if ($c->getPath() != $cookie->getPath() || + $c->getDomain() != $cookie->getDomain() || + $c->getName() != $cookie->getName() + ) { + continue; + } + + // The previously set cookie is a discard cookie and this one is + // not so allow the new cookie to be set + if (!$cookie->getDiscard() && $c->getDiscard()) { + unset($this->cookies[$i]); + continue; + } + + // If the new cookie's expiration is further into the future, then + // replace the old cookie + if ($cookie->getExpires() > $c->getExpires()) { + unset($this->cookies[$i]); + continue; + } + + // If the value has changed, we better change it + if ($cookie->getValue() !== $c->getValue()) { + unset($this->cookies[$i]); + continue; + } + + // The cookie exists, so no need to continue + return false; + } + + $this->cookies[] = $cookie; + + return true; + } + + public function count() + { + return count($this->cookies); + } + + public function getIterator() + { + return new \ArrayIterator(array_values($this->cookies)); + } + + public function extractCookies( + RequestInterface $request, + ResponseInterface $response + ) { + if ($cookieHeader = $response->getHeader('Set-Cookie')) { + foreach ($cookieHeader as $cookie) { + $sc = SetCookie::fromString($cookie); + if (!$sc->getDomain()) { + $sc->setDomain($request->getUri()->getHost()); + } + if (0 !== strpos($sc->getPath(), '/')) { + $sc->setPath($this->getCookiePathFromRequest($request)); + } + $this->setCookie($sc); + } + } + } + + /** + * Computes cookie path following RFC 6265 section 5.1.4 + * + * @link https://tools.ietf.org/html/rfc6265#section-5.1.4 + * + * @param RequestInterface $request + * @return string + */ + private function getCookiePathFromRequest(RequestInterface $request) + { + $uriPath = $request->getUri()->getPath(); + if ('' === $uriPath) { + return '/'; + } + if (0 !== strpos($uriPath, '/')) { + return '/'; + } + if ('/' === $uriPath) { + return '/'; + } + if (0 === $lastSlashPos = strrpos($uriPath, '/')) { + return '/'; + } + + return substr($uriPath, 0, $lastSlashPos); + } + + public function withCookieHeader(RequestInterface $request) + { + $values = []; + $uri = $request->getUri(); + $scheme = $uri->getScheme(); + $host = $uri->getHost(); + $path = $uri->getPath() ?: '/'; + + foreach ($this->cookies as $cookie) { + if ($cookie->matchesPath($path) && + $cookie->matchesDomain($host) && + !$cookie->isExpired() && + (!$cookie->getSecure() || $scheme === 'https') + ) { + $values[] = $cookie->getName() . '=' + . $cookie->getValue(); + } + } + + return $values + ? $request->withHeader('Cookie', implode('; ', $values)) + : $request; + } + + /** + * If a cookie already exists and the server asks to set it again with a + * null value, the cookie must be deleted. + * + * @param SetCookie $cookie + */ + private function removeCookieIfEmpty(SetCookie $cookie) + { + $cookieValue = $cookie->getValue(); + if ($cookieValue === null || $cookieValue === '') { + $this->clear( + $cookie->getDomain(), + $cookie->getPath(), + $cookie->getName() + ); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php new file mode 100644 index 0000000..2cf298a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php @@ -0,0 +1,84 @@ +filename = $cookieFile; + $this->storeSessionCookies = $storeSessionCookies; + + if (file_exists($cookieFile)) { + $this->load($cookieFile); + } + } + + /** + * Saves the file when shutting down + */ + public function __destruct() + { + $this->save($this->filename); + } + + /** + * Saves the cookies to a file. + * + * @param string $filename File to save + * @throws \RuntimeException if the file cannot be found or created + */ + public function save($filename) + { + $json = []; + foreach ($this as $cookie) { + /** @var SetCookie $cookie */ + if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + $json[] = $cookie->toArray(); + } + } + + $jsonStr = \GuzzleHttp\json_encode($json); + if (false === file_put_contents($filename, $jsonStr, LOCK_EX)) { + throw new \RuntimeException("Unable to save file {$filename}"); + } + } + + /** + * Load cookies from a JSON formatted file. + * + * Old cookies are kept unless overwritten by newly loaded ones. + * + * @param string $filename Cookie file to load. + * @throws \RuntimeException if the file cannot be loaded. + */ + public function load($filename) + { + $json = file_get_contents($filename); + if (false === $json) { + throw new \RuntimeException("Unable to load file {$filename}"); + } elseif ($json === '') { + return; + } + + $data = \GuzzleHttp\json_decode($json, true); + if (is_array($data)) { + foreach (json_decode($json, true) as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (strlen($data)) { + throw new \RuntimeException("Invalid cookie file: {$filename}"); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php new file mode 100644 index 0000000..0224a24 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php @@ -0,0 +1,72 @@ +sessionKey = $sessionKey; + $this->storeSessionCookies = $storeSessionCookies; + $this->load(); + } + + /** + * Saves cookies to session when shutting down + */ + public function __destruct() + { + $this->save(); + } + + /** + * Save cookies to the client session + */ + public function save() + { + $json = []; + foreach ($this as $cookie) { + /** @var SetCookie $cookie */ + if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + $json[] = $cookie->toArray(); + } + } + + $_SESSION[$this->sessionKey] = json_encode($json); + } + + /** + * Load the contents of the client session into the data array + */ + protected function load() + { + if (!isset($_SESSION[$this->sessionKey])) { + return; + } + $data = json_decode($_SESSION[$this->sessionKey], true); + if (is_array($data)) { + foreach ($data as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (strlen($data)) { + throw new \RuntimeException("Invalid cookie data"); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php new file mode 100644 index 0000000..3d776a7 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php @@ -0,0 +1,403 @@ + null, + 'Value' => null, + 'Domain' => null, + 'Path' => '/', + 'Max-Age' => null, + 'Expires' => null, + 'Secure' => false, + 'Discard' => false, + 'HttpOnly' => false + ]; + + /** @var array Cookie data */ + private $data; + + /** + * Create a new SetCookie object from a string + * + * @param string $cookie Set-Cookie header string + * + * @return self + */ + public static function fromString($cookie) + { + // Create the default return array + $data = self::$defaults; + // Explode the cookie string using a series of semicolons + $pieces = array_filter(array_map('trim', explode(';', $cookie))); + // The name of the cookie (first kvp) must exist and include an equal sign. + if (empty($pieces[0]) || !strpos($pieces[0], '=')) { + return new self($data); + } + + // Add the cookie pieces into the parsed data array + foreach ($pieces as $part) { + $cookieParts = explode('=', $part, 2); + $key = trim($cookieParts[0]); + $value = isset($cookieParts[1]) + ? trim($cookieParts[1], " \n\r\t\0\x0B") + : true; + + // Only check for non-cookies when cookies have been found + if (empty($data['Name'])) { + $data['Name'] = $key; + $data['Value'] = $value; + } else { + foreach (array_keys(self::$defaults) as $search) { + if (!strcasecmp($search, $key)) { + $data[$search] = $value; + continue 2; + } + } + $data[$key] = $value; + } + } + + return new self($data); + } + + /** + * @param array $data Array of cookie data provided by a Cookie parser + */ + public function __construct(array $data = []) + { + $this->data = array_replace(self::$defaults, $data); + // Extract the Expires value and turn it into a UNIX timestamp if needed + if (!$this->getExpires() && $this->getMaxAge()) { + // Calculate the Expires date + $this->setExpires(time() + $this->getMaxAge()); + } elseif ($this->getExpires() && !is_numeric($this->getExpires())) { + $this->setExpires($this->getExpires()); + } + } + + public function __toString() + { + $str = $this->data['Name'] . '=' . $this->data['Value'] . '; '; + foreach ($this->data as $k => $v) { + if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) { + if ($k === 'Expires') { + $str .= 'Expires=' . gmdate('D, d M Y H:i:s \G\M\T', $v) . '; '; + } else { + $str .= ($v === true ? $k : "{$k}={$v}") . '; '; + } + } + } + + return rtrim($str, '; '); + } + + public function toArray() + { + return $this->data; + } + + /** + * Get the cookie name + * + * @return string + */ + public function getName() + { + return $this->data['Name']; + } + + /** + * Set the cookie name + * + * @param string $name Cookie name + */ + public function setName($name) + { + $this->data['Name'] = $name; + } + + /** + * Get the cookie value + * + * @return string + */ + public function getValue() + { + return $this->data['Value']; + } + + /** + * Set the cookie value + * + * @param string $value Cookie value + */ + public function setValue($value) + { + $this->data['Value'] = $value; + } + + /** + * Get the domain + * + * @return string|null + */ + public function getDomain() + { + return $this->data['Domain']; + } + + /** + * Set the domain of the cookie + * + * @param string $domain + */ + public function setDomain($domain) + { + $this->data['Domain'] = $domain; + } + + /** + * Get the path + * + * @return string + */ + public function getPath() + { + return $this->data['Path']; + } + + /** + * Set the path of the cookie + * + * @param string $path Path of the cookie + */ + public function setPath($path) + { + $this->data['Path'] = $path; + } + + /** + * Maximum lifetime of the cookie in seconds + * + * @return int|null + */ + public function getMaxAge() + { + return $this->data['Max-Age']; + } + + /** + * Set the max-age of the cookie + * + * @param int $maxAge Max age of the cookie in seconds + */ + public function setMaxAge($maxAge) + { + $this->data['Max-Age'] = $maxAge; + } + + /** + * The UNIX timestamp when the cookie Expires + * + * @return mixed + */ + public function getExpires() + { + return $this->data['Expires']; + } + + /** + * Set the unix timestamp for which the cookie will expire + * + * @param int $timestamp Unix timestamp + */ + public function setExpires($timestamp) + { + $this->data['Expires'] = is_numeric($timestamp) + ? (int) $timestamp + : strtotime($timestamp); + } + + /** + * Get whether or not this is a secure cookie + * + * @return bool|null + */ + public function getSecure() + { + return $this->data['Secure']; + } + + /** + * Set whether or not the cookie is secure + * + * @param bool $secure Set to true or false if secure + */ + public function setSecure($secure) + { + $this->data['Secure'] = $secure; + } + + /** + * Get whether or not this is a session cookie + * + * @return bool|null + */ + public function getDiscard() + { + return $this->data['Discard']; + } + + /** + * Set whether or not this is a session cookie + * + * @param bool $discard Set to true or false if this is a session cookie + */ + public function setDiscard($discard) + { + $this->data['Discard'] = $discard; + } + + /** + * Get whether or not this is an HTTP only cookie + * + * @return bool + */ + public function getHttpOnly() + { + return $this->data['HttpOnly']; + } + + /** + * Set whether or not this is an HTTP only cookie + * + * @param bool $httpOnly Set to true or false if this is HTTP only + */ + public function setHttpOnly($httpOnly) + { + $this->data['HttpOnly'] = $httpOnly; + } + + /** + * Check if the cookie matches a path value. + * + * A request-path path-matches a given cookie-path if at least one of + * the following conditions holds: + * + * - The cookie-path and the request-path are identical. + * - The cookie-path is a prefix of the request-path, and the last + * character of the cookie-path is %x2F ("/"). + * - The cookie-path is a prefix of the request-path, and the first + * character of the request-path that is not included in the cookie- + * path is a %x2F ("/") character. + * + * @param string $requestPath Path to check against + * + * @return bool + */ + public function matchesPath($requestPath) + { + $cookiePath = $this->getPath(); + + // Match on exact matches or when path is the default empty "/" + if ($cookiePath === '/' || $cookiePath == $requestPath) { + return true; + } + + // Ensure that the cookie-path is a prefix of the request path. + if (0 !== strpos($requestPath, $cookiePath)) { + return false; + } + + // Match if the last character of the cookie-path is "/" + if (substr($cookiePath, -1, 1) === '/') { + return true; + } + + // Match if the first character not included in cookie path is "/" + return substr($requestPath, strlen($cookiePath), 1) === '/'; + } + + /** + * Check if the cookie matches a domain value + * + * @param string $domain Domain to check against + * + * @return bool + */ + public function matchesDomain($domain) + { + // Remove the leading '.' as per spec in RFC 6265. + // http://tools.ietf.org/html/rfc6265#section-5.2.3 + $cookieDomain = ltrim($this->getDomain(), '.'); + + // Domain not set or exact match. + if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) { + return true; + } + + // Matching the subdomain according to RFC 6265. + // http://tools.ietf.org/html/rfc6265#section-5.1.3 + if (filter_var($domain, FILTER_VALIDATE_IP)) { + return false; + } + + return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $domain); + } + + /** + * Check if the cookie is expired + * + * @return bool + */ + public function isExpired() + { + return $this->getExpires() !== null && time() > $this->getExpires(); + } + + /** + * Check if the cookie is valid according to RFC 6265 + * + * @return bool|string Returns true if valid or an error message if invalid + */ + public function validate() + { + // Names must not be empty, but can be 0 + $name = $this->getName(); + if (empty($name) && !is_numeric($name)) { + return 'The cookie name must not be empty'; + } + + // Check if any of the invalid characters are present in the cookie name + if (preg_match( + '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/', + $name + )) { + return 'Cookie name must not contain invalid characters: ASCII ' + . 'Control characters (0-31;127), space, tab and the ' + . 'following characters: ()<>@,;:\"/?={}'; + } + + // Value must not be empty, but can be 0 + $value = $this->getValue(); + if (empty($value) && !is_numeric($value)) { + return 'The cookie value must not be empty'; + } + + // Domains must not be empty, but can be 0 + // A "0" is not a valid internet domain, but may be used as server name + // in a private network. + $domain = $this->getDomain(); + if (empty($domain) && !is_numeric($domain)) { + return 'The cookie domain must not be empty'; + } + + return true; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php new file mode 100644 index 0000000..427d896 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php @@ -0,0 +1,27 @@ +getStatusCode() + : 0; + parent::__construct($message, $code, $previous); + $this->request = $request; + $this->response = $response; + $this->handlerContext = $handlerContext; + } + + /** + * Wrap non-RequestExceptions with a RequestException + * + * @param RequestInterface $request + * @param \Exception $e + * + * @return RequestException + */ + public static function wrapException(RequestInterface $request, \Exception $e) + { + return $e instanceof RequestException + ? $e + : new RequestException($e->getMessage(), $request, null, $e); + } + + /** + * Factory method to create a new exception with a normalized error message + * + * @param RequestInterface $request Request + * @param ResponseInterface $response Response received + * @param \Exception $previous Previous exception + * @param array $ctx Optional handler context. + * + * @return self + */ + public static function create( + RequestInterface $request, + ResponseInterface $response = null, + \Exception $previous = null, + array $ctx = [] + ) { + if (!$response) { + return new self( + 'Error completing request', + $request, + null, + $previous, + $ctx + ); + } + + $level = (int) floor($response->getStatusCode() / 100); + if ($level === 4) { + $label = 'Client error'; + $className = ClientException::class; + } elseif ($level === 5) { + $label = 'Server error'; + $className = ServerException::class; + } else { + $label = 'Unsuccessful request'; + $className = __CLASS__; + } + + $uri = $request->getUri(); + $uri = static::obfuscateUri($uri); + + // Client Error: `GET /` resulted in a `404 Not Found` response: + // ... (truncated) + $message = sprintf( + '%s: `%s %s` resulted in a `%s %s` response', + $label, + $request->getMethod(), + $uri, + $response->getStatusCode(), + $response->getReasonPhrase() + ); + + $summary = static::getResponseBodySummary($response); + + if ($summary !== null) { + $message .= ":\n{$summary}\n"; + } + + return new $className($message, $request, $response, $previous, $ctx); + } + + /** + * Get a short summary of the response + * + * Will return `null` if the response is not printable. + * + * @param ResponseInterface $response + * + * @return string|null + */ + public static function getResponseBodySummary(ResponseInterface $response) + { + $body = $response->getBody(); + + if (!$body->isSeekable() || !$body->isReadable()) { + return null; + } + + $size = $body->getSize(); + + if ($size === 0) { + return null; + } + + $summary = $body->read(120); + $body->rewind(); + + if ($size > 120) { + $summary .= ' (truncated...)'; + } + + // Matches any printable character, including unicode characters: + // letters, marks, numbers, punctuation, spacing, and separators. + if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/', $summary)) { + return null; + } + + return $summary; + } + + /** + * Obfuscates URI if there is an username and a password present + * + * @param UriInterface $uri + * + * @return UriInterface + */ + private static function obfuscateUri($uri) + { + $userInfo = $uri->getUserInfo(); + + if (false !== ($pos = strpos($userInfo, ':'))) { + return $uri->withUserInfo(substr($userInfo, 0, $pos), '***'); + } + + return $uri; + } + + /** + * Get the request that caused the exception + * + * @return RequestInterface + */ + public function getRequest() + { + return $this->request; + } + + /** + * Get the associated response + * + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + /** + * Check if a response was received + * + * @return bool + */ + public function hasResponse() + { + return $this->response !== null; + } + + /** + * Get contextual information about the error from the underlying handler. + * + * The contents of this array will vary depending on which handler you are + * using. It may also be just an empty array. Relying on this data will + * couple you to a specific handler, but can give more debug information + * when needed. + * + * @return array + */ + public function getHandlerContext() + { + return $this->handlerContext; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php new file mode 100644 index 0000000..a77c289 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php @@ -0,0 +1,27 @@ +stream = $stream; + $msg = $msg ?: 'Could not seek the stream to position ' . $pos; + parent::__construct($msg); + } + + /** + * @return StreamInterface + */ + public function getStream() + { + return $this->stream; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php new file mode 100644 index 0000000..127094c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php @@ -0,0 +1,9 @@ +maxHandles = $maxHandles; + } + + public function create(RequestInterface $request, array $options) + { + if (isset($options['curl']['body_as_string'])) { + $options['_body_as_string'] = $options['curl']['body_as_string']; + unset($options['curl']['body_as_string']); + } + + $easy = new EasyHandle; + $easy->request = $request; + $easy->options = $options; + $conf = $this->getDefaultConf($easy); + $this->applyMethod($easy, $conf); + $this->applyHandlerOptions($easy, $conf); + $this->applyHeaders($easy, $conf); + unset($conf['_headers']); + + // Add handler options from the request configuration options + if (isset($options['curl'])) { + $conf = array_replace($conf, $options['curl']); + } + + $conf[CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy); + $easy->handle = $this->handles + ? array_pop($this->handles) + : curl_init(); + curl_setopt_array($easy->handle, $conf); + + return $easy; + } + + public function release(EasyHandle $easy) + { + $resource = $easy->handle; + unset($easy->handle); + + if (count($this->handles) >= $this->maxHandles) { + curl_close($resource); + } else { + // Remove all callback functions as they can hold onto references + // and are not cleaned up by curl_reset. Using curl_setopt_array + // does not work for some reason, so removing each one + // individually. + curl_setopt($resource, CURLOPT_HEADERFUNCTION, null); + curl_setopt($resource, CURLOPT_READFUNCTION, null); + curl_setopt($resource, CURLOPT_WRITEFUNCTION, null); + curl_setopt($resource, CURLOPT_PROGRESSFUNCTION, null); + curl_reset($resource); + $this->handles[] = $resource; + } + } + + /** + * Completes a cURL transaction, either returning a response promise or a + * rejected promise. + * + * @param callable $handler + * @param EasyHandle $easy + * @param CurlFactoryInterface $factory Dictates how the handle is released + * + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public static function finish( + callable $handler, + EasyHandle $easy, + CurlFactoryInterface $factory + ) { + if (isset($easy->options['on_stats'])) { + self::invokeStats($easy); + } + + if (!$easy->response || $easy->errno) { + return self::finishError($handler, $easy, $factory); + } + + // Return the response if it is present and there is no error. + $factory->release($easy); + + // Rewind the body of the response if possible. + $body = $easy->response->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + + return new FulfilledPromise($easy->response); + } + + private static function invokeStats(EasyHandle $easy) + { + $curlStats = curl_getinfo($easy->handle); + $curlStats['appconnect_time'] = curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME); + $stats = new TransferStats( + $easy->request, + $easy->response, + $curlStats['total_time'], + $easy->errno, + $curlStats + ); + call_user_func($easy->options['on_stats'], $stats); + } + + private static function finishError( + callable $handler, + EasyHandle $easy, + CurlFactoryInterface $factory + ) { + // Get error information and release the handle to the factory. + $ctx = [ + 'errno' => $easy->errno, + 'error' => curl_error($easy->handle), + 'appconnect_time' => curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME), + ] + curl_getinfo($easy->handle); + $ctx[self::CURL_VERSION_STR] = curl_version()['version']; + $factory->release($easy); + + // Retry when nothing is present or when curl failed to rewind. + if (empty($easy->options['_err_message']) + && (!$easy->errno || $easy->errno == 65) + ) { + return self::retryFailedRewind($handler, $easy, $ctx); + } + + return self::createRejection($easy, $ctx); + } + + private static function createRejection(EasyHandle $easy, array $ctx) + { + static $connectionErrors = [ + CURLE_OPERATION_TIMEOUTED => true, + CURLE_COULDNT_RESOLVE_HOST => true, + CURLE_COULDNT_CONNECT => true, + CURLE_SSL_CONNECT_ERROR => true, + CURLE_GOT_NOTHING => true, + ]; + + // If an exception was encountered during the onHeaders event, then + // return a rejected promise that wraps that exception. + if ($easy->onHeadersException) { + return \GuzzleHttp\Promise\rejection_for( + new RequestException( + 'An error was encountered during the on_headers event', + $easy->request, + $easy->response, + $easy->onHeadersException, + $ctx + ) + ); + } + if (version_compare($ctx[self::CURL_VERSION_STR], self::LOW_CURL_VERSION_NUMBER)) { + $message = sprintf( + 'cURL error %s: %s (%s)', + $ctx['errno'], + $ctx['error'], + 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html' + ); + } else { + $message = sprintf( + 'cURL error %s: %s (%s) for %s', + $ctx['errno'], + $ctx['error'], + 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html', + $easy->request->getUri() + ); + } + + // Create a connection exception if it was a specific error code. + $error = isset($connectionErrors[$easy->errno]) + ? new ConnectException($message, $easy->request, null, $ctx) + : new RequestException($message, $easy->request, $easy->response, null, $ctx); + + return \GuzzleHttp\Promise\rejection_for($error); + } + + private function getDefaultConf(EasyHandle $easy) + { + $conf = [ + '_headers' => $easy->request->getHeaders(), + CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(), + CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''), + CURLOPT_RETURNTRANSFER => false, + CURLOPT_HEADER => false, + CURLOPT_CONNECTTIMEOUT => 150, + ]; + + if (defined('CURLOPT_PROTOCOLS')) { + $conf[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS; + } + + $version = $easy->request->getProtocolVersion(); + if ($version == 1.1) { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1; + } elseif ($version == 2.0) { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0; + } else { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0; + } + + return $conf; + } + + private function applyMethod(EasyHandle $easy, array &$conf) + { + $body = $easy->request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size > 0) { + $this->applyBody($easy->request, $easy->options, $conf); + return; + } + + $method = $easy->request->getMethod(); + if ($method === 'PUT' || $method === 'POST') { + // See http://tools.ietf.org/html/rfc7230#section-3.3.2 + if (!$easy->request->hasHeader('Content-Length')) { + $conf[CURLOPT_HTTPHEADER][] = 'Content-Length: 0'; + } + } elseif ($method === 'HEAD') { + $conf[CURLOPT_NOBODY] = true; + unset( + $conf[CURLOPT_WRITEFUNCTION], + $conf[CURLOPT_READFUNCTION], + $conf[CURLOPT_FILE], + $conf[CURLOPT_INFILE] + ); + } + } + + private function applyBody(RequestInterface $request, array $options, array &$conf) + { + $size = $request->hasHeader('Content-Length') + ? (int) $request->getHeaderLine('Content-Length') + : null; + + // Send the body as a string if the size is less than 1MB OR if the + // [curl][body_as_string] request value is set. + if (($size !== null && $size < 1000000) || + !empty($options['_body_as_string']) + ) { + $conf[CURLOPT_POSTFIELDS] = (string) $request->getBody(); + // Don't duplicate the Content-Length header + $this->removeHeader('Content-Length', $conf); + $this->removeHeader('Transfer-Encoding', $conf); + } else { + $conf[CURLOPT_UPLOAD] = true; + if ($size !== null) { + $conf[CURLOPT_INFILESIZE] = $size; + $this->removeHeader('Content-Length', $conf); + } + $body = $request->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + $conf[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) { + return $body->read($length); + }; + } + + // If the Expect header is not present, prevent curl from adding it + if (!$request->hasHeader('Expect')) { + $conf[CURLOPT_HTTPHEADER][] = 'Expect:'; + } + + // cURL sometimes adds a content-type by default. Prevent this. + if (!$request->hasHeader('Content-Type')) { + $conf[CURLOPT_HTTPHEADER][] = 'Content-Type:'; + } + } + + private function applyHeaders(EasyHandle $easy, array &$conf) + { + foreach ($conf['_headers'] as $name => $values) { + foreach ($values as $value) { + $value = (string) $value; + if ($value === '') { + // cURL requires a special format for empty headers. + // See https://github.com/guzzle/guzzle/issues/1882 for more details. + $conf[CURLOPT_HTTPHEADER][] = "$name;"; + } else { + $conf[CURLOPT_HTTPHEADER][] = "$name: $value"; + } + } + } + + // Remove the Accept header if one was not set + if (!$easy->request->hasHeader('Accept')) { + $conf[CURLOPT_HTTPHEADER][] = 'Accept:'; + } + } + + /** + * Remove a header from the options array. + * + * @param string $name Case-insensitive header to remove + * @param array $options Array of options to modify + */ + private function removeHeader($name, array &$options) + { + foreach (array_keys($options['_headers']) as $key) { + if (!strcasecmp($key, $name)) { + unset($options['_headers'][$key]); + return; + } + } + } + + private function applyHandlerOptions(EasyHandle $easy, array &$conf) + { + $options = $easy->options; + if (isset($options['verify'])) { + if ($options['verify'] === false) { + unset($conf[CURLOPT_CAINFO]); + $conf[CURLOPT_SSL_VERIFYHOST] = 0; + $conf[CURLOPT_SSL_VERIFYPEER] = false; + } else { + $conf[CURLOPT_SSL_VERIFYHOST] = 2; + $conf[CURLOPT_SSL_VERIFYPEER] = true; + if (is_string($options['verify'])) { + // Throw an error if the file/folder/link path is not valid or doesn't exist. + if (!file_exists($options['verify'])) { + throw new \InvalidArgumentException( + "SSL CA bundle not found: {$options['verify']}" + ); + } + // If it's a directory or a link to a directory use CURLOPT_CAPATH. + // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO. + if (is_dir($options['verify']) || + (is_link($options['verify']) && is_dir(readlink($options['verify'])))) { + $conf[CURLOPT_CAPATH] = $options['verify']; + } else { + $conf[CURLOPT_CAINFO] = $options['verify']; + } + } + } + } + + if (!empty($options['decode_content'])) { + $accept = $easy->request->getHeaderLine('Accept-Encoding'); + if ($accept) { + $conf[CURLOPT_ENCODING] = $accept; + } else { + $conf[CURLOPT_ENCODING] = ''; + // Don't let curl send the header over the wire + $conf[CURLOPT_HTTPHEADER][] = 'Accept-Encoding:'; + } + } + + if (isset($options['sink'])) { + $sink = $options['sink']; + if (!is_string($sink)) { + $sink = \GuzzleHttp\Psr7\stream_for($sink); + } elseif (!is_dir(dirname($sink))) { + // Ensure that the directory exists before failing in curl. + throw new \RuntimeException(sprintf( + 'Directory %s does not exist for sink value of %s', + dirname($sink), + $sink + )); + } else { + $sink = new LazyOpenStream($sink, 'w+'); + } + $easy->sink = $sink; + $conf[CURLOPT_WRITEFUNCTION] = function ($ch, $write) use ($sink) { + return $sink->write($write); + }; + } else { + // Use a default temp stream if no sink was set. + $conf[CURLOPT_FILE] = fopen('php://temp', 'w+'); + $easy->sink = Psr7\stream_for($conf[CURLOPT_FILE]); + } + $timeoutRequiresNoSignal = false; + if (isset($options['timeout'])) { + $timeoutRequiresNoSignal |= $options['timeout'] < 1; + $conf[CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000; + } + + // CURL default value is CURL_IPRESOLVE_WHATEVER + if (isset($options['force_ip_resolve'])) { + if ('v4' === $options['force_ip_resolve']) { + $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4; + } elseif ('v6' === $options['force_ip_resolve']) { + $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V6; + } + } + + if (isset($options['connect_timeout'])) { + $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1; + $conf[CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000; + } + + if ($timeoutRequiresNoSignal && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { + $conf[CURLOPT_NOSIGNAL] = true; + } + + if (isset($options['proxy'])) { + if (!is_array($options['proxy'])) { + $conf[CURLOPT_PROXY] = $options['proxy']; + } else { + $scheme = $easy->request->getUri()->getScheme(); + if (isset($options['proxy'][$scheme])) { + $host = $easy->request->getUri()->getHost(); + if (!isset($options['proxy']['no']) || + !\GuzzleHttp\is_host_in_noproxy($host, $options['proxy']['no']) + ) { + $conf[CURLOPT_PROXY] = $options['proxy'][$scheme]; + } + } + } + } + + if (isset($options['cert'])) { + $cert = $options['cert']; + if (is_array($cert)) { + $conf[CURLOPT_SSLCERTPASSWD] = $cert[1]; + $cert = $cert[0]; + } + if (!file_exists($cert)) { + throw new \InvalidArgumentException( + "SSL certificate not found: {$cert}" + ); + } + $conf[CURLOPT_SSLCERT] = $cert; + } + + if (isset($options['ssl_key'])) { + $sslKey = $options['ssl_key']; + if (is_array($sslKey)) { + $conf[CURLOPT_SSLKEYPASSWD] = $sslKey[1]; + $sslKey = $sslKey[0]; + } + if (!file_exists($sslKey)) { + throw new \InvalidArgumentException( + "SSL private key not found: {$sslKey}" + ); + } + $conf[CURLOPT_SSLKEY] = $sslKey; + } + + if (isset($options['progress'])) { + $progress = $options['progress']; + if (!is_callable($progress)) { + throw new \InvalidArgumentException( + 'progress client option must be callable' + ); + } + $conf[CURLOPT_NOPROGRESS] = false; + $conf[CURLOPT_PROGRESSFUNCTION] = function () use ($progress) { + $args = func_get_args(); + // PHP 5.5 pushed the handle onto the start of the args + if (is_resource($args[0])) { + array_shift($args); + } + call_user_func_array($progress, $args); + }; + } + + if (!empty($options['debug'])) { + $conf[CURLOPT_STDERR] = \GuzzleHttp\debug_resource($options['debug']); + $conf[CURLOPT_VERBOSE] = true; + } + } + + /** + * This function ensures that a response was set on a transaction. If one + * was not set, then the request is retried if possible. This error + * typically means you are sending a payload, curl encountered a + * "Connection died, retrying a fresh connect" error, tried to rewind the + * stream, and then encountered a "necessary data rewind wasn't possible" + * error, causing the request to be sent through curl_multi_info_read() + * without an error status. + */ + private static function retryFailedRewind( + callable $handler, + EasyHandle $easy, + array $ctx + ) { + try { + // Only rewind if the body has been read from. + $body = $easy->request->getBody(); + if ($body->tell() > 0) { + $body->rewind(); + } + } catch (\RuntimeException $e) { + $ctx['error'] = 'The connection unexpectedly failed without ' + . 'providing an error. The request would have been retried, ' + . 'but attempting to rewind the request body failed. ' + . 'Exception: ' . $e; + return self::createRejection($easy, $ctx); + } + + // Retry no more than 3 times before giving up. + if (!isset($easy->options['_curl_retries'])) { + $easy->options['_curl_retries'] = 1; + } elseif ($easy->options['_curl_retries'] == 2) { + $ctx['error'] = 'The cURL request was retried 3 times ' + . 'and did not succeed. The most likely reason for the failure ' + . 'is that cURL was unable to rewind the body of the request ' + . 'and subsequent retries resulted in the same error. Turn on ' + . 'the debug option to see what went wrong. See ' + . 'https://bugs.php.net/bug.php?id=47204 for more information.'; + return self::createRejection($easy, $ctx); + } else { + $easy->options['_curl_retries']++; + } + + return $handler($easy->request, $easy->options); + } + + private function createHeaderFn(EasyHandle $easy) + { + if (isset($easy->options['on_headers'])) { + $onHeaders = $easy->options['on_headers']; + + if (!is_callable($onHeaders)) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + } else { + $onHeaders = null; + } + + return function ($ch, $h) use ( + $onHeaders, + $easy, + &$startingResponse + ) { + $value = trim($h); + if ($value === '') { + $startingResponse = true; + $easy->createResponse(); + if ($onHeaders !== null) { + try { + $onHeaders($easy->response); + } catch (\Exception $e) { + // Associate the exception with the handle and trigger + // a curl header write error by returning 0. + $easy->onHeadersException = $e; + return -1; + } + } + } elseif ($startingResponse) { + $startingResponse = false; + $easy->headers = [$value]; + } else { + $easy->headers[] = $value; + } + return strlen($h); + }; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php new file mode 100644 index 0000000..b0fc236 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php @@ -0,0 +1,27 @@ +factory = isset($options['handle_factory']) + ? $options['handle_factory'] + : new CurlFactory(3); + } + + public function __invoke(RequestInterface $request, array $options) + { + if (isset($options['delay'])) { + usleep($options['delay'] * 1000); + } + + $easy = $this->factory->create($request, $options); + curl_exec($easy->handle); + $easy->errno = curl_errno($easy->handle); + + return CurlFactory::finish($this, $easy, $this->factory); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php new file mode 100644 index 0000000..d829762 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php @@ -0,0 +1,205 @@ +factory = isset($options['handle_factory']) + ? $options['handle_factory'] : new CurlFactory(50); + + if (isset($options['select_timeout'])) { + $this->selectTimeout = $options['select_timeout']; + } elseif ($selectTimeout = getenv('GUZZLE_CURL_SELECT_TIMEOUT')) { + $this->selectTimeout = $selectTimeout; + } else { + $this->selectTimeout = 1; + } + } + + public function __get($name) + { + if ($name === '_mh') { + return $this->_mh = curl_multi_init(); + } + + throw new \BadMethodCallException(); + } + + public function __destruct() + { + if (isset($this->_mh)) { + curl_multi_close($this->_mh); + unset($this->_mh); + } + } + + public function __invoke(RequestInterface $request, array $options) + { + $easy = $this->factory->create($request, $options); + $id = (int) $easy->handle; + + $promise = new Promise( + [$this, 'execute'], + function () use ($id) { + return $this->cancel($id); + } + ); + + $this->addRequest(['easy' => $easy, 'deferred' => $promise]); + + return $promise; + } + + /** + * Ticks the curl event loop. + */ + public function tick() + { + // Add any delayed handles if needed. + if ($this->delays) { + $currentTime = \GuzzleHttp\_current_time(); + foreach ($this->delays as $id => $delay) { + if ($currentTime >= $delay) { + unset($this->delays[$id]); + curl_multi_add_handle( + $this->_mh, + $this->handles[$id]['easy']->handle + ); + } + } + } + + // Step through the task queue which may add additional requests. + P\queue()->run(); + + if ($this->active && + curl_multi_select($this->_mh, $this->selectTimeout) === -1 + ) { + // Perform a usleep if a select returns -1. + // See: https://bugs.php.net/bug.php?id=61141 + usleep(250); + } + + while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM); + + $this->processMessages(); + } + + /** + * Runs until all outstanding connections have completed. + */ + public function execute() + { + $queue = P\queue(); + + while ($this->handles || !$queue->isEmpty()) { + // If there are no transfers, then sleep for the next delay + if (!$this->active && $this->delays) { + usleep($this->timeToNext()); + } + $this->tick(); + } + } + + private function addRequest(array $entry) + { + $easy = $entry['easy']; + $id = (int) $easy->handle; + $this->handles[$id] = $entry; + if (empty($easy->options['delay'])) { + curl_multi_add_handle($this->_mh, $easy->handle); + } else { + $this->delays[$id] = \GuzzleHttp\_current_time() + ($easy->options['delay'] / 1000); + } + } + + /** + * Cancels a handle from sending and removes references to it. + * + * @param int $id Handle ID to cancel and remove. + * + * @return bool True on success, false on failure. + */ + private function cancel($id) + { + // Cannot cancel if it has been processed. + if (!isset($this->handles[$id])) { + return false; + } + + $handle = $this->handles[$id]['easy']->handle; + unset($this->delays[$id], $this->handles[$id]); + curl_multi_remove_handle($this->_mh, $handle); + curl_close($handle); + + return true; + } + + private function processMessages() + { + while ($done = curl_multi_info_read($this->_mh)) { + $id = (int) $done['handle']; + curl_multi_remove_handle($this->_mh, $done['handle']); + + if (!isset($this->handles[$id])) { + // Probably was cancelled. + continue; + } + + $entry = $this->handles[$id]; + unset($this->handles[$id], $this->delays[$id]); + $entry['easy']->errno = $done['result']; + $entry['deferred']->resolve( + CurlFactory::finish( + $this, + $entry['easy'], + $this->factory + ) + ); + } + } + + private function timeToNext() + { + $currentTime = \GuzzleHttp\_current_time(); + $nextTime = PHP_INT_MAX; + foreach ($this->delays as $time) { + if ($time < $nextTime) { + $nextTime = $time; + } + } + + return max(0, $nextTime - $currentTime) * 1000000; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php new file mode 100644 index 0000000..7754e91 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php @@ -0,0 +1,92 @@ +headers)) { + throw new \RuntimeException('No headers have been received'); + } + + // HTTP-version SP status-code SP reason-phrase + $startLine = explode(' ', array_shift($this->headers), 3); + $headers = \GuzzleHttp\headers_from_lines($this->headers); + $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); + + if (!empty($this->options['decode_content']) + && isset($normalizedKeys['content-encoding']) + ) { + $headers['x-encoded-content-encoding'] + = $headers[$normalizedKeys['content-encoding']]; + unset($headers[$normalizedKeys['content-encoding']]); + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] + = $headers[$normalizedKeys['content-length']]; + + $bodyLength = (int) $this->sink->getSize(); + if ($bodyLength) { + $headers[$normalizedKeys['content-length']] = $bodyLength; + } else { + unset($headers[$normalizedKeys['content-length']]); + } + } + } + + // Attach a response to the easy handle with the parsed headers. + $this->response = new Response( + $startLine[1], + $headers, + $this->sink, + substr($startLine[0], 5), + isset($startLine[2]) ? (string) $startLine[2] : null + ); + } + + public function __get($name) + { + $msg = $name === 'handle' + ? 'The EasyHandle has been released' + : 'Invalid property: ' . $name; + throw new \BadMethodCallException($msg); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php new file mode 100644 index 0000000..d5c449c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php @@ -0,0 +1,190 @@ +onFulfilled = $onFulfilled; + $this->onRejected = $onRejected; + + if ($queue) { + call_user_func_array([$this, 'append'], $queue); + } + } + + public function __invoke(RequestInterface $request, array $options) + { + if (!$this->queue) { + throw new \OutOfBoundsException('Mock queue is empty'); + } + + if (isset($options['delay'])) { + usleep($options['delay'] * 1000); + } + + $this->lastRequest = $request; + $this->lastOptions = $options; + $response = array_shift($this->queue); + + if (isset($options['on_headers'])) { + if (!is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + try { + $options['on_headers']($response); + } catch (\Exception $e) { + $msg = 'An error was encountered during the on_headers event'; + $response = new RequestException($msg, $request, $response, $e); + } + } + + if (is_callable($response)) { + $response = call_user_func($response, $request, $options); + } + + $response = $response instanceof \Exception + ? \GuzzleHttp\Promise\rejection_for($response) + : \GuzzleHttp\Promise\promise_for($response); + + return $response->then( + function ($value) use ($request, $options) { + $this->invokeStats($request, $options, $value); + if ($this->onFulfilled) { + call_user_func($this->onFulfilled, $value); + } + if (isset($options['sink'])) { + $contents = (string) $value->getBody(); + $sink = $options['sink']; + + if (is_resource($sink)) { + fwrite($sink, $contents); + } elseif (is_string($sink)) { + file_put_contents($sink, $contents); + } elseif ($sink instanceof \Psr\Http\Message\StreamInterface) { + $sink->write($contents); + } + } + + return $value; + }, + function ($reason) use ($request, $options) { + $this->invokeStats($request, $options, null, $reason); + if ($this->onRejected) { + call_user_func($this->onRejected, $reason); + } + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + } + + /** + * Adds one or more variadic requests, exceptions, callables, or promises + * to the queue. + */ + public function append() + { + foreach (func_get_args() as $value) { + if ($value instanceof ResponseInterface + || $value instanceof \Exception + || $value instanceof PromiseInterface + || is_callable($value) + ) { + $this->queue[] = $value; + } else { + throw new \InvalidArgumentException('Expected a response or ' + . 'exception. Found ' . \GuzzleHttp\describe_type($value)); + } + } + } + + /** + * Get the last received request. + * + * @return RequestInterface + */ + public function getLastRequest() + { + return $this->lastRequest; + } + + /** + * Get the last received request options. + * + * @return array + */ + public function getLastOptions() + { + return $this->lastOptions; + } + + /** + * Returns the number of remaining items in the queue. + * + * @return int + */ + public function count() + { + return count($this->queue); + } + + private function invokeStats( + RequestInterface $request, + array $options, + ResponseInterface $response = null, + $reason = null + ) { + if (isset($options['on_stats'])) { + $transferTime = isset($options['transfer_time']) ? $options['transfer_time'] : 0; + $stats = new TransferStats($request, $response, $transferTime, $reason); + call_user_func($options['on_stats'], $stats); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php new file mode 100644 index 0000000..f8b00be --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php @@ -0,0 +1,55 @@ +withoutHeader('Expect'); + + // Append a content-length header if body size is zero to match + // cURL's behavior. + if (0 === $request->getBody()->getSize()) { + $request = $request->withHeader('Content-Length', '0'); + } + + return $this->createResponse( + $request, + $options, + $this->createStream($request, $options), + $startTime + ); + } catch (\InvalidArgumentException $e) { + throw $e; + } catch (\Exception $e) { + // Determine if the error was a networking error. + $message = $e->getMessage(); + // This list can probably get more comprehensive. + if (strpos($message, 'getaddrinfo') // DNS lookup failed + || strpos($message, 'Connection refused') + || strpos($message, "couldn't connect to host") // error on HHVM + || strpos($message, "connection attempt failed") + ) { + $e = new ConnectException($e->getMessage(), $request, $e); + } + $e = RequestException::wrapException($request, $e); + $this->invokeStats($options, $request, $startTime, null, $e); + + return \GuzzleHttp\Promise\rejection_for($e); + } + } + + private function invokeStats( + array $options, + RequestInterface $request, + $startTime, + ResponseInterface $response = null, + $error = null + ) { + if (isset($options['on_stats'])) { + $stats = new TransferStats( + $request, + $response, + \GuzzleHttp\_current_time() - $startTime, + $error, + [] + ); + call_user_func($options['on_stats'], $stats); + } + } + + private function createResponse( + RequestInterface $request, + array $options, + $stream, + $startTime + ) { + $hdrs = $this->lastHeaders; + $this->lastHeaders = []; + $parts = explode(' ', array_shift($hdrs), 3); + $ver = explode('/', $parts[0])[1]; + $status = $parts[1]; + $reason = isset($parts[2]) ? $parts[2] : null; + $headers = \GuzzleHttp\headers_from_lines($hdrs); + list($stream, $headers) = $this->checkDecode($options, $headers, $stream); + $stream = Psr7\stream_for($stream); + $sink = $stream; + + if (strcasecmp('HEAD', $request->getMethod())) { + $sink = $this->createSink($stream, $options); + } + + $response = new Psr7\Response($status, $headers, $sink, $ver, $reason); + + if (isset($options['on_headers'])) { + try { + $options['on_headers']($response); + } catch (\Exception $e) { + $msg = 'An error was encountered during the on_headers event'; + $ex = new RequestException($msg, $request, $response, $e); + return \GuzzleHttp\Promise\rejection_for($ex); + } + } + + // Do not drain when the request is a HEAD request because they have + // no body. + if ($sink !== $stream) { + $this->drain( + $stream, + $sink, + $response->getHeaderLine('Content-Length') + ); + } + + $this->invokeStats($options, $request, $startTime, $response, null); + + return new FulfilledPromise($response); + } + + private function createSink(StreamInterface $stream, array $options) + { + if (!empty($options['stream'])) { + return $stream; + } + + $sink = isset($options['sink']) + ? $options['sink'] + : fopen('php://temp', 'r+'); + + return is_string($sink) + ? new Psr7\LazyOpenStream($sink, 'w+') + : Psr7\stream_for($sink); + } + + private function checkDecode(array $options, array $headers, $stream) + { + // Automatically decode responses when instructed. + if (!empty($options['decode_content'])) { + $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); + if (isset($normalizedKeys['content-encoding'])) { + $encoding = $headers[$normalizedKeys['content-encoding']]; + if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') { + $stream = new Psr7\InflateStream( + Psr7\stream_for($stream) + ); + $headers['x-encoded-content-encoding'] + = $headers[$normalizedKeys['content-encoding']]; + // Remove content-encoding header + unset($headers[$normalizedKeys['content-encoding']]); + // Fix content-length header + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] + = $headers[$normalizedKeys['content-length']]; + + $length = (int) $stream->getSize(); + if ($length === 0) { + unset($headers[$normalizedKeys['content-length']]); + } else { + $headers[$normalizedKeys['content-length']] = [$length]; + } + } + } + } + } + + return [$stream, $headers]; + } + + /** + * Drains the source stream into the "sink" client option. + * + * @param StreamInterface $source + * @param StreamInterface $sink + * @param string $contentLength Header specifying the amount of + * data to read. + * + * @return StreamInterface + * @throws \RuntimeException when the sink option is invalid. + */ + private function drain( + StreamInterface $source, + StreamInterface $sink, + $contentLength + ) { + // If a content-length header is provided, then stop reading once + // that number of bytes has been read. This can prevent infinitely + // reading from a stream when dealing with servers that do not honor + // Connection: Close headers. + Psr7\copy_to_stream( + $source, + $sink, + (strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1 + ); + + $sink->seek(0); + $source->close(); + + return $sink; + } + + /** + * Create a resource and check to ensure it was created successfully + * + * @param callable $callback Callable that returns stream resource + * + * @return resource + * @throws \RuntimeException on error + */ + private function createResource(callable $callback) + { + $errors = null; + set_error_handler(function ($_, $msg, $file, $line) use (&$errors) { + $errors[] = [ + 'message' => $msg, + 'file' => $file, + 'line' => $line + ]; + return true; + }); + + $resource = $callback(); + restore_error_handler(); + + if (!$resource) { + $message = 'Error creating resource: '; + foreach ($errors as $err) { + foreach ($err as $key => $value) { + $message .= "[$key] $value" . PHP_EOL; + } + } + throw new \RuntimeException(trim($message)); + } + + return $resource; + } + + private function createStream(RequestInterface $request, array $options) + { + static $methods; + if (!$methods) { + $methods = array_flip(get_class_methods(__CLASS__)); + } + + // HTTP/1.1 streams using the PHP stream wrapper require a + // Connection: close header + if ($request->getProtocolVersion() == '1.1' + && !$request->hasHeader('Connection') + ) { + $request = $request->withHeader('Connection', 'close'); + } + + // Ensure SSL is verified by default + if (!isset($options['verify'])) { + $options['verify'] = true; + } + + $params = []; + $context = $this->getDefaultContext($request); + + if (isset($options['on_headers']) && !is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + + if (!empty($options)) { + foreach ($options as $key => $value) { + $method = "add_{$key}"; + if (isset($methods[$method])) { + $this->{$method}($request, $context, $value, $params); + } + } + } + + if (isset($options['stream_context'])) { + if (!is_array($options['stream_context'])) { + throw new \InvalidArgumentException('stream_context must be an array'); + } + $context = array_replace_recursive( + $context, + $options['stream_context'] + ); + } + + // Microsoft NTLM authentication only supported with curl handler + if (isset($options['auth']) + && is_array($options['auth']) + && isset($options['auth'][2]) + && 'ntlm' == $options['auth'][2] + ) { + throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler'); + } + + $uri = $this->resolveHost($request, $options); + + $context = $this->createResource( + function () use ($context, $params) { + return stream_context_create($context, $params); + } + ); + + return $this->createResource( + function () use ($uri, &$http_response_header, $context, $options) { + $resource = fopen((string) $uri, 'r', null, $context); + $this->lastHeaders = $http_response_header; + + if (isset($options['read_timeout'])) { + $readTimeout = $options['read_timeout']; + $sec = (int) $readTimeout; + $usec = ($readTimeout - $sec) * 100000; + stream_set_timeout($resource, $sec, $usec); + } + + return $resource; + } + ); + } + + private function resolveHost(RequestInterface $request, array $options) + { + $uri = $request->getUri(); + + if (isset($options['force_ip_resolve']) && !filter_var($uri->getHost(), FILTER_VALIDATE_IP)) { + if ('v4' === $options['force_ip_resolve']) { + $records = dns_get_record($uri->getHost(), DNS_A); + if (!isset($records[0]['ip'])) { + throw new ConnectException( + sprintf( + "Could not resolve IPv4 address for host '%s'", + $uri->getHost() + ), + $request + ); + } + $uri = $uri->withHost($records[0]['ip']); + } elseif ('v6' === $options['force_ip_resolve']) { + $records = dns_get_record($uri->getHost(), DNS_AAAA); + if (!isset($records[0]['ipv6'])) { + throw new ConnectException( + sprintf( + "Could not resolve IPv6 address for host '%s'", + $uri->getHost() + ), + $request + ); + } + $uri = $uri->withHost('[' . $records[0]['ipv6'] . ']'); + } + } + + return $uri; + } + + private function getDefaultContext(RequestInterface $request) + { + $headers = ''; + foreach ($request->getHeaders() as $name => $value) { + foreach ($value as $val) { + $headers .= "$name: $val\r\n"; + } + } + + $context = [ + 'http' => [ + 'method' => $request->getMethod(), + 'header' => $headers, + 'protocol_version' => $request->getProtocolVersion(), + 'ignore_errors' => true, + 'follow_location' => 0, + ], + ]; + + $body = (string) $request->getBody(); + + if (!empty($body)) { + $context['http']['content'] = $body; + // Prevent the HTTP handler from adding a Content-Type header. + if (!$request->hasHeader('Content-Type')) { + $context['http']['header'] .= "Content-Type:\r\n"; + } + } + + $context['http']['header'] = rtrim($context['http']['header']); + + return $context; + } + + private function add_proxy(RequestInterface $request, &$options, $value, &$params) + { + if (!is_array($value)) { + $options['http']['proxy'] = $value; + } else { + $scheme = $request->getUri()->getScheme(); + if (isset($value[$scheme])) { + if (!isset($value['no']) + || !\GuzzleHttp\is_host_in_noproxy( + $request->getUri()->getHost(), + $value['no'] + ) + ) { + $options['http']['proxy'] = $value[$scheme]; + } + } + } + } + + private function add_timeout(RequestInterface $request, &$options, $value, &$params) + { + if ($value > 0) { + $options['http']['timeout'] = $value; + } + } + + private function add_verify(RequestInterface $request, &$options, $value, &$params) + { + if ($value === true) { + // PHP 5.6 or greater will find the system cert by default. When + // < 5.6, use the Guzzle bundled cacert. + if (PHP_VERSION_ID < 50600) { + $options['ssl']['cafile'] = \GuzzleHttp\default_ca_bundle(); + } + } elseif (is_string($value)) { + $options['ssl']['cafile'] = $value; + if (!file_exists($value)) { + throw new \RuntimeException("SSL CA bundle not found: $value"); + } + } elseif ($value === false) { + $options['ssl']['verify_peer'] = false; + $options['ssl']['verify_peer_name'] = false; + return; + } else { + throw new \InvalidArgumentException('Invalid verify request option'); + } + + $options['ssl']['verify_peer'] = true; + $options['ssl']['verify_peer_name'] = true; + $options['ssl']['allow_self_signed'] = false; + } + + private function add_cert(RequestInterface $request, &$options, $value, &$params) + { + if (is_array($value)) { + $options['ssl']['passphrase'] = $value[1]; + $value = $value[0]; + } + + if (!file_exists($value)) { + throw new \RuntimeException("SSL certificate not found: {$value}"); + } + + $options['ssl']['local_cert'] = $value; + } + + private function add_progress(RequestInterface $request, &$options, $value, &$params) + { + $this->addNotification( + $params, + function ($code, $a, $b, $c, $transferred, $total) use ($value) { + if ($code == STREAM_NOTIFY_PROGRESS) { + $value($total, $transferred, null, null); + } + } + ); + } + + private function add_debug(RequestInterface $request, &$options, $value, &$params) + { + if ($value === false) { + return; + } + + static $map = [ + STREAM_NOTIFY_CONNECT => 'CONNECT', + STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED', + STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT', + STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS', + STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS', + STREAM_NOTIFY_REDIRECTED => 'REDIRECTED', + STREAM_NOTIFY_PROGRESS => 'PROGRESS', + STREAM_NOTIFY_FAILURE => 'FAILURE', + STREAM_NOTIFY_COMPLETED => 'COMPLETED', + STREAM_NOTIFY_RESOLVE => 'RESOLVE', + ]; + static $args = ['severity', 'message', 'message_code', + 'bytes_transferred', 'bytes_max']; + + $value = \GuzzleHttp\debug_resource($value); + $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment(''); + $this->addNotification( + $params, + function () use ($ident, $value, $map, $args) { + $passed = func_get_args(); + $code = array_shift($passed); + fprintf($value, '<%s> [%s] ', $ident, $map[$code]); + foreach (array_filter($passed) as $i => $v) { + fwrite($value, $args[$i] . ': "' . $v . '" '); + } + fwrite($value, "\n"); + } + ); + } + + private function addNotification(array &$params, callable $notify) + { + // Wrap the existing function if needed. + if (!isset($params['notification'])) { + $params['notification'] = $notify; + } else { + $params['notification'] = $this->callArray([ + $params['notification'], + $notify + ]); + } + } + + private function callArray(array $functions) + { + return function () use ($functions) { + $args = func_get_args(); + foreach ($functions as $fn) { + call_user_func_array($fn, $args); + } + }; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/HandlerStack.php new file mode 100644 index 0000000..f001686 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/HandlerStack.php @@ -0,0 +1,273 @@ +push(Middleware::httpErrors(), 'http_errors'); + $stack->push(Middleware::redirect(), 'allow_redirects'); + $stack->push(Middleware::cookies(), 'cookies'); + $stack->push(Middleware::prepareBody(), 'prepare_body'); + + return $stack; + } + + /** + * @param callable $handler Underlying HTTP handler. + */ + public function __construct(callable $handler = null) + { + $this->handler = $handler; + } + + /** + * Invokes the handler stack as a composed handler + * + * @param RequestInterface $request + * @param array $options + */ + public function __invoke(RequestInterface $request, array $options) + { + $handler = $this->resolve(); + + return $handler($request, $options); + } + + /** + * Dumps a string representation of the stack. + * + * @return string + */ + public function __toString() + { + $depth = 0; + $stack = []; + if ($this->handler) { + $stack[] = "0) Handler: " . $this->debugCallable($this->handler); + } + + $result = ''; + foreach (array_reverse($this->stack) as $tuple) { + $depth++; + $str = "{$depth}) Name: '{$tuple[1]}', "; + $str .= "Function: " . $this->debugCallable($tuple[0]); + $result = "> {$str}\n{$result}"; + $stack[] = $str; + } + + foreach (array_keys($stack) as $k) { + $result .= "< {$stack[$k]}\n"; + } + + return $result; + } + + /** + * Set the HTTP handler that actually returns a promise. + * + * @param callable $handler Accepts a request and array of options and + * returns a Promise. + */ + public function setHandler(callable $handler) + { + $this->handler = $handler; + $this->cached = null; + } + + /** + * Returns true if the builder has a handler. + * + * @return bool + */ + public function hasHandler() + { + return (bool) $this->handler; + } + + /** + * Unshift a middleware to the bottom of the stack. + * + * @param callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function unshift(callable $middleware, $name = null) + { + array_unshift($this->stack, [$middleware, $name]); + $this->cached = null; + } + + /** + * Push a middleware to the top of the stack. + * + * @param callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function push(callable $middleware, $name = '') + { + $this->stack[] = [$middleware, $name]; + $this->cached = null; + } + + /** + * Add a middleware before another middleware by name. + * + * @param string $findName Middleware to find + * @param callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function before($findName, callable $middleware, $withName = '') + { + $this->splice($findName, $withName, $middleware, true); + } + + /** + * Add a middleware after another middleware by name. + * + * @param string $findName Middleware to find + * @param callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function after($findName, callable $middleware, $withName = '') + { + $this->splice($findName, $withName, $middleware, false); + } + + /** + * Remove a middleware by instance or name from the stack. + * + * @param callable|string $remove Middleware to remove by instance or name. + */ + public function remove($remove) + { + $this->cached = null; + $idx = is_callable($remove) ? 0 : 1; + $this->stack = array_values(array_filter( + $this->stack, + function ($tuple) use ($idx, $remove) { + return $tuple[$idx] !== $remove; + } + )); + } + + /** + * Compose the middleware and handler into a single callable function. + * + * @return callable + */ + public function resolve() + { + if (!$this->cached) { + if (!($prev = $this->handler)) { + throw new \LogicException('No handler has been specified'); + } + + foreach (array_reverse($this->stack) as $fn) { + $prev = $fn[0]($prev); + } + + $this->cached = $prev; + } + + return $this->cached; + } + + /** + * @param string $name + * @return int + */ + private function findByName($name) + { + foreach ($this->stack as $k => $v) { + if ($v[1] === $name) { + return $k; + } + } + + throw new \InvalidArgumentException("Middleware not found: $name"); + } + + /** + * Splices a function into the middleware list at a specific position. + * + * @param string $findName + * @param string $withName + * @param callable $middleware + * @param bool $before + */ + private function splice($findName, $withName, callable $middleware, $before) + { + $this->cached = null; + $idx = $this->findByName($findName); + $tuple = [$middleware, $withName]; + + if ($before) { + if ($idx === 0) { + array_unshift($this->stack, $tuple); + } else { + $replacement = [$tuple, $this->stack[$idx]]; + array_splice($this->stack, $idx, 1, $replacement); + } + } elseif ($idx === count($this->stack) - 1) { + $this->stack[] = $tuple; + } else { + $replacement = [$this->stack[$idx], $tuple]; + array_splice($this->stack, $idx, 1, $replacement); + } + } + + /** + * Provides a debug string for a given callable. + * + * @param array|callable $fn Function to write as a string. + * + * @return string + */ + private function debugCallable($fn) + { + if (is_string($fn)) { + return "callable({$fn})"; + } + + if (is_array($fn)) { + return is_string($fn[0]) + ? "callable({$fn[0]}::{$fn[1]})" + : "callable(['" . get_class($fn[0]) . "', '{$fn[1]}'])"; + } + + return 'callable(' . spl_object_hash($fn) . ')'; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/MessageFormatter.php new file mode 100644 index 0000000..663ac73 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/MessageFormatter.php @@ -0,0 +1,180 @@ +>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"; + const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}'; + + /** @var string Template used to format log messages */ + private $template; + + /** + * @param string $template Log message template + */ + public function __construct($template = self::CLF) + { + $this->template = $template ?: self::CLF; + } + + /** + * Returns a formatted message string. + * + * @param RequestInterface $request Request that was sent + * @param ResponseInterface $response Response that was received + * @param \Exception $error Exception that was received + * + * @return string + */ + public function format( + RequestInterface $request, + ResponseInterface $response = null, + \Exception $error = null + ) { + $cache = []; + + return preg_replace_callback( + '/{\s*([A-Za-z_\-\.0-9]+)\s*}/', + function (array $matches) use ($request, $response, $error, &$cache) { + if (isset($cache[$matches[1]])) { + return $cache[$matches[1]]; + } + + $result = ''; + switch ($matches[1]) { + case 'request': + $result = Psr7\str($request); + break; + case 'response': + $result = $response ? Psr7\str($response) : ''; + break; + case 'req_headers': + $result = trim($request->getMethod() + . ' ' . $request->getRequestTarget()) + . ' HTTP/' . $request->getProtocolVersion() . "\r\n" + . $this->headers($request); + break; + case 'res_headers': + $result = $response ? + sprintf( + 'HTTP/%s %d %s', + $response->getProtocolVersion(), + $response->getStatusCode(), + $response->getReasonPhrase() + ) . "\r\n" . $this->headers($response) + : 'NULL'; + break; + case 'req_body': + $result = $request->getBody(); + break; + case 'res_body': + $result = $response ? $response->getBody() : 'NULL'; + break; + case 'ts': + case 'date_iso_8601': + $result = gmdate('c'); + break; + case 'date_common_log': + $result = date('d/M/Y:H:i:s O'); + break; + case 'method': + $result = $request->getMethod(); + break; + case 'version': + $result = $request->getProtocolVersion(); + break; + case 'uri': + case 'url': + $result = $request->getUri(); + break; + case 'target': + $result = $request->getRequestTarget(); + break; + case 'req_version': + $result = $request->getProtocolVersion(); + break; + case 'res_version': + $result = $response + ? $response->getProtocolVersion() + : 'NULL'; + break; + case 'host': + $result = $request->getHeaderLine('Host'); + break; + case 'hostname': + $result = gethostname(); + break; + case 'code': + $result = $response ? $response->getStatusCode() : 'NULL'; + break; + case 'phrase': + $result = $response ? $response->getReasonPhrase() : 'NULL'; + break; + case 'error': + $result = $error ? $error->getMessage() : 'NULL'; + break; + default: + // handle prefixed dynamic headers + if (strpos($matches[1], 'req_header_') === 0) { + $result = $request->getHeaderLine(substr($matches[1], 11)); + } elseif (strpos($matches[1], 'res_header_') === 0) { + $result = $response + ? $response->getHeaderLine(substr($matches[1], 11)) + : 'NULL'; + } + } + + $cache[$matches[1]] = $result; + return $result; + }, + $this->template + ); + } + + private function headers(MessageInterface $message) + { + $result = ''; + foreach ($message->getHeaders() as $name => $values) { + $result .= $name . ': ' . implode(', ', $values) . "\r\n"; + } + + return trim($result); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Middleware.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Middleware.php new file mode 100644 index 0000000..bffc197 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Middleware.php @@ -0,0 +1,254 @@ +withCookieHeader($request); + return $handler($request, $options) + ->then( + function ($response) use ($cookieJar, $request) { + $cookieJar->extractCookies($request, $response); + return $response; + } + ); + }; + }; + } + + /** + * Middleware that throws exceptions for 4xx or 5xx responses when the + * "http_error" request option is set to true. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function httpErrors() + { + return function (callable $handler) { + return function ($request, array $options) use ($handler) { + if (empty($options['http_errors'])) { + return $handler($request, $options); + } + return $handler($request, $options)->then( + function (ResponseInterface $response) use ($request) { + $code = $response->getStatusCode(); + if ($code < 400) { + return $response; + } + throw RequestException::create($request, $response); + } + ); + }; + }; + } + + /** + * Middleware that pushes history data to an ArrayAccess container. + * + * @param array|\ArrayAccess $container Container to hold the history (by reference). + * + * @return callable Returns a function that accepts the next handler. + * @throws \InvalidArgumentException if container is not an array or ArrayAccess. + */ + public static function history(&$container) + { + if (!is_array($container) && !$container instanceof \ArrayAccess) { + throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess'); + } + + return function (callable $handler) use (&$container) { + return function ($request, array $options) use ($handler, &$container) { + return $handler($request, $options)->then( + function ($value) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => $value, + 'error' => null, + 'options' => $options + ]; + return $value; + }, + function ($reason) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => null, + 'error' => $reason, + 'options' => $options + ]; + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + }; + }; + } + + /** + * Middleware that invokes a callback before and after sending a request. + * + * The provided listener cannot modify or alter the response. It simply + * "taps" into the chain to be notified before returning the promise. The + * before listener accepts a request and options array, and the after + * listener accepts a request, options array, and response promise. + * + * @param callable $before Function to invoke before forwarding the request. + * @param callable $after Function invoked after forwarding. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function tap(callable $before = null, callable $after = null) + { + return function (callable $handler) use ($before, $after) { + return function ($request, array $options) use ($handler, $before, $after) { + if ($before) { + $before($request, $options); + } + $response = $handler($request, $options); + if ($after) { + $after($request, $options, $response); + } + return $response; + }; + }; + } + + /** + * Middleware that handles request redirects. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function redirect() + { + return function (callable $handler) { + return new RedirectMiddleware($handler); + }; + } + + /** + * Middleware that retries requests based on the boolean result of + * invoking the provided "decider" function. + * + * If no delay function is provided, a simple implementation of exponential + * backoff will be utilized. + * + * @param callable $decider Function that accepts the number of retries, + * a request, [response], and [exception] and + * returns true if the request is to be retried. + * @param callable $delay Function that accepts the number of retries and + * returns the number of milliseconds to delay. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function retry(callable $decider, callable $delay = null) + { + return function (callable $handler) use ($decider, $delay) { + return new RetryMiddleware($decider, $handler, $delay); + }; + } + + /** + * Middleware that logs requests, responses, and errors using a message + * formatter. + * + * @param LoggerInterface $logger Logs messages. + * @param MessageFormatter $formatter Formatter used to create message strings. + * @param string $logLevel Level at which to log requests. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = 'info' /* \Psr\Log\LogLevel::INFO */) + { + return function (callable $handler) use ($logger, $formatter, $logLevel) { + return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) { + return $handler($request, $options)->then( + function ($response) use ($logger, $request, $formatter, $logLevel) { + $message = $formatter->format($request, $response); + $logger->log($logLevel, $message); + return $response; + }, + function ($reason) use ($logger, $request, $formatter) { + $response = $reason instanceof RequestException + ? $reason->getResponse() + : null; + $message = $formatter->format($request, $response, $reason); + $logger->notice($message); + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + }; + }; + } + + /** + * This middleware adds a default content-type if possible, a default + * content-length or transfer-encoding header, and the expect header. + * + * @return callable + */ + public static function prepareBody() + { + return function (callable $handler) { + return new PrepareBodyMiddleware($handler); + }; + } + + /** + * Middleware that applies a map function to the request before passing to + * the next handler. + * + * @param callable $fn Function that accepts a RequestInterface and returns + * a RequestInterface. + * @return callable + */ + public static function mapRequest(callable $fn) + { + return function (callable $handler) use ($fn) { + return function ($request, array $options) use ($handler, $fn) { + return $handler($fn($request), $options); + }; + }; + } + + /** + * Middleware that applies a map function to the resolved promise's + * response. + * + * @param callable $fn Function that accepts a ResponseInterface and + * returns a ResponseInterface. + * @return callable + */ + public static function mapResponse(callable $fn) + { + return function (callable $handler) use ($fn) { + return function ($request, array $options) use ($handler, $fn) { + return $handler($request, $options)->then($fn); + }; + }; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Pool.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Pool.php new file mode 100644 index 0000000..05c854a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/Pool.php @@ -0,0 +1,123 @@ + $rfn) { + if ($rfn instanceof RequestInterface) { + yield $key => $client->sendAsync($rfn, $opts); + } elseif (is_callable($rfn)) { + yield $key => $rfn($opts); + } else { + throw new \InvalidArgumentException('Each value yielded by ' + . 'the iterator must be a Psr7\Http\Message\RequestInterface ' + . 'or a callable that returns a promise that fulfills ' + . 'with a Psr7\Message\Http\ResponseInterface object.'); + } + } + }; + + $this->each = new EachPromise($requests(), $config); + } + + public function promise() + { + return $this->each->promise(); + } + + /** + * Sends multiple requests concurrently and returns an array of responses + * and exceptions that uses the same ordering as the provided requests. + * + * IMPORTANT: This method keeps every request and response in memory, and + * as such, is NOT recommended when sending a large number or an + * indeterminate number of requests concurrently. + * + * @param ClientInterface $client Client used to send the requests + * @param array|\Iterator $requests Requests to send concurrently. + * @param array $options Passes through the options available in + * {@see GuzzleHttp\Pool::__construct} + * + * @return array Returns an array containing the response or an exception + * in the same order that the requests were sent. + * @throws \InvalidArgumentException if the event format is incorrect. + */ + public static function batch( + ClientInterface $client, + $requests, + array $options = [] + ) { + $res = []; + self::cmpCallback($options, 'fulfilled', $res); + self::cmpCallback($options, 'rejected', $res); + $pool = new static($client, $requests, $options); + $pool->promise()->wait(); + ksort($res); + + return $res; + } + + private static function cmpCallback(array &$options, $name, array &$results) + { + if (!isset($options[$name])) { + $options[$name] = function ($v, $k) use (&$results) { + $results[$k] = $v; + }; + } else { + $currentFn = $options[$name]; + $options[$name] = function ($v, $k) use (&$results, $currentFn) { + $currentFn($v, $k); + $results[$k] = $v; + }; + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php new file mode 100644 index 0000000..2eb95f9 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php @@ -0,0 +1,106 @@ +nextHandler = $nextHandler; + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $fn = $this->nextHandler; + + // Don't do anything if the request has no body. + if ($request->getBody()->getSize() === 0) { + return $fn($request, $options); + } + + $modify = []; + + // Add a default content-type if possible. + if (!$request->hasHeader('Content-Type')) { + if ($uri = $request->getBody()->getMetadata('uri')) { + if ($type = Psr7\mimetype_from_filename($uri)) { + $modify['set_headers']['Content-Type'] = $type; + } + } + } + + // Add a default content-length or transfer-encoding header. + if (!$request->hasHeader('Content-Length') + && !$request->hasHeader('Transfer-Encoding') + ) { + $size = $request->getBody()->getSize(); + if ($size !== null) { + $modify['set_headers']['Content-Length'] = $size; + } else { + $modify['set_headers']['Transfer-Encoding'] = 'chunked'; + } + } + + // Add the expect header if needed. + $this->addExpectHeader($request, $options, $modify); + + return $fn(Psr7\modify_request($request, $modify), $options); + } + + private function addExpectHeader( + RequestInterface $request, + array $options, + array &$modify + ) { + // Determine if the Expect header should be used + if ($request->hasHeader('Expect')) { + return; + } + + $expect = isset($options['expect']) ? $options['expect'] : null; + + // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0 + if ($expect === false || $request->getProtocolVersion() < 1.1) { + return; + } + + // The expect header is unconditionally enabled + if ($expect === true) { + $modify['set_headers']['Expect'] = '100-Continue'; + return; + } + + // By default, send the expect header when the payload is > 1mb + if ($expect === null) { + $expect = 1048576; + } + + // Always add if the body cannot be rewound, the size cannot be + // determined, or the size is greater than the cutoff threshold + $body = $request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { + $modify['set_headers']['Expect'] = '100-Continue'; + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php new file mode 100644 index 0000000..bff4e4e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php @@ -0,0 +1,237 @@ + 5, + 'protocols' => ['http', 'https'], + 'strict' => false, + 'referer' => false, + 'track_redirects' => false, + ]; + + /** @var callable */ + private $nextHandler; + + /** + * @param callable $nextHandler Next handler to invoke. + */ + public function __construct(callable $nextHandler) + { + $this->nextHandler = $nextHandler; + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $fn = $this->nextHandler; + + if (empty($options['allow_redirects'])) { + return $fn($request, $options); + } + + if ($options['allow_redirects'] === true) { + $options['allow_redirects'] = self::$defaultSettings; + } elseif (!is_array($options['allow_redirects'])) { + throw new \InvalidArgumentException('allow_redirects must be true, false, or array'); + } else { + // Merge the default settings with the provided settings + $options['allow_redirects'] += self::$defaultSettings; + } + + if (empty($options['allow_redirects']['max'])) { + return $fn($request, $options); + } + + return $fn($request, $options) + ->then(function (ResponseInterface $response) use ($request, $options) { + return $this->checkRedirect($request, $options, $response); + }); + } + + /** + * @param RequestInterface $request + * @param array $options + * @param ResponseInterface|PromiseInterface $response + * + * @return ResponseInterface|PromiseInterface + */ + public function checkRedirect( + RequestInterface $request, + array $options, + ResponseInterface $response + ) { + if (substr($response->getStatusCode(), 0, 1) != '3' + || !$response->hasHeader('Location') + ) { + return $response; + } + + $this->guardMax($request, $options); + $nextRequest = $this->modifyRequest($request, $options, $response); + + if (isset($options['allow_redirects']['on_redirect'])) { + call_user_func( + $options['allow_redirects']['on_redirect'], + $request, + $response, + $nextRequest->getUri() + ); + } + + /** @var PromiseInterface|ResponseInterface $promise */ + $promise = $this($nextRequest, $options); + + // Add headers to be able to track history of redirects. + if (!empty($options['allow_redirects']['track_redirects'])) { + return $this->withTracking( + $promise, + (string) $nextRequest->getUri(), + $response->getStatusCode() + ); + } + + return $promise; + } + + private function withTracking(PromiseInterface $promise, $uri, $statusCode) + { + return $promise->then( + function (ResponseInterface $response) use ($uri, $statusCode) { + // Note that we are pushing to the front of the list as this + // would be an earlier response than what is currently present + // in the history header. + $historyHeader = $response->getHeader(self::HISTORY_HEADER); + $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER); + array_unshift($historyHeader, $uri); + array_unshift($statusHeader, $statusCode); + return $response->withHeader(self::HISTORY_HEADER, $historyHeader) + ->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader); + } + ); + } + + private function guardMax(RequestInterface $request, array &$options) + { + $current = isset($options['__redirect_count']) + ? $options['__redirect_count'] + : 0; + $options['__redirect_count'] = $current + 1; + $max = $options['allow_redirects']['max']; + + if ($options['__redirect_count'] > $max) { + throw new TooManyRedirectsException( + "Will not follow more than {$max} redirects", + $request + ); + } + } + + /** + * @param RequestInterface $request + * @param array $options + * @param ResponseInterface $response + * + * @return RequestInterface + */ + public function modifyRequest( + RequestInterface $request, + array $options, + ResponseInterface $response + ) { + // Request modifications to apply. + $modify = []; + $protocols = $options['allow_redirects']['protocols']; + + // Use a GET request if this is an entity enclosing request and we are + // not forcing RFC compliance, but rather emulating what all browsers + // would do. + $statusCode = $response->getStatusCode(); + if ($statusCode == 303 || + ($statusCode <= 302 && $request->getBody() && !$options['allow_redirects']['strict']) + ) { + $modify['method'] = 'GET'; + $modify['body'] = ''; + } + + $modify['uri'] = $this->redirectUri($request, $response, $protocols); + Psr7\rewind_body($request); + + // Add the Referer header if it is told to do so and only + // add the header if we are not redirecting from https to http. + if ($options['allow_redirects']['referer'] + && $modify['uri']->getScheme() === $request->getUri()->getScheme() + ) { + $uri = $request->getUri()->withUserInfo(''); + $modify['set_headers']['Referer'] = (string) $uri; + } else { + $modify['remove_headers'][] = 'Referer'; + } + + // Remove Authorization header if host is different. + if ($request->getUri()->getHost() !== $modify['uri']->getHost()) { + $modify['remove_headers'][] = 'Authorization'; + } + + return Psr7\modify_request($request, $modify); + } + + /** + * Set the appropriate URL on the request based on the location header + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @param array $protocols + * + * @return UriInterface + */ + private function redirectUri( + RequestInterface $request, + ResponseInterface $response, + array $protocols + ) { + $location = Psr7\UriResolver::resolve( + $request->getUri(), + new Psr7\Uri($response->getHeaderLine('Location')) + ); + + // Ensure that the redirect URI is allowed based on the protocols. + if (!in_array($location->getScheme(), $protocols)) { + throw new BadResponseException( + sprintf( + 'Redirect URI, %s, does not use one of the allowed redirect protocols: %s', + $location, + implode(', ', $protocols) + ), + $request, + $response + ); + } + + return $location; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/RequestOptions.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/RequestOptions.php new file mode 100644 index 0000000..5c0fd19 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/RequestOptions.php @@ -0,0 +1,255 @@ +decider = $decider; + $this->nextHandler = $nextHandler; + $this->delay = $delay ?: __CLASS__ . '::exponentialDelay'; + } + + /** + * Default exponential backoff delay function. + * + * @param int $retries + * + * @return int + */ + public static function exponentialDelay($retries) + { + return (int) pow(2, $retries - 1); + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + if (!isset($options['retries'])) { + $options['retries'] = 0; + } + + $fn = $this->nextHandler; + return $fn($request, $options) + ->then( + $this->onFulfilled($request, $options), + $this->onRejected($request, $options) + ); + } + + private function onFulfilled(RequestInterface $req, array $options) + { + return function ($value) use ($req, $options) { + if (!call_user_func( + $this->decider, + $options['retries'], + $req, + $value, + null + )) { + return $value; + } + return $this->doRetry($req, $options, $value); + }; + } + + private function onRejected(RequestInterface $req, array $options) + { + return function ($reason) use ($req, $options) { + if (!call_user_func( + $this->decider, + $options['retries'], + $req, + null, + $reason + )) { + return \GuzzleHttp\Promise\rejection_for($reason); + } + return $this->doRetry($req, $options); + }; + } + + private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null) + { + $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response); + + return $this($request, $options); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/TransferStats.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/TransferStats.php new file mode 100644 index 0000000..23a22a3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/TransferStats.php @@ -0,0 +1,126 @@ +request = $request; + $this->response = $response; + $this->transferTime = $transferTime; + $this->handlerErrorData = $handlerErrorData; + $this->handlerStats = $handlerStats; + } + + /** + * @return RequestInterface + */ + public function getRequest() + { + return $this->request; + } + + /** + * Returns the response that was received (if any). + * + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + /** + * Returns true if a response was received. + * + * @return bool + */ + public function hasResponse() + { + return $this->response !== null; + } + + /** + * Gets handler specific error data. + * + * This might be an exception, a integer representing an error code, or + * anything else. Relying on this value assumes that you know what handler + * you are using. + * + * @return mixed + */ + public function getHandlerErrorData() + { + return $this->handlerErrorData; + } + + /** + * Get the effective URI the request was sent to. + * + * @return UriInterface + */ + public function getEffectiveUri() + { + return $this->request->getUri(); + } + + /** + * Get the estimated time the request was being transferred by the handler. + * + * @return float Time in seconds. + */ + public function getTransferTime() + { + return $this->transferTime; + } + + /** + * Gets an array of all of the handler specific transfer data. + * + * @return array + */ + public function getHandlerStats() + { + return $this->handlerStats; + } + + /** + * Get a specific handler statistic from the handler by name. + * + * @param string $stat Handler specific transfer stat to retrieve. + * + * @return mixed|null + */ + public function getHandlerStat($stat) + { + return isset($this->handlerStats[$stat]) + ? $this->handlerStats[$stat] + : null; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/UriTemplate.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/UriTemplate.php new file mode 100644 index 0000000..96dcfd0 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/UriTemplate.php @@ -0,0 +1,237 @@ + ['prefix' => '', 'joiner' => ',', 'query' => false], + '+' => ['prefix' => '', 'joiner' => ',', 'query' => false], + '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false], + '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false], + '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false], + ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true], + '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true], + '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true] + ]; + + /** @var array Delimiters */ + private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$', + '&', '\'', '(', ')', '*', '+', ',', ';', '=']; + + /** @var array Percent encoded delimiters */ + private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D', + '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', + '%3B', '%3D']; + + public function expand($template, array $variables) + { + if (false === strpos($template, '{')) { + return $template; + } + + $this->template = $template; + $this->variables = $variables; + + return preg_replace_callback( + '/\{([^\}]+)\}/', + [$this, 'expandMatch'], + $this->template + ); + } + + /** + * Parse an expression into parts + * + * @param string $expression Expression to parse + * + * @return array Returns an associative array of parts + */ + private function parseExpression($expression) + { + $result = []; + + if (isset(self::$operatorHash[$expression[0]])) { + $result['operator'] = $expression[0]; + $expression = substr($expression, 1); + } else { + $result['operator'] = ''; + } + + foreach (explode(',', $expression) as $value) { + $value = trim($value); + $varspec = []; + if ($colonPos = strpos($value, ':')) { + $varspec['value'] = substr($value, 0, $colonPos); + $varspec['modifier'] = ':'; + $varspec['position'] = (int) substr($value, $colonPos + 1); + } elseif (substr($value, -1) === '*') { + $varspec['modifier'] = '*'; + $varspec['value'] = substr($value, 0, -1); + } else { + $varspec['value'] = (string) $value; + $varspec['modifier'] = ''; + } + $result['values'][] = $varspec; + } + + return $result; + } + + /** + * Process an expansion + * + * @param array $matches Matches met in the preg_replace_callback + * + * @return string Returns the replacement string + */ + private function expandMatch(array $matches) + { + static $rfc1738to3986 = ['+' => '%20', '%7e' => '~']; + + $replacements = []; + $parsed = self::parseExpression($matches[1]); + $prefix = self::$operatorHash[$parsed['operator']]['prefix']; + $joiner = self::$operatorHash[$parsed['operator']]['joiner']; + $useQuery = self::$operatorHash[$parsed['operator']]['query']; + + foreach ($parsed['values'] as $value) { + if (!isset($this->variables[$value['value']])) { + continue; + } + + $variable = $this->variables[$value['value']]; + $actuallyUseQuery = $useQuery; + $expanded = ''; + + if (is_array($variable)) { + $isAssoc = $this->isAssoc($variable); + $kvp = []; + foreach ($variable as $key => $var) { + if ($isAssoc) { + $key = rawurlencode($key); + $isNestedArray = is_array($var); + } else { + $isNestedArray = false; + } + + if (!$isNestedArray) { + $var = rawurlencode($var); + if ($parsed['operator'] === '+' || + $parsed['operator'] === '#' + ) { + $var = $this->decodeReserved($var); + } + } + + if ($value['modifier'] === '*') { + if ($isAssoc) { + if ($isNestedArray) { + // Nested arrays must allow for deeply nested + // structures. + $var = strtr( + http_build_query([$key => $var]), + $rfc1738to3986 + ); + } else { + $var = $key . '=' . $var; + } + } elseif ($key > 0 && $actuallyUseQuery) { + $var = $value['value'] . '=' . $var; + } + } + + $kvp[$key] = $var; + } + + if (empty($variable)) { + $actuallyUseQuery = false; + } elseif ($value['modifier'] === '*') { + $expanded = implode($joiner, $kvp); + if ($isAssoc) { + // Don't prepend the value name when using the explode + // modifier with an associative array. + $actuallyUseQuery = false; + } + } else { + if ($isAssoc) { + // When an associative array is encountered and the + // explode modifier is not set, then the result must be + // a comma separated list of keys followed by their + // respective values. + foreach ($kvp as $k => &$v) { + $v = $k . ',' . $v; + } + } + $expanded = implode(',', $kvp); + } + } else { + if ($value['modifier'] === ':') { + $variable = substr($variable, 0, $value['position']); + } + $expanded = rawurlencode($variable); + if ($parsed['operator'] === '+' || $parsed['operator'] === '#') { + $expanded = $this->decodeReserved($expanded); + } + } + + if ($actuallyUseQuery) { + if (!$expanded && $joiner !== '&') { + $expanded = $value['value']; + } else { + $expanded = $value['value'] . '=' . $expanded; + } + } + + $replacements[] = $expanded; + } + + $ret = implode($joiner, $replacements); + if ($ret && $prefix) { + return $prefix . $ret; + } + + return $ret; + } + + /** + * Determines if an array is associative. + * + * This makes the assumption that input arrays are sequences or hashes. + * This assumption is a tradeoff for accuracy in favor of speed, but it + * should work in almost every case where input is supplied for a URI + * template. + * + * @param array $array Array to check + * + * @return bool + */ + private function isAssoc(array $array) + { + return $array && array_keys($array)[0] !== 0; + } + + /** + * Removes percent encoding on reserved characters (used with + and # + * modifiers). + * + * @param string $string String to fix + * + * @return string + */ + private function decodeReserved($string) + { + return str_replace(self::$delimsPct, self::$delims, $string); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/functions.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/functions.php new file mode 100644 index 0000000..51d736d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/functions.php @@ -0,0 +1,346 @@ +expand($template, $variables); +} + +/** + * Debug function used to describe the provided value type and class. + * + * @param mixed $input + * + * @return string Returns a string containing the type of the variable and + * if a class is provided, the class name. + */ +function describe_type($input) +{ + switch (gettype($input)) { + case 'object': + return 'object(' . get_class($input) . ')'; + case 'array': + return 'array(' . count($input) . ')'; + default: + ob_start(); + var_dump($input); + // normalize float vs double + return str_replace('double(', 'float(', rtrim(ob_get_clean())); + } +} + +/** + * Parses an array of header lines into an associative array of headers. + * + * @param array $lines Header lines array of strings in the following + * format: "Name: Value" + * @return array + */ +function headers_from_lines($lines) +{ + $headers = []; + + foreach ($lines as $line) { + $parts = explode(':', $line, 2); + $headers[trim($parts[0])][] = isset($parts[1]) + ? trim($parts[1]) + : null; + } + + return $headers; +} + +/** + * Returns a debug stream based on the provided variable. + * + * @param mixed $value Optional value + * + * @return resource + */ +function debug_resource($value = null) +{ + if (is_resource($value)) { + return $value; + } elseif (defined('STDOUT')) { + return STDOUT; + } + + return fopen('php://output', 'w'); +} + +/** + * Chooses and creates a default handler to use based on the environment. + * + * The returned handler is not wrapped by any default middlewares. + * + * @throws \RuntimeException if no viable Handler is available. + * @return callable Returns the best handler for the given system. + */ +function choose_handler() +{ + $handler = null; + if (function_exists('curl_multi_exec') && function_exists('curl_exec')) { + $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler()); + } elseif (function_exists('curl_exec')) { + $handler = new CurlHandler(); + } elseif (function_exists('curl_multi_exec')) { + $handler = new CurlMultiHandler(); + } + + if (ini_get('allow_url_fopen')) { + $handler = $handler + ? Proxy::wrapStreaming($handler, new StreamHandler()) + : new StreamHandler(); + } elseif (!$handler) { + throw new \RuntimeException('GuzzleHttp requires cURL, the ' + . 'allow_url_fopen ini setting, or a custom HTTP handler.'); + } + + return $handler; +} + +/** + * Get the default User-Agent string to use with Guzzle + * + * @return string + */ +function default_user_agent() +{ + static $defaultAgent = ''; + + if (!$defaultAgent) { + $defaultAgent = 'GuzzleHttp/' . Client::VERSION; + if (extension_loaded('curl') && function_exists('curl_version')) { + $defaultAgent .= ' curl/' . \curl_version()['version']; + } + $defaultAgent .= ' PHP/' . PHP_VERSION; + } + + return $defaultAgent; +} + +/** + * Returns the default cacert bundle for the current system. + * + * First, the openssl.cafile and curl.cainfo php.ini settings are checked. + * If those settings are not configured, then the common locations for + * bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X + * and Windows are checked. If any of these file locations are found on + * disk, they will be utilized. + * + * Note: the result of this function is cached for subsequent calls. + * + * @return string + * @throws \RuntimeException if no bundle can be found. + */ +function default_ca_bundle() +{ + static $cached = null; + static $cafiles = [ + // Red Hat, CentOS, Fedora (provided by the ca-certificates package) + '/etc/pki/tls/certs/ca-bundle.crt', + // Ubuntu, Debian (provided by the ca-certificates package) + '/etc/ssl/certs/ca-certificates.crt', + // FreeBSD (provided by the ca_root_nss package) + '/usr/local/share/certs/ca-root-nss.crt', + // SLES 12 (provided by the ca-certificates package) + '/var/lib/ca-certificates/ca-bundle.pem', + // OS X provided by homebrew (using the default path) + '/usr/local/etc/openssl/cert.pem', + // Google app engine + '/etc/ca-certificates.crt', + // Windows? + 'C:\\windows\\system32\\curl-ca-bundle.crt', + 'C:\\windows\\curl-ca-bundle.crt', + ]; + + if ($cached) { + return $cached; + } + + if ($ca = ini_get('openssl.cafile')) { + return $cached = $ca; + } + + if ($ca = ini_get('curl.cainfo')) { + return $cached = $ca; + } + + foreach ($cafiles as $filename) { + if (file_exists($filename)) { + return $cached = $filename; + } + } + + throw new \RuntimeException( + <<< EOT +No system CA bundle could be found in any of the the common system locations. +PHP versions earlier than 5.6 are not properly configured to use the system's +CA bundle by default. In order to verify peer certificates, you will need to +supply the path on disk to a certificate bundle to the 'verify' request +option: http://docs.guzzlephp.org/en/latest/clients.html#verify. If you do not +need a specific certificate bundle, then Mozilla provides a commonly used CA +bundle which can be downloaded here (provided by the maintainer of cURL): +https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt. Once +you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP +ini setting to point to the path to the file, allowing you to omit the 'verify' +request option. See http://curl.haxx.se/docs/sslcerts.html for more +information. +EOT + ); +} + +/** + * Creates an associative array of lowercase header names to the actual + * header casing. + * + * @param array $headers + * + * @return array + */ +function normalize_header_keys(array $headers) +{ + $result = []; + foreach (array_keys($headers) as $key) { + $result[strtolower($key)] = $key; + } + + return $result; +} + +/** + * Returns true if the provided host matches any of the no proxy areas. + * + * This method will strip a port from the host if it is present. Each pattern + * can be matched with an exact match (e.g., "foo.com" == "foo.com") or a + * partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" == + * "baz.foo.com", but ".foo.com" != "foo.com"). + * + * Areas are matched in the following cases: + * 1. "*" (without quotes) always matches any hosts. + * 2. An exact match. + * 3. The area starts with "." and the area is the last part of the host. e.g. + * '.mit.edu' will match any host that ends with '.mit.edu'. + * + * @param string $host Host to check against the patterns. + * @param array $noProxyArray An array of host patterns. + * + * @return bool + */ +function is_host_in_noproxy($host, array $noProxyArray) +{ + if (strlen($host) === 0) { + throw new \InvalidArgumentException('Empty host provided'); + } + + // Strip port if present. + if (strpos($host, ':')) { + $host = explode($host, ':', 2)[0]; + } + + foreach ($noProxyArray as $area) { + // Always match on wildcards. + if ($area === '*') { + return true; + } elseif (empty($area)) { + // Don't match on empty values. + continue; + } elseif ($area === $host) { + // Exact matches. + return true; + } else { + // Special match if the area when prefixed with ".". Remove any + // existing leading "." and add a new leading ".". + $area = '.' . ltrim($area, '.'); + if (substr($host, -(strlen($area))) === $area) { + return true; + } + } + } + + return false; +} + +/** + * Wrapper for json_decode that throws when an error occurs. + * + * @param string $json JSON data to parse + * @param bool $assoc When true, returned objects will be converted + * into associative arrays. + * @param int $depth User specified recursion depth. + * @param int $options Bitmask of JSON decode options. + * + * @return mixed + * @throws Exception\InvalidArgumentException if the JSON cannot be decoded. + * @link http://www.php.net/manual/en/function.json-decode.php + */ +function json_decode($json, $assoc = false, $depth = 512, $options = 0) +{ + $data = \json_decode($json, $assoc, $depth, $options); + if (JSON_ERROR_NONE !== json_last_error()) { + throw new Exception\InvalidArgumentException( + 'json_decode error: ' . json_last_error_msg() + ); + } + + return $data; +} + +/** + * Wrapper for JSON encoding that throws when an error occurs. + * + * @param mixed $value The value being encoded + * @param int $options JSON encode option bitmask + * @param int $depth Set the maximum depth. Must be greater than zero. + * + * @return string + * @throws Exception\InvalidArgumentException if the JSON cannot be encoded. + * @link http://www.php.net/manual/en/function.json-encode.php + */ +function json_encode($value, $options = 0, $depth = 512) +{ + $json = \json_encode($value, $options, $depth); + if (JSON_ERROR_NONE !== json_last_error()) { + throw new Exception\InvalidArgumentException( + 'json_encode error: ' . json_last_error_msg() + ); + } + + return $json; +} + +/** + * Wrapper for the hrtime() or microtime() functions + * (depending on the PHP version, one of the two is used) + * + * @return float|mixed UNIX timestamp + * @internal + */ +function _current_time() +{ + return function_exists('hrtime') ? hrtime(true) / 1e9 : microtime(true); +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/functions_include.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/functions_include.php new file mode 100644 index 0000000..a93393a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/guzzle/src/functions_include.php @@ -0,0 +1,6 @@ + + +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. diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/AggregateException.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/AggregateException.php new file mode 100644 index 0000000..6a5690c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/AggregateException.php @@ -0,0 +1,16 @@ +then(function ($v) { echo $v; }); + * + * @param callable $generatorFn Generator function to wrap into a promise. + * + * @return Promise + * @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration + */ +final class Coroutine implements PromiseInterface +{ + /** + * @var PromiseInterface|null + */ + private $currentPromise; + + /** + * @var Generator + */ + private $generator; + + /** + * @var Promise + */ + private $result; + + public function __construct(callable $generatorFn) + { + $this->generator = $generatorFn(); + $this->result = new Promise(function () { + while (isset($this->currentPromise)) { + $this->currentPromise->wait(); + } + }); + $this->nextCoroutine($this->generator->current()); + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + return $this->result->then($onFulfilled, $onRejected); + } + + public function otherwise(callable $onRejected) + { + return $this->result->otherwise($onRejected); + } + + public function wait($unwrap = true) + { + return $this->result->wait($unwrap); + } + + public function getState() + { + return $this->result->getState(); + } + + public function resolve($value) + { + $this->result->resolve($value); + } + + public function reject($reason) + { + $this->result->reject($reason); + } + + public function cancel() + { + $this->currentPromise->cancel(); + $this->result->cancel(); + } + + private function nextCoroutine($yielded) + { + $this->currentPromise = promise_for($yielded) + ->then([$this, '_handleSuccess'], [$this, '_handleFailure']); + } + + /** + * @internal + */ + public function _handleSuccess($value) + { + unset($this->currentPromise); + try { + $next = $this->generator->send($value); + if ($this->generator->valid()) { + $this->nextCoroutine($next); + } else { + $this->result->resolve($value); + } + } catch (Exception $exception) { + $this->result->reject($exception); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } + + /** + * @internal + */ + public function _handleFailure($reason) + { + unset($this->currentPromise); + try { + $nextYield = $this->generator->throw(exception_for($reason)); + // The throw was caught, so keep iterating on the coroutine + $this->nextCoroutine($nextYield); + } catch (Exception $exception) { + $this->result->reject($exception); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/EachPromise.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/EachPromise.php new file mode 100644 index 0000000..d0ddf60 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/EachPromise.php @@ -0,0 +1,229 @@ +iterable = iter_for($iterable); + + if (isset($config['concurrency'])) { + $this->concurrency = $config['concurrency']; + } + + if (isset($config['fulfilled'])) { + $this->onFulfilled = $config['fulfilled']; + } + + if (isset($config['rejected'])) { + $this->onRejected = $config['rejected']; + } + } + + public function promise() + { + if ($this->aggregate) { + return $this->aggregate; + } + + try { + $this->createPromise(); + $this->iterable->rewind(); + $this->refillPending(); + } catch (\Throwable $e) { + $this->aggregate->reject($e); + } catch (\Exception $e) { + $this->aggregate->reject($e); + } + + return $this->aggregate; + } + + private function createPromise() + { + $this->mutex = false; + $this->aggregate = new Promise(function () { + reset($this->pending); + if (empty($this->pending) && !$this->iterable->valid()) { + $this->aggregate->resolve(null); + return; + } + + // Consume a potentially fluctuating list of promises while + // ensuring that indexes are maintained (precluding array_shift). + while ($promise = current($this->pending)) { + next($this->pending); + $promise->wait(); + if ($this->aggregate->getState() !== PromiseInterface::PENDING) { + return; + } + } + }); + + // Clear the references when the promise is resolved. + $clearFn = function () { + $this->iterable = $this->concurrency = $this->pending = null; + $this->onFulfilled = $this->onRejected = null; + }; + + $this->aggregate->then($clearFn, $clearFn); + } + + private function refillPending() + { + if (!$this->concurrency) { + // Add all pending promises. + while ($this->addPending() && $this->advanceIterator()); + return; + } + + // Add only up to N pending promises. + $concurrency = is_callable($this->concurrency) + ? call_user_func($this->concurrency, count($this->pending)) + : $this->concurrency; + $concurrency = max($concurrency - count($this->pending), 0); + // Concurrency may be set to 0 to disallow new promises. + if (!$concurrency) { + return; + } + // Add the first pending promise. + $this->addPending(); + // Note this is special handling for concurrency=1 so that we do + // not advance the iterator after adding the first promise. This + // helps work around issues with generators that might not have the + // next value to yield until promise callbacks are called. + while (--$concurrency + && $this->advanceIterator() + && $this->addPending()); + } + + private function addPending() + { + if (!$this->iterable || !$this->iterable->valid()) { + return false; + } + + $promise = promise_for($this->iterable->current()); + $idx = $this->iterable->key(); + + $this->pending[$idx] = $promise->then( + function ($value) use ($idx) { + if ($this->onFulfilled) { + call_user_func( + $this->onFulfilled, $value, $idx, $this->aggregate + ); + } + $this->step($idx); + }, + function ($reason) use ($idx) { + if ($this->onRejected) { + call_user_func( + $this->onRejected, $reason, $idx, $this->aggregate + ); + } + $this->step($idx); + } + ); + + return true; + } + + private function advanceIterator() + { + // Place a lock on the iterator so that we ensure to not recurse, + // preventing fatal generator errors. + if ($this->mutex) { + return false; + } + + $this->mutex = true; + + try { + $this->iterable->next(); + $this->mutex = false; + return true; + } catch (\Throwable $e) { + $this->aggregate->reject($e); + $this->mutex = false; + return false; + } catch (\Exception $e) { + $this->aggregate->reject($e); + $this->mutex = false; + return false; + } + } + + private function step($idx) + { + // If the promise was already resolved, then ignore this step. + if ($this->aggregate->getState() !== PromiseInterface::PENDING) { + return; + } + + unset($this->pending[$idx]); + + // Only refill pending promises if we are not locked, preventing the + // EachPromise to recursively invoke the provided iterator, which + // cause a fatal error: "Cannot resume an already running generator" + if ($this->advanceIterator() && !$this->checkIfFinished()) { + // Add more pending promises if possible. + $this->refillPending(); + } + } + + private function checkIfFinished() + { + if (!$this->pending && !$this->iterable->valid()) { + // Resolve the promise if there's nothing left to do. + $this->aggregate->resolve(null); + return true; + } + + return false; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/FulfilledPromise.php new file mode 100644 index 0000000..dbbeeb9 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/FulfilledPromise.php @@ -0,0 +1,82 @@ +value = $value; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + // Return itself if there is no onFulfilled function. + if (!$onFulfilled) { + return $this; + } + + $queue = queue(); + $p = new Promise([$queue, 'run']); + $value = $this->value; + $queue->add(static function () use ($p, $value, $onFulfilled) { + if ($p->getState() === self::PENDING) { + try { + $p->resolve($onFulfilled($value)); + } catch (\Throwable $e) { + $p->reject($e); + } catch (\Exception $e) { + $p->reject($e); + } + } + }); + + return $p; + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true, $defaultDelivery = null) + { + return $unwrap ? $this->value : null; + } + + public function getState() + { + return self::FULFILLED; + } + + public function resolve($value) + { + if ($value !== $this->value) { + throw new \LogicException("Cannot resolve a fulfilled promise"); + } + } + + public function reject($reason) + { + throw new \LogicException("Cannot reject a fulfilled promise"); + } + + public function cancel() + { + // pass + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/Promise.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/Promise.php new file mode 100644 index 0000000..844ada0 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/Promise.php @@ -0,0 +1,280 @@ +waitFn = $waitFn; + $this->cancelFn = $cancelFn; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + if ($this->state === self::PENDING) { + $p = new Promise(null, [$this, 'cancel']); + $this->handlers[] = [$p, $onFulfilled, $onRejected]; + $p->waitList = $this->waitList; + $p->waitList[] = $this; + return $p; + } + + // Return a fulfilled promise and immediately invoke any callbacks. + if ($this->state === self::FULFILLED) { + return $onFulfilled + ? promise_for($this->result)->then($onFulfilled) + : promise_for($this->result); + } + + // It's either cancelled or rejected, so return a rejected promise + // and immediately invoke any callbacks. + $rejection = rejection_for($this->result); + return $onRejected ? $rejection->then(null, $onRejected) : $rejection; + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true) + { + $this->waitIfPending(); + + $inner = $this->result instanceof PromiseInterface + ? $this->result->wait($unwrap) + : $this->result; + + if ($unwrap) { + if ($this->result instanceof PromiseInterface + || $this->state === self::FULFILLED + ) { + return $inner; + } else { + // It's rejected so "unwrap" and throw an exception. + throw exception_for($inner); + } + } + } + + public function getState() + { + return $this->state; + } + + public function cancel() + { + if ($this->state !== self::PENDING) { + return; + } + + $this->waitFn = $this->waitList = null; + + if ($this->cancelFn) { + $fn = $this->cancelFn; + $this->cancelFn = null; + try { + $fn(); + } catch (\Throwable $e) { + $this->reject($e); + } catch (\Exception $e) { + $this->reject($e); + } + } + + // Reject the promise only if it wasn't rejected in a then callback. + if ($this->state === self::PENDING) { + $this->reject(new CancellationException('Promise has been cancelled')); + } + } + + public function resolve($value) + { + $this->settle(self::FULFILLED, $value); + } + + public function reject($reason) + { + $this->settle(self::REJECTED, $reason); + } + + private function settle($state, $value) + { + if ($this->state !== self::PENDING) { + // Ignore calls with the same resolution. + if ($state === $this->state && $value === $this->result) { + return; + } + throw $this->state === $state + ? new \LogicException("The promise is already {$state}.") + : new \LogicException("Cannot change a {$this->state} promise to {$state}"); + } + + if ($value === $this) { + throw new \LogicException('Cannot fulfill or reject a promise with itself'); + } + + // Clear out the state of the promise but stash the handlers. + $this->state = $state; + $this->result = $value; + $handlers = $this->handlers; + $this->handlers = null; + $this->waitList = $this->waitFn = null; + $this->cancelFn = null; + + if (!$handlers) { + return; + } + + // If the value was not a settled promise or a thenable, then resolve + // it in the task queue using the correct ID. + if (!method_exists($value, 'then')) { + $id = $state === self::FULFILLED ? 1 : 2; + // It's a success, so resolve the handlers in the queue. + queue()->add(static function () use ($id, $value, $handlers) { + foreach ($handlers as $handler) { + self::callHandler($id, $value, $handler); + } + }); + } elseif ($value instanceof Promise + && $value->getState() === self::PENDING + ) { + // We can just merge our handlers onto the next promise. + $value->handlers = array_merge($value->handlers, $handlers); + } else { + // Resolve the handlers when the forwarded promise is resolved. + $value->then( + static function ($value) use ($handlers) { + foreach ($handlers as $handler) { + self::callHandler(1, $value, $handler); + } + }, + static function ($reason) use ($handlers) { + foreach ($handlers as $handler) { + self::callHandler(2, $reason, $handler); + } + } + ); + } + } + + /** + * Call a stack of handlers using a specific callback index and value. + * + * @param int $index 1 (resolve) or 2 (reject). + * @param mixed $value Value to pass to the callback. + * @param array $handler Array of handler data (promise and callbacks). + * + * @return array Returns the next group to resolve. + */ + private static function callHandler($index, $value, array $handler) + { + /** @var PromiseInterface $promise */ + $promise = $handler[0]; + + // The promise may have been cancelled or resolved before placing + // this thunk in the queue. + if ($promise->getState() !== self::PENDING) { + return; + } + + try { + if (isset($handler[$index])) { + $promise->resolve($handler[$index]($value)); + } elseif ($index === 1) { + // Forward resolution values as-is. + $promise->resolve($value); + } else { + // Forward rejections down the chain. + $promise->reject($value); + } + } catch (\Throwable $reason) { + $promise->reject($reason); + } catch (\Exception $reason) { + $promise->reject($reason); + } + } + + private function waitIfPending() + { + if ($this->state !== self::PENDING) { + return; + } elseif ($this->waitFn) { + $this->invokeWaitFn(); + } elseif ($this->waitList) { + $this->invokeWaitList(); + } else { + // If there's not wait function, then reject the promise. + $this->reject('Cannot wait on a promise that has ' + . 'no internal wait function. You must provide a wait ' + . 'function when constructing the promise to be able to ' + . 'wait on a promise.'); + } + + queue()->run(); + + if ($this->state === self::PENDING) { + $this->reject('Invoking the wait callback did not resolve the promise'); + } + } + + private function invokeWaitFn() + { + try { + $wfn = $this->waitFn; + $this->waitFn = null; + $wfn(true); + } catch (\Exception $reason) { + if ($this->state === self::PENDING) { + // The promise has not been resolved yet, so reject the promise + // with the exception. + $this->reject($reason); + } else { + // The promise was already resolved, so there's a problem in + // the application. + throw $reason; + } + } + } + + private function invokeWaitList() + { + $waitList = $this->waitList; + $this->waitList = null; + + foreach ($waitList as $result) { + while (true) { + $result->waitIfPending(); + + if ($result->result instanceof Promise) { + $result = $result->result; + } else { + if ($result->result instanceof PromiseInterface) { + $result->result->wait(false); + } + break; + } + } + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/PromiseInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/PromiseInterface.php new file mode 100644 index 0000000..8f5f4b9 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/PromiseInterface.php @@ -0,0 +1,93 @@ +reason = $reason; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + // If there's no onRejected callback then just return self. + if (!$onRejected) { + return $this; + } + + $queue = queue(); + $reason = $this->reason; + $p = new Promise([$queue, 'run']); + $queue->add(static function () use ($p, $reason, $onRejected) { + if ($p->getState() === self::PENDING) { + try { + // Return a resolved promise if onRejected does not throw. + $p->resolve($onRejected($reason)); + } catch (\Throwable $e) { + // onRejected threw, so return a rejected promise. + $p->reject($e); + } catch (\Exception $e) { + // onRejected threw, so return a rejected promise. + $p->reject($e); + } + } + }); + + return $p; + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true, $defaultDelivery = null) + { + if ($unwrap) { + throw exception_for($this->reason); + } + } + + public function getState() + { + return self::REJECTED; + } + + public function resolve($value) + { + throw new \LogicException("Cannot resolve a rejected promise"); + } + + public function reject($reason) + { + if ($reason !== $this->reason) { + throw new \LogicException("Cannot reject a rejected promise"); + } + } + + public function cancel() + { + // pass + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/RejectionException.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/RejectionException.php new file mode 100644 index 0000000..07c1136 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/RejectionException.php @@ -0,0 +1,47 @@ +reason = $reason; + + $message = 'The promise was rejected'; + + if ($description) { + $message .= ' with reason: ' . $description; + } elseif (is_string($reason) + || (is_object($reason) && method_exists($reason, '__toString')) + ) { + $message .= ' with reason: ' . $this->reason; + } elseif ($reason instanceof \JsonSerializable) { + $message .= ' with reason: ' + . json_encode($this->reason, JSON_PRETTY_PRINT); + } + + parent::__construct($message); + } + + /** + * Returns the rejection reason. + * + * @return mixed + */ + public function getReason() + { + return $this->reason; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/TaskQueue.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/TaskQueue.php new file mode 100644 index 0000000..6e8a2a0 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/TaskQueue.php @@ -0,0 +1,66 @@ +run(); + */ +class TaskQueue implements TaskQueueInterface +{ + private $enableShutdown = true; + private $queue = []; + + public function __construct($withShutdown = true) + { + if ($withShutdown) { + register_shutdown_function(function () { + if ($this->enableShutdown) { + // Only run the tasks if an E_ERROR didn't occur. + $err = error_get_last(); + if (!$err || ($err['type'] ^ E_ERROR)) { + $this->run(); + } + } + }); + } + } + + public function isEmpty() + { + return !$this->queue; + } + + public function add(callable $task) + { + $this->queue[] = $task; + } + + public function run() + { + /** @var callable $task */ + while ($task = array_shift($this->queue)) { + $task(); + } + } + + /** + * The task queue will be run and exhausted by default when the process + * exits IFF the exit is not the result of a PHP E_ERROR error. + * + * You can disable running the automatic shutdown of the queue by calling + * this function. If you disable the task queue shutdown process, then you + * MUST either run the task queue (as a result of running your event loop + * or manually using the run() method) or wait on each outstanding promise. + * + * Note: This shutdown will occur before any destructors are triggered. + */ + public function disableShutdown() + { + $this->enableShutdown = false; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/TaskQueueInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/TaskQueueInterface.php new file mode 100644 index 0000000..ac8306e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/TaskQueueInterface.php @@ -0,0 +1,25 @@ + + * while ($eventLoop->isRunning()) { + * GuzzleHttp\Promise\queue()->run(); + * } + * + * + * @param TaskQueueInterface $assign Optionally specify a new queue instance. + * + * @return TaskQueueInterface + */ +function queue(TaskQueueInterface $assign = null) +{ + static $queue; + + if ($assign) { + $queue = $assign; + } elseif (!$queue) { + $queue = new TaskQueue(); + } + + return $queue; +} + +/** + * Adds a function to run in the task queue when it is next `run()` and returns + * a promise that is fulfilled or rejected with the result. + * + * @param callable $task Task function to run. + * + * @return PromiseInterface + */ +function task(callable $task) +{ + $queue = queue(); + $promise = new Promise([$queue, 'run']); + $queue->add(function () use ($task, $promise) { + try { + $promise->resolve($task()); + } catch (\Throwable $e) { + $promise->reject($e); + } catch (\Exception $e) { + $promise->reject($e); + } + }); + + return $promise; +} + +/** + * Creates a promise for a value if the value is not a promise. + * + * @param mixed $value Promise or value. + * + * @return PromiseInterface + */ +function promise_for($value) +{ + if ($value instanceof PromiseInterface) { + return $value; + } + + // Return a Guzzle promise that shadows the given promise. + if (method_exists($value, 'then')) { + $wfn = method_exists($value, 'wait') ? [$value, 'wait'] : null; + $cfn = method_exists($value, 'cancel') ? [$value, 'cancel'] : null; + $promise = new Promise($wfn, $cfn); + $value->then([$promise, 'resolve'], [$promise, 'reject']); + return $promise; + } + + return new FulfilledPromise($value); +} + +/** + * Creates a rejected promise for a reason if the reason is not a promise. If + * the provided reason is a promise, then it is returned as-is. + * + * @param mixed $reason Promise or reason. + * + * @return PromiseInterface + */ +function rejection_for($reason) +{ + if ($reason instanceof PromiseInterface) { + return $reason; + } + + return new RejectedPromise($reason); +} + +/** + * Create an exception for a rejected promise value. + * + * @param mixed $reason + * + * @return \Exception|\Throwable + */ +function exception_for($reason) +{ + return $reason instanceof \Exception || $reason instanceof \Throwable + ? $reason + : new RejectionException($reason); +} + +/** + * Returns an iterator for the given value. + * + * @param mixed $value + * + * @return \Iterator + */ +function iter_for($value) +{ + if ($value instanceof \Iterator) { + return $value; + } elseif (is_array($value)) { + return new \ArrayIterator($value); + } else { + return new \ArrayIterator([$value]); + } +} + +/** + * Synchronously waits on a promise to resolve and returns an inspection state + * array. + * + * Returns a state associative array containing a "state" key mapping to a + * valid promise state. If the state of the promise is "fulfilled", the array + * will contain a "value" key mapping to the fulfilled value of the promise. If + * the promise is rejected, the array will contain a "reason" key mapping to + * the rejection reason of the promise. + * + * @param PromiseInterface $promise Promise or value. + * + * @return array + */ +function inspect(PromiseInterface $promise) +{ + try { + return [ + 'state' => PromiseInterface::FULFILLED, + 'value' => $promise->wait() + ]; + } catch (RejectionException $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()]; + } catch (\Throwable $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; + } catch (\Exception $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; + } +} + +/** + * Waits on all of the provided promises, but does not unwrap rejected promises + * as thrown exception. + * + * Returns an array of inspection state arrays. + * + * @param PromiseInterface[] $promises Traversable of promises to wait upon. + * + * @return array + * @see GuzzleHttp\Promise\inspect for the inspection state array format. + */ +function inspect_all($promises) +{ + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = inspect($promise); + } + + return $results; +} + +/** + * Waits on all of the provided promises and returns the fulfilled values. + * + * Returns an array that contains the value of each promise (in the same order + * the promises were provided). An exception is thrown if any of the promises + * are rejected. + * + * @param mixed $promises Iterable of PromiseInterface objects to wait on. + * + * @return array + * @throws \Exception on error + * @throws \Throwable on error in PHP >=7 + */ +function unwrap($promises) +{ + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = $promise->wait(); + } + + return $results; +} + +/** + * Given an array of promises, return a promise that is fulfilled when all the + * items in the array are fulfilled. + * + * The promise's fulfillment value is an array with fulfillment values at + * respective positions to the original array. If any promise in the array + * rejects, the returned promise is rejected with the rejection reason. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + */ +function all($promises) +{ + $results = []; + return each( + $promises, + function ($value, $idx) use (&$results) { + $results[$idx] = $value; + }, + function ($reason, $idx, Promise $aggregate) { + $aggregate->reject($reason); + } + )->then(function () use (&$results) { + ksort($results); + return $results; + }); +} + +/** + * Initiate a competitive race between multiple promises or values (values will + * become immediately fulfilled promises). + * + * When count amount of promises have been fulfilled, the returned promise is + * fulfilled with an array that contains the fulfillment values of the winners + * in order of resolution. + * + * This prommise is rejected with a {@see GuzzleHttp\Promise\AggregateException} + * if the number of fulfilled promises is less than the desired $count. + * + * @param int $count Total number of promises. + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + */ +function some($count, $promises) +{ + $results = []; + $rejections = []; + + return each( + $promises, + function ($value, $idx, PromiseInterface $p) use (&$results, $count) { + if ($p->getState() !== PromiseInterface::PENDING) { + return; + } + $results[$idx] = $value; + if (count($results) >= $count) { + $p->resolve(null); + } + }, + function ($reason) use (&$rejections) { + $rejections[] = $reason; + } + )->then( + function () use (&$results, &$rejections, $count) { + if (count($results) !== $count) { + throw new AggregateException( + 'Not enough promises to fulfill count', + $rejections + ); + } + ksort($results); + return array_values($results); + } + ); +} + +/** + * Like some(), with 1 as count. However, if the promise fulfills, the + * fulfillment value is not an array of 1 but the value directly. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + */ +function any($promises) +{ + return some(1, $promises)->then(function ($values) { return $values[0]; }); +} + +/** + * Returns a promise that is fulfilled when all of the provided promises have + * been fulfilled or rejected. + * + * The returned promise is fulfilled with an array of inspection state arrays. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + * @see GuzzleHttp\Promise\inspect for the inspection state array format. + */ +function settle($promises) +{ + $results = []; + + return each( + $promises, + function ($value, $idx) use (&$results) { + $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value]; + }, + function ($reason, $idx) use (&$results) { + $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason]; + } + )->then(function () use (&$results) { + ksort($results); + return $results; + }); +} + +/** + * Given an iterator that yields promises or values, returns a promise that is + * fulfilled with a null value when the iterator has been consumed or the + * aggregate promise has been fulfilled or rejected. + * + * $onFulfilled is a function that accepts the fulfilled value, iterator + * index, and the aggregate promise. The callback can invoke any necessary side + * effects and choose to resolve or reject the aggregate promise if needed. + * + * $onRejected is a function that accepts the rejection reason, iterator + * index, and the aggregate promise. The callback can invoke any necessary side + * effects and choose to resolve or reject the aggregate promise if needed. + * + * @param mixed $iterable Iterator or array to iterate over. + * @param callable $onFulfilled + * @param callable $onRejected + * + * @return PromiseInterface + */ +function each( + $iterable, + callable $onFulfilled = null, + callable $onRejected = null +) { + return (new EachPromise($iterable, [ + 'fulfilled' => $onFulfilled, + 'rejected' => $onRejected + ]))->promise(); +} + +/** + * Like each, but only allows a certain number of outstanding promises at any + * given time. + * + * $concurrency may be an integer or a function that accepts the number of + * pending promises and returns a numeric concurrency limit value to allow for + * dynamic a concurrency size. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * @param callable $onRejected + * + * @return PromiseInterface + */ +function each_limit( + $iterable, + $concurrency, + callable $onFulfilled = null, + callable $onRejected = null +) { + return (new EachPromise($iterable, [ + 'fulfilled' => $onFulfilled, + 'rejected' => $onRejected, + 'concurrency' => $concurrency + ]))->promise(); +} + +/** + * Like each_limit, but ensures that no promise in the given $iterable argument + * is rejected. If any promise is rejected, then the aggregate promise is + * rejected with the encountered rejection. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * + * @return PromiseInterface + */ +function each_limit_all( + $iterable, + $concurrency, + callable $onFulfilled = null +) { + return each_limit( + $iterable, + $concurrency, + $onFulfilled, + function ($reason, $idx, PromiseInterface $aggregate) { + $aggregate->reject($reason); + } + ); +} + +/** + * Returns true if a promise is fulfilled. + * + * @param PromiseInterface $promise + * + * @return bool + */ +function is_fulfilled(PromiseInterface $promise) +{ + return $promise->getState() === PromiseInterface::FULFILLED; +} + +/** + * Returns true if a promise is rejected. + * + * @param PromiseInterface $promise + * + * @return bool + */ +function is_rejected(PromiseInterface $promise) +{ + return $promise->getState() === PromiseInterface::REJECTED; +} + +/** + * Returns true if a promise is fulfilled or rejected. + * + * @param PromiseInterface $promise + * + * @return bool + */ +function is_settled(PromiseInterface $promise) +{ + return $promise->getState() !== PromiseInterface::PENDING; +} + +/** + * @see Coroutine + * + * @param callable $generatorFn + * + * @return PromiseInterface + */ +function coroutine(callable $generatorFn) +{ + return new Coroutine($generatorFn); +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/functions_include.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/functions_include.php new file mode 100644 index 0000000..34cd171 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/promises/src/functions_include.php @@ -0,0 +1,6 @@ + + +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. diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/AppendStream.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/AppendStream.php new file mode 100644 index 0000000..472a0d6 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/AppendStream.php @@ -0,0 +1,241 @@ +addStream($stream); + } + } + + public function __toString() + { + try { + $this->rewind(); + return $this->getContents(); + } catch (\Exception $e) { + return ''; + } + } + + /** + * Add a stream to the AppendStream + * + * @param StreamInterface $stream Stream to append. Must be readable. + * + * @throws \InvalidArgumentException if the stream is not readable + */ + public function addStream(StreamInterface $stream) + { + if (!$stream->isReadable()) { + throw new \InvalidArgumentException('Each stream must be readable'); + } + + // The stream is only seekable if all streams are seekable + if (!$stream->isSeekable()) { + $this->seekable = false; + } + + $this->streams[] = $stream; + } + + public function getContents() + { + return copy_to_string($this); + } + + /** + * Closes each attached stream. + * + * {@inheritdoc} + */ + public function close() + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->close(); + } + + $this->streams = []; + } + + /** + * Detaches each attached stream. + * + * Returns null as it's not clear which underlying stream resource to return. + * + * {@inheritdoc} + */ + public function detach() + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->detach(); + } + + $this->streams = []; + } + + public function tell() + { + return $this->pos; + } + + /** + * Tries to calculate the size by adding the size of each stream. + * + * If any of the streams do not return a valid number, then the size of the + * append stream cannot be determined and null is returned. + * + * {@inheritdoc} + */ + public function getSize() + { + $size = 0; + + foreach ($this->streams as $stream) { + $s = $stream->getSize(); + if ($s === null) { + return null; + } + $size += $s; + } + + return $size; + } + + public function eof() + { + return !$this->streams || + ($this->current >= count($this->streams) - 1 && + $this->streams[$this->current]->eof()); + } + + public function rewind() + { + $this->seek(0); + } + + /** + * Attempts to seek to the given position. Only supports SEEK_SET. + * + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + if (!$this->seekable) { + throw new \RuntimeException('This AppendStream is not seekable'); + } elseif ($whence !== SEEK_SET) { + throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); + } + + $this->pos = $this->current = 0; + + // Rewind each stream + foreach ($this->streams as $i => $stream) { + try { + $stream->rewind(); + } catch (\Exception $e) { + throw new \RuntimeException('Unable to seek stream ' + . $i . ' of the AppendStream', 0, $e); + } + } + + // Seek to the actual position by reading from each stream + while ($this->pos < $offset && !$this->eof()) { + $result = $this->read(min(8096, $offset - $this->pos)); + if ($result === '') { + break; + } + } + } + + /** + * Reads from all of the appended streams until the length is met or EOF. + * + * {@inheritdoc} + */ + public function read($length) + { + $buffer = ''; + $total = count($this->streams) - 1; + $remaining = $length; + $progressToNext = false; + + while ($remaining > 0) { + + // Progress to the next stream if needed. + if ($progressToNext || $this->streams[$this->current]->eof()) { + $progressToNext = false; + if ($this->current === $total) { + break; + } + $this->current++; + } + + $result = $this->streams[$this->current]->read($remaining); + + // Using a loose comparison here to match on '', false, and null + if ($result == null) { + $progressToNext = true; + continue; + } + + $buffer .= $result; + $remaining = $length - strlen($buffer); + } + + $this->pos += strlen($buffer); + + return $buffer; + } + + public function isReadable() + { + return true; + } + + public function isWritable() + { + return false; + } + + public function isSeekable() + { + return $this->seekable; + } + + public function write($string) + { + throw new \RuntimeException('Cannot write to an AppendStream'); + } + + public function getMetadata($key = null) + { + return $key ? null : []; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/BufferStream.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/BufferStream.php new file mode 100644 index 0000000..af4d4c2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/BufferStream.php @@ -0,0 +1,137 @@ +hwm = $hwm; + } + + public function __toString() + { + return $this->getContents(); + } + + public function getContents() + { + $buffer = $this->buffer; + $this->buffer = ''; + + return $buffer; + } + + public function close() + { + $this->buffer = ''; + } + + public function detach() + { + $this->close(); + } + + public function getSize() + { + return strlen($this->buffer); + } + + public function isReadable() + { + return true; + } + + public function isWritable() + { + return true; + } + + public function isSeekable() + { + return false; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + throw new \RuntimeException('Cannot seek a BufferStream'); + } + + public function eof() + { + return strlen($this->buffer) === 0; + } + + public function tell() + { + throw new \RuntimeException('Cannot determine the position of a BufferStream'); + } + + /** + * Reads data from the buffer. + */ + public function read($length) + { + $currentLength = strlen($this->buffer); + + if ($length >= $currentLength) { + // No need to slice the buffer because we don't have enough data. + $result = $this->buffer; + $this->buffer = ''; + } else { + // Slice up the result to provide a subset of the buffer. + $result = substr($this->buffer, 0, $length); + $this->buffer = substr($this->buffer, $length); + } + + return $result; + } + + /** + * Writes data to the buffer. + */ + public function write($string) + { + $this->buffer .= $string; + + // TODO: What should happen here? + if (strlen($this->buffer) >= $this->hwm) { + return false; + } + + return strlen($string); + } + + public function getMetadata($key = null) + { + if ($key == 'hwm') { + return $this->hwm; + } + + return $key ? null : []; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/CachingStream.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/CachingStream.php new file mode 100644 index 0000000..ed68f08 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/CachingStream.php @@ -0,0 +1,138 @@ +remoteStream = $stream; + $this->stream = $target ?: new Stream(fopen('php://temp', 'r+')); + } + + public function getSize() + { + return max($this->stream->getSize(), $this->remoteStream->getSize()); + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + if ($whence == SEEK_SET) { + $byte = $offset; + } elseif ($whence == SEEK_CUR) { + $byte = $offset + $this->tell(); + } elseif ($whence == SEEK_END) { + $size = $this->remoteStream->getSize(); + if ($size === null) { + $size = $this->cacheEntireStream(); + } + $byte = $size + $offset; + } else { + throw new \InvalidArgumentException('Invalid whence'); + } + + $diff = $byte - $this->stream->getSize(); + + if ($diff > 0) { + // Read the remoteStream until we have read in at least the amount + // of bytes requested, or we reach the end of the file. + while ($diff > 0 && !$this->remoteStream->eof()) { + $this->read($diff); + $diff = $byte - $this->stream->getSize(); + } + } else { + // We can just do a normal seek since we've already seen this byte. + $this->stream->seek($byte); + } + } + + public function read($length) + { + // Perform a regular read on any previously read data from the buffer + $data = $this->stream->read($length); + $remaining = $length - strlen($data); + + // More data was requested so read from the remote stream + if ($remaining) { + // If data was written to the buffer in a position that would have + // been filled from the remote stream, then we must skip bytes on + // the remote stream to emulate overwriting bytes from that + // position. This mimics the behavior of other PHP stream wrappers. + $remoteData = $this->remoteStream->read( + $remaining + $this->skipReadBytes + ); + + if ($this->skipReadBytes) { + $len = strlen($remoteData); + $remoteData = substr($remoteData, $this->skipReadBytes); + $this->skipReadBytes = max(0, $this->skipReadBytes - $len); + } + + $data .= $remoteData; + $this->stream->write($remoteData); + } + + return $data; + } + + public function write($string) + { + // When appending to the end of the currently read stream, you'll want + // to skip bytes from being read from the remote stream to emulate + // other stream wrappers. Basically replacing bytes of data of a fixed + // length. + $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); + if ($overflow > 0) { + $this->skipReadBytes += $overflow; + } + + return $this->stream->write($string); + } + + public function eof() + { + return $this->stream->eof() && $this->remoteStream->eof(); + } + + /** + * Close both the remote stream and buffer stream + */ + public function close() + { + $this->remoteStream->close() && $this->stream->close(); + } + + private function cacheEntireStream() + { + $target = new FnStream(['write' => 'strlen']); + copy_to_stream($this, $target); + + return $this->tell(); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/DroppingStream.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/DroppingStream.php new file mode 100644 index 0000000..8935c80 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/DroppingStream.php @@ -0,0 +1,42 @@ +stream = $stream; + $this->maxLength = $maxLength; + } + + public function write($string) + { + $diff = $this->maxLength - $this->stream->getSize(); + + // Begin returning 0 when the underlying stream is too large. + if ($diff <= 0) { + return 0; + } + + // Write the stream or a subset of the stream if needed. + if (strlen($string) < $diff) { + return $this->stream->write($string); + } + + return $this->stream->write(substr($string, 0, $diff)); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/FnStream.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/FnStream.php new file mode 100644 index 0000000..73daea6 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/FnStream.php @@ -0,0 +1,158 @@ +methods = $methods; + + // Create the functions on the class + foreach ($methods as $name => $fn) { + $this->{'_fn_' . $name} = $fn; + } + } + + /** + * Lazily determine which methods are not implemented. + * @throws \BadMethodCallException + */ + public function __get($name) + { + throw new \BadMethodCallException(str_replace('_fn_', '', $name) + . '() is not implemented in the FnStream'); + } + + /** + * The close method is called on the underlying stream only if possible. + */ + public function __destruct() + { + if (isset($this->_fn_close)) { + call_user_func($this->_fn_close); + } + } + + /** + * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. + * @throws \LogicException + */ + public function __wakeup() + { + throw new \LogicException('FnStream should never be unserialized'); + } + + /** + * Adds custom functionality to an underlying stream by intercepting + * specific method calls. + * + * @param StreamInterface $stream Stream to decorate + * @param array $methods Hash of method name to a closure + * + * @return FnStream + */ + public static function decorate(StreamInterface $stream, array $methods) + { + // If any of the required methods were not provided, then simply + // proxy to the decorated stream. + foreach (array_diff(self::$slots, array_keys($methods)) as $diff) { + $methods[$diff] = [$stream, $diff]; + } + + return new self($methods); + } + + public function __toString() + { + return call_user_func($this->_fn___toString); + } + + public function close() + { + return call_user_func($this->_fn_close); + } + + public function detach() + { + return call_user_func($this->_fn_detach); + } + + public function getSize() + { + return call_user_func($this->_fn_getSize); + } + + public function tell() + { + return call_user_func($this->_fn_tell); + } + + public function eof() + { + return call_user_func($this->_fn_eof); + } + + public function isSeekable() + { + return call_user_func($this->_fn_isSeekable); + } + + public function rewind() + { + call_user_func($this->_fn_rewind); + } + + public function seek($offset, $whence = SEEK_SET) + { + call_user_func($this->_fn_seek, $offset, $whence); + } + + public function isWritable() + { + return call_user_func($this->_fn_isWritable); + } + + public function write($string) + { + return call_user_func($this->_fn_write, $string); + } + + public function isReadable() + { + return call_user_func($this->_fn_isReadable); + } + + public function read($length) + { + return call_user_func($this->_fn_read, $length); + } + + public function getContents() + { + return call_user_func($this->_fn_getContents); + } + + public function getMetadata($key = null) + { + return call_user_func($this->_fn_getMetadata, $key); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/InflateStream.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/InflateStream.php new file mode 100644 index 0000000..5e4f602 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/InflateStream.php @@ -0,0 +1,52 @@ +read(10); + $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header); + // Skip the header, that is 10 + length of filename + 1 (nil) bytes + $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength); + $resource = StreamWrapper::getResource($stream); + stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ); + $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); + } + + /** + * @param StreamInterface $stream + * @param $header + * @return int + */ + private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) + { + $filename_header_length = 0; + + if (substr(bin2hex($header), 6, 2) === '08') { + // we have a filename, read until nil + $filename_header_length = 1; + while ($stream->read(1) !== chr(0)) { + $filename_header_length++; + } + } + + return $filename_header_length; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/LazyOpenStream.php new file mode 100644 index 0000000..02cec3a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/LazyOpenStream.php @@ -0,0 +1,39 @@ +filename = $filename; + $this->mode = $mode; + } + + /** + * Creates the underlying stream lazily when required. + * + * @return StreamInterface + */ + protected function createStream() + { + return stream_for(try_fopen($this->filename, $this->mode)); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/LimitStream.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/LimitStream.php new file mode 100644 index 0000000..e4f239e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/LimitStream.php @@ -0,0 +1,155 @@ +stream = $stream; + $this->setLimit($limit); + $this->setOffset($offset); + } + + public function eof() + { + // Always return true if the underlying stream is EOF + if ($this->stream->eof()) { + return true; + } + + // No limit and the underlying stream is not at EOF + if ($this->limit == -1) { + return false; + } + + return $this->stream->tell() >= $this->offset + $this->limit; + } + + /** + * Returns the size of the limited subset of data + * {@inheritdoc} + */ + public function getSize() + { + if (null === ($length = $this->stream->getSize())) { + return null; + } elseif ($this->limit == -1) { + return $length - $this->offset; + } else { + return min($this->limit, $length - $this->offset); + } + } + + /** + * Allow for a bounded seek on the read limited stream + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + if ($whence !== SEEK_SET || $offset < 0) { + throw new \RuntimeException(sprintf( + 'Cannot seek to offset %s with whence %s', + $offset, + $whence + )); + } + + $offset += $this->offset; + + if ($this->limit !== -1) { + if ($offset > $this->offset + $this->limit) { + $offset = $this->offset + $this->limit; + } + } + + $this->stream->seek($offset); + } + + /** + * Give a relative tell() + * {@inheritdoc} + */ + public function tell() + { + return $this->stream->tell() - $this->offset; + } + + /** + * Set the offset to start limiting from + * + * @param int $offset Offset to seek to and begin byte limiting from + * + * @throws \RuntimeException if the stream cannot be seeked. + */ + public function setOffset($offset) + { + $current = $this->stream->tell(); + + if ($current !== $offset) { + // If the stream cannot seek to the offset position, then read to it + if ($this->stream->isSeekable()) { + $this->stream->seek($offset); + } elseif ($current > $offset) { + throw new \RuntimeException("Could not seek to stream offset $offset"); + } else { + $this->stream->read($offset - $current); + } + } + + $this->offset = $offset; + } + + /** + * Set the limit of bytes that the decorator allows to be read from the + * stream. + * + * @param int $limit Number of bytes to allow to be read from the stream. + * Use -1 for no limit. + */ + public function setLimit($limit) + { + $this->limit = $limit; + } + + public function read($length) + { + if ($this->limit == -1) { + return $this->stream->read($length); + } + + // Check if the current position is less than the total allowed + // bytes + original offset + $remaining = ($this->offset + $this->limit) - $this->stream->tell(); + if ($remaining > 0) { + // Only return the amount of requested data, ensuring that the byte + // limit is not exceeded + return $this->stream->read(min($remaining, $length)); + } + + return ''; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/MessageTrait.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/MessageTrait.php new file mode 100644 index 0000000..a7966d1 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/MessageTrait.php @@ -0,0 +1,213 @@ + array of values */ + private $headers = []; + + /** @var array Map of lowercase header name => original name at registration */ + private $headerNames = []; + + /** @var string */ + private $protocol = '1.1'; + + /** @var StreamInterface */ + private $stream; + + public function getProtocolVersion() + { + return $this->protocol; + } + + public function withProtocolVersion($version) + { + if ($this->protocol === $version) { + return $this; + } + + $new = clone $this; + $new->protocol = $version; + return $new; + } + + public function getHeaders() + { + return $this->headers; + } + + public function hasHeader($header) + { + return isset($this->headerNames[strtolower($header)]); + } + + public function getHeader($header) + { + $header = strtolower($header); + + if (!isset($this->headerNames[$header])) { + return []; + } + + $header = $this->headerNames[$header]; + + return $this->headers[$header]; + } + + public function getHeaderLine($header) + { + return implode(', ', $this->getHeader($header)); + } + + public function withHeader($header, $value) + { + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + unset($new->headers[$new->headerNames[$normalized]]); + } + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + + return $new; + } + + public function withAddedHeader($header, $value) + { + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $new->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + } + + return $new; + } + + public function withoutHeader($header) + { + $normalized = strtolower($header); + + if (!isset($this->headerNames[$normalized])) { + return $this; + } + + $header = $this->headerNames[$normalized]; + + $new = clone $this; + unset($new->headers[$header], $new->headerNames[$normalized]); + + return $new; + } + + public function getBody() + { + if (!$this->stream) { + $this->stream = stream_for(''); + } + + return $this->stream; + } + + public function withBody(StreamInterface $body) + { + if ($body === $this->stream) { + return $this; + } + + $new = clone $this; + $new->stream = $body; + return $new; + } + + private function setHeaders(array $headers) + { + $this->headerNames = $this->headers = []; + foreach ($headers as $header => $value) { + if (is_int($header)) { + // Numeric array keys are converted to int by PHP but having a header name '123' is not forbidden by the spec + // and also allowed in withHeader(). So we need to cast it to string again for the following assertion to pass. + $header = (string) $header; + } + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + if (isset($this->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $this->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $this->headerNames[$normalized] = $header; + $this->headers[$header] = $value; + } + } + } + + private function normalizeHeaderValue($value) + { + if (!is_array($value)) { + return $this->trimHeaderValues([$value]); + } + + if (count($value) === 0) { + throw new \InvalidArgumentException('Header value can not be an empty array.'); + } + + return $this->trimHeaderValues($value); + } + + /** + * Trims whitespace from the header values. + * + * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field. + * + * header-field = field-name ":" OWS field-value OWS + * OWS = *( SP / HTAB ) + * + * @param string[] $values Header values + * + * @return string[] Trimmed header values + * + * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 + */ + private function trimHeaderValues(array $values) + { + return array_map(function ($value) { + if (!is_scalar($value) && null !== $value) { + throw new \InvalidArgumentException(sprintf( + 'Header value must be scalar or null but %s provided.', + is_object($value) ? get_class($value) : gettype($value) + )); + } + + return trim((string) $value, " \t"); + }, $values); + } + + private function assertHeader($header) + { + if (!is_string($header)) { + throw new \InvalidArgumentException(sprintf( + 'Header name must be a string but %s provided.', + is_object($header) ? get_class($header) : gettype($header) + )); + } + + if ($header === '') { + throw new \InvalidArgumentException('Header name can not be empty.'); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/MultipartStream.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/MultipartStream.php new file mode 100644 index 0000000..c0fd584 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -0,0 +1,153 @@ +boundary = $boundary ?: sha1(uniqid('', true)); + $this->stream = $this->createStream($elements); + } + + /** + * Get the boundary + * + * @return string + */ + public function getBoundary() + { + return $this->boundary; + } + + public function isWritable() + { + return false; + } + + /** + * Get the headers needed before transferring the content of a POST file + */ + private function getHeaders(array $headers) + { + $str = ''; + foreach ($headers as $key => $value) { + $str .= "{$key}: {$value}\r\n"; + } + + return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n"; + } + + /** + * Create the aggregate stream that will be used to upload the POST data + */ + protected function createStream(array $elements) + { + $stream = new AppendStream(); + + foreach ($elements as $element) { + $this->addElement($stream, $element); + } + + // Add the trailing boundary with CRLF + $stream->addStream(stream_for("--{$this->boundary}--\r\n")); + + return $stream; + } + + private function addElement(AppendStream $stream, array $element) + { + foreach (['contents', 'name'] as $key) { + if (!array_key_exists($key, $element)) { + throw new \InvalidArgumentException("A '{$key}' key is required"); + } + } + + $element['contents'] = stream_for($element['contents']); + + if (empty($element['filename'])) { + $uri = $element['contents']->getMetadata('uri'); + if (substr($uri, 0, 6) !== 'php://') { + $element['filename'] = $uri; + } + } + + list($body, $headers) = $this->createElement( + $element['name'], + $element['contents'], + isset($element['filename']) ? $element['filename'] : null, + isset($element['headers']) ? $element['headers'] : [] + ); + + $stream->addStream(stream_for($this->getHeaders($headers))); + $stream->addStream($body); + $stream->addStream(stream_for("\r\n")); + } + + /** + * @return array + */ + private function createElement($name, StreamInterface $stream, $filename, array $headers) + { + // Set a default content-disposition header if one was no provided + $disposition = $this->getHeader($headers, 'content-disposition'); + if (!$disposition) { + $headers['Content-Disposition'] = ($filename === '0' || $filename) + ? sprintf('form-data; name="%s"; filename="%s"', + $name, + basename($filename)) + : "form-data; name=\"{$name}\""; + } + + // Set a default content-length header if one was no provided + $length = $this->getHeader($headers, 'content-length'); + if (!$length) { + if ($length = $stream->getSize()) { + $headers['Content-Length'] = (string) $length; + } + } + + // Set a default Content-Type if one was not supplied + $type = $this->getHeader($headers, 'content-type'); + if (!$type && ($filename === '0' || $filename)) { + if ($type = mimetype_from_filename($filename)) { + $headers['Content-Type'] = $type; + } + } + + return [$stream, $headers]; + } + + private function getHeader(array $headers, $key) + { + $lowercaseHeader = strtolower($key); + foreach ($headers as $k => $v) { + if (strtolower($k) === $lowercaseHeader) { + return $v; + } + } + + return null; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/NoSeekStream.php new file mode 100644 index 0000000..2332218 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/NoSeekStream.php @@ -0,0 +1,22 @@ +source = $source; + $this->size = isset($options['size']) ? $options['size'] : null; + $this->metadata = isset($options['metadata']) ? $options['metadata'] : []; + $this->buffer = new BufferStream(); + } + + public function __toString() + { + try { + return copy_to_string($this); + } catch (\Exception $e) { + return ''; + } + } + + public function close() + { + $this->detach(); + } + + public function detach() + { + $this->tellPos = false; + $this->source = null; + } + + public function getSize() + { + return $this->size; + } + + public function tell() + { + return $this->tellPos; + } + + public function eof() + { + return !$this->source; + } + + public function isSeekable() + { + return false; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + throw new \RuntimeException('Cannot seek a PumpStream'); + } + + public function isWritable() + { + return false; + } + + public function write($string) + { + throw new \RuntimeException('Cannot write to a PumpStream'); + } + + public function isReadable() + { + return true; + } + + public function read($length) + { + $data = $this->buffer->read($length); + $readLen = strlen($data); + $this->tellPos += $readLen; + $remaining = $length - $readLen; + + if ($remaining) { + $this->pump($remaining); + $data .= $this->buffer->read($remaining); + $this->tellPos += strlen($data) - $readLen; + } + + return $data; + } + + public function getContents() + { + $result = ''; + while (!$this->eof()) { + $result .= $this->read(1000000); + } + + return $result; + } + + public function getMetadata($key = null) + { + if (!$key) { + return $this->metadata; + } + + return isset($this->metadata[$key]) ? $this->metadata[$key] : null; + } + + private function pump($length) + { + if ($this->source) { + do { + $data = call_user_func($this->source, $length); + if ($data === false || $data === null) { + $this->source = null; + return; + } + $this->buffer->write($data); + $length -= strlen($data); + } while ($length > 0); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Request.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Request.php new file mode 100644 index 0000000..59f337d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Request.php @@ -0,0 +1,151 @@ +assertMethod($method); + if (!($uri instanceof UriInterface)) { + $uri = new Uri($uri); + } + + $this->method = strtoupper($method); + $this->uri = $uri; + $this->setHeaders($headers); + $this->protocol = $version; + + if (!isset($this->headerNames['host'])) { + $this->updateHostFromUri(); + } + + if ($body !== '' && $body !== null) { + $this->stream = stream_for($body); + } + } + + public function getRequestTarget() + { + if ($this->requestTarget !== null) { + return $this->requestTarget; + } + + $target = $this->uri->getPath(); + if ($target == '') { + $target = '/'; + } + if ($this->uri->getQuery() != '') { + $target .= '?' . $this->uri->getQuery(); + } + + return $target; + } + + public function withRequestTarget($requestTarget) + { + if (preg_match('#\s#', $requestTarget)) { + throw new InvalidArgumentException( + 'Invalid request target provided; cannot contain whitespace' + ); + } + + $new = clone $this; + $new->requestTarget = $requestTarget; + return $new; + } + + public function getMethod() + { + return $this->method; + } + + public function withMethod($method) + { + $this->assertMethod($method); + $new = clone $this; + $new->method = strtoupper($method); + return $new; + } + + public function getUri() + { + return $this->uri; + } + + public function withUri(UriInterface $uri, $preserveHost = false) + { + if ($uri === $this->uri) { + return $this; + } + + $new = clone $this; + $new->uri = $uri; + + if (!$preserveHost || !isset($this->headerNames['host'])) { + $new->updateHostFromUri(); + } + + return $new; + } + + private function updateHostFromUri() + { + $host = $this->uri->getHost(); + + if ($host == '') { + return; + } + + if (($port = $this->uri->getPort()) !== null) { + $host .= ':' . $port; + } + + if (isset($this->headerNames['host'])) { + $header = $this->headerNames['host']; + } else { + $header = 'Host'; + $this->headerNames['host'] = 'Host'; + } + // Ensure Host is the first header. + // See: http://tools.ietf.org/html/rfc7230#section-5.4 + $this->headers = [$header => [$host]] + $this->headers; + } + + private function assertMethod($method) + { + if (!is_string($method) || $method === '') { + throw new \InvalidArgumentException('Method must be a non-empty string.'); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Response.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Response.php new file mode 100644 index 0000000..e7e04d8 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Response.php @@ -0,0 +1,154 @@ + 'Continue', + 101 => 'Switching Protocols', + 102 => 'Processing', + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + 207 => 'Multi-status', + 208 => 'Already Reported', + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 306 => 'Switch Proxy', + 307 => 'Temporary Redirect', + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Time-out', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Large', + 415 => 'Unsupported Media Type', + 416 => 'Requested range not satisfiable', + 417 => 'Expectation Failed', + 418 => 'I\'m a teapot', + 422 => 'Unprocessable Entity', + 423 => 'Locked', + 424 => 'Failed Dependency', + 425 => 'Unordered Collection', + 426 => 'Upgrade Required', + 428 => 'Precondition Required', + 429 => 'Too Many Requests', + 431 => 'Request Header Fields Too Large', + 451 => 'Unavailable For Legal Reasons', + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Time-out', + 505 => 'HTTP Version not supported', + 506 => 'Variant Also Negotiates', + 507 => 'Insufficient Storage', + 508 => 'Loop Detected', + 511 => 'Network Authentication Required', + ]; + + /** @var string */ + private $reasonPhrase = ''; + + /** @var int */ + private $statusCode = 200; + + /** + * @param int $status Status code + * @param array $headers Response headers + * @param string|null|resource|StreamInterface $body Response body + * @param string $version Protocol version + * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) + */ + public function __construct( + $status = 200, + array $headers = [], + $body = null, + $version = '1.1', + $reason = null + ) { + $this->assertStatusCodeIsInteger($status); + $status = (int) $status; + $this->assertStatusCodeRange($status); + + $this->statusCode = $status; + + if ($body !== '' && $body !== null) { + $this->stream = stream_for($body); + } + + $this->setHeaders($headers); + if ($reason == '' && isset(self::$phrases[$this->statusCode])) { + $this->reasonPhrase = self::$phrases[$this->statusCode]; + } else { + $this->reasonPhrase = (string) $reason; + } + + $this->protocol = $version; + } + + public function getStatusCode() + { + return $this->statusCode; + } + + public function getReasonPhrase() + { + return $this->reasonPhrase; + } + + public function withStatus($code, $reasonPhrase = '') + { + $this->assertStatusCodeIsInteger($code); + $code = (int) $code; + $this->assertStatusCodeRange($code); + + $new = clone $this; + $new->statusCode = $code; + if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) { + $reasonPhrase = self::$phrases[$new->statusCode]; + } + $new->reasonPhrase = $reasonPhrase; + return $new; + } + + private function assertStatusCodeIsInteger($statusCode) + { + if (filter_var($statusCode, FILTER_VALIDATE_INT) === false) { + throw new \InvalidArgumentException('Status code must be an integer value.'); + } + } + + private function assertStatusCodeRange($statusCode) + { + if ($statusCode < 100 || $statusCode >= 600) { + throw new \InvalidArgumentException('Status code must be an integer value between 1xx and 5xx.'); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Rfc7230.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Rfc7230.php new file mode 100644 index 0000000..505e474 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Rfc7230.php @@ -0,0 +1,18 @@ +@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; + const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)"; +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/ServerRequest.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/ServerRequest.php new file mode 100644 index 0000000..1a09a6c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -0,0 +1,376 @@ +serverParams = $serverParams; + + parent::__construct($method, $uri, $headers, $body, $version); + } + + /** + * Return an UploadedFile instance array. + * + * @param array $files A array which respect $_FILES structure + * @throws InvalidArgumentException for unrecognized values + * @return array + */ + public static function normalizeFiles(array $files) + { + $normalized = []; + + foreach ($files as $key => $value) { + if ($value instanceof UploadedFileInterface) { + $normalized[$key] = $value; + } elseif (is_array($value) && isset($value['tmp_name'])) { + $normalized[$key] = self::createUploadedFileFromSpec($value); + } elseif (is_array($value)) { + $normalized[$key] = self::normalizeFiles($value); + continue; + } else { + throw new InvalidArgumentException('Invalid value in files specification'); + } + } + + return $normalized; + } + + /** + * Create and return an UploadedFile instance from a $_FILES specification. + * + * If the specification represents an array of values, this method will + * delegate to normalizeNestedFileSpec() and return that return value. + * + * @param array $value $_FILES struct + * @return array|UploadedFileInterface + */ + private static function createUploadedFileFromSpec(array $value) + { + if (is_array($value['tmp_name'])) { + return self::normalizeNestedFileSpec($value); + } + + return new UploadedFile( + $value['tmp_name'], + (int) $value['size'], + (int) $value['error'], + $value['name'], + $value['type'] + ); + } + + /** + * Normalize an array of file specifications. + * + * Loops through all nested files and returns a normalized array of + * UploadedFileInterface instances. + * + * @param array $files + * @return UploadedFileInterface[] + */ + private static function normalizeNestedFileSpec(array $files = []) + { + $normalizedFiles = []; + + foreach (array_keys($files['tmp_name']) as $key) { + $spec = [ + 'tmp_name' => $files['tmp_name'][$key], + 'size' => $files['size'][$key], + 'error' => $files['error'][$key], + 'name' => $files['name'][$key], + 'type' => $files['type'][$key], + ]; + $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); + } + + return $normalizedFiles; + } + + /** + * Return a ServerRequest populated with superglobals: + * $_GET + * $_POST + * $_COOKIE + * $_FILES + * $_SERVER + * + * @return ServerRequestInterface + */ + public static function fromGlobals() + { + $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'; + $headers = getallheaders(); + $uri = self::getUriFromGlobals(); + $body = new CachingStream(new LazyOpenStream('php://input', 'r+')); + $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1'; + + $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER); + + return $serverRequest + ->withCookieParams($_COOKIE) + ->withQueryParams($_GET) + ->withParsedBody($_POST) + ->withUploadedFiles(self::normalizeFiles($_FILES)); + } + + private static function extractHostAndPortFromAuthority($authority) + { + $uri = 'http://'.$authority; + $parts = parse_url($uri); + if (false === $parts) { + return [null, null]; + } + + $host = isset($parts['host']) ? $parts['host'] : null; + $port = isset($parts['port']) ? $parts['port'] : null; + + return [$host, $port]; + } + + /** + * Get a Uri populated with values from $_SERVER. + * + * @return UriInterface + */ + public static function getUriFromGlobals() + { + $uri = new Uri(''); + + $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http'); + + $hasPort = false; + if (isset($_SERVER['HTTP_HOST'])) { + list($host, $port) = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']); + if ($host !== null) { + $uri = $uri->withHost($host); + } + + if ($port !== null) { + $hasPort = true; + $uri = $uri->withPort($port); + } + } elseif (isset($_SERVER['SERVER_NAME'])) { + $uri = $uri->withHost($_SERVER['SERVER_NAME']); + } elseif (isset($_SERVER['SERVER_ADDR'])) { + $uri = $uri->withHost($_SERVER['SERVER_ADDR']); + } + + if (!$hasPort && isset($_SERVER['SERVER_PORT'])) { + $uri = $uri->withPort($_SERVER['SERVER_PORT']); + } + + $hasQuery = false; + if (isset($_SERVER['REQUEST_URI'])) { + $requestUriParts = explode('?', $_SERVER['REQUEST_URI'], 2); + $uri = $uri->withPath($requestUriParts[0]); + if (isset($requestUriParts[1])) { + $hasQuery = true; + $uri = $uri->withQuery($requestUriParts[1]); + } + } + + if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) { + $uri = $uri->withQuery($_SERVER['QUERY_STRING']); + } + + return $uri; + } + + + /** + * {@inheritdoc} + */ + public function getServerParams() + { + return $this->serverParams; + } + + /** + * {@inheritdoc} + */ + public function getUploadedFiles() + { + return $this->uploadedFiles; + } + + /** + * {@inheritdoc} + */ + public function withUploadedFiles(array $uploadedFiles) + { + $new = clone $this; + $new->uploadedFiles = $uploadedFiles; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getCookieParams() + { + return $this->cookieParams; + } + + /** + * {@inheritdoc} + */ + public function withCookieParams(array $cookies) + { + $new = clone $this; + $new->cookieParams = $cookies; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getQueryParams() + { + return $this->queryParams; + } + + /** + * {@inheritdoc} + */ + public function withQueryParams(array $query) + { + $new = clone $this; + $new->queryParams = $query; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getParsedBody() + { + return $this->parsedBody; + } + + /** + * {@inheritdoc} + */ + public function withParsedBody($data) + { + $new = clone $this; + $new->parsedBody = $data; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * {@inheritdoc} + */ + public function getAttribute($attribute, $default = null) + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $default; + } + + return $this->attributes[$attribute]; + } + + /** + * {@inheritdoc} + */ + public function withAttribute($attribute, $value) + { + $new = clone $this; + $new->attributes[$attribute] = $value; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function withoutAttribute($attribute) + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $this; + } + + $new = clone $this; + unset($new->attributes[$attribute]); + + return $new; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Stream.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Stream.php new file mode 100644 index 0000000..d9e7409 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Stream.php @@ -0,0 +1,267 @@ +size = $options['size']; + } + + $this->customMetadata = isset($options['metadata']) + ? $options['metadata'] + : []; + + $this->stream = $stream; + $meta = stream_get_meta_data($this->stream); + $this->seekable = $meta['seekable']; + $this->readable = (bool)preg_match(self::READABLE_MODES, $meta['mode']); + $this->writable = (bool)preg_match(self::WRITABLE_MODES, $meta['mode']); + $this->uri = $this->getMetadata('uri'); + } + + /** + * Closes the stream when the destructed + */ + public function __destruct() + { + $this->close(); + } + + public function __toString() + { + try { + $this->seek(0); + return (string) stream_get_contents($this->stream); + } catch (\Exception $e) { + return ''; + } + } + + public function getContents() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $contents = stream_get_contents($this->stream); + + if ($contents === false) { + throw new \RuntimeException('Unable to read stream contents'); + } + + return $contents; + } + + public function close() + { + if (isset($this->stream)) { + if (is_resource($this->stream)) { + fclose($this->stream); + } + $this->detach(); + } + } + + public function detach() + { + if (!isset($this->stream)) { + return null; + } + + $result = $this->stream; + unset($this->stream); + $this->size = $this->uri = null; + $this->readable = $this->writable = $this->seekable = false; + + return $result; + } + + public function getSize() + { + if ($this->size !== null) { + return $this->size; + } + + if (!isset($this->stream)) { + return null; + } + + // Clear the stat cache if the stream has a URI + if ($this->uri) { + clearstatcache(true, $this->uri); + } + + $stats = fstat($this->stream); + if (isset($stats['size'])) { + $this->size = $stats['size']; + return $this->size; + } + + return null; + } + + public function isReadable() + { + return $this->readable; + } + + public function isWritable() + { + return $this->writable; + } + + public function isSeekable() + { + return $this->seekable; + } + + public function eof() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + return feof($this->stream); + } + + public function tell() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $result = ftell($this->stream); + + if ($result === false) { + throw new \RuntimeException('Unable to determine stream position'); + } + + return $result; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + $whence = (int) $whence; + + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->seekable) { + throw new \RuntimeException('Stream is not seekable'); + } + if (fseek($this->stream, $offset, $whence) === -1) { + throw new \RuntimeException('Unable to seek to stream position ' + . $offset . ' with whence ' . var_export($whence, true)); + } + } + + public function read($length) + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->readable) { + throw new \RuntimeException('Cannot read from non-readable stream'); + } + if ($length < 0) { + throw new \RuntimeException('Length parameter cannot be negative'); + } + + if (0 === $length) { + return ''; + } + + $string = fread($this->stream, $length); + if (false === $string) { + throw new \RuntimeException('Unable to read from stream'); + } + + return $string; + } + + public function write($string) + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->writable) { + throw new \RuntimeException('Cannot write to a non-writable stream'); + } + + // We can't know the size after writing anything + $this->size = null; + $result = fwrite($this->stream, $string); + + if ($result === false) { + throw new \RuntimeException('Unable to write to stream'); + } + + return $result; + } + + public function getMetadata($key = null) + { + if (!isset($this->stream)) { + return $key ? null : []; + } elseif (!$key) { + return $this->customMetadata + stream_get_meta_data($this->stream); + } elseif (isset($this->customMetadata[$key])) { + return $this->customMetadata[$key]; + } + + $meta = stream_get_meta_data($this->stream); + + return isset($meta[$key]) ? $meta[$key] : null; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php new file mode 100644 index 0000000..daec6f5 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php @@ -0,0 +1,149 @@ +stream = $stream; + } + + /** + * Magic method used to create a new stream if streams are not added in + * the constructor of a decorator (e.g., LazyOpenStream). + * + * @param string $name Name of the property (allows "stream" only). + * + * @return StreamInterface + */ + public function __get($name) + { + if ($name == 'stream') { + $this->stream = $this->createStream(); + return $this->stream; + } + + throw new \UnexpectedValueException("$name not found on class"); + } + + public function __toString() + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + return $this->getContents(); + } catch (\Exception $e) { + // Really, PHP? https://bugs.php.net/bug.php?id=53648 + trigger_error('StreamDecorator::__toString exception: ' + . (string) $e, E_USER_ERROR); + return ''; + } + } + + public function getContents() + { + return copy_to_string($this); + } + + /** + * Allow decorators to implement custom methods + * + * @param string $method Missing method name + * @param array $args Method arguments + * + * @return mixed + */ + public function __call($method, array $args) + { + $result = call_user_func_array([$this->stream, $method], $args); + + // Always return the wrapped object if the result is a return $this + return $result === $this->stream ? $this : $result; + } + + public function close() + { + $this->stream->close(); + } + + public function getMetadata($key = null) + { + return $this->stream->getMetadata($key); + } + + public function detach() + { + return $this->stream->detach(); + } + + public function getSize() + { + return $this->stream->getSize(); + } + + public function eof() + { + return $this->stream->eof(); + } + + public function tell() + { + return $this->stream->tell(); + } + + public function isReadable() + { + return $this->stream->isReadable(); + } + + public function isWritable() + { + return $this->stream->isWritable(); + } + + public function isSeekable() + { + return $this->stream->isSeekable(); + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + $this->stream->seek($offset, $whence); + } + + public function read($length) + { + return $this->stream->read($length); + } + + public function write($string) + { + return $this->stream->write($string); + } + + /** + * Implement in subclasses to dynamically create streams when requested. + * + * @return StreamInterface + * @throws \BadMethodCallException + */ + protected function createStream() + { + throw new \BadMethodCallException('Not implemented'); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/StreamWrapper.php new file mode 100644 index 0000000..0f3a285 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/StreamWrapper.php @@ -0,0 +1,161 @@ +isReadable()) { + $mode = $stream->isWritable() ? 'r+' : 'r'; + } elseif ($stream->isWritable()) { + $mode = 'w'; + } else { + throw new \InvalidArgumentException('The stream must be readable, ' + . 'writable, or both.'); + } + + return fopen('guzzle://stream', $mode, null, self::createStreamContext($stream)); + } + + /** + * Creates a stream context that can be used to open a stream as a php stream resource. + * + * @param StreamInterface $stream + * + * @return resource + */ + public static function createStreamContext(StreamInterface $stream) + { + return stream_context_create([ + 'guzzle' => ['stream' => $stream] + ]); + } + + /** + * Registers the stream wrapper if needed + */ + public static function register() + { + if (!in_array('guzzle', stream_get_wrappers())) { + stream_wrapper_register('guzzle', __CLASS__); + } + } + + public function stream_open($path, $mode, $options, &$opened_path) + { + $options = stream_context_get_options($this->context); + + if (!isset($options['guzzle']['stream'])) { + return false; + } + + $this->mode = $mode; + $this->stream = $options['guzzle']['stream']; + + return true; + } + + public function stream_read($count) + { + return $this->stream->read($count); + } + + public function stream_write($data) + { + return (int) $this->stream->write($data); + } + + public function stream_tell() + { + return $this->stream->tell(); + } + + public function stream_eof() + { + return $this->stream->eof(); + } + + public function stream_seek($offset, $whence) + { + $this->stream->seek($offset, $whence); + + return true; + } + + public function stream_cast($cast_as) + { + $stream = clone($this->stream); + + return $stream->detach(); + } + + public function stream_stat() + { + static $modeMap = [ + 'r' => 33060, + 'rb' => 33060, + 'r+' => 33206, + 'w' => 33188, + 'wb' => 33188 + ]; + + return [ + 'dev' => 0, + 'ino' => 0, + 'mode' => $modeMap[$this->mode], + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => $this->stream->getSize() ?: 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0 + ]; + } + + public function url_stat($path, $flags) + { + return [ + 'dev' => 0, + 'ino' => 0, + 'mode' => 0, + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0 + ]; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/UploadedFile.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/UploadedFile.php new file mode 100644 index 0000000..e62bd5c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/UploadedFile.php @@ -0,0 +1,316 @@ +setError($errorStatus); + $this->setSize($size); + $this->setClientFilename($clientFilename); + $this->setClientMediaType($clientMediaType); + + if ($this->isOk()) { + $this->setStreamOrFile($streamOrFile); + } + } + + /** + * Depending on the value set file or stream variable + * + * @param mixed $streamOrFile + * @throws InvalidArgumentException + */ + private function setStreamOrFile($streamOrFile) + { + if (is_string($streamOrFile)) { + $this->file = $streamOrFile; + } elseif (is_resource($streamOrFile)) { + $this->stream = new Stream($streamOrFile); + } elseif ($streamOrFile instanceof StreamInterface) { + $this->stream = $streamOrFile; + } else { + throw new InvalidArgumentException( + 'Invalid stream or file provided for UploadedFile' + ); + } + } + + /** + * @param int $error + * @throws InvalidArgumentException + */ + private function setError($error) + { + if (false === is_int($error)) { + throw new InvalidArgumentException( + 'Upload file error status must be an integer' + ); + } + + if (false === in_array($error, UploadedFile::$errors)) { + throw new InvalidArgumentException( + 'Invalid error status for UploadedFile' + ); + } + + $this->error = $error; + } + + /** + * @param int $size + * @throws InvalidArgumentException + */ + private function setSize($size) + { + if (false === is_int($size)) { + throw new InvalidArgumentException( + 'Upload file size must be an integer' + ); + } + + $this->size = $size; + } + + /** + * @param mixed $param + * @return boolean + */ + private function isStringOrNull($param) + { + return in_array(gettype($param), ['string', 'NULL']); + } + + /** + * @param mixed $param + * @return boolean + */ + private function isStringNotEmpty($param) + { + return is_string($param) && false === empty($param); + } + + /** + * @param string|null $clientFilename + * @throws InvalidArgumentException + */ + private function setClientFilename($clientFilename) + { + if (false === $this->isStringOrNull($clientFilename)) { + throw new InvalidArgumentException( + 'Upload file client filename must be a string or null' + ); + } + + $this->clientFilename = $clientFilename; + } + + /** + * @param string|null $clientMediaType + * @throws InvalidArgumentException + */ + private function setClientMediaType($clientMediaType) + { + if (false === $this->isStringOrNull($clientMediaType)) { + throw new InvalidArgumentException( + 'Upload file client media type must be a string or null' + ); + } + + $this->clientMediaType = $clientMediaType; + } + + /** + * Return true if there is no upload error + * + * @return boolean + */ + private function isOk() + { + return $this->error === UPLOAD_ERR_OK; + } + + /** + * @return boolean + */ + public function isMoved() + { + return $this->moved; + } + + /** + * @throws RuntimeException if is moved or not ok + */ + private function validateActive() + { + if (false === $this->isOk()) { + throw new RuntimeException('Cannot retrieve stream due to upload error'); + } + + if ($this->isMoved()) { + throw new RuntimeException('Cannot retrieve stream after it has already been moved'); + } + } + + /** + * {@inheritdoc} + * @throws RuntimeException if the upload was not successful. + */ + public function getStream() + { + $this->validateActive(); + + if ($this->stream instanceof StreamInterface) { + return $this->stream; + } + + return new LazyOpenStream($this->file, 'r+'); + } + + /** + * {@inheritdoc} + * + * @see http://php.net/is_uploaded_file + * @see http://php.net/move_uploaded_file + * @param string $targetPath Path to which to move the uploaded file. + * @throws RuntimeException if the upload was not successful. + * @throws InvalidArgumentException if the $path specified is invalid. + * @throws RuntimeException on any error during the move operation, or on + * the second or subsequent call to the method. + */ + public function moveTo($targetPath) + { + $this->validateActive(); + + if (false === $this->isStringNotEmpty($targetPath)) { + throw new InvalidArgumentException( + 'Invalid path provided for move operation; must be a non-empty string' + ); + } + + if ($this->file) { + $this->moved = php_sapi_name() == 'cli' + ? rename($this->file, $targetPath) + : move_uploaded_file($this->file, $targetPath); + } else { + copy_to_stream( + $this->getStream(), + new LazyOpenStream($targetPath, 'w') + ); + + $this->moved = true; + } + + if (false === $this->moved) { + throw new RuntimeException( + sprintf('Uploaded file could not be moved to %s', $targetPath) + ); + } + } + + /** + * {@inheritdoc} + * + * @return int|null The file size in bytes or null if unknown. + */ + public function getSize() + { + return $this->size; + } + + /** + * {@inheritdoc} + * + * @see http://php.net/manual/en/features.file-upload.errors.php + * @return int One of PHP's UPLOAD_ERR_XXX constants. + */ + public function getError() + { + return $this->error; + } + + /** + * {@inheritdoc} + * + * @return string|null The filename sent by the client or null if none + * was provided. + */ + public function getClientFilename() + { + return $this->clientFilename; + } + + /** + * {@inheritdoc} + */ + public function getClientMediaType() + { + return $this->clientMediaType; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Uri.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Uri.php new file mode 100644 index 0000000..825a25e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/Uri.php @@ -0,0 +1,760 @@ + 80, + 'https' => 443, + 'ftp' => 21, + 'gopher' => 70, + 'nntp' => 119, + 'news' => 119, + 'telnet' => 23, + 'tn3270' => 23, + 'imap' => 143, + 'pop' => 110, + 'ldap' => 389, + ]; + + private static $charUnreserved = 'a-zA-Z0-9_\-\.~'; + private static $charSubDelims = '!\$&\'\(\)\*\+,;='; + private static $replaceQuery = ['=' => '%3D', '&' => '%26']; + + /** @var string Uri scheme. */ + private $scheme = ''; + + /** @var string Uri user info. */ + private $userInfo = ''; + + /** @var string Uri host. */ + private $host = ''; + + /** @var int|null Uri port. */ + private $port; + + /** @var string Uri path. */ + private $path = ''; + + /** @var string Uri query string. */ + private $query = ''; + + /** @var string Uri fragment. */ + private $fragment = ''; + + /** + * @param string $uri URI to parse + */ + public function __construct($uri = '') + { + // weak type check to also accept null until we can add scalar type hints + if ($uri != '') { + $parts = parse_url($uri); + if ($parts === false) { + throw new \InvalidArgumentException("Unable to parse URI: $uri"); + } + $this->applyParts($parts); + } + } + + public function __toString() + { + return self::composeComponents( + $this->scheme, + $this->getAuthority(), + $this->path, + $this->query, + $this->fragment + ); + } + + /** + * Composes a URI reference string from its various components. + * + * Usually this method does not need to be called manually but instead is used indirectly via + * `Psr\Http\Message\UriInterface::__toString`. + * + * PSR-7 UriInterface treats an empty component the same as a missing component as + * getQuery(), getFragment() etc. always return a string. This explains the slight + * difference to RFC 3986 Section 5.3. + * + * Another adjustment is that the authority separator is added even when the authority is missing/empty + * for the "file" scheme. This is because PHP stream functions like `file_get_contents` only work with + * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But + * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to + * that format). + * + * @param string $scheme + * @param string $authority + * @param string $path + * @param string $query + * @param string $fragment + * + * @return string + * + * @link https://tools.ietf.org/html/rfc3986#section-5.3 + */ + public static function composeComponents($scheme, $authority, $path, $query, $fragment) + { + $uri = ''; + + // weak type checks to also accept null until we can add scalar type hints + if ($scheme != '') { + $uri .= $scheme . ':'; + } + + if ($authority != ''|| $scheme === 'file') { + $uri .= '//' . $authority; + } + + $uri .= $path; + + if ($query != '') { + $uri .= '?' . $query; + } + + if ($fragment != '') { + $uri .= '#' . $fragment; + } + + return $uri; + } + + /** + * Whether the URI has the default port of the current scheme. + * + * `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used + * independently of the implementation. + * + * @param UriInterface $uri + * + * @return bool + */ + public static function isDefaultPort(UriInterface $uri) + { + return $uri->getPort() === null + || (isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()]); + } + + /** + * Whether the URI is absolute, i.e. it has a scheme. + * + * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true + * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative + * to another URI, the base URI. Relative references can be divided into several forms: + * - network-path references, e.g. '//example.com/path' + * - absolute-path references, e.g. '/path' + * - relative-path references, e.g. 'subpath' + * + * @param UriInterface $uri + * + * @return bool + * @see Uri::isNetworkPathReference + * @see Uri::isAbsolutePathReference + * @see Uri::isRelativePathReference + * @link https://tools.ietf.org/html/rfc3986#section-4 + */ + public static function isAbsolute(UriInterface $uri) + { + return $uri->getScheme() !== ''; + } + + /** + * Whether the URI is a network-path reference. + * + * A relative reference that begins with two slash characters is termed an network-path reference. + * + * @param UriInterface $uri + * + * @return bool + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isNetworkPathReference(UriInterface $uri) + { + return $uri->getScheme() === '' && $uri->getAuthority() !== ''; + } + + /** + * Whether the URI is a absolute-path reference. + * + * A relative reference that begins with a single slash character is termed an absolute-path reference. + * + * @param UriInterface $uri + * + * @return bool + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isAbsolutePathReference(UriInterface $uri) + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && isset($uri->getPath()[0]) + && $uri->getPath()[0] === '/'; + } + + /** + * Whether the URI is a relative-path reference. + * + * A relative reference that does not begin with a slash character is termed a relative-path reference. + * + * @param UriInterface $uri + * + * @return bool + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isRelativePathReference(UriInterface $uri) + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/'); + } + + /** + * Whether the URI is a same-document reference. + * + * A same-document reference refers to a URI that is, aside from its fragment + * component, identical to the base URI. When no base URI is given, only an empty + * URI reference (apart from its fragment) is considered a same-document reference. + * + * @param UriInterface $uri The URI to check + * @param UriInterface|null $base An optional base URI to compare against + * + * @return bool + * @link https://tools.ietf.org/html/rfc3986#section-4.4 + */ + public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null) + { + if ($base !== null) { + $uri = UriResolver::resolve($base, $uri); + + return ($uri->getScheme() === $base->getScheme()) + && ($uri->getAuthority() === $base->getAuthority()) + && ($uri->getPath() === $base->getPath()) + && ($uri->getQuery() === $base->getQuery()); + } + + return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === ''; + } + + /** + * Removes dot segments from a path and returns the new path. + * + * @param string $path + * + * @return string + * + * @deprecated since version 1.4. Use UriResolver::removeDotSegments instead. + * @see UriResolver::removeDotSegments + */ + public static function removeDotSegments($path) + { + return UriResolver::removeDotSegments($path); + } + + /** + * Converts the relative URI into a new URI that is resolved against the base URI. + * + * @param UriInterface $base Base URI + * @param string|UriInterface $rel Relative URI + * + * @return UriInterface + * + * @deprecated since version 1.4. Use UriResolver::resolve instead. + * @see UriResolver::resolve + */ + public static function resolve(UriInterface $base, $rel) + { + if (!($rel instanceof UriInterface)) { + $rel = new self($rel); + } + + return UriResolver::resolve($base, $rel); + } + + /** + * Creates a new URI with a specific query string value removed. + * + * Any existing query string values that exactly match the provided key are + * removed. + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Query string key to remove. + * + * @return UriInterface + */ + public static function withoutQueryValue(UriInterface $uri, $key) + { + $result = self::getFilteredQueryString($uri, [$key]); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with a specific query string value. + * + * Any existing query string values that exactly match the provided key are + * removed and replaced with the given key value pair. + * + * A value of null will set the query string key without a value, e.g. "key" + * instead of "key=value". + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Key to set. + * @param string|null $value Value to set + * + * @return UriInterface + */ + public static function withQueryValue(UriInterface $uri, $key, $value) + { + $result = self::getFilteredQueryString($uri, [$key]); + + $result[] = self::generateQueryString($key, $value); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with multiple specific query string values. + * + * It has the same behavior as withQueryValue() but for an associative array of key => value. + * + * @param UriInterface $uri URI to use as a base. + * @param array $keyValueArray Associative array of key and values + * + * @return UriInterface + */ + public static function withQueryValues(UriInterface $uri, array $keyValueArray) + { + $result = self::getFilteredQueryString($uri, array_keys($keyValueArray)); + + foreach ($keyValueArray as $key => $value) { + $result[] = self::generateQueryString($key, $value); + } + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a URI from a hash of `parse_url` components. + * + * @param array $parts + * + * @return UriInterface + * @link http://php.net/manual/en/function.parse-url.php + * + * @throws \InvalidArgumentException If the components do not form a valid URI. + */ + public static function fromParts(array $parts) + { + $uri = new self(); + $uri->applyParts($parts); + $uri->validateState(); + + return $uri; + } + + public function getScheme() + { + return $this->scheme; + } + + public function getAuthority() + { + $authority = $this->host; + if ($this->userInfo !== '') { + $authority = $this->userInfo . '@' . $authority; + } + + if ($this->port !== null) { + $authority .= ':' . $this->port; + } + + return $authority; + } + + public function getUserInfo() + { + return $this->userInfo; + } + + public function getHost() + { + return $this->host; + } + + public function getPort() + { + return $this->port; + } + + public function getPath() + { + return $this->path; + } + + public function getQuery() + { + return $this->query; + } + + public function getFragment() + { + return $this->fragment; + } + + public function withScheme($scheme) + { + $scheme = $this->filterScheme($scheme); + + if ($this->scheme === $scheme) { + return $this; + } + + $new = clone $this; + $new->scheme = $scheme; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withUserInfo($user, $password = null) + { + $info = $this->filterUserInfoComponent($user); + if ($password !== null) { + $info .= ':' . $this->filterUserInfoComponent($password); + } + + if ($this->userInfo === $info) { + return $this; + } + + $new = clone $this; + $new->userInfo = $info; + $new->validateState(); + + return $new; + } + + public function withHost($host) + { + $host = $this->filterHost($host); + + if ($this->host === $host) { + return $this; + } + + $new = clone $this; + $new->host = $host; + $new->validateState(); + + return $new; + } + + public function withPort($port) + { + $port = $this->filterPort($port); + + if ($this->port === $port) { + return $this; + } + + $new = clone $this; + $new->port = $port; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withPath($path) + { + $path = $this->filterPath($path); + + if ($this->path === $path) { + return $this; + } + + $new = clone $this; + $new->path = $path; + $new->validateState(); + + return $new; + } + + public function withQuery($query) + { + $query = $this->filterQueryAndFragment($query); + + if ($this->query === $query) { + return $this; + } + + $new = clone $this; + $new->query = $query; + + return $new; + } + + public function withFragment($fragment) + { + $fragment = $this->filterQueryAndFragment($fragment); + + if ($this->fragment === $fragment) { + return $this; + } + + $new = clone $this; + $new->fragment = $fragment; + + return $new; + } + + /** + * Apply parse_url parts to a URI. + * + * @param array $parts Array of parse_url parts to apply. + */ + private function applyParts(array $parts) + { + $this->scheme = isset($parts['scheme']) + ? $this->filterScheme($parts['scheme']) + : ''; + $this->userInfo = isset($parts['user']) + ? $this->filterUserInfoComponent($parts['user']) + : ''; + $this->host = isset($parts['host']) + ? $this->filterHost($parts['host']) + : ''; + $this->port = isset($parts['port']) + ? $this->filterPort($parts['port']) + : null; + $this->path = isset($parts['path']) + ? $this->filterPath($parts['path']) + : ''; + $this->query = isset($parts['query']) + ? $this->filterQueryAndFragment($parts['query']) + : ''; + $this->fragment = isset($parts['fragment']) + ? $this->filterQueryAndFragment($parts['fragment']) + : ''; + if (isset($parts['pass'])) { + $this->userInfo .= ':' . $this->filterUserInfoComponent($parts['pass']); + } + + $this->removeDefaultPort(); + } + + /** + * @param string $scheme + * + * @return string + * + * @throws \InvalidArgumentException If the scheme is invalid. + */ + private function filterScheme($scheme) + { + if (!is_string($scheme)) { + throw new \InvalidArgumentException('Scheme must be a string'); + } + + return strtolower($scheme); + } + + /** + * @param string $component + * + * @return string + * + * @throws \InvalidArgumentException If the user info is invalid. + */ + private function filterUserInfoComponent($component) + { + if (!is_string($component)) { + throw new \InvalidArgumentException('User info must be a string'); + } + + return preg_replace_callback( + '/(?:[^%' . self::$charUnreserved . self::$charSubDelims . ']+|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $component + ); + } + + /** + * @param string $host + * + * @return string + * + * @throws \InvalidArgumentException If the host is invalid. + */ + private function filterHost($host) + { + if (!is_string($host)) { + throw new \InvalidArgumentException('Host must be a string'); + } + + return strtolower($host); + } + + /** + * @param int|null $port + * + * @return int|null + * + * @throws \InvalidArgumentException If the port is invalid. + */ + private function filterPort($port) + { + if ($port === null) { + return null; + } + + $port = (int) $port; + if (0 > $port || 0xffff < $port) { + throw new \InvalidArgumentException( + sprintf('Invalid port: %d. Must be between 0 and 65535', $port) + ); + } + + return $port; + } + + /** + * @param UriInterface $uri + * @param array $keys + * + * @return array + */ + private static function getFilteredQueryString(UriInterface $uri, array $keys) + { + $current = $uri->getQuery(); + + if ($current === '') { + return []; + } + + $decodedKeys = array_map('rawurldecode', $keys); + + return array_filter(explode('&', $current), function ($part) use ($decodedKeys) { + return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true); + }); + } + + /** + * @param string $key + * @param string|null $value + * + * @return string + */ + private static function generateQueryString($key, $value) + { + // Query string separators ("=", "&") within the key or value need to be encoded + // (while preventing double-encoding) before setting the query string. All other + // chars that need percent-encoding will be encoded by withQuery(). + $queryString = strtr($key, self::$replaceQuery); + + if ($value !== null) { + $queryString .= '=' . strtr($value, self::$replaceQuery); + } + + return $queryString; + } + + private function removeDefaultPort() + { + if ($this->port !== null && self::isDefaultPort($this)) { + $this->port = null; + } + } + + /** + * Filters the path of a URI + * + * @param string $path + * + * @return string + * + * @throws \InvalidArgumentException If the path is invalid. + */ + private function filterPath($path) + { + if (!is_string($path)) { + throw new \InvalidArgumentException('Path must be a string'); + } + + return preg_replace_callback( + '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $path + ); + } + + /** + * Filters the query string or fragment of a URI. + * + * @param string $str + * + * @return string + * + * @throws \InvalidArgumentException If the query or fragment is invalid. + */ + private function filterQueryAndFragment($str) + { + if (!is_string($str)) { + throw new \InvalidArgumentException('Query and fragment must be a string'); + } + + return preg_replace_callback( + '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $str + ); + } + + private function rawurlencodeMatchZero(array $match) + { + return rawurlencode($match[0]); + } + + private function validateState() + { + if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) { + $this->host = self::HTTP_DEFAULT_HOST; + } + + if ($this->getAuthority() === '') { + if (0 === strpos($this->path, '//')) { + throw new \InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"'); + } + if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) { + throw new \InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon'); + } + } elseif (isset($this->path[0]) && $this->path[0] !== '/') { + @trigger_error( + 'The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI ' . + 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.', + E_USER_DEPRECATED + ); + $this->path = '/'. $this->path; + //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty'); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/UriNormalizer.php new file mode 100644 index 0000000..384c29e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -0,0 +1,216 @@ +getPath() === '' && + ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') + ) { + $uri = $uri->withPath('/'); + } + + if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') { + $uri = $uri->withHost(''); + } + + if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) { + $uri = $uri->withPort(null); + } + + if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) { + $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath())); + } + + if ($flags & self::REMOVE_DUPLICATE_SLASHES) { + $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath())); + } + + if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { + $queryKeyValues = explode('&', $uri->getQuery()); + sort($queryKeyValues); + $uri = $uri->withQuery(implode('&', $queryKeyValues)); + } + + return $uri; + } + + /** + * Whether two URIs can be considered equivalent. + * + * Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also + * accepts relative URI references and returns true when they are equivalent. This of course assumes they will be + * resolved against the same base URI. If this is not the case, determination of equivalence or difference of + * relative references does not mean anything. + * + * @param UriInterface $uri1 An URI to compare + * @param UriInterface $uri2 An URI to compare + * @param int $normalizations A bitmask of normalizations to apply, see constants + * + * @return bool + * @link https://tools.ietf.org/html/rfc3986#section-6.1 + */ + public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS) + { + return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations); + } + + private static function capitalizePercentEncoding(UriInterface $uri) + { + $regex = '/(?:%[A-Fa-f0-9]{2})++/'; + + $callback = function (array $match) { + return strtoupper($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private static function decodeUnreservedCharacters(UriInterface $uri) + { + $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i'; + + $callback = function (array $match) { + return rawurldecode($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/UriResolver.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/UriResolver.php new file mode 100644 index 0000000..c1cb8a2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -0,0 +1,219 @@ +getScheme() != '') { + return $rel->withPath(self::removeDotSegments($rel->getPath())); + } + + if ($rel->getAuthority() != '') { + $targetAuthority = $rel->getAuthority(); + $targetPath = self::removeDotSegments($rel->getPath()); + $targetQuery = $rel->getQuery(); + } else { + $targetAuthority = $base->getAuthority(); + if ($rel->getPath() === '') { + $targetPath = $base->getPath(); + $targetQuery = $rel->getQuery() != '' ? $rel->getQuery() : $base->getQuery(); + } else { + if ($rel->getPath()[0] === '/') { + $targetPath = $rel->getPath(); + } else { + if ($targetAuthority != '' && $base->getPath() === '') { + $targetPath = '/' . $rel->getPath(); + } else { + $lastSlashPos = strrpos($base->getPath(), '/'); + if ($lastSlashPos === false) { + $targetPath = $rel->getPath(); + } else { + $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1) . $rel->getPath(); + } + } + } + $targetPath = self::removeDotSegments($targetPath); + $targetQuery = $rel->getQuery(); + } + } + + return new Uri(Uri::composeComponents( + $base->getScheme(), + $targetAuthority, + $targetPath, + $targetQuery, + $rel->getFragment() + )); + } + + /** + * Returns the target URI as a relative reference from the base URI. + * + * This method is the counterpart to resolve(): + * + * (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) + * + * One use-case is to use the current request URI as base URI and then generate relative links in your documents + * to reduce the document size or offer self-contained downloadable document archives. + * + * $base = new Uri('http://example.com/a/b/'); + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. + * echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. + * + * This method also accepts a target that is already relative and will try to relativize it further. Only a + * relative-path reference will be returned as-is. + * + * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well + * + * @param UriInterface $base Base URI + * @param UriInterface $target Target URI + * + * @return UriInterface The relative URI reference + */ + public static function relativize(UriInterface $base, UriInterface $target) + { + if ($target->getScheme() !== '' && + ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') + ) { + return $target; + } + + if (Uri::isRelativePathReference($target)) { + // As the target is already highly relative we return it as-is. It would be possible to resolve + // the target with `$target = self::resolve($base, $target);` and then try make it more relative + // by removing a duplicate query. But let's not do that automatically. + return $target; + } + + if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) { + return $target->withScheme(''); + } + + // We must remove the path before removing the authority because if the path starts with two slashes, the URI + // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also + // invalid. + $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost(''); + + if ($base->getPath() !== $target->getPath()) { + return $emptyPathUri->withPath(self::getRelativePath($base, $target)); + } + + if ($base->getQuery() === $target->getQuery()) { + // Only the target fragment is left. And it must be returned even if base and target fragment are the same. + return $emptyPathUri->withQuery(''); + } + + // If the base URI has a query but the target has none, we cannot return an empty path reference as it would + // inherit the base query component when resolving. + if ($target->getQuery() === '') { + $segments = explode('/', $target->getPath()); + $lastSegment = end($segments); + + return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment); + } + + return $emptyPathUri; + } + + private static function getRelativePath(UriInterface $base, UriInterface $target) + { + $sourceSegments = explode('/', $base->getPath()); + $targetSegments = explode('/', $target->getPath()); + array_pop($sourceSegments); + $targetLastSegment = array_pop($targetSegments); + foreach ($sourceSegments as $i => $segment) { + if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) { + unset($sourceSegments[$i], $targetSegments[$i]); + } else { + break; + } + } + $targetSegments[] = $targetLastSegment; + $relativePath = str_repeat('../', count($sourceSegments)) . implode('/', $targetSegments); + + // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./". + // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used + // as the first segment of a relative-path reference, as it would be mistaken for a scheme name. + if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) { + $relativePath = "./$relativePath"; + } elseif ('/' === $relativePath[0]) { + if ($base->getAuthority() != '' && $base->getPath() === '') { + // In this case an extra slash is added by resolve() automatically. So we must not add one here. + $relativePath = ".$relativePath"; + } else { + $relativePath = "./$relativePath"; + } + } + + return $relativePath; + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/functions.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/functions.php new file mode 100644 index 0000000..8e6dafe --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/functions.php @@ -0,0 +1,899 @@ +getMethod() . ' ' + . $message->getRequestTarget()) + . ' HTTP/' . $message->getProtocolVersion(); + if (!$message->hasHeader('host')) { + $msg .= "\r\nHost: " . $message->getUri()->getHost(); + } + } elseif ($message instanceof ResponseInterface) { + $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' + . $message->getStatusCode() . ' ' + . $message->getReasonPhrase(); + } else { + throw new \InvalidArgumentException('Unknown message type'); + } + + foreach ($message->getHeaders() as $name => $values) { + $msg .= "\r\n{$name}: " . implode(', ', $values); + } + + return "{$msg}\r\n\r\n" . $message->getBody(); +} + +/** + * Returns a UriInterface for the given value. + * + * This function accepts a string or {@see Psr\Http\Message\UriInterface} and + * returns a UriInterface for the given value. If the value is already a + * `UriInterface`, it is returned as-is. + * + * @param string|UriInterface $uri + * + * @return UriInterface + * @throws \InvalidArgumentException + */ +function uri_for($uri) +{ + if ($uri instanceof UriInterface) { + return $uri; + } elseif (is_string($uri)) { + return new Uri($uri); + } + + throw new \InvalidArgumentException('URI must be a string or UriInterface'); +} + +/** + * Create a new stream based on the input type. + * + * Options is an associative array that can contain the following keys: + * - metadata: Array of custom metadata. + * - size: Size of the stream. + * + * @param resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource Entity body data + * @param array $options Additional options + * + * @return StreamInterface + * @throws \InvalidArgumentException if the $resource arg is not valid. + */ +function stream_for($resource = '', array $options = []) +{ + if (is_scalar($resource)) { + $stream = fopen('php://temp', 'r+'); + if ($resource !== '') { + fwrite($stream, $resource); + fseek($stream, 0); + } + return new Stream($stream, $options); + } + + switch (gettype($resource)) { + case 'resource': + return new Stream($resource, $options); + case 'object': + if ($resource instanceof StreamInterface) { + return $resource; + } elseif ($resource instanceof \Iterator) { + return new PumpStream(function () use ($resource) { + if (!$resource->valid()) { + return false; + } + $result = $resource->current(); + $resource->next(); + return $result; + }, $options); + } elseif (method_exists($resource, '__toString')) { + return stream_for((string) $resource, $options); + } + break; + case 'NULL': + return new Stream(fopen('php://temp', 'r+'), $options); + } + + if (is_callable($resource)) { + return new PumpStream($resource, $options); + } + + throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); +} + +/** + * Parse an array of header values containing ";" separated data into an + * array of associative arrays representing the header key value pair + * data of the header. When a parameter does not contain a value, but just + * contains a key, this function will inject a key with a '' string value. + * + * @param string|array $header Header to parse into components. + * + * @return array Returns the parsed header values. + */ +function parse_header($header) +{ + static $trimmed = "\"' \n\t\r"; + $params = $matches = []; + + foreach (normalize_header($header) as $val) { + $part = []; + foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) { + if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) { + $m = $matches[0]; + if (isset($m[1])) { + $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); + } else { + $part[] = trim($m[0], $trimmed); + } + } + } + if ($part) { + $params[] = $part; + } + } + + return $params; +} + +/** + * Converts an array of header values that may contain comma separated + * headers into an array of headers with no comma separated values. + * + * @param string|array $header Header to normalize. + * + * @return array Returns the normalized header field values. + */ +function normalize_header($header) +{ + if (!is_array($header)) { + return array_map('trim', explode(',', $header)); + } + + $result = []; + foreach ($header as $value) { + foreach ((array) $value as $v) { + if (strpos($v, ',') === false) { + $result[] = $v; + continue; + } + foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) { + $result[] = trim($vv); + } + } + } + + return $result; +} + +/** + * Clone and modify a request with the given changes. + * + * The changes can be one of: + * - method: (string) Changes the HTTP method. + * - set_headers: (array) Sets the given headers. + * - remove_headers: (array) Remove the given headers. + * - body: (mixed) Sets the given body. + * - uri: (UriInterface) Set the URI. + * - query: (string) Set the query string value of the URI. + * - version: (string) Set the protocol version. + * + * @param RequestInterface $request Request to clone and modify. + * @param array $changes Changes to apply. + * + * @return RequestInterface + */ +function modify_request(RequestInterface $request, array $changes) +{ + if (!$changes) { + return $request; + } + + $headers = $request->getHeaders(); + + if (!isset($changes['uri'])) { + $uri = $request->getUri(); + } else { + // Remove the host header if one is on the URI + if ($host = $changes['uri']->getHost()) { + $changes['set_headers']['Host'] = $host; + + if ($port = $changes['uri']->getPort()) { + $standardPorts = ['http' => 80, 'https' => 443]; + $scheme = $changes['uri']->getScheme(); + if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { + $changes['set_headers']['Host'] .= ':'.$port; + } + } + } + $uri = $changes['uri']; + } + + if (!empty($changes['remove_headers'])) { + $headers = _caseless_remove($changes['remove_headers'], $headers); + } + + if (!empty($changes['set_headers'])) { + $headers = _caseless_remove(array_keys($changes['set_headers']), $headers); + $headers = $changes['set_headers'] + $headers; + } + + if (isset($changes['query'])) { + $uri = $uri->withQuery($changes['query']); + } + + if ($request instanceof ServerRequestInterface) { + return (new ServerRequest( + isset($changes['method']) ? $changes['method'] : $request->getMethod(), + $uri, + $headers, + isset($changes['body']) ? $changes['body'] : $request->getBody(), + isset($changes['version']) + ? $changes['version'] + : $request->getProtocolVersion(), + $request->getServerParams() + )) + ->withParsedBody($request->getParsedBody()) + ->withQueryParams($request->getQueryParams()) + ->withCookieParams($request->getCookieParams()) + ->withUploadedFiles($request->getUploadedFiles()); + } + + return new Request( + isset($changes['method']) ? $changes['method'] : $request->getMethod(), + $uri, + $headers, + isset($changes['body']) ? $changes['body'] : $request->getBody(), + isset($changes['version']) + ? $changes['version'] + : $request->getProtocolVersion() + ); +} + +/** + * Attempts to rewind a message body and throws an exception on failure. + * + * The body of the message will only be rewound if a call to `tell()` returns a + * value other than `0`. + * + * @param MessageInterface $message Message to rewind + * + * @throws \RuntimeException + */ +function rewind_body(MessageInterface $message) +{ + $body = $message->getBody(); + + if ($body->tell()) { + $body->rewind(); + } +} + +/** + * Safely opens a PHP stream resource using a filename. + * + * When fopen fails, PHP normally raises a warning. This function adds an + * error handler that checks for errors and throws an exception instead. + * + * @param string $filename File to open + * @param string $mode Mode used to open the file + * + * @return resource + * @throws \RuntimeException if the file cannot be opened + */ +function try_fopen($filename, $mode) +{ + $ex = null; + set_error_handler(function () use ($filename, $mode, &$ex) { + $ex = new \RuntimeException(sprintf( + 'Unable to open %s using mode %s: %s', + $filename, + $mode, + func_get_args()[1] + )); + }); + + $handle = fopen($filename, $mode); + restore_error_handler(); + + if ($ex) { + /** @var $ex \RuntimeException */ + throw $ex; + } + + return $handle; +} + +/** + * Copy the contents of a stream into a string until the given number of + * bytes have been read. + * + * @param StreamInterface $stream Stream to read + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * @return string + * @throws \RuntimeException on error. + */ +function copy_to_string(StreamInterface $stream, $maxLen = -1) +{ + $buffer = ''; + + if ($maxLen === -1) { + while (!$stream->eof()) { + $buf = $stream->read(1048576); + // Using a loose equality here to match on '' and false. + if ($buf == null) { + break; + } + $buffer .= $buf; + } + return $buffer; + } + + $len = 0; + while (!$stream->eof() && $len < $maxLen) { + $buf = $stream->read($maxLen - $len); + // Using a loose equality here to match on '' and false. + if ($buf == null) { + break; + } + $buffer .= $buf; + $len = strlen($buffer); + } + + return $buffer; +} + +/** + * Copy the contents of a stream into another stream until the given number + * of bytes have been read. + * + * @param StreamInterface $source Stream to read from + * @param StreamInterface $dest Stream to write to + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @throws \RuntimeException on error. + */ +function copy_to_stream( + StreamInterface $source, + StreamInterface $dest, + $maxLen = -1 +) { + $bufferSize = 8192; + + if ($maxLen === -1) { + while (!$source->eof()) { + if (!$dest->write($source->read($bufferSize))) { + break; + } + } + } else { + $remaining = $maxLen; + while ($remaining > 0 && !$source->eof()) { + $buf = $source->read(min($bufferSize, $remaining)); + $len = strlen($buf); + if (!$len) { + break; + } + $remaining -= $len; + $dest->write($buf); + } + } +} + +/** + * Calculate a hash of a Stream + * + * @param StreamInterface $stream Stream to calculate the hash for + * @param string $algo Hash algorithm (e.g. md5, crc32, etc) + * @param bool $rawOutput Whether or not to use raw output + * + * @return string Returns the hash of the stream + * @throws \RuntimeException on error. + */ +function hash( + StreamInterface $stream, + $algo, + $rawOutput = false +) { + $pos = $stream->tell(); + + if ($pos > 0) { + $stream->rewind(); + } + + $ctx = hash_init($algo); + while (!$stream->eof()) { + hash_update($ctx, $stream->read(1048576)); + } + + $out = hash_final($ctx, (bool) $rawOutput); + $stream->seek($pos); + + return $out; +} + +/** + * Read a line from the stream up to the maximum allowed buffer length + * + * @param StreamInterface $stream Stream to read from + * @param int $maxLength Maximum buffer length + * + * @return string + */ +function readline(StreamInterface $stream, $maxLength = null) +{ + $buffer = ''; + $size = 0; + + while (!$stream->eof()) { + // Using a loose equality here to match on '' and false. + if (null == ($byte = $stream->read(1))) { + return $buffer; + } + $buffer .= $byte; + // Break when a new line is found or the max length - 1 is reached + if ($byte === "\n" || ++$size === $maxLength - 1) { + break; + } + } + + return $buffer; +} + +/** + * Parses a request message string into a request object. + * + * @param string $message Request message string. + * + * @return Request + */ +function parse_request($message) +{ + $data = _parse_message($message); + $matches = []; + if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { + throw new \InvalidArgumentException('Invalid request string'); + } + $parts = explode(' ', $data['start-line'], 3); + $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; + + $request = new Request( + $parts[0], + $matches[1] === '/' ? _parse_request_uri($parts[1], $data['headers']) : $parts[1], + $data['headers'], + $data['body'], + $version + ); + + return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]); +} + +/** + * Parses a response message string into a response object. + * + * @param string $message Response message string. + * + * @return Response + */ +function parse_response($message) +{ + $data = _parse_message($message); + // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space + // between status-code and reason-phrase is required. But browsers accept + // responses without space and reason as well. + if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { + throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']); + } + $parts = explode(' ', $data['start-line'], 3); + + return new Response( + $parts[1], + $data['headers'], + $data['body'], + explode('/', $parts[0])[1], + isset($parts[2]) ? $parts[2] : null + ); +} + +/** + * Parse a query string into an associative array. + * + * If multiple values are found for the same key, the value of that key + * value pair will become an array. This function does not parse nested + * PHP style arrays into an associative array (e.g., foo[a]=1&foo[b]=2 will + * be parsed into ['foo[a]' => '1', 'foo[b]' => '2']). + * + * @param string $str Query string to parse + * @param int|bool $urlEncoding How the query string is encoded + * + * @return array + */ +function parse_query($str, $urlEncoding = true) +{ + $result = []; + + if ($str === '') { + return $result; + } + + if ($urlEncoding === true) { + $decoder = function ($value) { + return rawurldecode(str_replace('+', ' ', $value)); + }; + } elseif ($urlEncoding === PHP_QUERY_RFC3986) { + $decoder = 'rawurldecode'; + } elseif ($urlEncoding === PHP_QUERY_RFC1738) { + $decoder = 'urldecode'; + } else { + $decoder = function ($str) { return $str; }; + } + + foreach (explode('&', $str) as $kvp) { + $parts = explode('=', $kvp, 2); + $key = $decoder($parts[0]); + $value = isset($parts[1]) ? $decoder($parts[1]) : null; + if (!isset($result[$key])) { + $result[$key] = $value; + } else { + if (!is_array($result[$key])) { + $result[$key] = [$result[$key]]; + } + $result[$key][] = $value; + } + } + + return $result; +} + +/** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of parse_query() to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like http_build_query would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + * @return string + */ +function build_query(array $params, $encoding = PHP_QUERY_RFC3986) +{ + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function ($str) { return $str; }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder($k); + if (!is_array($v)) { + $qs .= $k; + if ($v !== null) { + $qs .= '=' . $encoder($v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + if ($vv !== null) { + $qs .= '=' . $encoder($vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; +} + +/** + * Determines the mimetype of a file by looking at its extension. + * + * @param $filename + * + * @return null|string + */ +function mimetype_from_filename($filename) +{ + return mimetype_from_extension(pathinfo($filename, PATHINFO_EXTENSION)); +} + +/** + * Maps a file extensions to a mimetype. + * + * @param $extension string The file extension. + * + * @return string|null + * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types + */ +function mimetype_from_extension($extension) +{ + static $mimetypes = [ + '3gp' => 'video/3gpp', + '7z' => 'application/x-7z-compressed', + 'aac' => 'audio/x-aac', + 'ai' => 'application/postscript', + 'aif' => 'audio/x-aiff', + 'asc' => 'text/plain', + 'asf' => 'video/x-ms-asf', + 'atom' => 'application/atom+xml', + 'avi' => 'video/x-msvideo', + 'bmp' => 'image/bmp', + 'bz2' => 'application/x-bzip2', + 'cer' => 'application/pkix-cert', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'css' => 'text/css', + 'csv' => 'text/csv', + 'cu' => 'application/cu-seeme', + 'deb' => 'application/x-debian-package', + 'doc' => 'application/msword', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dvi' => 'application/x-dvi', + 'eot' => 'application/vnd.ms-fontobject', + 'eps' => 'application/postscript', + 'epub' => 'application/epub+zip', + 'etx' => 'text/x-setext', + 'flac' => 'audio/flac', + 'flv' => 'video/x-flv', + 'gif' => 'image/gif', + 'gz' => 'application/gzip', + 'htm' => 'text/html', + 'html' => 'text/html', + 'ico' => 'image/x-icon', + 'ics' => 'text/calendar', + 'ini' => 'text/plain', + 'iso' => 'application/x-iso9660-image', + 'jar' => 'application/java-archive', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'js' => 'text/javascript', + 'json' => 'application/json', + 'latex' => 'application/x-latex', + 'log' => 'text/plain', + 'm4a' => 'audio/mp4', + 'm4v' => 'video/mp4', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mov' => 'video/quicktime', + 'mkv' => 'video/x-matroska', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', + 'mp4a' => 'audio/mp4', + 'mp4v' => 'video/mp4', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpg4' => 'video/mp4', + 'oga' => 'audio/ogg', + 'ogg' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'ogx' => 'application/ogg', + 'pbm' => 'image/x-portable-bitmap', + 'pdf' => 'application/pdf', + 'pgm' => 'image/x-portable-graymap', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'ppm' => 'image/x-portable-pixmap', + 'ppt' => 'application/vnd.ms-powerpoint', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'ps' => 'application/postscript', + 'qt' => 'video/quicktime', + 'rar' => 'application/x-rar-compressed', + 'ras' => 'image/x-cmu-raster', + 'rss' => 'application/rss+xml', + 'rtf' => 'application/rtf', + 'sgm' => 'text/sgml', + 'sgml' => 'text/sgml', + 'svg' => 'image/svg+xml', + 'swf' => 'application/x-shockwave-flash', + 'tar' => 'application/x-tar', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'torrent' => 'application/x-bittorrent', + 'ttf' => 'application/x-font-ttf', + 'txt' => 'text/plain', + 'wav' => 'audio/x-wav', + 'webm' => 'video/webm', + 'webp' => 'image/webp', + 'wma' => 'audio/x-ms-wma', + 'wmv' => 'video/x-ms-wmv', + 'woff' => 'application/x-font-woff', + 'wsdl' => 'application/wsdl+xml', + 'xbm' => 'image/x-xbitmap', + 'xls' => 'application/vnd.ms-excel', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xml' => 'application/xml', + 'xpm' => 'image/x-xpixmap', + 'xwd' => 'image/x-xwindowdump', + 'yaml' => 'text/yaml', + 'yml' => 'text/yaml', + 'zip' => 'application/zip', + ]; + + $extension = strtolower($extension); + + return isset($mimetypes[$extension]) + ? $mimetypes[$extension] + : null; +} + +/** + * Parses an HTTP message into an associative array. + * + * The array contains the "start-line" key containing the start line of + * the message, "headers" key containing an associative array of header + * array values, and a "body" key containing the body of the message. + * + * @param string $message HTTP request or response to parse. + * + * @return array + * @internal + */ +function _parse_message($message) +{ + if (!$message) { + throw new \InvalidArgumentException('Invalid message'); + } + + $message = ltrim($message, "\r\n"); + + $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); + + if ($messageParts === false || count($messageParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); + } + + list($rawHeaders, $body) = $messageParts; + $rawHeaders .= "\r\n"; // Put back the delimiter we split previously + $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); + + if ($headerParts === false || count($headerParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing status line'); + } + + list($startLine, $rawHeaders) = $headerParts; + + if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') { + // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0 + $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); + } + + /** @var array[] $headerLines */ + $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); + + // If these aren't the same, then one line didn't match and there's an invalid header. + if ($count !== substr_count($rawHeaders, "\n")) { + // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 + if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { + throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); + } + + throw new \InvalidArgumentException('Invalid header syntax'); + } + + $headers = []; + + foreach ($headerLines as $headerLine) { + $headers[$headerLine[1]][] = $headerLine[2]; + } + + return [ + 'start-line' => $startLine, + 'headers' => $headers, + 'body' => $body, + ]; +} + +/** + * Constructs a URI for an HTTP request message. + * + * @param string $path Path from the start-line + * @param array $headers Array of headers (each value an array). + * + * @return string + * @internal + */ +function _parse_request_uri($path, array $headers) +{ + $hostKey = array_filter(array_keys($headers), function ($k) { + return strtolower($k) === 'host'; + }); + + // If no host is found, then a full URI cannot be constructed. + if (!$hostKey) { + return $path; + } + + $host = $headers[reset($hostKey)][0]; + $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; + + return $scheme . '://' . $host . '/' . ltrim($path, '/'); +} + +/** + * Get a short summary of the message body + * + * Will return `null` if the response is not printable. + * + * @param MessageInterface $message The message to get the body summary + * @param int $truncateAt The maximum allowed size of the summary + * + * @return null|string + */ +function get_message_body_summary(MessageInterface $message, $truncateAt = 120) +{ + $body = $message->getBody(); + + if (!$body->isSeekable() || !$body->isReadable()) { + return null; + } + + $size = $body->getSize(); + + if ($size === 0) { + return null; + } + + $summary = $body->read($truncateAt); + $body->rewind(); + + if ($size > $truncateAt) { + $summary .= ' (truncated...)'; + } + + // Matches any printable character, including unicode characters: + // letters, marks, numbers, punctuation, spacing, and separators. + if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/', $summary)) { + return null; + } + + return $summary; +} + +/** @internal */ +function _caseless_remove($keys, array $data) +{ + $result = []; + + foreach ($keys as &$key) { + $key = strtolower($key); + } + + foreach ($data as $k => $v) { + if (!in_array(strtolower($k), $keys)) { + $result[$k] = $v; + } + } + + return $result; +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/functions_include.php b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/functions_include.php new file mode 100644 index 0000000..96a4a83 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/guzzlehttp/psr7/src/functions_include.php @@ -0,0 +1,6 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog; + +use Psr\Log\LoggerInterface; +use Psr\Log\LogLevel; +use Monolog\Handler\AbstractHandler; +use Monolog\Registry; + +/** + * Monolog error handler + * + * A facility to enable logging of runtime errors, exceptions and fatal errors. + * + * Quick setup: ErrorHandler::register($logger); + * + * @author Jordi Boggiano + */ +class ErrorHandler +{ + private $logger; + + private $previousExceptionHandler; + private $uncaughtExceptionLevel; + + private $previousErrorHandler; + private $errorLevelMap; + private $handleOnlyReportedErrors; + + private $hasFatalErrorHandler; + private $fatalLevel; + private $reservedMemory; + private $lastFatalTrace; + private static $fatalErrors = array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR); + + public function __construct(LoggerInterface $logger) + { + $this->logger = $logger; + } + + /** + * Registers a new ErrorHandler for a given Logger + * + * By default it will handle errors, exceptions and fatal errors + * + * @param LoggerInterface $logger + * @param array|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling + * @param int|false $exceptionLevel a LogLevel::* constant, or false to disable exception handling + * @param int|false $fatalLevel a LogLevel::* constant, or false to disable fatal error handling + * @return ErrorHandler + */ + public static function register(LoggerInterface $logger, $errorLevelMap = array(), $exceptionLevel = null, $fatalLevel = null) + { + //Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. See https://github.com/Seldaek/monolog/pull/929 + class_exists('\\Psr\\Log\\LogLevel', true); + + $handler = new static($logger); + if ($errorLevelMap !== false) { + $handler->registerErrorHandler($errorLevelMap); + } + if ($exceptionLevel !== false) { + $handler->registerExceptionHandler($exceptionLevel); + } + if ($fatalLevel !== false) { + $handler->registerFatalHandler($fatalLevel); + } + + return $handler; + } + + public function registerExceptionHandler($level = null, $callPrevious = true) + { + $prev = set_exception_handler(array($this, 'handleException')); + $this->uncaughtExceptionLevel = $level; + if ($callPrevious && $prev) { + $this->previousExceptionHandler = $prev; + } + } + + public function registerErrorHandler(array $levelMap = array(), $callPrevious = true, $errorTypes = -1, $handleOnlyReportedErrors = true) + { + $prev = set_error_handler(array($this, 'handleError'), $errorTypes); + $this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap); + if ($callPrevious) { + $this->previousErrorHandler = $prev ?: true; + } + + $this->handleOnlyReportedErrors = $handleOnlyReportedErrors; + } + + public function registerFatalHandler($level = null, $reservedMemorySize = 20) + { + register_shutdown_function(array($this, 'handleFatalError')); + + $this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize); + $this->fatalLevel = $level; + $this->hasFatalErrorHandler = true; + } + + protected function defaultErrorLevelMap() + { + return array( + E_ERROR => LogLevel::CRITICAL, + E_WARNING => LogLevel::WARNING, + E_PARSE => LogLevel::ALERT, + E_NOTICE => LogLevel::NOTICE, + E_CORE_ERROR => LogLevel::CRITICAL, + E_CORE_WARNING => LogLevel::WARNING, + E_COMPILE_ERROR => LogLevel::ALERT, + E_COMPILE_WARNING => LogLevel::WARNING, + E_USER_ERROR => LogLevel::ERROR, + E_USER_WARNING => LogLevel::WARNING, + E_USER_NOTICE => LogLevel::NOTICE, + E_STRICT => LogLevel::NOTICE, + E_RECOVERABLE_ERROR => LogLevel::ERROR, + E_DEPRECATED => LogLevel::NOTICE, + E_USER_DEPRECATED => LogLevel::NOTICE, + ); + } + + /** + * @private + */ + public function handleException($e) + { + $this->logger->log( + $this->uncaughtExceptionLevel === null ? LogLevel::ERROR : $this->uncaughtExceptionLevel, + sprintf('Uncaught Exception %s: "%s" at %s line %s', Utils::getClass($e), $e->getMessage(), $e->getFile(), $e->getLine()), + array('exception' => $e) + ); + + if ($this->previousExceptionHandler) { + call_user_func($this->previousExceptionHandler, $e); + } + + exit(255); + } + + /** + * @private + */ + public function handleError($code, $message, $file = '', $line = 0, $context = array()) + { + if ($this->handleOnlyReportedErrors && !(error_reporting() & $code)) { + return; + } + + // fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries + if (!$this->hasFatalErrorHandler || !in_array($code, self::$fatalErrors, true)) { + $level = isset($this->errorLevelMap[$code]) ? $this->errorLevelMap[$code] : LogLevel::CRITICAL; + $this->logger->log($level, self::codeToString($code).': '.$message, array('code' => $code, 'message' => $message, 'file' => $file, 'line' => $line)); + } else { + // http://php.net/manual/en/function.debug-backtrace.php + // As of 5.3.6, DEBUG_BACKTRACE_IGNORE_ARGS option was added. + // Any version less than 5.3.6 must use the DEBUG_BACKTRACE_IGNORE_ARGS constant value '2'. + $trace = debug_backtrace((PHP_VERSION_ID < 50306) ? 2 : DEBUG_BACKTRACE_IGNORE_ARGS); + array_shift($trace); // Exclude handleError from trace + $this->lastFatalTrace = $trace; + } + + if ($this->previousErrorHandler === true) { + return false; + } elseif ($this->previousErrorHandler) { + return call_user_func($this->previousErrorHandler, $code, $message, $file, $line, $context); + } + } + + /** + * @private + */ + public function handleFatalError() + { + $this->reservedMemory = null; + + $lastError = error_get_last(); + if ($lastError && in_array($lastError['type'], self::$fatalErrors, true)) { + $this->logger->log( + $this->fatalLevel === null ? LogLevel::ALERT : $this->fatalLevel, + 'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'], + array('code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'], 'trace' => $this->lastFatalTrace) + ); + + if ($this->logger instanceof Logger) { + foreach ($this->logger->getHandlers() as $handler) { + if ($handler instanceof AbstractHandler) { + $handler->close(); + } + } + } + } + } + + private static function codeToString($code) + { + switch ($code) { + case E_ERROR: + return 'E_ERROR'; + case E_WARNING: + return 'E_WARNING'; + case E_PARSE: + return 'E_PARSE'; + case E_NOTICE: + return 'E_NOTICE'; + case E_CORE_ERROR: + return 'E_CORE_ERROR'; + case E_CORE_WARNING: + return 'E_CORE_WARNING'; + case E_COMPILE_ERROR: + return 'E_COMPILE_ERROR'; + case E_COMPILE_WARNING: + return 'E_COMPILE_WARNING'; + case E_USER_ERROR: + return 'E_USER_ERROR'; + case E_USER_WARNING: + return 'E_USER_WARNING'; + case E_USER_NOTICE: + return 'E_USER_NOTICE'; + case E_STRICT: + return 'E_STRICT'; + case E_RECOVERABLE_ERROR: + return 'E_RECOVERABLE_ERROR'; + case E_DEPRECATED: + return 'E_DEPRECATED'; + case E_USER_DEPRECATED: + return 'E_USER_DEPRECATED'; + } + + return 'Unknown PHP error'; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php new file mode 100644 index 0000000..9beda1e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Logger; + +/** + * Formats a log message according to the ChromePHP array format + * + * @author Christophe Coevoet + */ +class ChromePHPFormatter implements FormatterInterface +{ + /** + * Translates Monolog log levels to Wildfire levels. + */ + private $logLevels = array( + Logger::DEBUG => 'log', + Logger::INFO => 'info', + Logger::NOTICE => 'info', + Logger::WARNING => 'warn', + Logger::ERROR => 'error', + Logger::CRITICAL => 'error', + Logger::ALERT => 'error', + Logger::EMERGENCY => 'error', + ); + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + // Retrieve the line and file if set and remove them from the formatted extra + $backtrace = 'unknown'; + if (isset($record['extra']['file'], $record['extra']['line'])) { + $backtrace = $record['extra']['file'].' : '.$record['extra']['line']; + unset($record['extra']['file'], $record['extra']['line']); + } + + $message = array('message' => $record['message']); + if ($record['context']) { + $message['context'] = $record['context']; + } + if ($record['extra']) { + $message['extra'] = $record['extra']; + } + if (count($message) === 1) { + $message = reset($message); + } + + return array( + $record['channel'], + $message, + $backtrace, + $this->logLevels[$record['level']], + ); + } + + public function formatBatch(array $records) + { + $formatted = array(); + + foreach ($records as $record) { + $formatted[] = $this->format($record); + } + + return $formatted; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php new file mode 100644 index 0000000..4c556cf --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Elastica\Document; + +/** + * Format a log message into an Elastica Document + * + * @author Jelle Vink + */ +class ElasticaFormatter extends NormalizerFormatter +{ + /** + * @var string Elastic search index name + */ + protected $index; + + /** + * @var string Elastic search document type + */ + protected $type; + + /** + * @param string $index Elastic Search index name + * @param string $type Elastic Search document type + */ + public function __construct($index, $type) + { + // elasticsearch requires a ISO 8601 format date with optional millisecond precision. + parent::__construct('Y-m-d\TH:i:s.uP'); + + $this->index = $index; + $this->type = $type; + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + $record = parent::format($record); + + return $this->getDocument($record); + } + + /** + * Getter index + * @return string + */ + public function getIndex() + { + return $this->index; + } + + /** + * Getter type + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Convert a log message into an Elastica Document + * + * @param array $record Log message + * @return Document + */ + protected function getDocument($record) + { + $document = new Document(); + $document->setData($record); + $document->setType($this->type); + $document->setIndex($this->index); + + return $document; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php new file mode 100644 index 0000000..5094af3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php @@ -0,0 +1,116 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +/** + * formats the record to be used in the FlowdockHandler + * + * @author Dominik Liebler + */ +class FlowdockFormatter implements FormatterInterface +{ + /** + * @var string + */ + private $source; + + /** + * @var string + */ + private $sourceEmail; + + /** + * @param string $source + * @param string $sourceEmail + */ + public function __construct($source, $sourceEmail) + { + $this->source = $source; + $this->sourceEmail = $sourceEmail; + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + $tags = array( + '#logs', + '#' . strtolower($record['level_name']), + '#' . $record['channel'], + ); + + foreach ($record['extra'] as $value) { + $tags[] = '#' . $value; + } + + $subject = sprintf( + 'in %s: %s - %s', + $this->source, + $record['level_name'], + $this->getShortMessage($record['message']) + ); + + $record['flowdock'] = array( + 'source' => $this->source, + 'from_address' => $this->sourceEmail, + 'subject' => $subject, + 'content' => $record['message'], + 'tags' => $tags, + 'project' => $this->source, + ); + + return $record; + } + + /** + * {@inheritdoc} + */ + public function formatBatch(array $records) + { + $formatted = array(); + + foreach ($records as $record) { + $formatted[] = $this->format($record); + } + + return $formatted; + } + + /** + * @param string $message + * + * @return string + */ + public function getShortMessage($message) + { + static $hasMbString; + + if (null === $hasMbString) { + $hasMbString = function_exists('mb_strlen'); + } + + $maxLength = 45; + + if ($hasMbString) { + if (mb_strlen($message, 'UTF-8') > $maxLength) { + $message = mb_substr($message, 0, $maxLength - 4, 'UTF-8') . ' ...'; + } + } else { + if (strlen($message) > $maxLength) { + $message = substr($message, 0, $maxLength - 4) . ' ...'; + } + } + + return $message; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php new file mode 100644 index 0000000..46a91ff --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +/** + * Class FluentdFormatter + * + * Serializes a log message to Fluentd unix socket protocol + * + * Fluentd config: + * + * + * type unix + * path /var/run/td-agent/td-agent.sock + * + * + * Monolog setup: + * + * $logger = new Monolog\Logger('fluent.tag'); + * $fluentHandler = new Monolog\Handler\SocketHandler('unix:///var/run/td-agent/td-agent.sock'); + * $fluentHandler->setFormatter(new Monolog\Formatter\FluentdFormatter()); + * $logger->pushHandler($fluentHandler); + * + * @author Andrius Putna + */ +class FluentdFormatter implements FormatterInterface +{ + /** + * @var bool $levelTag should message level be a part of the fluentd tag + */ + protected $levelTag = false; + + public function __construct($levelTag = false) + { + if (!function_exists('json_encode')) { + throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s FluentdUnixFormatter'); + } + + $this->levelTag = (bool) $levelTag; + } + + public function isUsingLevelsInTag() + { + return $this->levelTag; + } + + public function format(array $record) + { + $tag = $record['channel']; + if ($this->levelTag) { + $tag .= '.' . strtolower($record['level_name']); + } + + $message = array( + 'message' => $record['message'], + 'context' => $record['context'], + 'extra' => $record['extra'], + ); + + if (!$this->levelTag) { + $message['level'] = $record['level']; + $message['level_name'] = $record['level_name']; + } + + return json_encode(array($tag, $record['datetime']->getTimestamp(), $message)); + } + + public function formatBatch(array $records) + { + $message = ''; + foreach ($records as $record) { + $message .= $this->format($record); + } + + return $message; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php new file mode 100644 index 0000000..b5de751 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +/** + * Interface for formatters + * + * @author Jordi Boggiano + */ +interface FormatterInterface +{ + /** + * Formats a log record. + * + * @param array $record A record to format + * @return mixed The formatted record + */ + public function format(array $record); + + /** + * Formats a set of log records. + * + * @param array $records A set of records to format + * @return mixed The formatted set of records + */ + public function formatBatch(array $records); +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php new file mode 100644 index 0000000..2c1b0e8 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php @@ -0,0 +1,138 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Logger; +use Gelf\Message; + +/** + * Serializes a log message to GELF + * @see http://www.graylog2.org/about/gelf + * + * @author Matt Lehner + */ +class GelfMessageFormatter extends NormalizerFormatter +{ + const DEFAULT_MAX_LENGTH = 32766; + + /** + * @var string the name of the system for the Gelf log message + */ + protected $systemName; + + /** + * @var string a prefix for 'extra' fields from the Monolog record (optional) + */ + protected $extraPrefix; + + /** + * @var string a prefix for 'context' fields from the Monolog record (optional) + */ + protected $contextPrefix; + + /** + * @var int max length per field + */ + protected $maxLength; + + /** + * Translates Monolog log levels to Graylog2 log priorities. + */ + private $logLevels = array( + Logger::DEBUG => 7, + Logger::INFO => 6, + Logger::NOTICE => 5, + Logger::WARNING => 4, + Logger::ERROR => 3, + Logger::CRITICAL => 2, + Logger::ALERT => 1, + Logger::EMERGENCY => 0, + ); + + public function __construct($systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_', $maxLength = null) + { + parent::__construct('U.u'); + + $this->systemName = $systemName ?: gethostname(); + + $this->extraPrefix = $extraPrefix; + $this->contextPrefix = $contextPrefix; + $this->maxLength = is_null($maxLength) ? self::DEFAULT_MAX_LENGTH : $maxLength; + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + $record = parent::format($record); + + if (!isset($record['datetime'], $record['message'], $record['level'])) { + throw new \InvalidArgumentException('The record should at least contain datetime, message and level keys, '.var_export($record, true).' given'); + } + + $message = new Message(); + $message + ->setTimestamp($record['datetime']) + ->setShortMessage((string) $record['message']) + ->setHost($this->systemName) + ->setLevel($this->logLevels[$record['level']]); + + // message length + system name length + 200 for padding / metadata + $len = 200 + strlen((string) $record['message']) + strlen($this->systemName); + + if ($len > $this->maxLength) { + $message->setShortMessage(substr($record['message'], 0, $this->maxLength)); + } + + if (isset($record['channel'])) { + $message->setFacility($record['channel']); + } + if (isset($record['extra']['line'])) { + $message->setLine($record['extra']['line']); + unset($record['extra']['line']); + } + if (isset($record['extra']['file'])) { + $message->setFile($record['extra']['file']); + unset($record['extra']['file']); + } + + foreach ($record['extra'] as $key => $val) { + $val = is_scalar($val) || null === $val ? $val : $this->toJson($val); + $len = strlen($this->extraPrefix . $key . $val); + if ($len > $this->maxLength) { + $message->setAdditional($this->extraPrefix . $key, substr($val, 0, $this->maxLength)); + break; + } + $message->setAdditional($this->extraPrefix . $key, $val); + } + + foreach ($record['context'] as $key => $val) { + $val = is_scalar($val) || null === $val ? $val : $this->toJson($val); + $len = strlen($this->contextPrefix . $key . $val); + if ($len > $this->maxLength) { + $message->setAdditional($this->contextPrefix . $key, substr($val, 0, $this->maxLength)); + break; + } + $message->setAdditional($this->contextPrefix . $key, $val); + } + + if (null === $message->getFile() && isset($record['context']['exception']['file'])) { + if (preg_match("/^(.+):([0-9]+)$/", $record['context']['exception']['file'], $matches)) { + $message->setFile($matches[1]); + $message->setLine($matches[2]); + } + } + + return $message; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php new file mode 100644 index 0000000..dfc0b4a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php @@ -0,0 +1,141 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Logger; + +/** + * Formats incoming records into an HTML table + * + * This is especially useful for html email logging + * + * @author Tiago Brito + */ +class HtmlFormatter extends NormalizerFormatter +{ + /** + * Translates Monolog log levels to html color priorities. + */ + protected $logLevels = array( + Logger::DEBUG => '#cccccc', + Logger::INFO => '#468847', + Logger::NOTICE => '#3a87ad', + Logger::WARNING => '#c09853', + Logger::ERROR => '#f0ad4e', + Logger::CRITICAL => '#FF7708', + Logger::ALERT => '#C12A19', + Logger::EMERGENCY => '#000000', + ); + + /** + * @param string $dateFormat The format of the timestamp: one supported by DateTime::format + */ + public function __construct($dateFormat = null) + { + parent::__construct($dateFormat); + } + + /** + * Creates an HTML table row + * + * @param string $th Row header content + * @param string $td Row standard cell content + * @param bool $escapeTd false if td content must not be html escaped + * @return string + */ + protected function addRow($th, $td = ' ', $escapeTd = true) + { + $th = htmlspecialchars($th, ENT_NOQUOTES, 'UTF-8'); + if ($escapeTd) { + $td = '
        '.htmlspecialchars($td, ENT_NOQUOTES, 'UTF-8').'
        '; + } + + return "\n$th:\n".$td."\n"; + } + + /** + * Create a HTML h1 tag + * + * @param string $title Text to be in the h1 + * @param int $level Error level + * @return string + */ + protected function addTitle($title, $level) + { + $title = htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8'); + + return '

        '.$title.'

        '; + } + + /** + * Formats a log record. + * + * @param array $record A record to format + * @return mixed The formatted record + */ + public function format(array $record) + { + $output = $this->addTitle($record['level_name'], $record['level']); + $output .= ''; + + $output .= $this->addRow('Message', (string) $record['message']); + $output .= $this->addRow('Time', $record['datetime']->format($this->dateFormat)); + $output .= $this->addRow('Channel', $record['channel']); + if ($record['context']) { + $embeddedTable = '
        '; + foreach ($record['context'] as $key => $value) { + $embeddedTable .= $this->addRow($key, $this->convertToString($value)); + } + $embeddedTable .= '
        '; + $output .= $this->addRow('Context', $embeddedTable, false); + } + if ($record['extra']) { + $embeddedTable = ''; + foreach ($record['extra'] as $key => $value) { + $embeddedTable .= $this->addRow($key, $this->convertToString($value)); + } + $embeddedTable .= '
        '; + $output .= $this->addRow('Extra', $embeddedTable, false); + } + + return $output.''; + } + + /** + * Formats a set of log records. + * + * @param array $records A set of records to format + * @return mixed The formatted set of records + */ + public function formatBatch(array $records) + { + $message = ''; + foreach ($records as $record) { + $message .= $this->format($record); + } + + return $message; + } + + protected function convertToString($data) + { + if (null === $data || is_scalar($data)) { + return (string) $data; + } + + $data = $this->normalize($data); + if (version_compare(PHP_VERSION, '5.4.0', '>=')) { + return json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); + } + + return str_replace('\\/', '/', json_encode($data)); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php new file mode 100644 index 0000000..2ff119e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php @@ -0,0 +1,208 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Exception; +use Monolog\Utils; +use Throwable; + +/** + * Encodes whatever record data is passed to it as json + * + * This can be useful to log to databases or remote APIs + * + * @author Jordi Boggiano + */ +class JsonFormatter extends NormalizerFormatter +{ + const BATCH_MODE_JSON = 1; + const BATCH_MODE_NEWLINES = 2; + + protected $batchMode; + protected $appendNewline; + + /** + * @var bool + */ + protected $includeStacktraces = false; + + /** + * @param int $batchMode + * @param bool $appendNewline + */ + public function __construct($batchMode = self::BATCH_MODE_JSON, $appendNewline = true) + { + $this->batchMode = $batchMode; + $this->appendNewline = $appendNewline; + } + + /** + * The batch mode option configures the formatting style for + * multiple records. By default, multiple records will be + * formatted as a JSON-encoded array. However, for + * compatibility with some API endpoints, alternative styles + * are available. + * + * @return int + */ + public function getBatchMode() + { + return $this->batchMode; + } + + /** + * True if newlines are appended to every formatted record + * + * @return bool + */ + public function isAppendingNewlines() + { + return $this->appendNewline; + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + return $this->toJson($this->normalize($record), true) . ($this->appendNewline ? "\n" : ''); + } + + /** + * {@inheritdoc} + */ + public function formatBatch(array $records) + { + switch ($this->batchMode) { + case static::BATCH_MODE_NEWLINES: + return $this->formatBatchNewlines($records); + + case static::BATCH_MODE_JSON: + default: + return $this->formatBatchJson($records); + } + } + + /** + * @param bool $include + */ + public function includeStacktraces($include = true) + { + $this->includeStacktraces = $include; + } + + /** + * Return a JSON-encoded array of records. + * + * @param array $records + * @return string + */ + protected function formatBatchJson(array $records) + { + return $this->toJson($this->normalize($records), true); + } + + /** + * Use new lines to separate records instead of a + * JSON-encoded array. + * + * @param array $records + * @return string + */ + protected function formatBatchNewlines(array $records) + { + $instance = $this; + + $oldNewline = $this->appendNewline; + $this->appendNewline = false; + array_walk($records, function (&$value, $key) use ($instance) { + $value = $instance->format($value); + }); + $this->appendNewline = $oldNewline; + + return implode("\n", $records); + } + + /** + * Normalizes given $data. + * + * @param mixed $data + * + * @return mixed + */ + protected function normalize($data, $depth = 0) + { + if ($depth > 9) { + return 'Over 9 levels deep, aborting normalization'; + } + + if (is_array($data) || $data instanceof \Traversable) { + $normalized = array(); + + $count = 1; + foreach ($data as $key => $value) { + if ($count++ > 1000) { + $normalized['...'] = 'Over 1000 items ('.count($data).' total), aborting normalization'; + break; + } + + $normalized[$key] = $this->normalize($value, $depth+1); + } + + return $normalized; + } + + if ($data instanceof Exception || $data instanceof Throwable) { + return $this->normalizeException($data); + } + + return $data; + } + + /** + * Normalizes given exception with or without its own stack trace based on + * `includeStacktraces` property. + * + * @param Exception|Throwable $e + * + * @return array + */ + protected function normalizeException($e) + { + // TODO 2.0 only check for Throwable + if (!$e instanceof Exception && !$e instanceof Throwable) { + throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e)); + } + + $data = array( + 'class' => Utils::getClass($e), + 'message' => $e->getMessage(), + 'code' => $e->getCode(), + 'file' => $e->getFile().':'.$e->getLine(), + ); + + if ($this->includeStacktraces) { + $trace = $e->getTrace(); + foreach ($trace as $frame) { + if (isset($frame['file'])) { + $data['trace'][] = $frame['file'].':'.$frame['line']; + } + } + } + + if ($previous = $e->getPrevious()) { + $data['previous'] = $this->normalizeException($previous); + } + + return $data; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php new file mode 100644 index 0000000..f98e1a6 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php @@ -0,0 +1,181 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Utils; + +/** + * Formats incoming records into a one-line string + * + * This is especially useful for logging to files + * + * @author Jordi Boggiano + * @author Christophe Coevoet + */ +class LineFormatter extends NormalizerFormatter +{ + const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; + + protected $format; + protected $allowInlineLineBreaks; + protected $ignoreEmptyContextAndExtra; + protected $includeStacktraces; + + /** + * @param string $format The format of the message + * @param string $dateFormat The format of the timestamp: one supported by DateTime::format + * @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries + * @param bool $ignoreEmptyContextAndExtra + */ + public function __construct($format = null, $dateFormat = null, $allowInlineLineBreaks = false, $ignoreEmptyContextAndExtra = false) + { + $this->format = $format ?: static::SIMPLE_FORMAT; + $this->allowInlineLineBreaks = $allowInlineLineBreaks; + $this->ignoreEmptyContextAndExtra = $ignoreEmptyContextAndExtra; + parent::__construct($dateFormat); + } + + public function includeStacktraces($include = true) + { + $this->includeStacktraces = $include; + if ($this->includeStacktraces) { + $this->allowInlineLineBreaks = true; + } + } + + public function allowInlineLineBreaks($allow = true) + { + $this->allowInlineLineBreaks = $allow; + } + + public function ignoreEmptyContextAndExtra($ignore = true) + { + $this->ignoreEmptyContextAndExtra = $ignore; + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + $vars = parent::format($record); + + $output = $this->format; + + foreach ($vars['extra'] as $var => $val) { + if (false !== strpos($output, '%extra.'.$var.'%')) { + $output = str_replace('%extra.'.$var.'%', $this->stringify($val), $output); + unset($vars['extra'][$var]); + } + } + + + foreach ($vars['context'] as $var => $val) { + if (false !== strpos($output, '%context.'.$var.'%')) { + $output = str_replace('%context.'.$var.'%', $this->stringify($val), $output); + unset($vars['context'][$var]); + } + } + + if ($this->ignoreEmptyContextAndExtra) { + if (empty($vars['context'])) { + unset($vars['context']); + $output = str_replace('%context%', '', $output); + } + + if (empty($vars['extra'])) { + unset($vars['extra']); + $output = str_replace('%extra%', '', $output); + } + } + + foreach ($vars as $var => $val) { + if (false !== strpos($output, '%'.$var.'%')) { + $output = str_replace('%'.$var.'%', $this->stringify($val), $output); + } + } + + // remove leftover %extra.xxx% and %context.xxx% if any + if (false !== strpos($output, '%')) { + $output = preg_replace('/%(?:extra|context)\..+?%/', '', $output); + } + + return $output; + } + + public function formatBatch(array $records) + { + $message = ''; + foreach ($records as $record) { + $message .= $this->format($record); + } + + return $message; + } + + public function stringify($value) + { + return $this->replaceNewlines($this->convertToString($value)); + } + + protected function normalizeException($e) + { + // TODO 2.0 only check for Throwable + if (!$e instanceof \Exception && !$e instanceof \Throwable) { + throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e)); + } + + $previousText = ''; + if ($previous = $e->getPrevious()) { + do { + $previousText .= ', '.Utils::getClass($previous).'(code: '.$previous->getCode().'): '.$previous->getMessage().' at '.$previous->getFile().':'.$previous->getLine(); + } while ($previous = $previous->getPrevious()); + } + + $str = '[object] ('.Utils::getClass($e).'(code: '.$e->getCode().'): '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine().$previousText.')'; + if ($this->includeStacktraces) { + $str .= "\n[stacktrace]\n".$e->getTraceAsString()."\n"; + } + + return $str; + } + + protected function convertToString($data) + { + if (null === $data || is_bool($data)) { + return var_export($data, true); + } + + if (is_scalar($data)) { + return (string) $data; + } + + if (version_compare(PHP_VERSION, '5.4.0', '>=')) { + return $this->toJson($data, true); + } + + return str_replace('\\/', '/', @json_encode($data)); + } + + protected function replaceNewlines($str) + { + if ($this->allowInlineLineBreaks) { + if (0 === strpos($str, '{')) { + return str_replace(array('\r', '\n'), array("\r", "\n"), $str); + } + + return $str; + } + + return str_replace(array("\r\n", "\r", "\n"), ' ', $str); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php new file mode 100644 index 0000000..401859b --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +/** + * Encodes message information into JSON in a format compatible with Loggly. + * + * @author Adam Pancutt + */ +class LogglyFormatter extends JsonFormatter +{ + /** + * Overrides the default batch mode to new lines for compatibility with the + * Loggly bulk API. + * + * @param int $batchMode + */ + public function __construct($batchMode = self::BATCH_MODE_NEWLINES, $appendNewline = false) + { + parent::__construct($batchMode, $appendNewline); + } + + /** + * Appends the 'timestamp' parameter for indexing by Loggly. + * + * @see https://www.loggly.com/docs/automated-parsing/#json + * @see \Monolog\Formatter\JsonFormatter::format() + */ + public function format(array $record) + { + if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTime)) { + $record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO"); + // TODO 2.0 unset the 'datetime' parameter, retained for BC + } + + return parent::format($record); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php new file mode 100644 index 0000000..8f83bec --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php @@ -0,0 +1,166 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +/** + * Serializes a log message to Logstash Event Format + * + * @see http://logstash.net/ + * @see https://github.com/logstash/logstash/blob/master/lib/logstash/event.rb + * + * @author Tim Mower + */ +class LogstashFormatter extends NormalizerFormatter +{ + const V0 = 0; + const V1 = 1; + + /** + * @var string the name of the system for the Logstash log message, used to fill the @source field + */ + protected $systemName; + + /** + * @var string an application name for the Logstash log message, used to fill the @type field + */ + protected $applicationName; + + /** + * @var string a prefix for 'extra' fields from the Monolog record (optional) + */ + protected $extraPrefix; + + /** + * @var string a prefix for 'context' fields from the Monolog record (optional) + */ + protected $contextPrefix; + + /** + * @var int logstash format version to use + */ + protected $version; + + /** + * @param string $applicationName the application that sends the data, used as the "type" field of logstash + * @param string $systemName the system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine + * @param string $extraPrefix prefix for extra keys inside logstash "fields" + * @param string $contextPrefix prefix for context keys inside logstash "fields", defaults to ctxt_ + * @param int $version the logstash format version to use, defaults to 0 + */ + public function __construct($applicationName, $systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_', $version = self::V0) + { + // logstash requires a ISO 8601 format date with optional millisecond precision. + parent::__construct('Y-m-d\TH:i:s.uP'); + + $this->systemName = $systemName ?: gethostname(); + $this->applicationName = $applicationName; + $this->extraPrefix = $extraPrefix; + $this->contextPrefix = $contextPrefix; + $this->version = $version; + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + $record = parent::format($record); + + if ($this->version === self::V1) { + $message = $this->formatV1($record); + } else { + $message = $this->formatV0($record); + } + + return $this->toJson($message) . "\n"; + } + + protected function formatV0(array $record) + { + if (empty($record['datetime'])) { + $record['datetime'] = gmdate('c'); + } + $message = array( + '@timestamp' => $record['datetime'], + '@source' => $this->systemName, + '@fields' => array(), + ); + if (isset($record['message'])) { + $message['@message'] = $record['message']; + } + if (isset($record['channel'])) { + $message['@tags'] = array($record['channel']); + $message['@fields']['channel'] = $record['channel']; + } + if (isset($record['level'])) { + $message['@fields']['level'] = $record['level']; + } + if ($this->applicationName) { + $message['@type'] = $this->applicationName; + } + if (isset($record['extra']['server'])) { + $message['@source_host'] = $record['extra']['server']; + } + if (isset($record['extra']['url'])) { + $message['@source_path'] = $record['extra']['url']; + } + if (!empty($record['extra'])) { + foreach ($record['extra'] as $key => $val) { + $message['@fields'][$this->extraPrefix . $key] = $val; + } + } + if (!empty($record['context'])) { + foreach ($record['context'] as $key => $val) { + $message['@fields'][$this->contextPrefix . $key] = $val; + } + } + + return $message; + } + + protected function formatV1(array $record) + { + if (empty($record['datetime'])) { + $record['datetime'] = gmdate('c'); + } + $message = array( + '@timestamp' => $record['datetime'], + '@version' => 1, + 'host' => $this->systemName, + ); + if (isset($record['message'])) { + $message['message'] = $record['message']; + } + if (isset($record['channel'])) { + $message['type'] = $record['channel']; + $message['channel'] = $record['channel']; + } + if (isset($record['level_name'])) { + $message['level'] = $record['level_name']; + } + if ($this->applicationName) { + $message['type'] = $this->applicationName; + } + if (!empty($record['extra'])) { + foreach ($record['extra'] as $key => $val) { + $message[$this->extraPrefix . $key] = $val; + } + } + if (!empty($record['context'])) { + foreach ($record['context'] as $key => $val) { + $message[$this->contextPrefix . $key] = $val; + } + } + + return $message; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php new file mode 100644 index 0000000..eb7be84 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Utils; + +/** + * Formats a record for use with the MongoDBHandler. + * + * @author Florian Plattner + */ +class MongoDBFormatter implements FormatterInterface +{ + private $exceptionTraceAsString; + private $maxNestingLevel; + + /** + * @param int $maxNestingLevel 0 means infinite nesting, the $record itself is level 1, $record['context'] is 2 + * @param bool $exceptionTraceAsString set to false to log exception traces as a sub documents instead of strings + */ + public function __construct($maxNestingLevel = 3, $exceptionTraceAsString = true) + { + $this->maxNestingLevel = max($maxNestingLevel, 0); + $this->exceptionTraceAsString = (bool) $exceptionTraceAsString; + } + + /** + * {@inheritDoc} + */ + public function format(array $record) + { + return $this->formatArray($record); + } + + /** + * {@inheritDoc} + */ + public function formatBatch(array $records) + { + foreach ($records as $key => $record) { + $records[$key] = $this->format($record); + } + + return $records; + } + + protected function formatArray(array $record, $nestingLevel = 0) + { + if ($this->maxNestingLevel == 0 || $nestingLevel <= $this->maxNestingLevel) { + foreach ($record as $name => $value) { + if ($value instanceof \DateTime) { + $record[$name] = $this->formatDate($value, $nestingLevel + 1); + } elseif ($value instanceof \Exception) { + $record[$name] = $this->formatException($value, $nestingLevel + 1); + } elseif (is_array($value)) { + $record[$name] = $this->formatArray($value, $nestingLevel + 1); + } elseif (is_object($value)) { + $record[$name] = $this->formatObject($value, $nestingLevel + 1); + } + } + } else { + $record = '[...]'; + } + + return $record; + } + + protected function formatObject($value, $nestingLevel) + { + $objectVars = get_object_vars($value); + $objectVars['class'] = Utils::getClass($value); + + return $this->formatArray($objectVars, $nestingLevel); + } + + protected function formatException(\Exception $exception, $nestingLevel) + { + $formattedException = array( + 'class' => Utils::getClass($exception), + 'message' => $exception->getMessage(), + 'code' => $exception->getCode(), + 'file' => $exception->getFile() . ':' . $exception->getLine(), + ); + + if ($this->exceptionTraceAsString === true) { + $formattedException['trace'] = $exception->getTraceAsString(); + } else { + $formattedException['trace'] = $exception->getTrace(); + } + + return $this->formatArray($formattedException, $nestingLevel); + } + + protected function formatDate(\DateTime $value, $nestingLevel) + { + return new \MongoDate($value->getTimestamp()); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php new file mode 100644 index 0000000..9865394 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php @@ -0,0 +1,297 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Exception; +use Monolog\Utils; + +/** + * Normalizes incoming records to remove objects/resources so it's easier to dump to various targets + * + * @author Jordi Boggiano + */ +class NormalizerFormatter implements FormatterInterface +{ + const SIMPLE_DATE = "Y-m-d H:i:s"; + + protected $dateFormat; + + /** + * @param string $dateFormat The format of the timestamp: one supported by DateTime::format + */ + public function __construct($dateFormat = null) + { + $this->dateFormat = $dateFormat ?: static::SIMPLE_DATE; + if (!function_exists('json_encode')) { + throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s NormalizerFormatter'); + } + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + return $this->normalize($record); + } + + /** + * {@inheritdoc} + */ + public function formatBatch(array $records) + { + foreach ($records as $key => $record) { + $records[$key] = $this->format($record); + } + + return $records; + } + + protected function normalize($data, $depth = 0) + { + if ($depth > 9) { + return 'Over 9 levels deep, aborting normalization'; + } + + if (null === $data || is_scalar($data)) { + if (is_float($data)) { + if (is_infinite($data)) { + return ($data > 0 ? '' : '-') . 'INF'; + } + if (is_nan($data)) { + return 'NaN'; + } + } + + return $data; + } + + if (is_array($data)) { + $normalized = array(); + + $count = 1; + foreach ($data as $key => $value) { + if ($count++ > 1000) { + $normalized['...'] = 'Over 1000 items ('.count($data).' total), aborting normalization'; + break; + } + + $normalized[$key] = $this->normalize($value, $depth+1); + } + + return $normalized; + } + + if ($data instanceof \DateTime) { + return $data->format($this->dateFormat); + } + + if (is_object($data)) { + // TODO 2.0 only check for Throwable + if ($data instanceof Exception || (PHP_VERSION_ID > 70000 && $data instanceof \Throwable)) { + return $this->normalizeException($data); + } + + // non-serializable objects that implement __toString stringified + if (method_exists($data, '__toString') && !$data instanceof \JsonSerializable) { + $value = $data->__toString(); + } else { + // the rest is json-serialized in some way + $value = $this->toJson($data, true); + } + + return sprintf("[object] (%s: %s)", Utils::getClass($data), $value); + } + + if (is_resource($data)) { + return sprintf('[resource] (%s)', get_resource_type($data)); + } + + return '[unknown('.gettype($data).')]'; + } + + protected function normalizeException($e) + { + // TODO 2.0 only check for Throwable + if (!$e instanceof Exception && !$e instanceof \Throwable) { + throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e)); + } + + $data = array( + 'class' => Utils::getClass($e), + 'message' => $e->getMessage(), + 'code' => $e->getCode(), + 'file' => $e->getFile().':'.$e->getLine(), + ); + + if ($e instanceof \SoapFault) { + if (isset($e->faultcode)) { + $data['faultcode'] = $e->faultcode; + } + + if (isset($e->faultactor)) { + $data['faultactor'] = $e->faultactor; + } + + if (isset($e->detail)) { + $data['detail'] = $e->detail; + } + } + + $trace = $e->getTrace(); + foreach ($trace as $frame) { + if (isset($frame['file'])) { + $data['trace'][] = $frame['file'].':'.$frame['line']; + } + } + + if ($previous = $e->getPrevious()) { + $data['previous'] = $this->normalizeException($previous); + } + + return $data; + } + + /** + * Return the JSON representation of a value + * + * @param mixed $data + * @param bool $ignoreErrors + * @throws \RuntimeException if encoding fails and errors are not ignored + * @return string + */ + protected function toJson($data, $ignoreErrors = false) + { + // suppress json_encode errors since it's twitchy with some inputs + if ($ignoreErrors) { + return @$this->jsonEncode($data); + } + + $json = $this->jsonEncode($data); + + if ($json === false) { + $json = $this->handleJsonError(json_last_error(), $data); + } + + return $json; + } + + /** + * @param mixed $data + * @return string JSON encoded data or null on failure + */ + private function jsonEncode($data) + { + if (version_compare(PHP_VERSION, '5.4.0', '>=')) { + return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); + } + + return json_encode($data); + } + + /** + * Handle a json_encode failure. + * + * If the failure is due to invalid string encoding, try to clean the + * input and encode again. If the second encoding attempt fails, the + * inital error is not encoding related or the input can't be cleaned then + * raise a descriptive exception. + * + * @param int $code return code of json_last_error function + * @param mixed $data data that was meant to be encoded + * @throws \RuntimeException if failure can't be corrected + * @return string JSON encoded data after error correction + */ + private function handleJsonError($code, $data) + { + if ($code !== JSON_ERROR_UTF8) { + $this->throwEncodeError($code, $data); + } + + if (is_string($data)) { + $this->detectAndCleanUtf8($data); + } elseif (is_array($data)) { + array_walk_recursive($data, array($this, 'detectAndCleanUtf8')); + } else { + $this->throwEncodeError($code, $data); + } + + $json = $this->jsonEncode($data); + + if ($json === false) { + $this->throwEncodeError(json_last_error(), $data); + } + + return $json; + } + + /** + * Throws an exception according to a given code with a customized message + * + * @param int $code return code of json_last_error function + * @param mixed $data data that was meant to be encoded + * @throws \RuntimeException + */ + private function throwEncodeError($code, $data) + { + switch ($code) { + case JSON_ERROR_DEPTH: + $msg = 'Maximum stack depth exceeded'; + break; + case JSON_ERROR_STATE_MISMATCH: + $msg = 'Underflow or the modes mismatch'; + break; + case JSON_ERROR_CTRL_CHAR: + $msg = 'Unexpected control character found'; + break; + case JSON_ERROR_UTF8: + $msg = 'Malformed UTF-8 characters, possibly incorrectly encoded'; + break; + default: + $msg = 'Unknown error'; + } + + throw new \RuntimeException('JSON encoding failed: '.$msg.'. Encoding: '.var_export($data, true)); + } + + /** + * Detect invalid UTF-8 string characters and convert to valid UTF-8. + * + * Valid UTF-8 input will be left unmodified, but strings containing + * invalid UTF-8 codepoints will be reencoded as UTF-8 with an assumed + * original encoding of ISO-8859-15. This conversion may result in + * incorrect output if the actual encoding was not ISO-8859-15, but it + * will be clean UTF-8 output and will not rely on expensive and fragile + * detection algorithms. + * + * Function converts the input in place in the passed variable so that it + * can be used as a callback for array_walk_recursive. + * + * @param mixed &$data Input to check and convert if needed + * @private + */ + public function detectAndCleanUtf8(&$data) + { + if (is_string($data) && !preg_match('//u', $data)) { + $data = preg_replace_callback( + '/[\x80-\xFF]+/', + function ($m) { return utf8_encode($m[0]); }, + $data + ); + $data = str_replace( + array('¤', '¦', '¨', '´', '¸', '¼', '½', '¾'), + array('€', 'Š', 'š', 'Ž', 'ž', 'Œ', 'œ', 'Ÿ'), + $data + ); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php new file mode 100644 index 0000000..5d345d5 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +/** + * Formats data into an associative array of scalar values. + * Objects and arrays will be JSON encoded. + * + * @author Andrew Lawson + */ +class ScalarFormatter extends NormalizerFormatter +{ + /** + * {@inheritdoc} + */ + public function format(array $record) + { + foreach ($record as $key => $value) { + $record[$key] = $this->normalizeValue($value); + } + + return $record; + } + + /** + * @param mixed $value + * @return mixed + */ + protected function normalizeValue($value) + { + $normalized = $this->normalize($value); + + if (is_array($normalized) || is_object($normalized)) { + return $this->toJson($normalized, true); + } + + return $normalized; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php new file mode 100644 index 0000000..65dba99 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php @@ -0,0 +1,113 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Logger; + +/** + * Serializes a log message according to Wildfire's header requirements + * + * @author Eric Clemmons (@ericclemmons) + * @author Christophe Coevoet + * @author Kirill chEbba Chebunin + */ +class WildfireFormatter extends NormalizerFormatter +{ + const TABLE = 'table'; + + /** + * Translates Monolog log levels to Wildfire levels. + */ + private $logLevels = array( + Logger::DEBUG => 'LOG', + Logger::INFO => 'INFO', + Logger::NOTICE => 'INFO', + Logger::WARNING => 'WARN', + Logger::ERROR => 'ERROR', + Logger::CRITICAL => 'ERROR', + Logger::ALERT => 'ERROR', + Logger::EMERGENCY => 'ERROR', + ); + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + // Retrieve the line and file if set and remove them from the formatted extra + $file = $line = ''; + if (isset($record['extra']['file'])) { + $file = $record['extra']['file']; + unset($record['extra']['file']); + } + if (isset($record['extra']['line'])) { + $line = $record['extra']['line']; + unset($record['extra']['line']); + } + + $record = $this->normalize($record); + $message = array('message' => $record['message']); + $handleError = false; + if ($record['context']) { + $message['context'] = $record['context']; + $handleError = true; + } + if ($record['extra']) { + $message['extra'] = $record['extra']; + $handleError = true; + } + if (count($message) === 1) { + $message = reset($message); + } + + if (isset($record['context'][self::TABLE])) { + $type = 'TABLE'; + $label = $record['channel'] .': '. $record['message']; + $message = $record['context'][self::TABLE]; + } else { + $type = $this->logLevels[$record['level']]; + $label = $record['channel']; + } + + // Create JSON object describing the appearance of the message in the console + $json = $this->toJson(array( + array( + 'Type' => $type, + 'File' => $file, + 'Line' => $line, + 'Label' => $label, + ), + $message, + ), $handleError); + + // The message itself is a serialization of the above JSON object + it's length + return sprintf( + '%s|%s|', + strlen($json), + $json + ); + } + + public function formatBatch(array $records) + { + throw new \BadMethodCallException('Batch formatting does not make sense for the WildfireFormatter'); + } + + protected function normalize($data, $depth = 0) + { + if (is_object($data) && !$data instanceof \DateTime) { + return $data; + } + + return parent::normalize($data, $depth); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php new file mode 100644 index 0000000..92b9d45 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php @@ -0,0 +1,196 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\FormatterInterface; +use Monolog\Formatter\LineFormatter; +use Monolog\Logger; +use Monolog\ResettableInterface; + +/** + * Base Handler class providing the Handler structure + * + * @author Jordi Boggiano + */ +abstract class AbstractHandler implements HandlerInterface, ResettableInterface +{ + protected $level = Logger::DEBUG; + protected $bubble = true; + + /** + * @var FormatterInterface + */ + protected $formatter; + protected $processors = array(); + + /** + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($level = Logger::DEBUG, $bubble = true) + { + $this->setLevel($level); + $this->bubble = $bubble; + } + + /** + * {@inheritdoc} + */ + public function isHandling(array $record) + { + return $record['level'] >= $this->level; + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + foreach ($records as $record) { + $this->handle($record); + } + } + + /** + * Closes the handler. + * + * This will be called automatically when the object is destroyed + */ + public function close() + { + } + + /** + * {@inheritdoc} + */ + public function pushProcessor($callback) + { + if (!is_callable($callback)) { + throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given'); + } + array_unshift($this->processors, $callback); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function popProcessor() + { + if (!$this->processors) { + throw new \LogicException('You tried to pop from an empty processor stack.'); + } + + return array_shift($this->processors); + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->formatter = $formatter; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + if (!$this->formatter) { + $this->formatter = $this->getDefaultFormatter(); + } + + return $this->formatter; + } + + /** + * Sets minimum logging level at which this handler will be triggered. + * + * @param int|string $level Level or level name + * @return self + */ + public function setLevel($level) + { + $this->level = Logger::toMonologLevel($level); + + return $this; + } + + /** + * Gets minimum logging level at which this handler will be triggered. + * + * @return int + */ + public function getLevel() + { + return $this->level; + } + + /** + * Sets the bubbling behavior. + * + * @param bool $bubble true means that this handler allows bubbling. + * false means that bubbling is not permitted. + * @return self + */ + public function setBubble($bubble) + { + $this->bubble = $bubble; + + return $this; + } + + /** + * Gets the bubbling behavior. + * + * @return bool true means that this handler allows bubbling. + * false means that bubbling is not permitted. + */ + public function getBubble() + { + return $this->bubble; + } + + public function __destruct() + { + try { + $this->close(); + } catch (\Exception $e) { + // do nothing + } catch (\Throwable $e) { + // do nothing + } + } + + public function reset() + { + foreach ($this->processors as $processor) { + if ($processor instanceof ResettableInterface) { + $processor->reset(); + } + } + } + + /** + * Gets the default formatter. + * + * @return FormatterInterface + */ + protected function getDefaultFormatter() + { + return new LineFormatter(); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php new file mode 100644 index 0000000..e1e8953 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php @@ -0,0 +1,68 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\ResettableInterface; + +/** + * Base Handler class providing the Handler structure + * + * Classes extending it should (in most cases) only implement write($record) + * + * @author Jordi Boggiano + * @author Christophe Coevoet + */ +abstract class AbstractProcessingHandler extends AbstractHandler +{ + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + if (!$this->isHandling($record)) { + return false; + } + + $record = $this->processRecord($record); + + $record['formatted'] = $this->getFormatter()->format($record); + + $this->write($record); + + return false === $this->bubble; + } + + /** + * Writes the record down to the log of the implementing handler + * + * @param array $record + * @return void + */ + abstract protected function write(array $record); + + /** + * Processes a record. + * + * @param array $record + * @return array + */ + protected function processRecord(array $record) + { + if ($this->processors) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + } + + return $record; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php new file mode 100644 index 0000000..8c76aca --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php @@ -0,0 +1,101 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\LineFormatter; + +/** + * Common syslog functionality + */ +abstract class AbstractSyslogHandler extends AbstractProcessingHandler +{ + protected $facility; + + /** + * Translates Monolog log levels to syslog log priorities. + */ + protected $logLevels = array( + Logger::DEBUG => LOG_DEBUG, + Logger::INFO => LOG_INFO, + Logger::NOTICE => LOG_NOTICE, + Logger::WARNING => LOG_WARNING, + Logger::ERROR => LOG_ERR, + Logger::CRITICAL => LOG_CRIT, + Logger::ALERT => LOG_ALERT, + Logger::EMERGENCY => LOG_EMERG, + ); + + /** + * List of valid log facility names. + */ + protected $facilities = array( + 'auth' => LOG_AUTH, + 'authpriv' => LOG_AUTHPRIV, + 'cron' => LOG_CRON, + 'daemon' => LOG_DAEMON, + 'kern' => LOG_KERN, + 'lpr' => LOG_LPR, + 'mail' => LOG_MAIL, + 'news' => LOG_NEWS, + 'syslog' => LOG_SYSLOG, + 'user' => LOG_USER, + 'uucp' => LOG_UUCP, + ); + + /** + * @param mixed $facility + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($facility = LOG_USER, $level = Logger::DEBUG, $bubble = true) + { + parent::__construct($level, $bubble); + + if (!defined('PHP_WINDOWS_VERSION_BUILD')) { + $this->facilities['local0'] = LOG_LOCAL0; + $this->facilities['local1'] = LOG_LOCAL1; + $this->facilities['local2'] = LOG_LOCAL2; + $this->facilities['local3'] = LOG_LOCAL3; + $this->facilities['local4'] = LOG_LOCAL4; + $this->facilities['local5'] = LOG_LOCAL5; + $this->facilities['local6'] = LOG_LOCAL6; + $this->facilities['local7'] = LOG_LOCAL7; + } else { + $this->facilities['local0'] = 128; // LOG_LOCAL0 + $this->facilities['local1'] = 136; // LOG_LOCAL1 + $this->facilities['local2'] = 144; // LOG_LOCAL2 + $this->facilities['local3'] = 152; // LOG_LOCAL3 + $this->facilities['local4'] = 160; // LOG_LOCAL4 + $this->facilities['local5'] = 168; // LOG_LOCAL5 + $this->facilities['local6'] = 176; // LOG_LOCAL6 + $this->facilities['local7'] = 184; // LOG_LOCAL7 + } + + // convert textual description of facility to syslog constant + if (array_key_exists(strtolower($facility), $this->facilities)) { + $facility = $this->facilities[strtolower($facility)]; + } elseif (!in_array($facility, array_values($this->facilities), true)) { + throw new \UnexpectedValueException('Unknown facility value "'.$facility.'" given'); + } + + $this->facility = $facility; + } + + /** + * {@inheritdoc} + */ + protected function getDefaultFormatter() + { + return new LineFormatter('%channel%.%level_name%: %message% %context% %extra%'); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php new file mode 100644 index 0000000..e5a46bc --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php @@ -0,0 +1,148 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\JsonFormatter; +use PhpAmqpLib\Message\AMQPMessage; +use PhpAmqpLib\Channel\AMQPChannel; +use AMQPExchange; + +class AmqpHandler extends AbstractProcessingHandler +{ + /** + * @var AMQPExchange|AMQPChannel $exchange + */ + protected $exchange; + + /** + * @var string + */ + protected $exchangeName; + + /** + * @param AMQPExchange|AMQPChannel $exchange AMQPExchange (php AMQP ext) or PHP AMQP lib channel, ready for use + * @param string $exchangeName + * @param int $level + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($exchange, $exchangeName = 'log', $level = Logger::DEBUG, $bubble = true) + { + if ($exchange instanceof AMQPExchange) { + $exchange->setName($exchangeName); + } elseif ($exchange instanceof AMQPChannel) { + $this->exchangeName = $exchangeName; + } else { + throw new \InvalidArgumentException('PhpAmqpLib\Channel\AMQPChannel or AMQPExchange instance required'); + } + $this->exchange = $exchange; + + parent::__construct($level, $bubble); + } + + /** + * {@inheritDoc} + */ + protected function write(array $record) + { + $data = $record["formatted"]; + $routingKey = $this->getRoutingKey($record); + + if ($this->exchange instanceof AMQPExchange) { + $this->exchange->publish( + $data, + $routingKey, + 0, + array( + 'delivery_mode' => 2, + 'content_type' => 'application/json', + ) + ); + } else { + $this->exchange->basic_publish( + $this->createAmqpMessage($data), + $this->exchangeName, + $routingKey + ); + } + } + + /** + * {@inheritDoc} + */ + public function handleBatch(array $records) + { + if ($this->exchange instanceof AMQPExchange) { + parent::handleBatch($records); + + return; + } + + foreach ($records as $record) { + if (!$this->isHandling($record)) { + continue; + } + + $record = $this->processRecord($record); + $data = $this->getFormatter()->format($record); + + $this->exchange->batch_basic_publish( + $this->createAmqpMessage($data), + $this->exchangeName, + $this->getRoutingKey($record) + ); + } + + $this->exchange->publish_batch(); + } + + /** + * Gets the routing key for the AMQP exchange + * + * @param array $record + * @return string + */ + protected function getRoutingKey(array $record) + { + $routingKey = sprintf( + '%s.%s', + // TODO 2.0 remove substr call + substr($record['level_name'], 0, 4), + $record['channel'] + ); + + return strtolower($routingKey); + } + + /** + * @param string $data + * @return AMQPMessage + */ + private function createAmqpMessage($data) + { + return new AMQPMessage( + (string) $data, + array( + 'delivery_mode' => 2, + 'content_type' => 'application/json', + ) + ); + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php new file mode 100644 index 0000000..23cf23b --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php @@ -0,0 +1,240 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\LineFormatter; + +/** + * Handler sending logs to browser's javascript console with no browser extension required + * + * @author Olivier Poitrey + */ +class BrowserConsoleHandler extends AbstractProcessingHandler +{ + protected static $initialized = false; + protected static $records = array(); + + /** + * {@inheritDoc} + * + * Formatted output may contain some formatting markers to be transferred to `console.log` using the %c format. + * + * Example of formatted string: + * + * You can do [[blue text]]{color: blue} or [[green background]]{background-color: green; color: white} + */ + protected function getDefaultFormatter() + { + return new LineFormatter('[[%channel%]]{macro: autolabel} [[%level_name%]]{font-weight: bold} %message%'); + } + + /** + * {@inheritDoc} + */ + protected function write(array $record) + { + // Accumulate records + static::$records[] = $record; + + // Register shutdown handler if not already done + if (!static::$initialized) { + static::$initialized = true; + $this->registerShutdownFunction(); + } + } + + /** + * Convert records to javascript console commands and send it to the browser. + * This method is automatically called on PHP shutdown if output is HTML or Javascript. + */ + public static function send() + { + $format = static::getResponseFormat(); + if ($format === 'unknown') { + return; + } + + if (count(static::$records)) { + if ($format === 'html') { + static::writeOutput(''); + } elseif ($format === 'js') { + static::writeOutput(static::generateScript()); + } + static::resetStatic(); + } + } + + public function close() + { + self::resetStatic(); + } + + public function reset() + { + self::resetStatic(); + } + + /** + * Forget all logged records + */ + public static function resetStatic() + { + static::$records = array(); + } + + /** + * Wrapper for register_shutdown_function to allow overriding + */ + protected function registerShutdownFunction() + { + if (PHP_SAPI !== 'cli') { + register_shutdown_function(array('Monolog\Handler\BrowserConsoleHandler', 'send')); + } + } + + /** + * Wrapper for echo to allow overriding + * + * @param string $str + */ + protected static function writeOutput($str) + { + echo $str; + } + + /** + * Checks the format of the response + * + * If Content-Type is set to application/javascript or text/javascript -> js + * If Content-Type is set to text/html, or is unset -> html + * If Content-Type is anything else -> unknown + * + * @return string One of 'js', 'html' or 'unknown' + */ + protected static function getResponseFormat() + { + // Check content type + foreach (headers_list() as $header) { + if (stripos($header, 'content-type:') === 0) { + // This handler only works with HTML and javascript outputs + // text/javascript is obsolete in favour of application/javascript, but still used + if (stripos($header, 'application/javascript') !== false || stripos($header, 'text/javascript') !== false) { + return 'js'; + } + if (stripos($header, 'text/html') === false) { + return 'unknown'; + } + break; + } + } + + return 'html'; + } + + private static function generateScript() + { + $script = array(); + foreach (static::$records as $record) { + $context = static::dump('Context', $record['context']); + $extra = static::dump('Extra', $record['extra']); + + if (empty($context) && empty($extra)) { + $script[] = static::call_array('log', static::handleStyles($record['formatted'])); + } else { + $script = array_merge($script, + array(static::call_array('groupCollapsed', static::handleStyles($record['formatted']))), + $context, + $extra, + array(static::call('groupEnd')) + ); + } + } + + return "(function (c) {if (c && c.groupCollapsed) {\n" . implode("\n", $script) . "\n}})(console);"; + } + + private static function handleStyles($formatted) + { + $args = array(static::quote('font-weight: normal')); + $format = '%c' . $formatted; + preg_match_all('/\[\[(.*?)\]\]\{([^}]*)\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); + + foreach (array_reverse($matches) as $match) { + $args[] = static::quote(static::handleCustomStyles($match[2][0], $match[1][0])); + $args[] = '"font-weight: normal"'; + + $pos = $match[0][1]; + $format = substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . substr($format, $pos + strlen($match[0][0])); + } + + array_unshift($args, static::quote($format)); + + return $args; + } + + private static function handleCustomStyles($style, $string) + { + static $colors = array('blue', 'green', 'red', 'magenta', 'orange', 'black', 'grey'); + static $labels = array(); + + return preg_replace_callback('/macro\s*:(.*?)(?:;|$)/', function ($m) use ($string, &$colors, &$labels) { + if (trim($m[1]) === 'autolabel') { + // Format the string as a label with consistent auto assigned background color + if (!isset($labels[$string])) { + $labels[$string] = $colors[count($labels) % count($colors)]; + } + $color = $labels[$string]; + + return "background-color: $color; color: white; border-radius: 3px; padding: 0 2px 0 2px"; + } + + return $m[1]; + }, $style); + } + + private static function dump($title, array $dict) + { + $script = array(); + $dict = array_filter($dict); + if (empty($dict)) { + return $script; + } + $script[] = static::call('log', static::quote('%c%s'), static::quote('font-weight: bold'), static::quote($title)); + foreach ($dict as $key => $value) { + $value = json_encode($value); + if (empty($value)) { + $value = static::quote(''); + } + $script[] = static::call('log', static::quote('%s: %o'), static::quote($key), $value); + } + + return $script; + } + + private static function quote($arg) + { + return '"' . addcslashes($arg, "\"\n\\") . '"'; + } + + private static function call() + { + $args = func_get_args(); + $method = array_shift($args); + + return static::call_array($method, $args); + } + + private static function call_array($method, array $args) + { + return 'c.' . $method . '(' . implode(', ', $args) . ');'; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php new file mode 100644 index 0000000..61d1b50 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php @@ -0,0 +1,129 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\ResettableInterface; + +/** + * Buffers all records until closing the handler and then pass them as batch. + * + * This is useful for a MailHandler to send only one mail per request instead of + * sending one per log message. + * + * @author Christophe Coevoet + */ +class BufferHandler extends AbstractHandler +{ + protected $handler; + protected $bufferSize = 0; + protected $bufferLimit; + protected $flushOnOverflow; + protected $buffer = array(); + protected $initialized = false; + + /** + * @param HandlerInterface $handler Handler. + * @param int $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded + */ + public function __construct(HandlerInterface $handler, $bufferLimit = 0, $level = Logger::DEBUG, $bubble = true, $flushOnOverflow = false) + { + parent::__construct($level, $bubble); + $this->handler = $handler; + $this->bufferLimit = (int) $bufferLimit; + $this->flushOnOverflow = $flushOnOverflow; + } + + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + if ($record['level'] < $this->level) { + return false; + } + + if (!$this->initialized) { + // __destructor() doesn't get called on Fatal errors + register_shutdown_function(array($this, 'close')); + $this->initialized = true; + } + + if ($this->bufferLimit > 0 && $this->bufferSize === $this->bufferLimit) { + if ($this->flushOnOverflow) { + $this->flush(); + } else { + array_shift($this->buffer); + $this->bufferSize--; + } + } + + if ($this->processors) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + } + + $this->buffer[] = $record; + $this->bufferSize++; + + return false === $this->bubble; + } + + public function flush() + { + if ($this->bufferSize === 0) { + return; + } + + $this->handler->handleBatch($this->buffer); + $this->clear(); + } + + public function __destruct() + { + // suppress the parent behavior since we already have register_shutdown_function() + // to call close(), and the reference contained there will prevent this from being + // GC'd until the end of the request + } + + /** + * {@inheritdoc} + */ + public function close() + { + $this->flush(); + } + + /** + * Clears the buffer without flushing any messages down to the wrapped handler. + */ + public function clear() + { + $this->bufferSize = 0; + $this->buffer = array(); + } + + public function reset() + { + $this->flush(); + + parent::reset(); + + if ($this->handler instanceof ResettableInterface) { + $this->handler->reset(); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php new file mode 100644 index 0000000..ac98d5d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php @@ -0,0 +1,211 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\ChromePHPFormatter; +use Monolog\Logger; + +/** + * Handler sending logs to the ChromePHP extension (http://www.chromephp.com/) + * + * This also works out of the box with Firefox 43+ + * + * @author Christophe Coevoet + */ +class ChromePHPHandler extends AbstractProcessingHandler +{ + /** + * Version of the extension + */ + const VERSION = '4.0'; + + /** + * Header name + */ + const HEADER_NAME = 'X-ChromeLogger-Data'; + + /** + * Regular expression to detect supported browsers (matches any Chrome, or Firefox 43+) + */ + const USER_AGENT_REGEX = '{\b(?:Chrome/\d+(?:\.\d+)*|HeadlessChrome|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}'; + + protected static $initialized = false; + + /** + * Tracks whether we sent too much data + * + * Chrome limits the headers to 4KB, so when we sent 3KB we stop sending + * + * @var bool + */ + protected static $overflowed = false; + + protected static $json = array( + 'version' => self::VERSION, + 'columns' => array('label', 'log', 'backtrace', 'type'), + 'rows' => array(), + ); + + protected static $sendHeaders = true; + + /** + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($level = Logger::DEBUG, $bubble = true) + { + parent::__construct($level, $bubble); + if (!function_exists('json_encode')) { + throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s ChromePHPHandler'); + } + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + $messages = array(); + + foreach ($records as $record) { + if ($record['level'] < $this->level) { + continue; + } + $messages[] = $this->processRecord($record); + } + + if (!empty($messages)) { + $messages = $this->getFormatter()->formatBatch($messages); + self::$json['rows'] = array_merge(self::$json['rows'], $messages); + $this->send(); + } + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new ChromePHPFormatter(); + } + + /** + * Creates & sends header for a record + * + * @see sendHeader() + * @see send() + * @param array $record + */ + protected function write(array $record) + { + self::$json['rows'][] = $record['formatted']; + + $this->send(); + } + + /** + * Sends the log header + * + * @see sendHeader() + */ + protected function send() + { + if (self::$overflowed || !self::$sendHeaders) { + return; + } + + if (!self::$initialized) { + self::$initialized = true; + + self::$sendHeaders = $this->headersAccepted(); + if (!self::$sendHeaders) { + return; + } + + self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; + } + + $json = @json_encode(self::$json); + $data = base64_encode(utf8_encode($json)); + if (strlen($data) > 3 * 1024) { + self::$overflowed = true; + + $record = array( + 'message' => 'Incomplete logs, chrome header size limit reached', + 'context' => array(), + 'level' => Logger::WARNING, + 'level_name' => Logger::getLevelName(Logger::WARNING), + 'channel' => 'monolog', + 'datetime' => new \DateTime(), + 'extra' => array(), + ); + self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record); + $json = @json_encode(self::$json); + $data = base64_encode(utf8_encode($json)); + } + + if (trim($data) !== '') { + $this->sendHeader(self::HEADER_NAME, $data); + } + } + + /** + * Send header string to the client + * + * @param string $header + * @param string $content + */ + protected function sendHeader($header, $content) + { + if (!headers_sent() && self::$sendHeaders) { + header(sprintf('%s: %s', $header, $content)); + } + } + + /** + * Verifies if the headers are accepted by the current user agent + * + * @return bool + */ + protected function headersAccepted() + { + if (empty($_SERVER['HTTP_USER_AGENT'])) { + return false; + } + + return preg_match(self::USER_AGENT_REGEX, $_SERVER['HTTP_USER_AGENT']); + } + + /** + * BC getter for the sendHeaders property that has been made static + */ + public function __get($property) + { + if ('sendHeaders' !== $property) { + throw new \InvalidArgumentException('Undefined property '.$property); + } + + return static::$sendHeaders; + } + + /** + * BC setter for the sendHeaders property that has been made static + */ + public function __set($property, $value) + { + if ('sendHeaders' !== $property) { + throw new \InvalidArgumentException('Undefined property '.$property); + } + + static::$sendHeaders = $value; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php new file mode 100644 index 0000000..cc98697 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\JsonFormatter; +use Monolog\Logger; + +/** + * CouchDB handler + * + * @author Markus Bachmann + */ +class CouchDBHandler extends AbstractProcessingHandler +{ + private $options; + + public function __construct(array $options = array(), $level = Logger::DEBUG, $bubble = true) + { + $this->options = array_merge(array( + 'host' => 'localhost', + 'port' => 5984, + 'dbname' => 'logger', + 'username' => null, + 'password' => null, + ), $options); + + parent::__construct($level, $bubble); + } + + /** + * {@inheritDoc} + */ + protected function write(array $record) + { + $basicAuth = null; + if ($this->options['username']) { + $basicAuth = sprintf('%s:%s@', $this->options['username'], $this->options['password']); + } + + $url = 'http://'.$basicAuth.$this->options['host'].':'.$this->options['port'].'/'.$this->options['dbname']; + $context = stream_context_create(array( + 'http' => array( + 'method' => 'POST', + 'content' => $record['formatted'], + 'ignore_errors' => true, + 'max_redirects' => 0, + 'header' => 'Content-type: application/json', + ), + )); + + if (false === @file_get_contents($url, null, $context)) { + throw new \RuntimeException(sprintf('Could not connect to %s', $url)); + } + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php new file mode 100644 index 0000000..96b3ca0 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php @@ -0,0 +1,151 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Logs to Cube. + * + * @link http://square.github.com/cube/ + * @author Wan Chen + */ +class CubeHandler extends AbstractProcessingHandler +{ + private $udpConnection; + private $httpConnection; + private $scheme; + private $host; + private $port; + private $acceptedSchemes = array('http', 'udp'); + + /** + * Create a Cube handler + * + * @throws \UnexpectedValueException when given url is not a valid url. + * A valid url must consist of three parts : protocol://host:port + * Only valid protocols used by Cube are http and udp + */ + public function __construct($url, $level = Logger::DEBUG, $bubble = true) + { + $urlInfo = parse_url($url); + + if (!isset($urlInfo['scheme'], $urlInfo['host'], $urlInfo['port'])) { + throw new \UnexpectedValueException('URL "'.$url.'" is not valid'); + } + + if (!in_array($urlInfo['scheme'], $this->acceptedSchemes)) { + throw new \UnexpectedValueException( + 'Invalid protocol (' . $urlInfo['scheme'] . ').' + . ' Valid options are ' . implode(', ', $this->acceptedSchemes)); + } + + $this->scheme = $urlInfo['scheme']; + $this->host = $urlInfo['host']; + $this->port = $urlInfo['port']; + + parent::__construct($level, $bubble); + } + + /** + * Establish a connection to an UDP socket + * + * @throws \LogicException when unable to connect to the socket + * @throws MissingExtensionException when there is no socket extension + */ + protected function connectUdp() + { + if (!extension_loaded('sockets')) { + throw new MissingExtensionException('The sockets extension is required to use udp URLs with the CubeHandler'); + } + + $this->udpConnection = socket_create(AF_INET, SOCK_DGRAM, 0); + if (!$this->udpConnection) { + throw new \LogicException('Unable to create a socket'); + } + + if (!socket_connect($this->udpConnection, $this->host, $this->port)) { + throw new \LogicException('Unable to connect to the socket at ' . $this->host . ':' . $this->port); + } + } + + /** + * Establish a connection to a http server + * @throws \LogicException when no curl extension + */ + protected function connectHttp() + { + if (!extension_loaded('curl')) { + throw new \LogicException('The curl extension is needed to use http URLs with the CubeHandler'); + } + + $this->httpConnection = curl_init('http://'.$this->host.':'.$this->port.'/1.0/event/put'); + + if (!$this->httpConnection) { + throw new \LogicException('Unable to connect to ' . $this->host . ':' . $this->port); + } + + curl_setopt($this->httpConnection, CURLOPT_CUSTOMREQUEST, "POST"); + curl_setopt($this->httpConnection, CURLOPT_RETURNTRANSFER, true); + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + $date = $record['datetime']; + + $data = array('time' => $date->format('Y-m-d\TH:i:s.uO')); + unset($record['datetime']); + + if (isset($record['context']['type'])) { + $data['type'] = $record['context']['type']; + unset($record['context']['type']); + } else { + $data['type'] = $record['channel']; + } + + $data['data'] = $record['context']; + $data['data']['level'] = $record['level']; + + if ($this->scheme === 'http') { + $this->writeHttp(json_encode($data)); + } else { + $this->writeUdp(json_encode($data)); + } + } + + private function writeUdp($data) + { + if (!$this->udpConnection) { + $this->connectUdp(); + } + + socket_send($this->udpConnection, $data, strlen($data), 0); + } + + private function writeHttp($data) + { + if (!$this->httpConnection) { + $this->connectHttp(); + } + + curl_setopt($this->httpConnection, CURLOPT_POSTFIELDS, '['.$data.']'); + curl_setopt($this->httpConnection, CURLOPT_HTTPHEADER, array( + 'Content-Type: application/json', + 'Content-Length: ' . strlen('['.$data.']'), + )); + + Curl\Util::execute($this->httpConnection, 5, false); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php new file mode 100644 index 0000000..48d30b3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler\Curl; + +class Util +{ + private static $retriableErrorCodes = array( + CURLE_COULDNT_RESOLVE_HOST, + CURLE_COULDNT_CONNECT, + CURLE_HTTP_NOT_FOUND, + CURLE_READ_ERROR, + CURLE_OPERATION_TIMEOUTED, + CURLE_HTTP_POST_ERROR, + CURLE_SSL_CONNECT_ERROR, + ); + + /** + * Executes a CURL request with optional retries and exception on failure + * + * @param resource $ch curl handler + * @throws \RuntimeException + */ + public static function execute($ch, $retries = 5, $closeAfterDone = true) + { + while ($retries--) { + if (curl_exec($ch) === false) { + $curlErrno = curl_errno($ch); + + if (false === in_array($curlErrno, self::$retriableErrorCodes, true) || !$retries) { + $curlError = curl_error($ch); + + if ($closeAfterDone) { + curl_close($ch); + } + + throw new \RuntimeException(sprintf('Curl error (code %s): %s', $curlErrno, $curlError)); + } + + continue; + } + + if ($closeAfterDone) { + curl_close($ch); + } + break; + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php new file mode 100644 index 0000000..35b55cb --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php @@ -0,0 +1,169 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Simple handler wrapper that deduplicates log records across multiple requests + * + * It also includes the BufferHandler functionality and will buffer + * all messages until the end of the request or flush() is called. + * + * This works by storing all log records' messages above $deduplicationLevel + * to the file specified by $deduplicationStore. When further logs come in at the end of the + * request (or when flush() is called), all those above $deduplicationLevel are checked + * against the existing stored logs. If they match and the timestamps in the stored log is + * not older than $time seconds, the new log record is discarded. If no log record is new, the + * whole data set is discarded. + * + * This is mainly useful in combination with Mail handlers or things like Slack or HipChat handlers + * that send messages to people, to avoid spamming with the same message over and over in case of + * a major component failure like a database server being down which makes all requests fail in the + * same way. + * + * @author Jordi Boggiano + */ +class DeduplicationHandler extends BufferHandler +{ + /** + * @var string + */ + protected $deduplicationStore; + + /** + * @var int + */ + protected $deduplicationLevel; + + /** + * @var int + */ + protected $time; + + /** + * @var bool + */ + private $gc = false; + + /** + * @param HandlerInterface $handler Handler. + * @param string $deduplicationStore The file/path where the deduplication log should be kept + * @param int $deduplicationLevel The minimum logging level for log records to be looked at for deduplication purposes + * @param int $time The period (in seconds) during which duplicate entries should be suppressed after a given log is sent through + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct(HandlerInterface $handler, $deduplicationStore = null, $deduplicationLevel = Logger::ERROR, $time = 60, $bubble = true) + { + parent::__construct($handler, 0, Logger::DEBUG, $bubble, false); + + $this->deduplicationStore = $deduplicationStore === null ? sys_get_temp_dir() . '/monolog-dedup-' . substr(md5(__FILE__), 0, 20) .'.log' : $deduplicationStore; + $this->deduplicationLevel = Logger::toMonologLevel($deduplicationLevel); + $this->time = $time; + } + + public function flush() + { + if ($this->bufferSize === 0) { + return; + } + + $passthru = null; + + foreach ($this->buffer as $record) { + if ($record['level'] >= $this->deduplicationLevel) { + + $passthru = $passthru || !$this->isDuplicate($record); + if ($passthru) { + $this->appendRecord($record); + } + } + } + + // default of null is valid as well as if no record matches duplicationLevel we just pass through + if ($passthru === true || $passthru === null) { + $this->handler->handleBatch($this->buffer); + } + + $this->clear(); + + if ($this->gc) { + $this->collectLogs(); + } + } + + private function isDuplicate(array $record) + { + if (!file_exists($this->deduplicationStore)) { + return false; + } + + $store = file($this->deduplicationStore, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + if (!is_array($store)) { + return false; + } + + $yesterday = time() - 86400; + $timestampValidity = $record['datetime']->getTimestamp() - $this->time; + $expectedMessage = preg_replace('{[\r\n].*}', '', $record['message']); + + for ($i = count($store) - 1; $i >= 0; $i--) { + list($timestamp, $level, $message) = explode(':', $store[$i], 3); + + if ($level === $record['level_name'] && $message === $expectedMessage && $timestamp > $timestampValidity) { + return true; + } + + if ($timestamp < $yesterday) { + $this->gc = true; + } + } + + return false; + } + + private function collectLogs() + { + if (!file_exists($this->deduplicationStore)) { + return false; + } + + $handle = fopen($this->deduplicationStore, 'rw+'); + flock($handle, LOCK_EX); + $validLogs = array(); + + $timestampValidity = time() - $this->time; + + while (!feof($handle)) { + $log = fgets($handle); + if (substr($log, 0, 10) >= $timestampValidity) { + $validLogs[] = $log; + } + } + + ftruncate($handle, 0); + rewind($handle); + foreach ($validLogs as $log) { + fwrite($handle, $log); + } + + flock($handle, LOCK_UN); + fclose($handle); + + $this->gc = false; + } + + private function appendRecord(array $record) + { + file_put_contents($this->deduplicationStore, $record['datetime']->getTimestamp() . ':' . $record['level_name'] . ':' . preg_replace('{[\r\n].*}', '', $record['message']) . "\n", FILE_APPEND); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php new file mode 100644 index 0000000..b91ffec --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\NormalizerFormatter; +use Doctrine\CouchDB\CouchDBClient; + +/** + * CouchDB handler for Doctrine CouchDB ODM + * + * @author Markus Bachmann + */ +class DoctrineCouchDBHandler extends AbstractProcessingHandler +{ + private $client; + + public function __construct(CouchDBClient $client, $level = Logger::DEBUG, $bubble = true) + { + $this->client = $client; + parent::__construct($level, $bubble); + } + + /** + * {@inheritDoc} + */ + protected function write(array $record) + { + $this->client->postDocument($record['formatted']); + } + + protected function getDefaultFormatter() + { + return new NormalizerFormatter; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php new file mode 100644 index 0000000..237b71f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Aws\Sdk; +use Aws\DynamoDb\DynamoDbClient; +use Aws\DynamoDb\Marshaler; +use Monolog\Formatter\ScalarFormatter; +use Monolog\Logger; + +/** + * Amazon DynamoDB handler (http://aws.amazon.com/dynamodb/) + * + * @link https://github.com/aws/aws-sdk-php/ + * @author Andrew Lawson + */ +class DynamoDbHandler extends AbstractProcessingHandler +{ + const DATE_FORMAT = 'Y-m-d\TH:i:s.uO'; + + /** + * @var DynamoDbClient + */ + protected $client; + + /** + * @var string + */ + protected $table; + + /** + * @var int + */ + protected $version; + + /** + * @var Marshaler + */ + protected $marshaler; + + /** + * @param DynamoDbClient $client + * @param string $table + * @param int $level + * @param bool $bubble + */ + public function __construct(DynamoDbClient $client, $table, $level = Logger::DEBUG, $bubble = true) + { + if (defined('Aws\Sdk::VERSION') && version_compare(Sdk::VERSION, '3.0', '>=')) { + $this->version = 3; + $this->marshaler = new Marshaler; + } else { + $this->version = 2; + } + + $this->client = $client; + $this->table = $table; + + parent::__construct($level, $bubble); + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + $filtered = $this->filterEmptyFields($record['formatted']); + if ($this->version === 3) { + $formatted = $this->marshaler->marshalItem($filtered); + } else { + $formatted = $this->client->formatAttributes($filtered); + } + + $this->client->putItem(array( + 'TableName' => $this->table, + 'Item' => $formatted, + )); + } + + /** + * @param array $record + * @return array + */ + protected function filterEmptyFields(array $record) + { + return array_filter($record, function ($value) { + return !empty($value) || false === $value || 0 === $value; + }); + } + + /** + * {@inheritdoc} + */ + protected function getDefaultFormatter() + { + return new ScalarFormatter(self::DATE_FORMAT); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php new file mode 100644 index 0000000..bb0f83e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php @@ -0,0 +1,128 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\FormatterInterface; +use Monolog\Formatter\ElasticaFormatter; +use Monolog\Logger; +use Elastica\Client; +use Elastica\Exception\ExceptionInterface; + +/** + * Elastic Search handler + * + * Usage example: + * + * $client = new \Elastica\Client(); + * $options = array( + * 'index' => 'elastic_index_name', + * 'type' => 'elastic_doc_type', + * ); + * $handler = new ElasticSearchHandler($client, $options); + * $log = new Logger('application'); + * $log->pushHandler($handler); + * + * @author Jelle Vink + */ +class ElasticSearchHandler extends AbstractProcessingHandler +{ + /** + * @var Client + */ + protected $client; + + /** + * @var array Handler config options + */ + protected $options = array(); + + /** + * @param Client $client Elastica Client object + * @param array $options Handler configuration + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct(Client $client, array $options = array(), $level = Logger::DEBUG, $bubble = true) + { + parent::__construct($level, $bubble); + $this->client = $client; + $this->options = array_merge( + array( + 'index' => 'monolog', // Elastic index name + 'type' => 'record', // Elastic document type + 'ignore_error' => false, // Suppress Elastica exceptions + ), + $options + ); + } + + /** + * {@inheritDoc} + */ + protected function write(array $record) + { + $this->bulkSend(array($record['formatted'])); + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + if ($formatter instanceof ElasticaFormatter) { + return parent::setFormatter($formatter); + } + throw new \InvalidArgumentException('ElasticSearchHandler is only compatible with ElasticaFormatter'); + } + + /** + * Getter options + * @return array + */ + public function getOptions() + { + return $this->options; + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new ElasticaFormatter($this->options['index'], $this->options['type']); + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + $documents = $this->getFormatter()->formatBatch($records); + $this->bulkSend($documents); + } + + /** + * Use Elasticsearch bulk API to send list of documents + * @param array $documents + * @throws \RuntimeException + */ + protected function bulkSend(array $documents) + { + try { + $this->client->addDocuments($documents); + } catch (ExceptionInterface $e) { + if (!$this->options['ignore_error']) { + throw new \RuntimeException("Error sending messages to Elasticsearch", 0, $e); + } + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php new file mode 100644 index 0000000..b2986b0 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php @@ -0,0 +1,82 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\LineFormatter; +use Monolog\Logger; + +/** + * Stores to PHP error_log() handler. + * + * @author Elan Ruusamäe + */ +class ErrorLogHandler extends AbstractProcessingHandler +{ + const OPERATING_SYSTEM = 0; + const SAPI = 4; + + protected $messageType; + protected $expandNewlines; + + /** + * @param int $messageType Says where the error should go. + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries + */ + public function __construct($messageType = self::OPERATING_SYSTEM, $level = Logger::DEBUG, $bubble = true, $expandNewlines = false) + { + parent::__construct($level, $bubble); + + if (false === in_array($messageType, self::getAvailableTypes())) { + $message = sprintf('The given message type "%s" is not supported', print_r($messageType, true)); + throw new \InvalidArgumentException($message); + } + + $this->messageType = $messageType; + $this->expandNewlines = $expandNewlines; + } + + /** + * @return array With all available types + */ + public static function getAvailableTypes() + { + return array( + self::OPERATING_SYSTEM, + self::SAPI, + ); + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new LineFormatter('[%datetime%] %channel%.%level_name%: %message% %context% %extra%'); + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + if ($this->expandNewlines) { + $lines = preg_split('{[\r\n]+}', (string) $record['formatted']); + foreach ($lines as $line) { + error_log($line, $this->messageType); + } + } else { + error_log((string) $record['formatted'], $this->messageType); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php new file mode 100644 index 0000000..938c1a7 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php @@ -0,0 +1,140 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Simple handler wrapper that filters records based on a list of levels + * + * It can be configured with an exact list of levels to allow, or a min/max level. + * + * @author Hennadiy Verkh + * @author Jordi Boggiano + */ +class FilterHandler extends AbstractHandler +{ + /** + * Handler or factory callable($record, $this) + * + * @var callable|\Monolog\Handler\HandlerInterface + */ + protected $handler; + + /** + * Minimum level for logs that are passed to handler + * + * @var int[] + */ + protected $acceptedLevels; + + /** + * Whether the messages that are handled can bubble up the stack or not + * + * @var bool + */ + protected $bubble; + + /** + * @param callable|HandlerInterface $handler Handler or factory callable($record, $this). + * @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided + * @param int $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($handler, $minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY, $bubble = true) + { + $this->handler = $handler; + $this->bubble = $bubble; + $this->setAcceptedLevels($minLevelOrList, $maxLevel); + + if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { + throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); + } + } + + /** + * @return array + */ + public function getAcceptedLevels() + { + return array_flip($this->acceptedLevels); + } + + /** + * @param int|string|array $minLevelOrList A list of levels to accept or a minimum level or level name if maxLevel is provided + * @param int|string $maxLevel Maximum level or level name to accept, only used if $minLevelOrList is not an array + */ + public function setAcceptedLevels($minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY) + { + if (is_array($minLevelOrList)) { + $acceptedLevels = array_map('Monolog\Logger::toMonologLevel', $minLevelOrList); + } else { + $minLevelOrList = Logger::toMonologLevel($minLevelOrList); + $maxLevel = Logger::toMonologLevel($maxLevel); + $acceptedLevels = array_values(array_filter(Logger::getLevels(), function ($level) use ($minLevelOrList, $maxLevel) { + return $level >= $minLevelOrList && $level <= $maxLevel; + })); + } + $this->acceptedLevels = array_flip($acceptedLevels); + } + + /** + * {@inheritdoc} + */ + public function isHandling(array $record) + { + return isset($this->acceptedLevels[$record['level']]); + } + + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + if (!$this->isHandling($record)) { + return false; + } + + // The same logic as in FingersCrossedHandler + if (!$this->handler instanceof HandlerInterface) { + $this->handler = call_user_func($this->handler, $record, $this); + if (!$this->handler instanceof HandlerInterface) { + throw new \RuntimeException("The factory callable should return a HandlerInterface"); + } + } + + if ($this->processors) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + } + + $this->handler->handle($record); + + return false === $this->bubble; + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + $filtered = array(); + foreach ($records as $record) { + if ($this->isHandling($record)) { + $filtered[] = $record; + } + } + + $this->handler->handleBatch($filtered); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php new file mode 100644 index 0000000..aaca12c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler\FingersCrossed; + +/** + * Interface for activation strategies for the FingersCrossedHandler. + * + * @author Johannes M. Schmitt + */ +interface ActivationStrategyInterface +{ + /** + * Returns whether the given record activates the handler. + * + * @param array $record + * @return bool + */ + public function isHandlerActivated(array $record); +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php new file mode 100644 index 0000000..2a2a64d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler\FingersCrossed; + +use Monolog\Logger; + +/** + * Channel and Error level based monolog activation strategy. Allows to trigger activation + * based on level per channel. e.g. trigger activation on level 'ERROR' by default, except + * for records of the 'sql' channel; those should trigger activation on level 'WARN'. + * + * Example: + * + * + * $activationStrategy = new ChannelLevelActivationStrategy( + * Logger::CRITICAL, + * array( + * 'request' => Logger::ALERT, + * 'sensitive' => Logger::ERROR, + * ) + * ); + * $handler = new FingersCrossedHandler(new StreamHandler('php://stderr'), $activationStrategy); + * + * + * @author Mike Meessen + */ +class ChannelLevelActivationStrategy implements ActivationStrategyInterface +{ + private $defaultActionLevel; + private $channelToActionLevel; + + /** + * @param int $defaultActionLevel The default action level to be used if the record's category doesn't match any + * @param array $channelToActionLevel An array that maps channel names to action levels. + */ + public function __construct($defaultActionLevel, $channelToActionLevel = array()) + { + $this->defaultActionLevel = Logger::toMonologLevel($defaultActionLevel); + $this->channelToActionLevel = array_map('Monolog\Logger::toMonologLevel', $channelToActionLevel); + } + + public function isHandlerActivated(array $record) + { + if (isset($this->channelToActionLevel[$record['channel']])) { + return $record['level'] >= $this->channelToActionLevel[$record['channel']]; + } + + return $record['level'] >= $this->defaultActionLevel; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php new file mode 100644 index 0000000..6e63085 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler\FingersCrossed; + +use Monolog\Logger; + +/** + * Error level based activation strategy. + * + * @author Johannes M. Schmitt + */ +class ErrorLevelActivationStrategy implements ActivationStrategyInterface +{ + private $actionLevel; + + public function __construct($actionLevel) + { + $this->actionLevel = Logger::toMonologLevel($actionLevel); + } + + public function isHandlerActivated(array $record) + { + return $record['level'] >= $this->actionLevel; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php new file mode 100644 index 0000000..275fd51 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php @@ -0,0 +1,177 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; +use Monolog\Handler\FingersCrossed\ActivationStrategyInterface; +use Monolog\Logger; +use Monolog\ResettableInterface; + +/** + * Buffers all records until a certain level is reached + * + * The advantage of this approach is that you don't get any clutter in your log files. + * Only requests which actually trigger an error (or whatever your actionLevel is) will be + * in the logs, but they will contain all records, not only those above the level threshold. + * + * You can find the various activation strategies in the + * Monolog\Handler\FingersCrossed\ namespace. + * + * @author Jordi Boggiano + */ +class FingersCrossedHandler extends AbstractHandler +{ + protected $handler; + protected $activationStrategy; + protected $buffering = true; + protected $bufferSize; + protected $buffer = array(); + protected $stopBuffering; + protected $passthruLevel; + + /** + * @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler). + * @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action + * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $stopBuffering Whether the handler should stop buffering after being triggered (default true) + * @param int $passthruLevel Minimum level to always flush to handler on close, even if strategy not triggered + */ + public function __construct($handler, $activationStrategy = null, $bufferSize = 0, $bubble = true, $stopBuffering = true, $passthruLevel = null) + { + if (null === $activationStrategy) { + $activationStrategy = new ErrorLevelActivationStrategy(Logger::WARNING); + } + + // convert simple int activationStrategy to an object + if (!$activationStrategy instanceof ActivationStrategyInterface) { + $activationStrategy = new ErrorLevelActivationStrategy($activationStrategy); + } + + $this->handler = $handler; + $this->activationStrategy = $activationStrategy; + $this->bufferSize = $bufferSize; + $this->bubble = $bubble; + $this->stopBuffering = $stopBuffering; + + if ($passthruLevel !== null) { + $this->passthruLevel = Logger::toMonologLevel($passthruLevel); + } + + if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { + throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); + } + } + + /** + * {@inheritdoc} + */ + public function isHandling(array $record) + { + return true; + } + + /** + * Manually activate this logger regardless of the activation strategy + */ + public function activate() + { + if ($this->stopBuffering) { + $this->buffering = false; + } + if (!$this->handler instanceof HandlerInterface) { + $record = end($this->buffer) ?: null; + + $this->handler = call_user_func($this->handler, $record, $this); + if (!$this->handler instanceof HandlerInterface) { + throw new \RuntimeException("The factory callable should return a HandlerInterface"); + } + } + $this->handler->handleBatch($this->buffer); + $this->buffer = array(); + } + + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + if ($this->processors) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + } + + if ($this->buffering) { + $this->buffer[] = $record; + if ($this->bufferSize > 0 && count($this->buffer) > $this->bufferSize) { + array_shift($this->buffer); + } + if ($this->activationStrategy->isHandlerActivated($record)) { + $this->activate(); + } + } else { + $this->handler->handle($record); + } + + return false === $this->bubble; + } + + /** + * {@inheritdoc} + */ + public function close() + { + $this->flushBuffer(); + } + + public function reset() + { + $this->flushBuffer(); + + parent::reset(); + + if ($this->handler instanceof ResettableInterface) { + $this->handler->reset(); + } + } + + /** + * Clears the buffer without flushing any messages down to the wrapped handler. + * + * It also resets the handler to its initial buffering state. + */ + public function clear() + { + $this->buffer = array(); + $this->reset(); + } + + /** + * Resets the state of the handler. Stops forwarding records to the wrapped handler. + */ + private function flushBuffer() + { + if (null !== $this->passthruLevel) { + $level = $this->passthruLevel; + $this->buffer = array_filter($this->buffer, function ($record) use ($level) { + return $record['level'] >= $level; + }); + if (count($this->buffer) > 0) { + $this->handler->handleBatch($this->buffer); + } + } + + $this->buffer = array(); + $this->buffering = true; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php new file mode 100644 index 0000000..c30b184 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php @@ -0,0 +1,195 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\WildfireFormatter; + +/** + * Simple FirePHP Handler (http://www.firephp.org/), which uses the Wildfire protocol. + * + * @author Eric Clemmons (@ericclemmons) + */ +class FirePHPHandler extends AbstractProcessingHandler +{ + /** + * WildFire JSON header message format + */ + const PROTOCOL_URI = 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2'; + + /** + * FirePHP structure for parsing messages & their presentation + */ + const STRUCTURE_URI = 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'; + + /** + * Must reference a "known" plugin, otherwise headers won't display in FirePHP + */ + const PLUGIN_URI = 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3'; + + /** + * Header prefix for Wildfire to recognize & parse headers + */ + const HEADER_PREFIX = 'X-Wf'; + + /** + * Whether or not Wildfire vendor-specific headers have been generated & sent yet + */ + protected static $initialized = false; + + /** + * Shared static message index between potentially multiple handlers + * @var int + */ + protected static $messageIndex = 1; + + protected static $sendHeaders = true; + + /** + * Base header creation function used by init headers & record headers + * + * @param array $meta Wildfire Plugin, Protocol & Structure Indexes + * @param string $message Log message + * @return array Complete header string ready for the client as key and message as value + */ + protected function createHeader(array $meta, $message) + { + $header = sprintf('%s-%s', self::HEADER_PREFIX, join('-', $meta)); + + return array($header => $message); + } + + /** + * Creates message header from record + * + * @see createHeader() + * @param array $record + * @return string + */ + protected function createRecordHeader(array $record) + { + // Wildfire is extensible to support multiple protocols & plugins in a single request, + // but we're not taking advantage of that (yet), so we're using "1" for simplicity's sake. + return $this->createHeader( + array(1, 1, 1, self::$messageIndex++), + $record['formatted'] + ); + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new WildfireFormatter(); + } + + /** + * Wildfire initialization headers to enable message parsing + * + * @see createHeader() + * @see sendHeader() + * @return array + */ + protected function getInitHeaders() + { + // Initial payload consists of required headers for Wildfire + return array_merge( + $this->createHeader(array('Protocol', 1), self::PROTOCOL_URI), + $this->createHeader(array(1, 'Structure', 1), self::STRUCTURE_URI), + $this->createHeader(array(1, 'Plugin', 1), self::PLUGIN_URI) + ); + } + + /** + * Send header string to the client + * + * @param string $header + * @param string $content + */ + protected function sendHeader($header, $content) + { + if (!headers_sent() && self::$sendHeaders) { + header(sprintf('%s: %s', $header, $content)); + } + } + + /** + * Creates & sends header for a record, ensuring init headers have been sent prior + * + * @see sendHeader() + * @see sendInitHeaders() + * @param array $record + */ + protected function write(array $record) + { + if (!self::$sendHeaders) { + return; + } + + // WildFire-specific headers must be sent prior to any messages + if (!self::$initialized) { + self::$initialized = true; + + self::$sendHeaders = $this->headersAccepted(); + if (!self::$sendHeaders) { + return; + } + + foreach ($this->getInitHeaders() as $header => $content) { + $this->sendHeader($header, $content); + } + } + + $header = $this->createRecordHeader($record); + if (trim(current($header)) !== '') { + $this->sendHeader(key($header), current($header)); + } + } + + /** + * Verifies if the headers are accepted by the current user agent + * + * @return bool + */ + protected function headersAccepted() + { + if (!empty($_SERVER['HTTP_USER_AGENT']) && preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT'])) { + return true; + } + + return isset($_SERVER['HTTP_X_FIREPHP_VERSION']); + } + + /** + * BC getter for the sendHeaders property that has been made static + */ + public function __get($property) + { + if ('sendHeaders' !== $property) { + throw new \InvalidArgumentException('Undefined property '.$property); + } + + return static::$sendHeaders; + } + + /** + * BC setter for the sendHeaders property that has been made static + */ + public function __set($property, $value) + { + if ('sendHeaders' !== $property) { + throw new \InvalidArgumentException('Undefined property '.$property); + } + + static::$sendHeaders = $value; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php new file mode 100644 index 0000000..c43c013 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php @@ -0,0 +1,126 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\LineFormatter; +use Monolog\Logger; + +/** + * Sends logs to Fleep.io using Webhook integrations + * + * You'll need a Fleep.io account to use this handler. + * + * @see https://fleep.io/integrations/webhooks/ Fleep Webhooks Documentation + * @author Ando Roots + */ +class FleepHookHandler extends SocketHandler +{ + const FLEEP_HOST = 'fleep.io'; + + const FLEEP_HOOK_URI = '/hook/'; + + /** + * @var string Webhook token (specifies the conversation where logs are sent) + */ + protected $token; + + /** + * Construct a new Fleep.io Handler. + * + * For instructions on how to create a new web hook in your conversations + * see https://fleep.io/integrations/webhooks/ + * + * @param string $token Webhook token + * @param bool|int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @throws MissingExtensionException + */ + public function __construct($token, $level = Logger::DEBUG, $bubble = true) + { + if (!extension_loaded('openssl')) { + throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FleepHookHandler'); + } + + $this->token = $token; + + $connectionString = 'ssl://' . self::FLEEP_HOST . ':443'; + parent::__construct($connectionString, $level, $bubble); + } + + /** + * Returns the default formatter to use with this handler + * + * Overloaded to remove empty context and extra arrays from the end of the log message. + * + * @return LineFormatter + */ + protected function getDefaultFormatter() + { + return new LineFormatter(null, null, true, true); + } + + /** + * Handles a log record + * + * @param array $record + */ + public function write(array $record) + { + parent::write($record); + $this->closeSocket(); + } + + /** + * {@inheritdoc} + * + * @param array $record + * @return string + */ + protected function generateDataStream($record) + { + $content = $this->buildContent($record); + + return $this->buildHeader($content) . $content; + } + + /** + * Builds the header of the API Call + * + * @param string $content + * @return string + */ + private function buildHeader($content) + { + $header = "POST " . self::FLEEP_HOOK_URI . $this->token . " HTTP/1.1\r\n"; + $header .= "Host: " . self::FLEEP_HOST . "\r\n"; + $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; + $header .= "Content-Length: " . strlen($content) . "\r\n"; + $header .= "\r\n"; + + return $header; + } + + /** + * Builds the body of API call + * + * @param array $record + * @return string + */ + private function buildContent($record) + { + $dataArray = array( + 'message' => $record['formatted'], + ); + + return http_build_query($dataArray); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php new file mode 100644 index 0000000..dd9a361 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php @@ -0,0 +1,127 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\FlowdockFormatter; +use Monolog\Formatter\FormatterInterface; + +/** + * Sends notifications through the Flowdock push API + * + * This must be configured with a FlowdockFormatter instance via setFormatter() + * + * Notes: + * API token - Flowdock API token + * + * @author Dominik Liebler + * @see https://www.flowdock.com/api/push + */ +class FlowdockHandler extends SocketHandler +{ + /** + * @var string + */ + protected $apiToken; + + /** + * @param string $apiToken + * @param bool|int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * + * @throws MissingExtensionException if OpenSSL is missing + */ + public function __construct($apiToken, $level = Logger::DEBUG, $bubble = true) + { + if (!extension_loaded('openssl')) { + throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FlowdockHandler'); + } + + parent::__construct('ssl://api.flowdock.com:443', $level, $bubble); + $this->apiToken = $apiToken; + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + if (!$formatter instanceof FlowdockFormatter) { + throw new \InvalidArgumentException('The FlowdockHandler requires an instance of Monolog\Formatter\FlowdockFormatter to function correctly'); + } + + return parent::setFormatter($formatter); + } + + /** + * Gets the default formatter. + * + * @return FormatterInterface + */ + protected function getDefaultFormatter() + { + throw new \InvalidArgumentException('The FlowdockHandler must be configured (via setFormatter) with an instance of Monolog\Formatter\FlowdockFormatter to function correctly'); + } + + /** + * {@inheritdoc} + * + * @param array $record + */ + protected function write(array $record) + { + parent::write($record); + + $this->closeSocket(); + } + + /** + * {@inheritdoc} + * + * @param array $record + * @return string + */ + protected function generateDataStream($record) + { + $content = $this->buildContent($record); + + return $this->buildHeader($content) . $content; + } + + /** + * Builds the body of API call + * + * @param array $record + * @return string + */ + private function buildContent($record) + { + return json_encode($record['formatted']['flowdock']); + } + + /** + * Builds the header of the API Call + * + * @param string $content + * @return string + */ + private function buildHeader($content) + { + $header = "POST /v1/messages/team_inbox/" . $this->apiToken . " HTTP/1.1\r\n"; + $header .= "Host: api.flowdock.com\r\n"; + $header .= "Content-Type: application/json\r\n"; + $header .= "Content-Length: " . strlen($content) . "\r\n"; + $header .= "\r\n"; + + return $header; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php new file mode 100644 index 0000000..3e2f1b2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\FormatterInterface; + +/** + * Interface to describe loggers that have a formatter + * + * This interface is present in monolog 1.x to ease forward compatibility. + * + * @author Jordi Boggiano + */ +interface FormattableHandlerInterface +{ + /** + * Sets the formatter. + * + * @param FormatterInterface $formatter + * @return HandlerInterface self + */ + public function setFormatter(FormatterInterface $formatter): HandlerInterface; + + /** + * Gets the formatter. + * + * @return FormatterInterface + */ + public function getFormatter(): FormatterInterface; +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php new file mode 100644 index 0000000..e9ec5e7 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\FormatterInterface; +use Monolog\Formatter\LineFormatter; + +/** + * Helper trait for implementing FormattableInterface + * + * This trait is present in monolog 1.x to ease forward compatibility. + * + * @author Jordi Boggiano + */ +trait FormattableHandlerTrait +{ + /** + * @var FormatterInterface + */ + protected $formatter; + + /** + * {@inheritdoc} + * @suppress PhanTypeMismatchReturn + */ + public function setFormatter(FormatterInterface $formatter): HandlerInterface + { + $this->formatter = $formatter; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormatter(): FormatterInterface + { + if (!$this->formatter) { + $this->formatter = $this->getDefaultFormatter(); + } + + return $this->formatter; + } + + /** + * Gets the default formatter. + * + * Overwrite this if the LineFormatter is not a good default for your handler. + */ + protected function getDefaultFormatter(): FormatterInterface + { + return new LineFormatter(); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php new file mode 100644 index 0000000..71e4669 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Gelf\IMessagePublisher; +use Gelf\PublisherInterface; +use Gelf\Publisher; +use InvalidArgumentException; +use Monolog\Logger; +use Monolog\Formatter\GelfMessageFormatter; + +/** + * Handler to send messages to a Graylog2 (http://www.graylog2.org) server + * + * @author Matt Lehner + * @author Benjamin Zikarsky + */ +class GelfHandler extends AbstractProcessingHandler +{ + /** + * @var Publisher the publisher object that sends the message to the server + */ + protected $publisher; + + /** + * @param PublisherInterface|IMessagePublisher|Publisher $publisher a publisher object + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($publisher, $level = Logger::DEBUG, $bubble = true) + { + parent::__construct($level, $bubble); + + if (!$publisher instanceof Publisher && !$publisher instanceof IMessagePublisher && !$publisher instanceof PublisherInterface) { + throw new InvalidArgumentException('Invalid publisher, expected a Gelf\Publisher, Gelf\IMessagePublisher or Gelf\PublisherInterface instance'); + } + + $this->publisher = $publisher; + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + $this->publisher->publish($record['formatted']); + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new GelfMessageFormatter(); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php new file mode 100644 index 0000000..0d461f9 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php @@ -0,0 +1,117 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\FormatterInterface; +use Monolog\ResettableInterface; + +/** + * Forwards records to multiple handlers + * + * @author Lenar Lõhmus + */ +class GroupHandler extends AbstractHandler +{ + protected $handlers; + + /** + * @param array $handlers Array of Handlers. + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct(array $handlers, $bubble = true) + { + foreach ($handlers as $handler) { + if (!$handler instanceof HandlerInterface) { + throw new \InvalidArgumentException('The first argument of the GroupHandler must be an array of HandlerInterface instances.'); + } + } + + $this->handlers = $handlers; + $this->bubble = $bubble; + } + + /** + * {@inheritdoc} + */ + public function isHandling(array $record) + { + foreach ($this->handlers as $handler) { + if ($handler->isHandling($record)) { + return true; + } + } + + return false; + } + + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + if ($this->processors) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + } + + foreach ($this->handlers as $handler) { + $handler->handle($record); + } + + return false === $this->bubble; + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + if ($this->processors) { + $processed = array(); + foreach ($records as $record) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + $processed[] = $record; + } + $records = $processed; + } + + foreach ($this->handlers as $handler) { + $handler->handleBatch($records); + } + } + + public function reset() + { + parent::reset(); + + foreach ($this->handlers as $handler) { + if ($handler instanceof ResettableInterface) { + $handler->reset(); + } + } + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + foreach ($this->handlers as $handler) { + $handler->setFormatter($formatter); + } + + return $this; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php new file mode 100644 index 0000000..8d5a4a0 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php @@ -0,0 +1,90 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\FormatterInterface; + +/** + * Interface that all Monolog Handlers must implement + * + * @author Jordi Boggiano + */ +interface HandlerInterface +{ + /** + * Checks whether the given record will be handled by this handler. + * + * This is mostly done for performance reasons, to avoid calling processors for nothing. + * + * Handlers should still check the record levels within handle(), returning false in isHandling() + * is no guarantee that handle() will not be called, and isHandling() might not be called + * for a given record. + * + * @param array $record Partial log record containing only a level key + * + * @return bool + */ + public function isHandling(array $record); + + /** + * Handles a record. + * + * All records may be passed to this method, and the handler should discard + * those that it does not want to handle. + * + * The return value of this function controls the bubbling process of the handler stack. + * Unless the bubbling is interrupted (by returning true), the Logger class will keep on + * calling further handlers in the stack with a given log record. + * + * @param array $record The record to handle + * @return bool true means that this handler handled the record, and that bubbling is not permitted. + * false means the record was either not processed or that this handler allows bubbling. + */ + public function handle(array $record); + + /** + * Handles a set of records at once. + * + * @param array $records The records to handle (an array of record arrays) + */ + public function handleBatch(array $records); + + /** + * Adds a processor in the stack. + * + * @param callable $callback + * @return self + */ + public function pushProcessor($callback); + + /** + * Removes the processor on top of the stack and returns it. + * + * @return callable + */ + public function popProcessor(); + + /** + * Sets the formatter. + * + * @param FormatterInterface $formatter + * @return self + */ + public function setFormatter(FormatterInterface $formatter); + + /** + * Gets the formatter. + * + * @return FormatterInterface + */ + public function getFormatter(); +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php new file mode 100644 index 0000000..55e6498 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php @@ -0,0 +1,116 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\ResettableInterface; +use Monolog\Formatter\FormatterInterface; + +/** + * This simple wrapper class can be used to extend handlers functionality. + * + * Example: A custom filtering that can be applied to any handler. + * + * Inherit from this class and override handle() like this: + * + * public function handle(array $record) + * { + * if ($record meets certain conditions) { + * return false; + * } + * return $this->handler->handle($record); + * } + * + * @author Alexey Karapetov + */ +class HandlerWrapper implements HandlerInterface, ResettableInterface +{ + /** + * @var HandlerInterface + */ + protected $handler; + + /** + * HandlerWrapper constructor. + * @param HandlerInterface $handler + */ + public function __construct(HandlerInterface $handler) + { + $this->handler = $handler; + } + + /** + * {@inheritdoc} + */ + public function isHandling(array $record) + { + return $this->handler->isHandling($record); + } + + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + return $this->handler->handle($record); + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + return $this->handler->handleBatch($records); + } + + /** + * {@inheritdoc} + */ + public function pushProcessor($callback) + { + $this->handler->pushProcessor($callback); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function popProcessor() + { + return $this->handler->popProcessor(); + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->handler->setFormatter($formatter); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + return $this->handler->getFormatter(); + } + + public function reset() + { + if ($this->handler instanceof ResettableInterface) { + return $this->handler->reset(); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php new file mode 100644 index 0000000..179d626 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php @@ -0,0 +1,367 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Sends notifications through the hipchat api to a hipchat room + * + * Notes: + * API token - HipChat API token + * Room - HipChat Room Id or name, where messages are sent + * Name - Name used to send the message (from) + * notify - Should the message trigger a notification in the clients + * version - The API version to use (HipChatHandler::API_V1 | HipChatHandler::API_V2) + * + * @author Rafael Dohms + * @see https://www.hipchat.com/docs/api + */ +class HipChatHandler extends SocketHandler +{ + /** + * Use API version 1 + */ + const API_V1 = 'v1'; + + /** + * Use API version v2 + */ + const API_V2 = 'v2'; + + /** + * The maximum allowed length for the name used in the "from" field. + */ + const MAXIMUM_NAME_LENGTH = 15; + + /** + * The maximum allowed length for the message. + */ + const MAXIMUM_MESSAGE_LENGTH = 9500; + + /** + * @var string + */ + private $token; + + /** + * @var string + */ + private $room; + + /** + * @var string + */ + private $name; + + /** + * @var bool + */ + private $notify; + + /** + * @var string + */ + private $format; + + /** + * @var string + */ + private $host; + + /** + * @var string + */ + private $version; + + /** + * @param string $token HipChat API Token + * @param string $room The room that should be alerted of the message (Id or Name) + * @param string $name Name used in the "from" field. + * @param bool $notify Trigger a notification in clients or not + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $useSSL Whether to connect via SSL. + * @param string $format The format of the messages (default to text, can be set to html if you have html in the messages) + * @param string $host The HipChat server hostname. + * @param string $version The HipChat API version (default HipChatHandler::API_V1) + */ + public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com', $version = self::API_V1) + { + @trigger_error('The Monolog\Handler\HipChatHandler class is deprecated. You should migrate to Slack and the SlackWebhookHandler / SlackbotHandler, see https://www.atlassian.com/partnerships/slack', E_USER_DEPRECATED); + + if ($version == self::API_V1 && !$this->validateStringLength($name, static::MAXIMUM_NAME_LENGTH)) { + throw new \InvalidArgumentException('The supplied name is too long. HipChat\'s v1 API supports names up to 15 UTF-8 characters.'); + } + + $connectionString = $useSSL ? 'ssl://'.$host.':443' : $host.':80'; + parent::__construct($connectionString, $level, $bubble); + + $this->token = $token; + $this->name = $name; + $this->notify = $notify; + $this->room = $room; + $this->format = $format; + $this->host = $host; + $this->version = $version; + } + + /** + * {@inheritdoc} + * + * @param array $record + * @return string + */ + protected function generateDataStream($record) + { + $content = $this->buildContent($record); + + return $this->buildHeader($content) . $content; + } + + /** + * Builds the body of API call + * + * @param array $record + * @return string + */ + private function buildContent($record) + { + $dataArray = array( + 'notify' => $this->version == self::API_V1 ? + ($this->notify ? 1 : 0) : + ($this->notify ? 'true' : 'false'), + 'message' => $record['formatted'], + 'message_format' => $this->format, + 'color' => $this->getAlertColor($record['level']), + ); + + if (!$this->validateStringLength($dataArray['message'], static::MAXIMUM_MESSAGE_LENGTH)) { + if (function_exists('mb_substr')) { + $dataArray['message'] = mb_substr($dataArray['message'], 0, static::MAXIMUM_MESSAGE_LENGTH).' [truncated]'; + } else { + $dataArray['message'] = substr($dataArray['message'], 0, static::MAXIMUM_MESSAGE_LENGTH).' [truncated]'; + } + } + + // if we are using the legacy API then we need to send some additional information + if ($this->version == self::API_V1) { + $dataArray['room_id'] = $this->room; + } + + // append the sender name if it is set + // always append it if we use the v1 api (it is required in v1) + if ($this->version == self::API_V1 || $this->name !== null) { + $dataArray['from'] = (string) $this->name; + } + + return http_build_query($dataArray); + } + + /** + * Builds the header of the API Call + * + * @param string $content + * @return string + */ + private function buildHeader($content) + { + if ($this->version == self::API_V1) { + $header = "POST /v1/rooms/message?format=json&auth_token={$this->token} HTTP/1.1\r\n"; + } else { + // needed for rooms with special (spaces, etc) characters in the name + $room = rawurlencode($this->room); + $header = "POST /v2/room/{$room}/notification?auth_token={$this->token} HTTP/1.1\r\n"; + } + + $header .= "Host: {$this->host}\r\n"; + $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; + $header .= "Content-Length: " . strlen($content) . "\r\n"; + $header .= "\r\n"; + + return $header; + } + + /** + * Assigns a color to each level of log records. + * + * @param int $level + * @return string + */ + protected function getAlertColor($level) + { + switch (true) { + case $level >= Logger::ERROR: + return 'red'; + case $level >= Logger::WARNING: + return 'yellow'; + case $level >= Logger::INFO: + return 'green'; + case $level == Logger::DEBUG: + return 'gray'; + default: + return 'yellow'; + } + } + + /** + * {@inheritdoc} + * + * @param array $record + */ + protected function write(array $record) + { + parent::write($record); + $this->finalizeWrite(); + } + + /** + * Finalizes the request by reading some bytes and then closing the socket + * + * If we do not read some but close the socket too early, hipchat sometimes + * drops the request entirely. + */ + protected function finalizeWrite() + { + $res = $this->getResource(); + if (is_resource($res)) { + @fread($res, 2048); + } + $this->closeSocket(); + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + if (count($records) == 0) { + return true; + } + + $batchRecords = $this->combineRecords($records); + + $handled = false; + foreach ($batchRecords as $batchRecord) { + if ($this->isHandling($batchRecord)) { + $this->write($batchRecord); + $handled = true; + } + } + + if (!$handled) { + return false; + } + + return false === $this->bubble; + } + + /** + * Combines multiple records into one. Error level of the combined record + * will be the highest level from the given records. Datetime will be taken + * from the first record. + * + * @param $records + * @return array + */ + private function combineRecords($records) + { + $batchRecord = null; + $batchRecords = array(); + $messages = array(); + $formattedMessages = array(); + $level = 0; + $levelName = null; + $datetime = null; + + foreach ($records as $record) { + $record = $this->processRecord($record); + + if ($record['level'] > $level) { + $level = $record['level']; + $levelName = $record['level_name']; + } + + if (null === $datetime) { + $datetime = $record['datetime']; + } + + $messages[] = $record['message']; + $messageStr = implode(PHP_EOL, $messages); + $formattedMessages[] = $this->getFormatter()->format($record); + $formattedMessageStr = implode('', $formattedMessages); + + $batchRecord = array( + 'message' => $messageStr, + 'formatted' => $formattedMessageStr, + 'context' => array(), + 'extra' => array(), + ); + + if (!$this->validateStringLength($batchRecord['formatted'], static::MAXIMUM_MESSAGE_LENGTH)) { + // Pop the last message and implode the remaining messages + $lastMessage = array_pop($messages); + $lastFormattedMessage = array_pop($formattedMessages); + $batchRecord['message'] = implode(PHP_EOL, $messages); + $batchRecord['formatted'] = implode('', $formattedMessages); + + $batchRecords[] = $batchRecord; + $messages = array($lastMessage); + $formattedMessages = array($lastFormattedMessage); + + $batchRecord = null; + } + } + + if (null !== $batchRecord) { + $batchRecords[] = $batchRecord; + } + + // Set the max level and datetime for all records + foreach ($batchRecords as &$batchRecord) { + $batchRecord = array_merge( + $batchRecord, + array( + 'level' => $level, + 'level_name' => $levelName, + 'datetime' => $datetime, + ) + ); + } + + return $batchRecords; + } + + /** + * Validates the length of a string. + * + * If the `mb_strlen()` function is available, it will use that, as HipChat + * allows UTF-8 characters. Otherwise, it will fall back to `strlen()`. + * + * Note that this might cause false failures in the specific case of using + * a valid name with less than 16 characters, but 16 or more bytes, on a + * system where `mb_strlen()` is unavailable. + * + * @param string $str + * @param int $length + * + * @return bool + */ + private function validateStringLength($str, $length) + { + if (function_exists('mb_strlen')) { + return (mb_strlen($str) <= $length); + } + + return (strlen($str) <= $length); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php new file mode 100644 index 0000000..7f22622 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * IFTTTHandler uses cURL to trigger IFTTT Maker actions + * + * Register a secret key and trigger/event name at https://ifttt.com/maker + * + * value1 will be the channel from monolog's Logger constructor, + * value2 will be the level name (ERROR, WARNING, ..) + * value3 will be the log record's message + * + * @author Nehal Patel + */ +class IFTTTHandler extends AbstractProcessingHandler +{ + private $eventName; + private $secretKey; + + /** + * @param string $eventName The name of the IFTTT Maker event that should be triggered + * @param string $secretKey A valid IFTTT secret key + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($eventName, $secretKey, $level = Logger::ERROR, $bubble = true) + { + $this->eventName = $eventName; + $this->secretKey = $secretKey; + + parent::__construct($level, $bubble); + } + + /** + * {@inheritdoc} + */ + public function write(array $record) + { + $postData = array( + "value1" => $record["channel"], + "value2" => $record["level_name"], + "value3" => $record["message"], + ); + $postString = json_encode($postData); + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, "https://maker.ifttt.com/trigger/" . $this->eventName . "/with/key/" . $this->secretKey); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $postString); + curl_setopt($ch, CURLOPT_HTTPHEADER, array( + "Content-Type: application/json", + )); + + Curl\Util::execute($ch); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php new file mode 100644 index 0000000..8f683dc --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php @@ -0,0 +1,62 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + + namespace Monolog\Handler; + + use Monolog\Logger; + +/** + * Inspired on LogEntriesHandler. + * + * @author Robert Kaufmann III + * @author Gabriel Machado + */ +class InsightOpsHandler extends SocketHandler +{ + /** + * @var string + */ + protected $logToken; + + /** + * @param string $token Log token supplied by InsightOps + * @param string $region Region where InsightOps account is hosted. Could be 'us' or 'eu'. + * @param bool $useSSL Whether or not SSL encryption should be used + * @param int $level The minimum logging level to trigger this handler + * @param bool $bubble Whether or not messages that are handled should bubble up the stack. + * + * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing + */ + public function __construct($token, $region = 'us', $useSSL = true, $level = Logger::DEBUG, $bubble = true) + { + if ($useSSL && !extension_loaded('openssl')) { + throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for InsightOpsHandler'); + } + + $endpoint = $useSSL + ? 'ssl://' . $region . '.data.logs.insight.rapid7.com:443' + : $region . '.data.logs.insight.rapid7.com:80'; + + parent::__construct($endpoint, $level, $bubble); + $this->logToken = $token; + } + + /** + * {@inheritdoc} + * + * @param array $record + * @return string + */ + protected function generateDataStream($record) + { + return $this->logToken . ' ' . $record['formatted']; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php new file mode 100644 index 0000000..ea89fb3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * @author Robert Kaufmann III + */ +class LogEntriesHandler extends SocketHandler +{ + /** + * @var string + */ + protected $logToken; + + /** + * @param string $token Log token supplied by LogEntries + * @param bool $useSSL Whether or not SSL encryption should be used. + * @param int $level The minimum logging level to trigger this handler + * @param bool $bubble Whether or not messages that are handled should bubble up the stack. + * + * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing + */ + public function __construct($token, $useSSL = true, $level = Logger::DEBUG, $bubble = true, $host = 'data.logentries.com') + { + if ($useSSL && !extension_loaded('openssl')) { + throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler'); + } + + $endpoint = $useSSL ? 'ssl://' . $host . ':443' : $host . ':80'; + parent::__construct($endpoint, $level, $bubble); + $this->logToken = $token; + } + + /** + * {@inheritdoc} + * + * @param array $record + * @return string + */ + protected function generateDataStream($record) + { + return $this->logToken . ' ' . $record['formatted']; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php new file mode 100644 index 0000000..bcd62e1 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php @@ -0,0 +1,102 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\LogglyFormatter; + +/** + * Sends errors to Loggly. + * + * @author Przemek Sobstel + * @author Adam Pancutt + * @author Gregory Barchard + */ +class LogglyHandler extends AbstractProcessingHandler +{ + const HOST = 'logs-01.loggly.com'; + const ENDPOINT_SINGLE = 'inputs'; + const ENDPOINT_BATCH = 'bulk'; + + protected $token; + + protected $tag = array(); + + public function __construct($token, $level = Logger::DEBUG, $bubble = true) + { + if (!extension_loaded('curl')) { + throw new \LogicException('The curl extension is needed to use the LogglyHandler'); + } + + $this->token = $token; + + parent::__construct($level, $bubble); + } + + public function setTag($tag) + { + $tag = !empty($tag) ? $tag : array(); + $this->tag = is_array($tag) ? $tag : array($tag); + } + + public function addTag($tag) + { + if (!empty($tag)) { + $tag = is_array($tag) ? $tag : array($tag); + $this->tag = array_unique(array_merge($this->tag, $tag)); + } + } + + protected function write(array $record) + { + $this->send($record["formatted"], self::ENDPOINT_SINGLE); + } + + public function handleBatch(array $records) + { + $level = $this->level; + + $records = array_filter($records, function ($record) use ($level) { + return ($record['level'] >= $level); + }); + + if ($records) { + $this->send($this->getFormatter()->formatBatch($records), self::ENDPOINT_BATCH); + } + } + + protected function send($data, $endpoint) + { + $url = sprintf("https://%s/%s/%s/", self::HOST, $endpoint, $this->token); + + $headers = array('Content-Type: application/json'); + + if (!empty($this->tag)) { + $headers[] = 'X-LOGGLY-TAG: '.implode(',', $this->tag); + } + + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + Curl\Util::execute($ch); + } + + protected function getDefaultFormatter() + { + return new LogglyFormatter(); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php new file mode 100644 index 0000000..9e23283 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +/** + * Base class for all mail handlers + * + * @author Gyula Sallai + */ +abstract class MailHandler extends AbstractProcessingHandler +{ + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + $messages = array(); + + foreach ($records as $record) { + if ($record['level'] < $this->level) { + continue; + } + $messages[] = $this->processRecord($record); + } + + if (!empty($messages)) { + $this->send((string) $this->getFormatter()->formatBatch($messages), $messages); + } + } + + /** + * Send a mail with the given content + * + * @param string $content formatted email body to be sent + * @param array $records the array of log records that formed this content + */ + abstract protected function send($content, array $records); + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + $this->send((string) $record['formatted'], array($record)); + } + + protected function getHighestRecord(array $records) + { + $highestRecord = null; + foreach ($records as $record) { + if ($highestRecord === null || $highestRecord['level'] < $record['level']) { + $highestRecord = $record; + } + } + + return $highestRecord; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php new file mode 100644 index 0000000..3f0956a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php @@ -0,0 +1,68 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * MandrillHandler uses cURL to send the emails to the Mandrill API + * + * @author Adam Nicholson + */ +class MandrillHandler extends MailHandler +{ + protected $message; + protected $apiKey; + + /** + * @param string $apiKey A valid Mandrill API key + * @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($apiKey, $message, $level = Logger::ERROR, $bubble = true) + { + parent::__construct($level, $bubble); + + if (!$message instanceof \Swift_Message && is_callable($message)) { + $message = call_user_func($message); + } + if (!$message instanceof \Swift_Message) { + throw new \InvalidArgumentException('You must provide either a Swift_Message instance or a callable returning it'); + } + $this->message = $message; + $this->apiKey = $apiKey; + } + + /** + * {@inheritdoc} + */ + protected function send($content, array $records) + { + $message = clone $this->message; + $message->setBody($content); + $message->setDate(time()); + + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, 'https://mandrillapp.com/api/1.0/messages/send-raw.json'); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array( + 'key' => $this->apiKey, + 'raw_message' => (string) $message, + 'async' => false, + ))); + + Curl\Util::execute($ch); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php new file mode 100644 index 0000000..4724a7e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +/** + * Exception can be thrown if an extension for an handler is missing + * + * @author Christian Bergau + */ +class MissingExtensionException extends \Exception +{ +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php new file mode 100644 index 0000000..56fe755 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\NormalizerFormatter; + +/** + * Logs to a MongoDB database. + * + * usage example: + * + * $log = new Logger('application'); + * $mongodb = new MongoDBHandler(new \Mongo("mongodb://localhost:27017"), "logs", "prod"); + * $log->pushHandler($mongodb); + * + * @author Thomas Tourlourat + */ +class MongoDBHandler extends AbstractProcessingHandler +{ + protected $mongoCollection; + + public function __construct($mongo, $database, $collection, $level = Logger::DEBUG, $bubble = true) + { + if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo || $mongo instanceof \MongoDB\Client)) { + throw new \InvalidArgumentException('MongoClient, Mongo or MongoDB\Client instance required'); + } + + $this->mongoCollection = $mongo->selectCollection($database, $collection); + + parent::__construct($level, $bubble); + } + + protected function write(array $record) + { + if ($this->mongoCollection instanceof \MongoDB\Collection) { + $this->mongoCollection->insertOne($record["formatted"]); + } else { + $this->mongoCollection->save($record["formatted"]); + } + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new NormalizerFormatter(); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php new file mode 100644 index 0000000..d7807fd --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php @@ -0,0 +1,185 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\LineFormatter; + +/** + * NativeMailerHandler uses the mail() function to send the emails + * + * @author Christophe Coevoet + * @author Mark Garrett + */ +class NativeMailerHandler extends MailHandler +{ + /** + * The email addresses to which the message will be sent + * @var array + */ + protected $to; + + /** + * The subject of the email + * @var string + */ + protected $subject; + + /** + * Optional headers for the message + * @var array + */ + protected $headers = array(); + + /** + * Optional parameters for the message + * @var array + */ + protected $parameters = array(); + + /** + * The wordwrap length for the message + * @var int + */ + protected $maxColumnWidth; + + /** + * The Content-type for the message + * @var string + */ + protected $contentType = 'text/plain'; + + /** + * The encoding for the message + * @var string + */ + protected $encoding = 'utf-8'; + + /** + * @param string|array $to The receiver of the mail + * @param string $subject The subject of the mail + * @param string $from The sender of the mail + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param int $maxColumnWidth The maximum column width that the message lines will have + */ + public function __construct($to, $subject, $from, $level = Logger::ERROR, $bubble = true, $maxColumnWidth = 70) + { + parent::__construct($level, $bubble); + $this->to = is_array($to) ? $to : array($to); + $this->subject = $subject; + $this->addHeader(sprintf('From: %s', $from)); + $this->maxColumnWidth = $maxColumnWidth; + } + + /** + * Add headers to the message + * + * @param string|array $headers Custom added headers + * @return self + */ + public function addHeader($headers) + { + foreach ((array) $headers as $header) { + if (strpos($header, "\n") !== false || strpos($header, "\r") !== false) { + throw new \InvalidArgumentException('Headers can not contain newline characters for security reasons'); + } + $this->headers[] = $header; + } + + return $this; + } + + /** + * Add parameters to the message + * + * @param string|array $parameters Custom added parameters + * @return self + */ + public function addParameter($parameters) + { + $this->parameters = array_merge($this->parameters, (array) $parameters); + + return $this; + } + + /** + * {@inheritdoc} + */ + protected function send($content, array $records) + { + $content = wordwrap($content, $this->maxColumnWidth); + $headers = ltrim(implode("\r\n", $this->headers) . "\r\n", "\r\n"); + $headers .= 'Content-type: ' . $this->getContentType() . '; charset=' . $this->getEncoding() . "\r\n"; + if ($this->getContentType() == 'text/html' && false === strpos($headers, 'MIME-Version:')) { + $headers .= 'MIME-Version: 1.0' . "\r\n"; + } + + $subject = $this->subject; + if ($records) { + $subjectFormatter = new LineFormatter($this->subject); + $subject = $subjectFormatter->format($this->getHighestRecord($records)); + } + + $parameters = implode(' ', $this->parameters); + foreach ($this->to as $to) { + mail($to, $subject, $content, $headers, $parameters); + } + } + + /** + * @return string $contentType + */ + public function getContentType() + { + return $this->contentType; + } + + /** + * @return string $encoding + */ + public function getEncoding() + { + return $this->encoding; + } + + /** + * @param string $contentType The content type of the email - Defaults to text/plain. Use text/html for HTML + * messages. + * @return self + */ + public function setContentType($contentType) + { + if (strpos($contentType, "\n") !== false || strpos($contentType, "\r") !== false) { + throw new \InvalidArgumentException('The content type can not contain newline characters to prevent email header injection'); + } + + $this->contentType = $contentType; + + return $this; + } + + /** + * @param string $encoding + * @return self + */ + public function setEncoding($encoding) + { + if (strpos($encoding, "\n") !== false || strpos($encoding, "\r") !== false) { + throw new \InvalidArgumentException('The encoding can not contain newline characters to prevent email header injection'); + } + + $this->encoding = $encoding; + + return $this; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php new file mode 100644 index 0000000..f911997 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php @@ -0,0 +1,204 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\NormalizerFormatter; + +/** + * Class to record a log on a NewRelic application. + * Enabling New Relic High Security mode may prevent capture of useful information. + * + * This handler requires a NormalizerFormatter to function and expects an array in $record['formatted'] + * + * @see https://docs.newrelic.com/docs/agents/php-agent + * @see https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security + */ +class NewRelicHandler extends AbstractProcessingHandler +{ + /** + * Name of the New Relic application that will receive logs from this handler. + * + * @var string + */ + protected $appName; + + /** + * Name of the current transaction + * + * @var string + */ + protected $transactionName; + + /** + * Some context and extra data is passed into the handler as arrays of values. Do we send them as is + * (useful if we are using the API), or explode them for display on the NewRelic RPM website? + * + * @var bool + */ + protected $explodeArrays; + + /** + * {@inheritDoc} + * + * @param string $appName + * @param bool $explodeArrays + * @param string $transactionName + */ + public function __construct( + $level = Logger::ERROR, + $bubble = true, + $appName = null, + $explodeArrays = false, + $transactionName = null + ) { + parent::__construct($level, $bubble); + + $this->appName = $appName; + $this->explodeArrays = $explodeArrays; + $this->transactionName = $transactionName; + } + + /** + * {@inheritDoc} + */ + protected function write(array $record) + { + if (!$this->isNewRelicEnabled()) { + throw new MissingExtensionException('The newrelic PHP extension is required to use the NewRelicHandler'); + } + + if ($appName = $this->getAppName($record['context'])) { + $this->setNewRelicAppName($appName); + } + + if ($transactionName = $this->getTransactionName($record['context'])) { + $this->setNewRelicTransactionName($transactionName); + unset($record['formatted']['context']['transaction_name']); + } + + if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) { + newrelic_notice_error($record['message'], $record['context']['exception']); + unset($record['formatted']['context']['exception']); + } else { + newrelic_notice_error($record['message']); + } + + if (isset($record['formatted']['context']) && is_array($record['formatted']['context'])) { + foreach ($record['formatted']['context'] as $key => $parameter) { + if (is_array($parameter) && $this->explodeArrays) { + foreach ($parameter as $paramKey => $paramValue) { + $this->setNewRelicParameter('context_' . $key . '_' . $paramKey, $paramValue); + } + } else { + $this->setNewRelicParameter('context_' . $key, $parameter); + } + } + } + + if (isset($record['formatted']['extra']) && is_array($record['formatted']['extra'])) { + foreach ($record['formatted']['extra'] as $key => $parameter) { + if (is_array($parameter) && $this->explodeArrays) { + foreach ($parameter as $paramKey => $paramValue) { + $this->setNewRelicParameter('extra_' . $key . '_' . $paramKey, $paramValue); + } + } else { + $this->setNewRelicParameter('extra_' . $key, $parameter); + } + } + } + } + + /** + * Checks whether the NewRelic extension is enabled in the system. + * + * @return bool + */ + protected function isNewRelicEnabled() + { + return extension_loaded('newrelic'); + } + + /** + * Returns the appname where this log should be sent. Each log can override the default appname, set in this + * handler's constructor, by providing the appname in it's context. + * + * @param array $context + * @return null|string + */ + protected function getAppName(array $context) + { + if (isset($context['appname'])) { + return $context['appname']; + } + + return $this->appName; + } + + /** + * Returns the name of the current transaction. Each log can override the default transaction name, set in this + * handler's constructor, by providing the transaction_name in it's context + * + * @param array $context + * + * @return null|string + */ + protected function getTransactionName(array $context) + { + if (isset($context['transaction_name'])) { + return $context['transaction_name']; + } + + return $this->transactionName; + } + + /** + * Sets the NewRelic application that should receive this log. + * + * @param string $appName + */ + protected function setNewRelicAppName($appName) + { + newrelic_set_appname($appName); + } + + /** + * Overwrites the name of the current transaction + * + * @param string $transactionName + */ + protected function setNewRelicTransactionName($transactionName) + { + newrelic_name_transaction($transactionName); + } + + /** + * @param string $key + * @param mixed $value + */ + protected function setNewRelicParameter($key, $value) + { + if (null === $value || is_scalar($value)) { + newrelic_add_custom_parameter($key, $value); + } else { + newrelic_add_custom_parameter($key, @json_encode($value)); + } + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new NormalizerFormatter(); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php new file mode 100644 index 0000000..4b84588 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Blackhole + * + * Any record it can handle will be thrown away. This can be used + * to put on top of an existing stack to override it temporarily. + * + * @author Jordi Boggiano + */ +class NullHandler extends AbstractHandler +{ + /** + * @param int $level The minimum logging level at which this handler will be triggered + */ + public function __construct($level = Logger::DEBUG) + { + parent::__construct($level, false); + } + + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + if ($record['level'] < $this->level) { + return false; + } + + return true; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php new file mode 100644 index 0000000..1f2076a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php @@ -0,0 +1,242 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Exception; +use Monolog\Formatter\LineFormatter; +use Monolog\Logger; +use PhpConsole\Connector; +use PhpConsole\Handler; +use PhpConsole\Helper; + +/** + * Monolog handler for Google Chrome extension "PHP Console" + * + * Display PHP error/debug log messages in Google Chrome console and notification popups, executes PHP code remotely + * + * Usage: + * 1. Install Google Chrome extension https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef + * 2. See overview https://github.com/barbushin/php-console#overview + * 3. Install PHP Console library https://github.com/barbushin/php-console#installation + * 4. Example (result will looks like http://i.hizliresim.com/vg3Pz4.png) + * + * $logger = new \Monolog\Logger('all', array(new \Monolog\Handler\PHPConsoleHandler())); + * \Monolog\ErrorHandler::register($logger); + * echo $undefinedVar; + * $logger->addDebug('SELECT * FROM users', array('db', 'time' => 0.012)); + * PC::debug($_SERVER); // PHP Console debugger for any type of vars + * + * @author Sergey Barbushin https://www.linkedin.com/in/barbushin + */ +class PHPConsoleHandler extends AbstractProcessingHandler +{ + private $options = array( + 'enabled' => true, // bool Is PHP Console server enabled + 'classesPartialsTraceIgnore' => array('Monolog\\'), // array Hide calls of classes started with... + 'debugTagsKeysInContext' => array(0, 'tag'), // bool Is PHP Console server enabled + 'useOwnErrorsHandler' => false, // bool Enable errors handling + 'useOwnExceptionsHandler' => false, // bool Enable exceptions handling + 'sourcesBasePath' => null, // string Base path of all project sources to strip in errors source paths + 'registerHelper' => true, // bool Register PhpConsole\Helper that allows short debug calls like PC::debug($var, 'ta.g.s') + 'serverEncoding' => null, // string|null Server internal encoding + 'headersLimit' => null, // int|null Set headers size limit for your web-server + 'password' => null, // string|null Protect PHP Console connection by password + 'enableSslOnlyMode' => false, // bool Force connection by SSL for clients with PHP Console installed + 'ipMasks' => array(), // array Set IP masks of clients that will be allowed to connect to PHP Console: array('192.168.*.*', '127.0.0.1') + 'enableEvalListener' => false, // bool Enable eval request to be handled by eval dispatcher(if enabled, 'password' option is also required) + 'dumperDetectCallbacks' => false, // bool Convert callback items in dumper vars to (callback SomeClass::someMethod) strings + 'dumperLevelLimit' => 5, // int Maximum dumped vars array or object nested dump level + 'dumperItemsCountLimit' => 100, // int Maximum dumped var same level array items or object properties number + 'dumperItemSizeLimit' => 5000, // int Maximum length of any string or dumped array item + 'dumperDumpSizeLimit' => 500000, // int Maximum approximate size of dumped vars result formatted in JSON + 'detectDumpTraceAndSource' => false, // bool Autodetect and append trace data to debug + 'dataStorage' => null, // PhpConsole\Storage|null Fixes problem with custom $_SESSION handler(see http://goo.gl/Ne8juJ) + ); + + /** @var Connector */ + private $connector; + + /** + * @param array $options See \Monolog\Handler\PHPConsoleHandler::$options for more details + * @param Connector|null $connector Instance of \PhpConsole\Connector class (optional) + * @param int $level + * @param bool $bubble + * @throws Exception + */ + public function __construct(array $options = array(), Connector $connector = null, $level = Logger::DEBUG, $bubble = true) + { + if (!class_exists('PhpConsole\Connector')) { + throw new Exception('PHP Console library not found. See https://github.com/barbushin/php-console#installation'); + } + parent::__construct($level, $bubble); + $this->options = $this->initOptions($options); + $this->connector = $this->initConnector($connector); + } + + private function initOptions(array $options) + { + $wrongOptions = array_diff(array_keys($options), array_keys($this->options)); + if ($wrongOptions) { + throw new Exception('Unknown options: ' . implode(', ', $wrongOptions)); + } + + return array_replace($this->options, $options); + } + + private function initConnector(Connector $connector = null) + { + if (!$connector) { + if ($this->options['dataStorage']) { + Connector::setPostponeStorage($this->options['dataStorage']); + } + $connector = Connector::getInstance(); + } + + if ($this->options['registerHelper'] && !Helper::isRegistered()) { + Helper::register(); + } + + if ($this->options['enabled'] && $connector->isActiveClient()) { + if ($this->options['useOwnErrorsHandler'] || $this->options['useOwnExceptionsHandler']) { + $handler = Handler::getInstance(); + $handler->setHandleErrors($this->options['useOwnErrorsHandler']); + $handler->setHandleExceptions($this->options['useOwnExceptionsHandler']); + $handler->start(); + } + if ($this->options['sourcesBasePath']) { + $connector->setSourcesBasePath($this->options['sourcesBasePath']); + } + if ($this->options['serverEncoding']) { + $connector->setServerEncoding($this->options['serverEncoding']); + } + if ($this->options['password']) { + $connector->setPassword($this->options['password']); + } + if ($this->options['enableSslOnlyMode']) { + $connector->enableSslOnlyMode(); + } + if ($this->options['ipMasks']) { + $connector->setAllowedIpMasks($this->options['ipMasks']); + } + if ($this->options['headersLimit']) { + $connector->setHeadersLimit($this->options['headersLimit']); + } + if ($this->options['detectDumpTraceAndSource']) { + $connector->getDebugDispatcher()->detectTraceAndSource = true; + } + $dumper = $connector->getDumper(); + $dumper->levelLimit = $this->options['dumperLevelLimit']; + $dumper->itemsCountLimit = $this->options['dumperItemsCountLimit']; + $dumper->itemSizeLimit = $this->options['dumperItemSizeLimit']; + $dumper->dumpSizeLimit = $this->options['dumperDumpSizeLimit']; + $dumper->detectCallbacks = $this->options['dumperDetectCallbacks']; + if ($this->options['enableEvalListener']) { + $connector->startEvalRequestsListener(); + } + } + + return $connector; + } + + public function getConnector() + { + return $this->connector; + } + + public function getOptions() + { + return $this->options; + } + + public function handle(array $record) + { + if ($this->options['enabled'] && $this->connector->isActiveClient()) { + return parent::handle($record); + } + + return !$this->bubble; + } + + /** + * Writes the record down to the log of the implementing handler + * + * @param array $record + * @return void + */ + protected function write(array $record) + { + if ($record['level'] < Logger::NOTICE) { + $this->handleDebugRecord($record); + } elseif (isset($record['context']['exception']) && $record['context']['exception'] instanceof Exception) { + $this->handleExceptionRecord($record); + } else { + $this->handleErrorRecord($record); + } + } + + private function handleDebugRecord(array $record) + { + $tags = $this->getRecordTags($record); + $message = $record['message']; + if ($record['context']) { + $message .= ' ' . json_encode($this->connector->getDumper()->dump(array_filter($record['context']))); + } + $this->connector->getDebugDispatcher()->dispatchDebug($message, $tags, $this->options['classesPartialsTraceIgnore']); + } + + private function handleExceptionRecord(array $record) + { + $this->connector->getErrorsDispatcher()->dispatchException($record['context']['exception']); + } + + private function handleErrorRecord(array $record) + { + $context = $record['context']; + + $this->connector->getErrorsDispatcher()->dispatchError( + isset($context['code']) ? $context['code'] : null, + isset($context['message']) ? $context['message'] : $record['message'], + isset($context['file']) ? $context['file'] : null, + isset($context['line']) ? $context['line'] : null, + $this->options['classesPartialsTraceIgnore'] + ); + } + + private function getRecordTags(array &$record) + { + $tags = null; + if (!empty($record['context'])) { + $context = & $record['context']; + foreach ($this->options['debugTagsKeysInContext'] as $key) { + if (!empty($context[$key])) { + $tags = $context[$key]; + if ($key === 0) { + array_shift($context); + } else { + unset($context[$key]); + } + break; + } + } + } + + return $tags ?: strtolower($record['level_name']); + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new LineFormatter('%message%'); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php new file mode 100644 index 0000000..66a3d83 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Processor\ProcessorInterface; + +/** + * Interface to describe loggers that have processors + * + * This interface is present in monolog 1.x to ease forward compatibility. + * + * @author Jordi Boggiano + */ +interface ProcessableHandlerInterface +{ + /** + * Adds a processor in the stack. + * + * @param ProcessorInterface|callable $callback + * @return HandlerInterface self + */ + public function pushProcessor($callback): HandlerInterface; + + /** + * Removes the processor on top of the stack and returns it. + * + * @throws \LogicException In case the processor stack is empty + * @return callable + */ + public function popProcessor(): callable; +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php new file mode 100644 index 0000000..09f32a1 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\ResettableInterface; + +/** + * Helper trait for implementing ProcessableInterface + * + * This trait is present in monolog 1.x to ease forward compatibility. + * + * @author Jordi Boggiano + */ +trait ProcessableHandlerTrait +{ + /** + * @var callable[] + */ + protected $processors = []; + + /** + * {@inheritdoc} + * @suppress PhanTypeMismatchReturn + */ + public function pushProcessor($callback): HandlerInterface + { + array_unshift($this->processors, $callback); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function popProcessor(): callable + { + if (!$this->processors) { + throw new \LogicException('You tried to pop from an empty processor stack.'); + } + + return array_shift($this->processors); + } + + /** + * Processes a record. + */ + protected function processRecord(array $record): array + { + foreach ($this->processors as $processor) { + $record = $processor($record); + } + + return $record; + } + + protected function resetProcessors(): void + { + foreach ($this->processors as $processor) { + if ($processor instanceof ResettableInterface) { + $processor->reset(); + } + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php new file mode 100644 index 0000000..a99e6ab --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Psr\Log\LoggerInterface; + +/** + * Proxies log messages to an existing PSR-3 compliant logger. + * + * @author Michael Moussa + */ +class PsrHandler extends AbstractHandler +{ + /** + * PSR-3 compliant logger + * + * @var LoggerInterface + */ + protected $logger; + + /** + * @param LoggerInterface $logger The underlying PSR-3 compliant logger to which messages will be proxied + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct(LoggerInterface $logger, $level = Logger::DEBUG, $bubble = true) + { + parent::__construct($level, $bubble); + + $this->logger = $logger; + } + + /** + * {@inheritDoc} + */ + public function handle(array $record) + { + if (!$this->isHandling($record)) { + return false; + } + + $this->logger->log(strtolower($record['level_name']), $record['message'], $record['context']); + + return false === $this->bubble; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php new file mode 100644 index 0000000..f27bb3d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php @@ -0,0 +1,185 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Sends notifications through the pushover api to mobile phones + * + * @author Sebastian Göttschkes + * @see https://www.pushover.net/api + */ +class PushoverHandler extends SocketHandler +{ + private $token; + private $users; + private $title; + private $user; + private $retry; + private $expire; + + private $highPriorityLevel; + private $emergencyLevel; + private $useFormattedMessage = false; + + /** + * All parameters that can be sent to Pushover + * @see https://pushover.net/api + * @var array + */ + private $parameterNames = array( + 'token' => true, + 'user' => true, + 'message' => true, + 'device' => true, + 'title' => true, + 'url' => true, + 'url_title' => true, + 'priority' => true, + 'timestamp' => true, + 'sound' => true, + 'retry' => true, + 'expire' => true, + 'callback' => true, + ); + + /** + * Sounds the api supports by default + * @see https://pushover.net/api#sounds + * @var array + */ + private $sounds = array( + 'pushover', 'bike', 'bugle', 'cashregister', 'classical', 'cosmic', 'falling', 'gamelan', 'incoming', + 'intermission', 'magic', 'mechanical', 'pianobar', 'siren', 'spacealarm', 'tugboat', 'alien', 'climb', + 'persistent', 'echo', 'updown', 'none', + ); + + /** + * @param string $token Pushover api token + * @param string|array $users Pushover user id or array of ids the message will be sent to + * @param string $title Title sent to the Pushover API + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $useSSL Whether to connect via SSL. Required when pushing messages to users that are not + * the pushover.net app owner. OpenSSL is required for this option. + * @param int $highPriorityLevel The minimum logging level at which this handler will start + * sending "high priority" requests to the Pushover API + * @param int $emergencyLevel The minimum logging level at which this handler will start + * sending "emergency" requests to the Pushover API + * @param int $retry The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user. + * @param int $expire The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds). + */ + public function __construct($token, $users, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $highPriorityLevel = Logger::CRITICAL, $emergencyLevel = Logger::EMERGENCY, $retry = 30, $expire = 25200) + { + $connectionString = $useSSL ? 'ssl://api.pushover.net:443' : 'api.pushover.net:80'; + parent::__construct($connectionString, $level, $bubble); + + $this->token = $token; + $this->users = (array) $users; + $this->title = $title ?: gethostname(); + $this->highPriorityLevel = Logger::toMonologLevel($highPriorityLevel); + $this->emergencyLevel = Logger::toMonologLevel($emergencyLevel); + $this->retry = $retry; + $this->expire = $expire; + } + + protected function generateDataStream($record) + { + $content = $this->buildContent($record); + + return $this->buildHeader($content) . $content; + } + + private function buildContent($record) + { + // Pushover has a limit of 512 characters on title and message combined. + $maxMessageLength = 512 - strlen($this->title); + + $message = ($this->useFormattedMessage) ? $record['formatted'] : $record['message']; + $message = substr($message, 0, $maxMessageLength); + + $timestamp = $record['datetime']->getTimestamp(); + + $dataArray = array( + 'token' => $this->token, + 'user' => $this->user, + 'message' => $message, + 'title' => $this->title, + 'timestamp' => $timestamp, + ); + + if (isset($record['level']) && $record['level'] >= $this->emergencyLevel) { + $dataArray['priority'] = 2; + $dataArray['retry'] = $this->retry; + $dataArray['expire'] = $this->expire; + } elseif (isset($record['level']) && $record['level'] >= $this->highPriorityLevel) { + $dataArray['priority'] = 1; + } + + // First determine the available parameters + $context = array_intersect_key($record['context'], $this->parameterNames); + $extra = array_intersect_key($record['extra'], $this->parameterNames); + + // Least important info should be merged with subsequent info + $dataArray = array_merge($extra, $context, $dataArray); + + // Only pass sounds that are supported by the API + if (isset($dataArray['sound']) && !in_array($dataArray['sound'], $this->sounds)) { + unset($dataArray['sound']); + } + + return http_build_query($dataArray); + } + + private function buildHeader($content) + { + $header = "POST /1/messages.json HTTP/1.1\r\n"; + $header .= "Host: api.pushover.net\r\n"; + $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; + $header .= "Content-Length: " . strlen($content) . "\r\n"; + $header .= "\r\n"; + + return $header; + } + + protected function write(array $record) + { + foreach ($this->users as $user) { + $this->user = $user; + + parent::write($record); + $this->closeSocket(); + } + + $this->user = null; + } + + public function setHighPriorityLevel($value) + { + $this->highPriorityLevel = $value; + } + + public function setEmergencyLevel($value) + { + $this->emergencyLevel = $value; + } + + /** + * Use the formatted message? + * @param bool $value + */ + public function useFormattedMessage($value) + { + $this->useFormattedMessage = (bool) $value; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php new file mode 100644 index 0000000..1929f25 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php @@ -0,0 +1,234 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\LineFormatter; +use Monolog\Formatter\FormatterInterface; +use Monolog\Logger; +use Raven_Client; + +/** + * Handler to send messages to a Sentry (https://github.com/getsentry/sentry) server + * using sentry-php (https://github.com/getsentry/sentry-php) + * + * @author Marc Abramowitz + */ +class RavenHandler extends AbstractProcessingHandler +{ + /** + * Translates Monolog log levels to Raven log levels. + */ + protected $logLevels = array( + Logger::DEBUG => Raven_Client::DEBUG, + Logger::INFO => Raven_Client::INFO, + Logger::NOTICE => Raven_Client::INFO, + Logger::WARNING => Raven_Client::WARNING, + Logger::ERROR => Raven_Client::ERROR, + Logger::CRITICAL => Raven_Client::FATAL, + Logger::ALERT => Raven_Client::FATAL, + Logger::EMERGENCY => Raven_Client::FATAL, + ); + + /** + * @var string should represent the current version of the calling + * software. Can be any string (git commit, version number) + */ + protected $release; + + /** + * @var Raven_Client the client object that sends the message to the server + */ + protected $ravenClient; + + /** + * @var LineFormatter The formatter to use for the logs generated via handleBatch() + */ + protected $batchFormatter; + + /** + * @param Raven_Client $ravenClient + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct(Raven_Client $ravenClient, $level = Logger::DEBUG, $bubble = true) + { + @trigger_error('The Monolog\Handler\RavenHandler class is deprecated. You should rather upgrade to the sentry/sentry 2.x and use Sentry\Monolog\Handler, see https://github.com/getsentry/sentry-php/blob/master/src/Monolog/Handler.php', E_USER_DEPRECATED); + + parent::__construct($level, $bubble); + + $this->ravenClient = $ravenClient; + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + $level = $this->level; + + // filter records based on their level + $records = array_filter($records, function ($record) use ($level) { + return $record['level'] >= $level; + }); + + if (!$records) { + return; + } + + // the record with the highest severity is the "main" one + $record = array_reduce($records, function ($highest, $record) { + if ($record['level'] > $highest['level']) { + return $record; + } + + return $highest; + }); + + // the other ones are added as a context item + $logs = array(); + foreach ($records as $r) { + $logs[] = $this->processRecord($r); + } + + if ($logs) { + $record['context']['logs'] = (string) $this->getBatchFormatter()->formatBatch($logs); + } + + $this->handle($record); + } + + /** + * Sets the formatter for the logs generated by handleBatch(). + * + * @param FormatterInterface $formatter + */ + public function setBatchFormatter(FormatterInterface $formatter) + { + $this->batchFormatter = $formatter; + } + + /** + * Gets the formatter for the logs generated by handleBatch(). + * + * @return FormatterInterface + */ + public function getBatchFormatter() + { + if (!$this->batchFormatter) { + $this->batchFormatter = $this->getDefaultBatchFormatter(); + } + + return $this->batchFormatter; + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + $previousUserContext = false; + $options = array(); + $options['level'] = $this->logLevels[$record['level']]; + $options['tags'] = array(); + if (!empty($record['extra']['tags'])) { + $options['tags'] = array_merge($options['tags'], $record['extra']['tags']); + unset($record['extra']['tags']); + } + if (!empty($record['context']['tags'])) { + $options['tags'] = array_merge($options['tags'], $record['context']['tags']); + unset($record['context']['tags']); + } + if (!empty($record['context']['fingerprint'])) { + $options['fingerprint'] = $record['context']['fingerprint']; + unset($record['context']['fingerprint']); + } + if (!empty($record['context']['logger'])) { + $options['logger'] = $record['context']['logger']; + unset($record['context']['logger']); + } else { + $options['logger'] = $record['channel']; + } + foreach ($this->getExtraParameters() as $key) { + foreach (array('extra', 'context') as $source) { + if (!empty($record[$source][$key])) { + $options[$key] = $record[$source][$key]; + unset($record[$source][$key]); + } + } + } + if (!empty($record['context'])) { + $options['extra']['context'] = $record['context']; + if (!empty($record['context']['user'])) { + $previousUserContext = $this->ravenClient->context->user; + $this->ravenClient->user_context($record['context']['user']); + unset($options['extra']['context']['user']); + } + } + if (!empty($record['extra'])) { + $options['extra']['extra'] = $record['extra']; + } + + if (!empty($this->release) && !isset($options['release'])) { + $options['release'] = $this->release; + } + + if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) { + $options['message'] = $record['formatted']; + $this->ravenClient->captureException($record['context']['exception'], $options); + } else { + $this->ravenClient->captureMessage($record['formatted'], array(), $options); + } + + if ($previousUserContext !== false) { + $this->ravenClient->user_context($previousUserContext); + } + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new LineFormatter('[%channel%] %message%'); + } + + /** + * Gets the default formatter for the logs generated by handleBatch(). + * + * @return FormatterInterface + */ + protected function getDefaultBatchFormatter() + { + return new LineFormatter(); + } + + /** + * Gets extra parameters supported by Raven that can be found in "extra" and "context" + * + * @return array + */ + protected function getExtraParameters() + { + return array('contexts', 'checksum', 'release', 'event_id'); + } + + /** + * @param string $value + * @return self + */ + public function setRelease($value) + { + $this->release = $value; + + return $this; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php new file mode 100644 index 0000000..590f996 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\LineFormatter; +use Monolog\Logger; + +/** + * Logs to a Redis key using rpush + * + * usage example: + * + * $log = new Logger('application'); + * $redis = new RedisHandler(new Predis\Client("tcp://localhost:6379"), "logs", "prod"); + * $log->pushHandler($redis); + * + * @author Thomas Tourlourat + */ +class RedisHandler extends AbstractProcessingHandler +{ + private $redisClient; + private $redisKey; + protected $capSize; + + /** + * @param \Predis\Client|\Redis $redis The redis instance + * @param string $key The key name to push records to + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param int $capSize Number of entries to limit list size to + */ + public function __construct($redis, $key, $level = Logger::DEBUG, $bubble = true, $capSize = false) + { + if (!(($redis instanceof \Predis\Client) || ($redis instanceof \Redis))) { + throw new \InvalidArgumentException('Predis\Client or Redis instance required'); + } + + $this->redisClient = $redis; + $this->redisKey = $key; + $this->capSize = $capSize; + + parent::__construct($level, $bubble); + } + + /** + * {@inheritDoc} + */ + protected function write(array $record) + { + if ($this->capSize) { + $this->writeCapped($record); + } else { + $this->redisClient->rpush($this->redisKey, $record["formatted"]); + } + } + + /** + * Write and cap the collection + * Writes the record to the redis list and caps its + * + * @param array $record associative record array + * @return void + */ + protected function writeCapped(array $record) + { + if ($this->redisClient instanceof \Redis) { + $this->redisClient->multi() + ->rpush($this->redisKey, $record["formatted"]) + ->ltrim($this->redisKey, -$this->capSize, -1) + ->exec(); + } else { + $redisKey = $this->redisKey; + $capSize = $this->capSize; + $this->redisClient->transaction(function ($tx) use ($record, $redisKey, $capSize) { + $tx->rpush($redisKey, $record["formatted"]); + $tx->ltrim($redisKey, -$capSize, -1); + }); + } + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new LineFormatter(); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php new file mode 100644 index 0000000..65073ff --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php @@ -0,0 +1,144 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use RollbarNotifier; +use Exception; +use Monolog\Logger; + +/** + * Sends errors to Rollbar + * + * If the context data contains a `payload` key, that is used as an array + * of payload options to RollbarNotifier's report_message/report_exception methods. + * + * Rollbar's context info will contain the context + extra keys from the log record + * merged, and then on top of that a few keys: + * + * - level (rollbar level name) + * - monolog_level (monolog level name, raw level, as rollbar only has 5 but monolog 8) + * - channel + * - datetime (unix timestamp) + * + * @author Paul Statezny + */ +class RollbarHandler extends AbstractProcessingHandler +{ + /** + * Rollbar notifier + * + * @var RollbarNotifier + */ + protected $rollbarNotifier; + + protected $levelMap = array( + Logger::DEBUG => 'debug', + Logger::INFO => 'info', + Logger::NOTICE => 'info', + Logger::WARNING => 'warning', + Logger::ERROR => 'error', + Logger::CRITICAL => 'critical', + Logger::ALERT => 'critical', + Logger::EMERGENCY => 'critical', + ); + + /** + * Records whether any log records have been added since the last flush of the rollbar notifier + * + * @var bool + */ + private $hasRecords = false; + + protected $initialized = false; + + /** + * @param RollbarNotifier $rollbarNotifier RollbarNotifier object constructed with valid token + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct(RollbarNotifier $rollbarNotifier, $level = Logger::ERROR, $bubble = true) + { + $this->rollbarNotifier = $rollbarNotifier; + + parent::__construct($level, $bubble); + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + if (!$this->initialized) { + // __destructor() doesn't get called on Fatal errors + register_shutdown_function(array($this, 'close')); + $this->initialized = true; + } + + $context = $record['context']; + $payload = array(); + if (isset($context['payload'])) { + $payload = $context['payload']; + unset($context['payload']); + } + $context = array_merge($context, $record['extra'], array( + 'level' => $this->levelMap[$record['level']], + 'monolog_level' => $record['level_name'], + 'channel' => $record['channel'], + 'datetime' => $record['datetime']->format('U'), + )); + + if (isset($context['exception']) && $context['exception'] instanceof Exception) { + $payload['level'] = $context['level']; + $exception = $context['exception']; + unset($context['exception']); + + $this->rollbarNotifier->report_exception($exception, $context, $payload); + } else { + $this->rollbarNotifier->report_message( + $record['message'], + $context['level'], + $context, + $payload + ); + } + + $this->hasRecords = true; + } + + public function flush() + { + if ($this->hasRecords) { + $this->rollbarNotifier->flush(); + $this->hasRecords = false; + } + } + + /** + * {@inheritdoc} + */ + public function close() + { + $this->flush(); + } + + /** + * {@inheritdoc} + */ + public function reset() + { + $this->flush(); + + parent::reset(); + } + + +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php new file mode 100644 index 0000000..ae2309f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php @@ -0,0 +1,190 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Stores logs to files that are rotated every day and a limited number of files are kept. + * + * This rotation is only intended to be used as a workaround. Using logrotate to + * handle the rotation is strongly encouraged when you can use it. + * + * @author Christophe Coevoet + * @author Jordi Boggiano + */ +class RotatingFileHandler extends StreamHandler +{ + const FILE_PER_DAY = 'Y-m-d'; + const FILE_PER_MONTH = 'Y-m'; + const FILE_PER_YEAR = 'Y'; + + protected $filename; + protected $maxFiles; + protected $mustRotate; + protected $nextRotation; + protected $filenameFormat; + protected $dateFormat; + + /** + * @param string $filename + * @param int $maxFiles The maximal amount of files to keep (0 means unlimited) + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) + * @param bool $useLocking Try to lock log file before doing any writes + */ + public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false) + { + $this->filename = $filename; + $this->maxFiles = (int) $maxFiles; + $this->nextRotation = new \DateTime('tomorrow'); + $this->filenameFormat = '{filename}-{date}'; + $this->dateFormat = 'Y-m-d'; + + parent::__construct($this->getTimedFilename(), $level, $bubble, $filePermission, $useLocking); + } + + /** + * {@inheritdoc} + */ + public function close() + { + parent::close(); + + if (true === $this->mustRotate) { + $this->rotate(); + } + } + + /** + * {@inheritdoc} + */ + public function reset() + { + parent::reset(); + + if (true === $this->mustRotate) { + $this->rotate(); + } + } + + public function setFilenameFormat($filenameFormat, $dateFormat) + { + if (!preg_match('{^Y(([/_.-]?m)([/_.-]?d)?)?$}', $dateFormat)) { + trigger_error( + 'Invalid date format - format must be one of '. + 'RotatingFileHandler::FILE_PER_DAY ("Y-m-d"), RotatingFileHandler::FILE_PER_MONTH ("Y-m") '. + 'or RotatingFileHandler::FILE_PER_YEAR ("Y"), or you can set one of the '. + 'date formats using slashes, underscores and/or dots instead of dashes.', + E_USER_DEPRECATED + ); + } + if (substr_count($filenameFormat, '{date}') === 0) { + trigger_error( + 'Invalid filename format - format should contain at least `{date}`, because otherwise rotating is impossible.', + E_USER_DEPRECATED + ); + } + $this->filenameFormat = $filenameFormat; + $this->dateFormat = $dateFormat; + $this->url = $this->getTimedFilename(); + $this->close(); + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + // on the first record written, if the log is new, we should rotate (once per day) + if (null === $this->mustRotate) { + $this->mustRotate = !file_exists($this->url); + } + + if ($this->nextRotation < $record['datetime']) { + $this->mustRotate = true; + $this->close(); + } + + parent::write($record); + } + + /** + * Rotates the files. + */ + protected function rotate() + { + // update filename + $this->url = $this->getTimedFilename(); + $this->nextRotation = new \DateTime('tomorrow'); + + // skip GC of old logs if files are unlimited + if (0 === $this->maxFiles) { + return; + } + + $logFiles = glob($this->getGlobPattern()); + if ($this->maxFiles >= count($logFiles)) { + // no files to remove + return; + } + + // Sorting the files by name to remove the older ones + usort($logFiles, function ($a, $b) { + return strcmp($b, $a); + }); + + foreach (array_slice($logFiles, $this->maxFiles) as $file) { + if (is_writable($file)) { + // suppress errors here as unlink() might fail if two processes + // are cleaning up/rotating at the same time + set_error_handler(function ($errno, $errstr, $errfile, $errline) {}); + unlink($file); + restore_error_handler(); + } + } + + $this->mustRotate = false; + } + + protected function getTimedFilename() + { + $fileInfo = pathinfo($this->filename); + $timedFilename = str_replace( + array('{filename}', '{date}'), + array($fileInfo['filename'], date($this->dateFormat)), + $fileInfo['dirname'] . '/' . $this->filenameFormat + ); + + if (!empty($fileInfo['extension'])) { + $timedFilename .= '.'.$fileInfo['extension']; + } + + return $timedFilename; + } + + protected function getGlobPattern() + { + $fileInfo = pathinfo($this->filename); + $glob = str_replace( + array('{filename}', '{date}'), + array($fileInfo['filename'], '[0-9][0-9][0-9][0-9]*'), + $fileInfo['dirname'] . '/' . $this->filenameFormat + ); + if (!empty($fileInfo['extension'])) { + $glob .= '.'.$fileInfo['extension']; + } + + return $glob; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php new file mode 100644 index 0000000..9509ae3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php @@ -0,0 +1,82 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +/** + * Sampling handler + * + * A sampled event stream can be useful for logging high frequency events in + * a production environment where you only need an idea of what is happening + * and are not concerned with capturing every occurrence. Since the decision to + * handle or not handle a particular event is determined randomly, the + * resulting sampled log is not guaranteed to contain 1/N of the events that + * occurred in the application, but based on the Law of large numbers, it will + * tend to be close to this ratio with a large number of attempts. + * + * @author Bryan Davis + * @author Kunal Mehta + */ +class SamplingHandler extends AbstractHandler +{ + /** + * @var callable|HandlerInterface $handler + */ + protected $handler; + + /** + * @var int $factor + */ + protected $factor; + + /** + * @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler). + * @param int $factor Sample factor + */ + public function __construct($handler, $factor) + { + parent::__construct(); + $this->handler = $handler; + $this->factor = $factor; + + if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { + throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); + } + } + + public function isHandling(array $record) + { + return $this->handler->isHandling($record); + } + + public function handle(array $record) + { + if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) { + // The same logic as in FingersCrossedHandler + if (!$this->handler instanceof HandlerInterface) { + $this->handler = call_user_func($this->handler, $record, $this); + if (!$this->handler instanceof HandlerInterface) { + throw new \RuntimeException("The factory callable should return a HandlerInterface"); + } + } + + if ($this->processors) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + } + + $this->handler->handle($record); + } + + return false === $this->bubble; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php new file mode 100644 index 0000000..e55e0e2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php @@ -0,0 +1,294 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler\Slack; + +use Monolog\Logger; +use Monolog\Formatter\NormalizerFormatter; +use Monolog\Formatter\FormatterInterface; + +/** + * Slack record utility helping to log to Slack webhooks or API. + * + * @author Greg Kedzierski + * @author Haralan Dobrev + * @see https://api.slack.com/incoming-webhooks + * @see https://api.slack.com/docs/message-attachments + */ +class SlackRecord +{ + const COLOR_DANGER = 'danger'; + + const COLOR_WARNING = 'warning'; + + const COLOR_GOOD = 'good'; + + const COLOR_DEFAULT = '#e3e4e6'; + + /** + * Slack channel (encoded ID or name) + * @var string|null + */ + private $channel; + + /** + * Name of a bot + * @var string|null + */ + private $username; + + /** + * User icon e.g. 'ghost', 'http://example.com/user.png' + * @var string + */ + private $userIcon; + + /** + * Whether the message should be added to Slack as attachment (plain text otherwise) + * @var bool + */ + private $useAttachment; + + /** + * Whether the the context/extra messages added to Slack as attachments are in a short style + * @var bool + */ + private $useShortAttachment; + + /** + * Whether the attachment should include context and extra data + * @var bool + */ + private $includeContextAndExtra; + + /** + * Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] + * @var array + */ + private $excludeFields; + + /** + * @var FormatterInterface + */ + private $formatter; + + /** + * @var NormalizerFormatter + */ + private $normalizerFormatter; + + public function __construct($channel = null, $username = null, $useAttachment = true, $userIcon = null, $useShortAttachment = false, $includeContextAndExtra = false, array $excludeFields = array(), FormatterInterface $formatter = null) + { + $this->channel = $channel; + $this->username = $username; + $this->userIcon = trim($userIcon, ':'); + $this->useAttachment = $useAttachment; + $this->useShortAttachment = $useShortAttachment; + $this->includeContextAndExtra = $includeContextAndExtra; + $this->excludeFields = $excludeFields; + $this->formatter = $formatter; + + if ($this->includeContextAndExtra) { + $this->normalizerFormatter = new NormalizerFormatter(); + } + } + + public function getSlackData(array $record) + { + $dataArray = array(); + $record = $this->excludeFields($record); + + if ($this->username) { + $dataArray['username'] = $this->username; + } + + if ($this->channel) { + $dataArray['channel'] = $this->channel; + } + + if ($this->formatter && !$this->useAttachment) { + $message = $this->formatter->format($record); + } else { + $message = $record['message']; + } + + if ($this->useAttachment) { + $attachment = array( + 'fallback' => $message, + 'text' => $message, + 'color' => $this->getAttachmentColor($record['level']), + 'fields' => array(), + 'mrkdwn_in' => array('fields'), + 'ts' => $record['datetime']->getTimestamp() + ); + + if ($this->useShortAttachment) { + $attachment['title'] = $record['level_name']; + } else { + $attachment['title'] = 'Message'; + $attachment['fields'][] = $this->generateAttachmentField('Level', $record['level_name']); + } + + + if ($this->includeContextAndExtra) { + foreach (array('extra', 'context') as $key) { + if (empty($record[$key])) { + continue; + } + + if ($this->useShortAttachment) { + $attachment['fields'][] = $this->generateAttachmentField( + $key, + $record[$key] + ); + } else { + // Add all extra fields as individual fields in attachment + $attachment['fields'] = array_merge( + $attachment['fields'], + $this->generateAttachmentFields($record[$key]) + ); + } + } + } + + $dataArray['attachments'] = array($attachment); + } else { + $dataArray['text'] = $message; + } + + if ($this->userIcon) { + if (filter_var($this->userIcon, FILTER_VALIDATE_URL)) { + $dataArray['icon_url'] = $this->userIcon; + } else { + $dataArray['icon_emoji'] = ":{$this->userIcon}:"; + } + } + + return $dataArray; + } + + /** + * Returned a Slack message attachment color associated with + * provided level. + * + * @param int $level + * @return string + */ + public function getAttachmentColor($level) + { + switch (true) { + case $level >= Logger::ERROR: + return self::COLOR_DANGER; + case $level >= Logger::WARNING: + return self::COLOR_WARNING; + case $level >= Logger::INFO: + return self::COLOR_GOOD; + default: + return self::COLOR_DEFAULT; + } + } + + /** + * Stringifies an array of key/value pairs to be used in attachment fields + * + * @param array $fields + * + * @return string + */ + public function stringify($fields) + { + $normalized = $this->normalizerFormatter->format($fields); + $prettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128; + + $hasSecondDimension = count(array_filter($normalized, 'is_array')); + $hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric')); + + return $hasSecondDimension || $hasNonNumericKeys + ? json_encode($normalized, $prettyPrintFlag) + : json_encode($normalized); + } + + /** + * Sets the formatter + * + * @param FormatterInterface $formatter + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->formatter = $formatter; + } + + /** + * Generates attachment field + * + * @param string $title + * @param string|array $value + * + * @return array + */ + private function generateAttachmentField($title, $value) + { + $value = is_array($value) + ? sprintf('```%s```', $this->stringify($value)) + : $value; + + return array( + 'title' => ucfirst($title), + 'value' => $value, + 'short' => false + ); + } + + /** + * Generates a collection of attachment fields from array + * + * @param array $data + * + * @return array + */ + private function generateAttachmentFields(array $data) + { + $fields = array(); + foreach ($this->normalizerFormatter->format($data) as $key => $value) { + $fields[] = $this->generateAttachmentField($key, $value); + } + + return $fields; + } + + /** + * Get a copy of record with fields excluded according to $this->excludeFields + * + * @param array $record + * + * @return array + */ + private function excludeFields(array $record) + { + foreach ($this->excludeFields as $field) { + $keys = explode('.', $field); + $node = &$record; + $lastKey = end($keys); + foreach ($keys as $key) { + if (!isset($node[$key])) { + break; + } + if ($lastKey === $key) { + unset($node[$key]); + break; + } + $node = &$node[$key]; + } + } + + return $record; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php new file mode 100644 index 0000000..45d634f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php @@ -0,0 +1,220 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\FormatterInterface; +use Monolog\Logger; +use Monolog\Handler\Slack\SlackRecord; + +/** + * Sends notifications through Slack API + * + * @author Greg Kedzierski + * @see https://api.slack.com/ + */ +class SlackHandler extends SocketHandler +{ + /** + * Slack API token + * @var string + */ + private $token; + + /** + * Instance of the SlackRecord util class preparing data for Slack API. + * @var SlackRecord + */ + private $slackRecord; + + /** + * @param string $token Slack API token + * @param string $channel Slack channel (encoded ID or name) + * @param string|null $username Name of a bot + * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) + * @param string|null $iconEmoji The emoji name to use (or null) + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style + * @param bool $includeContextAndExtra Whether the attachment should include context and extra data + * @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] + * @throws MissingExtensionException If no OpenSSL PHP extension configured + */ + public function __construct($token, $channel, $username = null, $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false, array $excludeFields = array()) + { + if (!extension_loaded('openssl')) { + throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler'); + } + + parent::__construct('ssl://slack.com:443', $level, $bubble); + + $this->slackRecord = new SlackRecord( + $channel, + $username, + $useAttachment, + $iconEmoji, + $useShortAttachment, + $includeContextAndExtra, + $excludeFields, + $this->formatter + ); + + $this->token = $token; + } + + public function getSlackRecord() + { + return $this->slackRecord; + } + + public function getToken() + { + return $this->token; + } + + /** + * {@inheritdoc} + * + * @param array $record + * @return string + */ + protected function generateDataStream($record) + { + $content = $this->buildContent($record); + + return $this->buildHeader($content) . $content; + } + + /** + * Builds the body of API call + * + * @param array $record + * @return string + */ + private function buildContent($record) + { + $dataArray = $this->prepareContentData($record); + + return http_build_query($dataArray); + } + + /** + * Prepares content data + * + * @param array $record + * @return array + */ + protected function prepareContentData($record) + { + $dataArray = $this->slackRecord->getSlackData($record); + $dataArray['token'] = $this->token; + + if (!empty($dataArray['attachments'])) { + $dataArray['attachments'] = json_encode($dataArray['attachments']); + } + + return $dataArray; + } + + /** + * Builds the header of the API Call + * + * @param string $content + * @return string + */ + private function buildHeader($content) + { + $header = "POST /api/chat.postMessage HTTP/1.1\r\n"; + $header .= "Host: slack.com\r\n"; + $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; + $header .= "Content-Length: " . strlen($content) . "\r\n"; + $header .= "\r\n"; + + return $header; + } + + /** + * {@inheritdoc} + * + * @param array $record + */ + protected function write(array $record) + { + parent::write($record); + $this->finalizeWrite(); + } + + /** + * Finalizes the request by reading some bytes and then closing the socket + * + * If we do not read some but close the socket too early, slack sometimes + * drops the request entirely. + */ + protected function finalizeWrite() + { + $res = $this->getResource(); + if (is_resource($res)) { + @fread($res, 2048); + } + $this->closeSocket(); + } + + /** + * Returned a Slack message attachment color associated with + * provided level. + * + * @param int $level + * @return string + * @deprecated Use underlying SlackRecord instead + */ + protected function getAttachmentColor($level) + { + trigger_error( + 'SlackHandler::getAttachmentColor() is deprecated. Use underlying SlackRecord instead.', + E_USER_DEPRECATED + ); + + return $this->slackRecord->getAttachmentColor($level); + } + + /** + * Stringifies an array of key/value pairs to be used in attachment fields + * + * @param array $fields + * @return string + * @deprecated Use underlying SlackRecord instead + */ + protected function stringify($fields) + { + trigger_error( + 'SlackHandler::stringify() is deprecated. Use underlying SlackRecord instead.', + E_USER_DEPRECATED + ); + + return $this->slackRecord->stringify($fields); + } + + public function setFormatter(FormatterInterface $formatter) + { + parent::setFormatter($formatter); + $this->slackRecord->setFormatter($formatter); + + return $this; + } + + public function getFormatter() + { + $formatter = parent::getFormatter(); + $this->slackRecord->setFormatter($formatter); + + return $formatter; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php new file mode 100644 index 0000000..1ef85fa --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php @@ -0,0 +1,120 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\FormatterInterface; +use Monolog\Logger; +use Monolog\Handler\Slack\SlackRecord; + +/** + * Sends notifications through Slack Webhooks + * + * @author Haralan Dobrev + * @see https://api.slack.com/incoming-webhooks + */ +class SlackWebhookHandler extends AbstractProcessingHandler +{ + /** + * Slack Webhook token + * @var string + */ + private $webhookUrl; + + /** + * Instance of the SlackRecord util class preparing data for Slack API. + * @var SlackRecord + */ + private $slackRecord; + + /** + * @param string $webhookUrl Slack Webhook URL + * @param string|null $channel Slack channel (encoded ID or name) + * @param string|null $username Name of a bot + * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) + * @param string|null $iconEmoji The emoji name to use (or null) + * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style + * @param bool $includeContextAndExtra Whether the attachment should include context and extra data + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] + */ + public function __construct($webhookUrl, $channel = null, $username = null, $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeContextAndExtra = false, $level = Logger::CRITICAL, $bubble = true, array $excludeFields = array()) + { + parent::__construct($level, $bubble); + + $this->webhookUrl = $webhookUrl; + + $this->slackRecord = new SlackRecord( + $channel, + $username, + $useAttachment, + $iconEmoji, + $useShortAttachment, + $includeContextAndExtra, + $excludeFields, + $this->formatter + ); + } + + public function getSlackRecord() + { + return $this->slackRecord; + } + + public function getWebhookUrl() + { + return $this->webhookUrl; + } + + /** + * {@inheritdoc} + * + * @param array $record + */ + protected function write(array $record) + { + $postData = $this->slackRecord->getSlackData($record); + $postString = json_encode($postData); + + $ch = curl_init(); + $options = array( + CURLOPT_URL => $this->webhookUrl, + CURLOPT_POST => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_HTTPHEADER => array('Content-type: application/json'), + CURLOPT_POSTFIELDS => $postString + ); + if (defined('CURLOPT_SAFE_UPLOAD')) { + $options[CURLOPT_SAFE_UPLOAD] = true; + } + + curl_setopt_array($ch, $options); + + Curl\Util::execute($ch); + } + + public function setFormatter(FormatterInterface $formatter) + { + parent::setFormatter($formatter); + $this->slackRecord->setFormatter($formatter); + + return $this; + } + + public function getFormatter() + { + $formatter = parent::getFormatter(); + $this->slackRecord->setFormatter($formatter); + + return $formatter; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php new file mode 100644 index 0000000..d3352ea --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php @@ -0,0 +1,84 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Sends notifications through Slack's Slackbot + * + * @author Haralan Dobrev + * @see https://slack.com/apps/A0F81R8ET-slackbot + * @deprecated According to Slack the API used on this handler it is deprecated. + * Therefore this handler will be removed on 2.x + * Slack suggests to use webhooks instead. Please contact slack for more information. + */ +class SlackbotHandler extends AbstractProcessingHandler +{ + /** + * The slug of the Slack team + * @var string + */ + private $slackTeam; + + /** + * Slackbot token + * @var string + */ + private $token; + + /** + * Slack channel name + * @var string + */ + private $channel; + + /** + * @param string $slackTeam Slack team slug + * @param string $token Slackbot token + * @param string $channel Slack channel (encoded ID or name) + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($slackTeam, $token, $channel, $level = Logger::CRITICAL, $bubble = true) + { + @trigger_error('SlackbotHandler is deprecated and will be removed on 2.x', E_USER_DEPRECATED); + parent::__construct($level, $bubble); + + $this->slackTeam = $slackTeam; + $this->token = $token; + $this->channel = $channel; + } + + /** + * {@inheritdoc} + * + * @param array $record + */ + protected function write(array $record) + { + $slackbotUrl = sprintf( + 'https://%s.slack.com/services/hooks/slackbot?token=%s&channel=%s', + $this->slackTeam, + $this->token, + $this->channel + ); + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $slackbotUrl); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $record['message']); + + Curl\Util::execute($ch); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php new file mode 100644 index 0000000..db50d97 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php @@ -0,0 +1,385 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Stores to any socket - uses fsockopen() or pfsockopen(). + * + * @author Pablo de Leon Belloc + * @see http://php.net/manual/en/function.fsockopen.php + */ +class SocketHandler extends AbstractProcessingHandler +{ + private $connectionString; + private $connectionTimeout; + private $resource; + private $timeout = 0; + private $writingTimeout = 10; + private $lastSentBytes = null; + private $chunkSize = null; + private $persistent = false; + private $errno; + private $errstr; + private $lastWritingAt; + + /** + * @param string $connectionString Socket connection string + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($connectionString, $level = Logger::DEBUG, $bubble = true) + { + parent::__construct($level, $bubble); + $this->connectionString = $connectionString; + $this->connectionTimeout = (float) ini_get('default_socket_timeout'); + } + + /** + * Connect (if necessary) and write to the socket + * + * @param array $record + * + * @throws \UnexpectedValueException + * @throws \RuntimeException + */ + protected function write(array $record) + { + $this->connectIfNotConnected(); + $data = $this->generateDataStream($record); + $this->writeToSocket($data); + } + + /** + * We will not close a PersistentSocket instance so it can be reused in other requests. + */ + public function close() + { + if (!$this->isPersistent()) { + $this->closeSocket(); + } + } + + /** + * Close socket, if open + */ + public function closeSocket() + { + if (is_resource($this->resource)) { + fclose($this->resource); + $this->resource = null; + } + } + + /** + * Set socket connection to nbe persistent. It only has effect before the connection is initiated. + * + * @param bool $persistent + */ + public function setPersistent($persistent) + { + $this->persistent = (bool) $persistent; + } + + /** + * Set connection timeout. Only has effect before we connect. + * + * @param float $seconds + * + * @see http://php.net/manual/en/function.fsockopen.php + */ + public function setConnectionTimeout($seconds) + { + $this->validateTimeout($seconds); + $this->connectionTimeout = (float) $seconds; + } + + /** + * Set write timeout. Only has effect before we connect. + * + * @param float $seconds + * + * @see http://php.net/manual/en/function.stream-set-timeout.php + */ + public function setTimeout($seconds) + { + $this->validateTimeout($seconds); + $this->timeout = (float) $seconds; + } + + /** + * Set writing timeout. Only has effect during connection in the writing cycle. + * + * @param float $seconds 0 for no timeout + */ + public function setWritingTimeout($seconds) + { + $this->validateTimeout($seconds); + $this->writingTimeout = (float) $seconds; + } + + /** + * Set chunk size. Only has effect during connection in the writing cycle. + * + * @param float $bytes + */ + public function setChunkSize($bytes) + { + $this->chunkSize = $bytes; + } + + /** + * Get current connection string + * + * @return string + */ + public function getConnectionString() + { + return $this->connectionString; + } + + /** + * Get persistent setting + * + * @return bool + */ + public function isPersistent() + { + return $this->persistent; + } + + /** + * Get current connection timeout setting + * + * @return float + */ + public function getConnectionTimeout() + { + return $this->connectionTimeout; + } + + /** + * Get current in-transfer timeout + * + * @return float + */ + public function getTimeout() + { + return $this->timeout; + } + + /** + * Get current local writing timeout + * + * @return float + */ + public function getWritingTimeout() + { + return $this->writingTimeout; + } + + /** + * Get current chunk size + * + * @return float + */ + public function getChunkSize() + { + return $this->chunkSize; + } + + /** + * Check to see if the socket is currently available. + * + * UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details. + * + * @return bool + */ + public function isConnected() + { + return is_resource($this->resource) + && !feof($this->resource); // on TCP - other party can close connection. + } + + /** + * Wrapper to allow mocking + */ + protected function pfsockopen() + { + return @pfsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout); + } + + /** + * Wrapper to allow mocking + */ + protected function fsockopen() + { + return @fsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout); + } + + /** + * Wrapper to allow mocking + * + * @see http://php.net/manual/en/function.stream-set-timeout.php + */ + protected function streamSetTimeout() + { + $seconds = floor($this->timeout); + $microseconds = round(($this->timeout - $seconds) * 1e6); + + return stream_set_timeout($this->resource, $seconds, $microseconds); + } + + /** + * Wrapper to allow mocking + * + * @see http://php.net/manual/en/function.stream-set-chunk-size.php + */ + protected function streamSetChunkSize() + { + return stream_set_chunk_size($this->resource, $this->chunkSize); + } + + /** + * Wrapper to allow mocking + */ + protected function fwrite($data) + { + return @fwrite($this->resource, $data); + } + + /** + * Wrapper to allow mocking + */ + protected function streamGetMetadata() + { + return stream_get_meta_data($this->resource); + } + + private function validateTimeout($value) + { + $ok = filter_var($value, FILTER_VALIDATE_FLOAT); + if ($ok === false || $value < 0) { + throw new \InvalidArgumentException("Timeout must be 0 or a positive float (got $value)"); + } + } + + private function connectIfNotConnected() + { + if ($this->isConnected()) { + return; + } + $this->connect(); + } + + protected function generateDataStream($record) + { + return (string) $record['formatted']; + } + + /** + * @return resource|null + */ + protected function getResource() + { + return $this->resource; + } + + private function connect() + { + $this->createSocketResource(); + $this->setSocketTimeout(); + $this->setStreamChunkSize(); + } + + private function createSocketResource() + { + if ($this->isPersistent()) { + $resource = $this->pfsockopen(); + } else { + $resource = $this->fsockopen(); + } + if (!$resource) { + throw new \UnexpectedValueException("Failed connecting to $this->connectionString ($this->errno: $this->errstr)"); + } + $this->resource = $resource; + } + + private function setSocketTimeout() + { + if (!$this->streamSetTimeout()) { + throw new \UnexpectedValueException("Failed setting timeout with stream_set_timeout()"); + } + } + + private function setStreamChunkSize() + { + if ($this->chunkSize && !$this->streamSetChunkSize()) { + throw new \UnexpectedValueException("Failed setting chunk size with stream_set_chunk_size()"); + } + } + + private function writeToSocket($data) + { + $length = strlen($data); + $sent = 0; + $this->lastSentBytes = $sent; + while ($this->isConnected() && $sent < $length) { + if (0 == $sent) { + $chunk = $this->fwrite($data); + } else { + $chunk = $this->fwrite(substr($data, $sent)); + } + if ($chunk === false) { + throw new \RuntimeException("Could not write to socket"); + } + $sent += $chunk; + $socketInfo = $this->streamGetMetadata(); + if ($socketInfo['timed_out']) { + throw new \RuntimeException("Write timed-out"); + } + + if ($this->writingIsTimedOut($sent)) { + throw new \RuntimeException("Write timed-out, no data sent for `{$this->writingTimeout}` seconds, probably we got disconnected (sent $sent of $length)"); + } + } + if (!$this->isConnected() && $sent < $length) { + throw new \RuntimeException("End-of-file reached, probably we got disconnected (sent $sent of $length)"); + } + } + + private function writingIsTimedOut($sent) + { + $writingTimeout = (int) floor($this->writingTimeout); + if (0 === $writingTimeout) { + return false; + } + + if ($sent !== $this->lastSentBytes) { + $this->lastWritingAt = time(); + $this->lastSentBytes = $sent; + + return false; + } else { + usleep(100); + } + + if ((time() - $this->lastWritingAt) >= $writingTimeout) { + $this->closeSocket(); + + return true; + } + + return false; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php new file mode 100644 index 0000000..27d90e0 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php @@ -0,0 +1,177 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Stores to any stream resource + * + * Can be used to store into php://stderr, remote and local files, etc. + * + * @author Jordi Boggiano + */ +class StreamHandler extends AbstractProcessingHandler +{ + protected $stream; + protected $url; + private $errorMessage; + protected $filePermission; + protected $useLocking; + private $dirCreated; + + /** + * @param resource|string $stream + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) + * @param bool $useLocking Try to lock log file before doing any writes + * + * @throws \Exception If a missing directory is not buildable + * @throws \InvalidArgumentException If stream is not a resource or string + */ + public function __construct($stream, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false) + { + parent::__construct($level, $bubble); + if (is_resource($stream)) { + $this->stream = $stream; + } elseif (is_string($stream)) { + $this->url = $stream; + } else { + throw new \InvalidArgumentException('A stream must either be a resource or a string.'); + } + + $this->filePermission = $filePermission; + $this->useLocking = $useLocking; + } + + /** + * {@inheritdoc} + */ + public function close() + { + if ($this->url && is_resource($this->stream)) { + fclose($this->stream); + } + $this->stream = null; + $this->dirCreated = null; + } + + /** + * Return the currently active stream if it is open + * + * @return resource|null + */ + public function getStream() + { + return $this->stream; + } + + /** + * Return the stream URL if it was configured with a URL and not an active resource + * + * @return string|null + */ + public function getUrl() + { + return $this->url; + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + if (!is_resource($this->stream)) { + if (null === $this->url || '' === $this->url) { + throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().'); + } + $this->createDir(); + $this->errorMessage = null; + set_error_handler(array($this, 'customErrorHandler')); + $this->stream = fopen($this->url, 'a'); + if ($this->filePermission !== null) { + @chmod($this->url, $this->filePermission); + } + restore_error_handler(); + if (!is_resource($this->stream)) { + $this->stream = null; + throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened: '.$this->errorMessage, $this->url)); + } + } + + if ($this->useLocking) { + // ignoring errors here, there's not much we can do about them + flock($this->stream, LOCK_EX); + } + + $this->streamWrite($this->stream, $record); + + if ($this->useLocking) { + flock($this->stream, LOCK_UN); + } + } + + /** + * Write to stream + * @param resource $stream + * @param array $record + */ + protected function streamWrite($stream, array $record) + { + fwrite($stream, (string) $record['formatted']); + } + + private function customErrorHandler($code, $msg) + { + $this->errorMessage = preg_replace('{^(fopen|mkdir)\(.*?\): }', '', $msg); + } + + /** + * @param string $stream + * + * @return null|string + */ + private function getDirFromStream($stream) + { + $pos = strpos($stream, '://'); + if ($pos === false) { + return dirname($stream); + } + + if ('file://' === substr($stream, 0, 7)) { + return dirname(substr($stream, 7)); + } + + return; + } + + private function createDir() + { + // Do not try to create dir if it has already been tried. + if ($this->dirCreated) { + return; + } + + $dir = $this->getDirFromStream($this->url); + if (null !== $dir && !is_dir($dir)) { + $this->errorMessage = null; + set_error_handler(array($this, 'customErrorHandler')); + $status = mkdir($dir, 0777, true); + restore_error_handler(); + if (false === $status && !is_dir($dir)) { + throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and its not buildable: '.$this->errorMessage, $dir)); + } + } + $this->dirCreated = true; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php new file mode 100644 index 0000000..ac7b16f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php @@ -0,0 +1,111 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\FormatterInterface; +use Monolog\Formatter\LineFormatter; +use Swift; + +/** + * SwiftMailerHandler uses Swift_Mailer to send the emails + * + * @author Gyula Sallai + */ +class SwiftMailerHandler extends MailHandler +{ + protected $mailer; + private $messageTemplate; + + /** + * @param \Swift_Mailer $mailer The mailer to use + * @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, $bubble = true) + { + parent::__construct($level, $bubble); + + $this->mailer = $mailer; + $this->messageTemplate = $message; + } + + /** + * {@inheritdoc} + */ + protected function send($content, array $records) + { + $this->mailer->send($this->buildMessage($content, $records)); + } + + /** + * Gets the formatter for the Swift_Message subject. + * + * @param string $format The format of the subject + * @return FormatterInterface + */ + protected function getSubjectFormatter($format) + { + return new LineFormatter($format); + } + + /** + * Creates instance of Swift_Message to be sent + * + * @param string $content formatted email body to be sent + * @param array $records Log records that formed the content + * @return \Swift_Message + */ + protected function buildMessage($content, array $records) + { + $message = null; + if ($this->messageTemplate instanceof \Swift_Message) { + $message = clone $this->messageTemplate; + $message->generateId(); + } elseif (is_callable($this->messageTemplate)) { + $message = call_user_func($this->messageTemplate, $content, $records); + } + + if (!$message instanceof \Swift_Message) { + throw new \InvalidArgumentException('Could not resolve message as instance of Swift_Message or a callable returning it'); + } + + if ($records) { + $subjectFormatter = $this->getSubjectFormatter($message->getSubject()); + $message->setSubject($subjectFormatter->format($this->getHighestRecord($records))); + } + + $message->setBody($content); + if (version_compare(Swift::VERSION, '6.0.0', '>=')) { + $message->setDate(new \DateTimeImmutable()); + } else { + $message->setDate(time()); + } + + return $message; + } + + /** + * BC getter, to be removed in 2.0 + */ + public function __get($name) + { + if ($name === 'message') { + trigger_error('SwiftMailerHandler->message is deprecated, use ->buildMessage() instead to retrieve the message', E_USER_DEPRECATED); + + return $this->buildMessage(null, array()); + } + + throw new \InvalidArgumentException('Invalid property '.$name); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php new file mode 100644 index 0000000..f770c80 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Logs to syslog service. + * + * usage example: + * + * $log = new Logger('application'); + * $syslog = new SyslogHandler('myfacility', 'local6'); + * $formatter = new LineFormatter("%channel%.%level_name%: %message% %extra%"); + * $syslog->setFormatter($formatter); + * $log->pushHandler($syslog); + * + * @author Sven Paulus + */ +class SyslogHandler extends AbstractSyslogHandler +{ + protected $ident; + protected $logopts; + + /** + * @param string $ident + * @param mixed $facility + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param int $logopts Option flags for the openlog() call, defaults to LOG_PID + */ + public function __construct($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $logopts = LOG_PID) + { + parent::__construct($facility, $level, $bubble); + + $this->ident = $ident; + $this->logopts = $logopts; + } + + /** + * {@inheritdoc} + */ + public function close() + { + closelog(); + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + if (!openlog($this->ident, $this->logopts, $this->facility)) { + throw new \LogicException('Can\'t open syslog for ident "'.$this->ident.'" and facility "'.$this->facility.'"'); + } + syslog($this->logLevels[$record['level']], (string) $record['formatted']); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php new file mode 100644 index 0000000..3bff085 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler\SyslogUdp; + +class UdpSocket +{ + const DATAGRAM_MAX_LENGTH = 65023; + + protected $ip; + protected $port; + protected $socket; + + public function __construct($ip, $port = 514) + { + $this->ip = $ip; + $this->port = $port; + $this->socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); + } + + public function write($line, $header = "") + { + $this->send($this->assembleMessage($line, $header)); + } + + public function close() + { + if (is_resource($this->socket)) { + socket_close($this->socket); + $this->socket = null; + } + } + + protected function send($chunk) + { + if (!is_resource($this->socket)) { + throw new \LogicException('The UdpSocket to '.$this->ip.':'.$this->port.' has been closed and can not be written to anymore'); + } + socket_sendto($this->socket, $chunk, strlen($chunk), $flags = 0, $this->ip, $this->port); + } + + protected function assembleMessage($line, $header) + { + $chunkSize = self::DATAGRAM_MAX_LENGTH - strlen($header); + + return $header . substr($line, 0, $chunkSize); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php new file mode 100644 index 0000000..4dfd5f5 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php @@ -0,0 +1,124 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Handler\SyslogUdp\UdpSocket; + +/** + * A Handler for logging to a remote syslogd server. + * + * @author Jesper Skovgaard Nielsen + * @author Dominik Kukacka + */ +class SyslogUdpHandler extends AbstractSyslogHandler +{ + const RFC3164 = 0; + const RFC5424 = 1; + + private $dateFormats = array( + self::RFC3164 => 'M d H:i:s', + self::RFC5424 => \DateTime::RFC3339, + ); + + protected $socket; + protected $ident; + protected $rfc; + + /** + * @param string $host + * @param int $port + * @param mixed $facility + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param string $ident Program name or tag for each log message. + * @param int $rfc RFC to format the message for. + */ + public function __construct($host, $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $ident = 'php', $rfc = self::RFC5424) + { + parent::__construct($facility, $level, $bubble); + + $this->ident = $ident; + $this->rfc = $rfc; + + $this->socket = new UdpSocket($host, $port ?: 514); + } + + protected function write(array $record) + { + $lines = $this->splitMessageIntoLines($record['formatted']); + + $header = $this->makeCommonSyslogHeader($this->logLevels[$record['level']]); + + foreach ($lines as $line) { + $this->socket->write($line, $header); + } + } + + public function close() + { + $this->socket->close(); + } + + private function splitMessageIntoLines($message) + { + if (is_array($message)) { + $message = implode("\n", $message); + } + + return preg_split('/$\R?^/m', $message, -1, PREG_SPLIT_NO_EMPTY); + } + + /** + * Make common syslog header (see rfc5424 or rfc3164) + */ + protected function makeCommonSyslogHeader($severity) + { + $priority = $severity + $this->facility; + + if (!$pid = getmypid()) { + $pid = '-'; + } + + if (!$hostname = gethostname()) { + $hostname = '-'; + } + + $date = $this->getDateTime(); + + if ($this->rfc === self::RFC3164) { + return "<$priority>" . + $date . " " . + $hostname . " " . + $this->ident . "[" . $pid . "]: "; + } else { + return "<$priority>1 " . + $date . " " . + $hostname . " " . + $this->ident . " " . + $pid . " - - "; + } + } + + protected function getDateTime() + { + return date($this->dateFormats[$this->rfc]); + } + + /** + * Inject your own socket, mainly used for testing + */ + public function setSocket($socket) + { + $this->socket = $socket; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php new file mode 100644 index 0000000..478db0a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php @@ -0,0 +1,177 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +/** + * Used for testing purposes. + * + * It records all records and gives you access to them for verification. + * + * @author Jordi Boggiano + * + * @method bool hasEmergency($record) + * @method bool hasAlert($record) + * @method bool hasCritical($record) + * @method bool hasError($record) + * @method bool hasWarning($record) + * @method bool hasNotice($record) + * @method bool hasInfo($record) + * @method bool hasDebug($record) + * + * @method bool hasEmergencyRecords() + * @method bool hasAlertRecords() + * @method bool hasCriticalRecords() + * @method bool hasErrorRecords() + * @method bool hasWarningRecords() + * @method bool hasNoticeRecords() + * @method bool hasInfoRecords() + * @method bool hasDebugRecords() + * + * @method bool hasEmergencyThatContains($message) + * @method bool hasAlertThatContains($message) + * @method bool hasCriticalThatContains($message) + * @method bool hasErrorThatContains($message) + * @method bool hasWarningThatContains($message) + * @method bool hasNoticeThatContains($message) + * @method bool hasInfoThatContains($message) + * @method bool hasDebugThatContains($message) + * + * @method bool hasEmergencyThatMatches($message) + * @method bool hasAlertThatMatches($message) + * @method bool hasCriticalThatMatches($message) + * @method bool hasErrorThatMatches($message) + * @method bool hasWarningThatMatches($message) + * @method bool hasNoticeThatMatches($message) + * @method bool hasInfoThatMatches($message) + * @method bool hasDebugThatMatches($message) + * + * @method bool hasEmergencyThatPasses($message) + * @method bool hasAlertThatPasses($message) + * @method bool hasCriticalThatPasses($message) + * @method bool hasErrorThatPasses($message) + * @method bool hasWarningThatPasses($message) + * @method bool hasNoticeThatPasses($message) + * @method bool hasInfoThatPasses($message) + * @method bool hasDebugThatPasses($message) + */ +class TestHandler extends AbstractProcessingHandler +{ + protected $records = array(); + protected $recordsByLevel = array(); + private $skipReset = false; + + public function getRecords() + { + return $this->records; + } + + public function clear() + { + $this->records = array(); + $this->recordsByLevel = array(); + } + + public function reset() + { + if (!$this->skipReset) { + $this->clear(); + } + } + + public function setSkipReset($skipReset) + { + $this->skipReset = $skipReset; + } + + public function hasRecords($level) + { + return isset($this->recordsByLevel[$level]); + } + + /** + * @param string|array $record Either a message string or an array containing message and optionally context keys that will be checked against all records + * @param int $level Logger::LEVEL constant value + */ + public function hasRecord($record, $level) + { + if (is_string($record)) { + $record = array('message' => $record); + } + + return $this->hasRecordThatPasses(function ($rec) use ($record) { + if ($rec['message'] !== $record['message']) { + return false; + } + if (isset($record['context']) && $rec['context'] !== $record['context']) { + return false; + } + return true; + }, $level); + } + + public function hasRecordThatContains($message, $level) + { + return $this->hasRecordThatPasses(function ($rec) use ($message) { + return strpos($rec['message'], $message) !== false; + }, $level); + } + + public function hasRecordThatMatches($regex, $level) + { + return $this->hasRecordThatPasses(function ($rec) use ($regex) { + return preg_match($regex, $rec['message']) > 0; + }, $level); + } + + public function hasRecordThatPasses($predicate, $level) + { + if (!is_callable($predicate)) { + throw new \InvalidArgumentException("Expected a callable for hasRecordThatSucceeds"); + } + + if (!isset($this->recordsByLevel[$level])) { + return false; + } + + foreach ($this->recordsByLevel[$level] as $i => $rec) { + if (call_user_func($predicate, $rec, $i)) { + return true; + } + } + + return false; + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + $this->recordsByLevel[$record['level']][] = $record; + $this->records[] = $record; + } + + public function __call($method, $args) + { + if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { + $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; + $level = constant('Monolog\Logger::' . strtoupper($matches[2])); + if (method_exists($this, $genericMethod)) { + $args[] = $level; + + return call_user_func_array(array($this, $genericMethod), $args); + } + } + + throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php new file mode 100644 index 0000000..7d7622a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +/** + * Forwards records to multiple handlers suppressing failures of each handler + * and continuing through to give every handler a chance to succeed. + * + * @author Craig D'Amelio + */ +class WhatFailureGroupHandler extends GroupHandler +{ + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + if ($this->processors) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + } + + foreach ($this->handlers as $handler) { + try { + $handler->handle($record); + } catch (\Exception $e) { + // What failure? + } catch (\Throwable $e) { + // What failure? + } + } + + return false === $this->bubble; + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + if ($this->processors) { + $processed = array(); + foreach ($records as $record) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + $processed[] = $record; + } + $records = $processed; + } + + foreach ($this->handlers as $handler) { + try { + $handler->handleBatch($records); + } catch (\Exception $e) { + // What failure? + } catch (\Throwable $e) { + // What failure? + } + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php new file mode 100644 index 0000000..a20aeae --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php @@ -0,0 +1,101 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\NormalizerFormatter; +use Monolog\Logger; + +/** + * Handler sending logs to Zend Monitor + * + * @author Christian Bergau + * @author Jason Davis + */ +class ZendMonitorHandler extends AbstractProcessingHandler +{ + /** + * Monolog level / ZendMonitor Custom Event priority map + * + * @var array + */ + protected $levelMap = array(); + + /** + * Construct + * + * @param int $level + * @param bool $bubble + * @throws MissingExtensionException + */ + public function __construct($level = Logger::DEBUG, $bubble = true) + { + if (!function_exists('zend_monitor_custom_event')) { + throw new MissingExtensionException( + 'You must have Zend Server installed with Zend Monitor enabled in order to use this handler' + ); + } + //zend monitor constants are not defined if zend monitor is not enabled. + $this->levelMap = array( + Logger::DEBUG => \ZEND_MONITOR_EVENT_SEVERITY_INFO, + Logger::INFO => \ZEND_MONITOR_EVENT_SEVERITY_INFO, + Logger::NOTICE => \ZEND_MONITOR_EVENT_SEVERITY_INFO, + Logger::WARNING => \ZEND_MONITOR_EVENT_SEVERITY_WARNING, + Logger::ERROR => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, + Logger::CRITICAL => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, + Logger::ALERT => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, + Logger::EMERGENCY => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, + ); + parent::__construct($level, $bubble); + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + $this->writeZendMonitorCustomEvent( + Logger::getLevelName($record['level']), + $record['message'], + $record['formatted'], + $this->levelMap[$record['level']] + ); + } + + /** + * Write to Zend Monitor Events + * @param string $type Text displayed in "Class Name (custom)" field + * @param string $message Text displayed in "Error String" + * @param mixed $formatted Displayed in Custom Variables tab + * @param int $severity Set the event severity level (-1,0,1) + */ + protected function writeZendMonitorCustomEvent($type, $message, $formatted, $severity) + { + zend_monitor_custom_event($type, $message, $formatted, $severity); + } + + /** + * {@inheritdoc} + */ + public function getDefaultFormatter() + { + return new NormalizerFormatter(); + } + + /** + * Get the level map + * + * @return array + */ + public function getLevelMap() + { + return $this->levelMap; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Logger.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Logger.php new file mode 100644 index 0000000..05dfc81 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Logger.php @@ -0,0 +1,791 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog; + +use Monolog\Handler\HandlerInterface; +use Monolog\Handler\StreamHandler; +use Psr\Log\LoggerInterface; +use Psr\Log\InvalidArgumentException; +use Exception; + +/** + * Monolog log channel + * + * It contains a stack of Handlers and a stack of Processors, + * and uses them to store records that are added to it. + * + * @author Jordi Boggiano + */ +class Logger implements LoggerInterface, ResettableInterface +{ + /** + * Detailed debug information + */ + const DEBUG = 100; + + /** + * Interesting events + * + * Examples: User logs in, SQL logs. + */ + const INFO = 200; + + /** + * Uncommon events + */ + const NOTICE = 250; + + /** + * Exceptional occurrences that are not errors + * + * Examples: Use of deprecated APIs, poor use of an API, + * undesirable things that are not necessarily wrong. + */ + const WARNING = 300; + + /** + * Runtime errors + */ + const ERROR = 400; + + /** + * Critical conditions + * + * Example: Application component unavailable, unexpected exception. + */ + const CRITICAL = 500; + + /** + * Action must be taken immediately + * + * Example: Entire website down, database unavailable, etc. + * This should trigger the SMS alerts and wake you up. + */ + const ALERT = 550; + + /** + * Urgent alert. + */ + const EMERGENCY = 600; + + /** + * Monolog API version + * + * This is only bumped when API breaks are done and should + * follow the major version of the library + * + * @var int + */ + const API = 1; + + /** + * Logging levels from syslog protocol defined in RFC 5424 + * + * @var array $levels Logging levels + */ + protected static $levels = array( + self::DEBUG => 'DEBUG', + self::INFO => 'INFO', + self::NOTICE => 'NOTICE', + self::WARNING => 'WARNING', + self::ERROR => 'ERROR', + self::CRITICAL => 'CRITICAL', + self::ALERT => 'ALERT', + self::EMERGENCY => 'EMERGENCY', + ); + + /** + * @var \DateTimeZone + */ + protected static $timezone; + + /** + * @var string + */ + protected $name; + + /** + * The handler stack + * + * @var HandlerInterface[] + */ + protected $handlers; + + /** + * Processors that will process all log records + * + * To process records of a single handler instead, add the processor on that specific handler + * + * @var callable[] + */ + protected $processors; + + /** + * @var bool + */ + protected $microsecondTimestamps = true; + + /** + * @var callable + */ + protected $exceptionHandler; + + /** + * @param string $name The logging channel + * @param HandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc. + * @param callable[] $processors Optional array of processors + */ + public function __construct($name, array $handlers = array(), array $processors = array()) + { + $this->name = $name; + $this->setHandlers($handlers); + $this->processors = $processors; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Return a new cloned instance with the name changed + * + * @return static + */ + public function withName($name) + { + $new = clone $this; + $new->name = $name; + + return $new; + } + + /** + * Pushes a handler on to the stack. + * + * @param HandlerInterface $handler + * @return $this + */ + public function pushHandler(HandlerInterface $handler) + { + array_unshift($this->handlers, $handler); + + return $this; + } + + /** + * Pops a handler from the stack + * + * @return HandlerInterface + */ + public function popHandler() + { + if (!$this->handlers) { + throw new \LogicException('You tried to pop from an empty handler stack.'); + } + + return array_shift($this->handlers); + } + + /** + * Set handlers, replacing all existing ones. + * + * If a map is passed, keys will be ignored. + * + * @param HandlerInterface[] $handlers + * @return $this + */ + public function setHandlers(array $handlers) + { + $this->handlers = array(); + foreach (array_reverse($handlers) as $handler) { + $this->pushHandler($handler); + } + + return $this; + } + + /** + * @return HandlerInterface[] + */ + public function getHandlers() + { + return $this->handlers; + } + + /** + * Adds a processor on to the stack. + * + * @param callable $callback + * @return $this + */ + public function pushProcessor($callback) + { + if (!is_callable($callback)) { + throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given'); + } + array_unshift($this->processors, $callback); + + return $this; + } + + /** + * Removes the processor on top of the stack and returns it. + * + * @return callable + */ + public function popProcessor() + { + if (!$this->processors) { + throw new \LogicException('You tried to pop from an empty processor stack.'); + } + + return array_shift($this->processors); + } + + /** + * @return callable[] + */ + public function getProcessors() + { + return $this->processors; + } + + /** + * Control the use of microsecond resolution timestamps in the 'datetime' + * member of new records. + * + * Generating microsecond resolution timestamps by calling + * microtime(true), formatting the result via sprintf() and then parsing + * the resulting string via \DateTime::createFromFormat() can incur + * a measurable runtime overhead vs simple usage of DateTime to capture + * a second resolution timestamp in systems which generate a large number + * of log events. + * + * @param bool $micro True to use microtime() to create timestamps + */ + public function useMicrosecondTimestamps($micro) + { + $this->microsecondTimestamps = (bool) $micro; + } + + /** + * Adds a log record. + * + * @param int $level The logging level + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addRecord($level, $message, array $context = array()) + { + if (!$this->handlers) { + $this->pushHandler(new StreamHandler('php://stderr', static::DEBUG)); + } + + $levelName = static::getLevelName($level); + + // check if any handler will handle this message so we can return early and save cycles + $handlerKey = null; + reset($this->handlers); + while ($handler = current($this->handlers)) { + if ($handler->isHandling(array('level' => $level))) { + $handlerKey = key($this->handlers); + break; + } + + next($this->handlers); + } + + if (null === $handlerKey) { + return false; + } + + if (!static::$timezone) { + static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'UTC'); + } + + // php7.1+ always has microseconds enabled, so we do not need this hack + if ($this->microsecondTimestamps && PHP_VERSION_ID < 70100) { + $ts = \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone); + } else { + $ts = new \DateTime(null, static::$timezone); + } + $ts->setTimezone(static::$timezone); + + $record = array( + 'message' => (string) $message, + 'context' => $context, + 'level' => $level, + 'level_name' => $levelName, + 'channel' => $this->name, + 'datetime' => $ts, + 'extra' => array(), + ); + + try { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + + while ($handler = current($this->handlers)) { + if (true === $handler->handle($record)) { + break; + } + + next($this->handlers); + } + } catch (Exception $e) { + $this->handleException($e, $record); + } + + return true; + } + + /** + * Ends a log cycle and frees all resources used by handlers. + * + * Closing a Handler means flushing all buffers and freeing any open resources/handles. + * Handlers that have been closed should be able to accept log records again and re-open + * themselves on demand, but this may not always be possible depending on implementation. + * + * This is useful at the end of a request and will be called automatically on every handler + * when they get destructed. + */ + public function close() + { + foreach ($this->handlers as $handler) { + if (method_exists($handler, 'close')) { + $handler->close(); + } + } + } + + /** + * Ends a log cycle and resets all handlers and processors to their initial state. + * + * Resetting a Handler or a Processor means flushing/cleaning all buffers, resetting internal + * state, and getting it back to a state in which it can receive log records again. + * + * This is useful in case you want to avoid logs leaking between two requests or jobs when you + * have a long running process like a worker or an application server serving multiple requests + * in one process. + */ + public function reset() + { + foreach ($this->handlers as $handler) { + if ($handler instanceof ResettableInterface) { + $handler->reset(); + } + } + + foreach ($this->processors as $processor) { + if ($processor instanceof ResettableInterface) { + $processor->reset(); + } + } + } + + /** + * Adds a log record at the DEBUG level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addDebug($message, array $context = array()) + { + return $this->addRecord(static::DEBUG, $message, $context); + } + + /** + * Adds a log record at the INFO level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addInfo($message, array $context = array()) + { + return $this->addRecord(static::INFO, $message, $context); + } + + /** + * Adds a log record at the NOTICE level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addNotice($message, array $context = array()) + { + return $this->addRecord(static::NOTICE, $message, $context); + } + + /** + * Adds a log record at the WARNING level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addWarning($message, array $context = array()) + { + return $this->addRecord(static::WARNING, $message, $context); + } + + /** + * Adds a log record at the ERROR level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addError($message, array $context = array()) + { + return $this->addRecord(static::ERROR, $message, $context); + } + + /** + * Adds a log record at the CRITICAL level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addCritical($message, array $context = array()) + { + return $this->addRecord(static::CRITICAL, $message, $context); + } + + /** + * Adds a log record at the ALERT level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addAlert($message, array $context = array()) + { + return $this->addRecord(static::ALERT, $message, $context); + } + + /** + * Adds a log record at the EMERGENCY level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addEmergency($message, array $context = array()) + { + return $this->addRecord(static::EMERGENCY, $message, $context); + } + + /** + * Gets all supported logging levels. + * + * @return array Assoc array with human-readable level names => level codes. + */ + public static function getLevels() + { + return array_flip(static::$levels); + } + + /** + * Gets the name of the logging level. + * + * @param int $level + * @return string + */ + public static function getLevelName($level) + { + if (!isset(static::$levels[$level])) { + throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', array_keys(static::$levels))); + } + + return static::$levels[$level]; + } + + /** + * Converts PSR-3 levels to Monolog ones if necessary + * + * @param string|int Level number (monolog) or name (PSR-3) + * @return int + */ + public static function toMonologLevel($level) + { + if (is_string($level) && defined(__CLASS__.'::'.strtoupper($level))) { + return constant(__CLASS__.'::'.strtoupper($level)); + } + + return $level; + } + + /** + * Checks whether the Logger has a handler that listens on the given level + * + * @param int $level + * @return bool + */ + public function isHandling($level) + { + $record = array( + 'level' => $level, + ); + + foreach ($this->handlers as $handler) { + if ($handler->isHandling($record)) { + return true; + } + } + + return false; + } + + /** + * Set a custom exception handler + * + * @param callable $callback + * @return $this + */ + public function setExceptionHandler($callback) + { + if (!is_callable($callback)) { + throw new \InvalidArgumentException('Exception handler must be valid callable (callback or object with an __invoke method), '.var_export($callback, true).' given'); + } + $this->exceptionHandler = $callback; + + return $this; + } + + /** + * @return callable + */ + public function getExceptionHandler() + { + return $this->exceptionHandler; + } + + /** + * Delegates exception management to the custom exception handler, + * or throws the exception if no custom handler is set. + */ + protected function handleException(Exception $e, array $record) + { + if (!$this->exceptionHandler) { + throw $e; + } + + call_user_func($this->exceptionHandler, $e, $record); + } + + /** + * Adds a log record at an arbitrary level. + * + * This method allows for compatibility with common interfaces. + * + * @param mixed $level The log level + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function log($level, $message, array $context = array()) + { + $level = static::toMonologLevel($level); + + return $this->addRecord($level, $message, $context); + } + + /** + * Adds a log record at the DEBUG level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function debug($message, array $context = array()) + { + return $this->addRecord(static::DEBUG, $message, $context); + } + + /** + * Adds a log record at the INFO level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function info($message, array $context = array()) + { + return $this->addRecord(static::INFO, $message, $context); + } + + /** + * Adds a log record at the NOTICE level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function notice($message, array $context = array()) + { + return $this->addRecord(static::NOTICE, $message, $context); + } + + /** + * Adds a log record at the WARNING level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function warn($message, array $context = array()) + { + return $this->addRecord(static::WARNING, $message, $context); + } + + /** + * Adds a log record at the WARNING level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function warning($message, array $context = array()) + { + return $this->addRecord(static::WARNING, $message, $context); + } + + /** + * Adds a log record at the ERROR level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function err($message, array $context = array()) + { + return $this->addRecord(static::ERROR, $message, $context); + } + + /** + * Adds a log record at the ERROR level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function error($message, array $context = array()) + { + return $this->addRecord(static::ERROR, $message, $context); + } + + /** + * Adds a log record at the CRITICAL level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function crit($message, array $context = array()) + { + return $this->addRecord(static::CRITICAL, $message, $context); + } + + /** + * Adds a log record at the CRITICAL level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function critical($message, array $context = array()) + { + return $this->addRecord(static::CRITICAL, $message, $context); + } + + /** + * Adds a log record at the ALERT level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function alert($message, array $context = array()) + { + return $this->addRecord(static::ALERT, $message, $context); + } + + /** + * Adds a log record at the EMERGENCY level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function emerg($message, array $context = array()) + { + return $this->addRecord(static::EMERGENCY, $message, $context); + } + + /** + * Adds a log record at the EMERGENCY level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function emergency($message, array $context = array()) + { + return $this->addRecord(static::EMERGENCY, $message, $context); + } + + /** + * Set the timezone to be used for the timestamp of log records. + * + * This is stored globally for all Logger instances + * + * @param \DateTimeZone $tz Timezone object + */ + public static function setTimezone(\DateTimeZone $tz) + { + self::$timezone = $tz; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php new file mode 100644 index 0000000..9fc3f50 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +use Monolog\Logger; + +/** + * Injects Git branch and Git commit SHA in all records + * + * @author Nick Otter + * @author Jordi Boggiano + */ +class GitProcessor implements ProcessorInterface +{ + private $level; + private static $cache; + + public function __construct($level = Logger::DEBUG) + { + $this->level = Logger::toMonologLevel($level); + } + + /** + * @param array $record + * @return array + */ + public function __invoke(array $record) + { + // return if the level is not high enough + if ($record['level'] < $this->level) { + return $record; + } + + $record['extra']['git'] = self::getGitInfo(); + + return $record; + } + + private static function getGitInfo() + { + if (self::$cache) { + return self::$cache; + } + + $branches = `git branch -v --no-abbrev`; + if (preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) { + return self::$cache = array( + 'branch' => $matches[1], + 'commit' => $matches[2], + ); + } + + return self::$cache = array(); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php new file mode 100644 index 0000000..6ae192a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php @@ -0,0 +1,112 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +use Monolog\Logger; + +/** + * Injects line/file:class/function where the log message came from + * + * Warning: This only works if the handler processes the logs directly. + * If you put the processor on a handler that is behind a FingersCrossedHandler + * for example, the processor will only be called once the trigger level is reached, + * and all the log records will have the same file/line/.. data from the call that + * triggered the FingersCrossedHandler. + * + * @author Jordi Boggiano + */ +class IntrospectionProcessor implements ProcessorInterface +{ + private $level; + + private $skipClassesPartials; + + private $skipStackFramesCount; + + private $skipFunctions = array( + 'call_user_func', + 'call_user_func_array', + ); + + public function __construct($level = Logger::DEBUG, array $skipClassesPartials = array(), $skipStackFramesCount = 0) + { + $this->level = Logger::toMonologLevel($level); + $this->skipClassesPartials = array_merge(array('Monolog\\'), $skipClassesPartials); + $this->skipStackFramesCount = $skipStackFramesCount; + } + + /** + * @param array $record + * @return array + */ + public function __invoke(array $record) + { + // return if the level is not high enough + if ($record['level'] < $this->level) { + return $record; + } + + /* + * http://php.net/manual/en/function.debug-backtrace.php + * As of 5.3.6, DEBUG_BACKTRACE_IGNORE_ARGS option was added. + * Any version less than 5.3.6 must use the DEBUG_BACKTRACE_IGNORE_ARGS constant value '2'. + */ + $trace = debug_backtrace((PHP_VERSION_ID < 50306) ? 2 : DEBUG_BACKTRACE_IGNORE_ARGS); + + // skip first since it's always the current method + array_shift($trace); + // the call_user_func call is also skipped + array_shift($trace); + + $i = 0; + + while ($this->isTraceClassOrSkippedFunction($trace, $i)) { + if (isset($trace[$i]['class'])) { + foreach ($this->skipClassesPartials as $part) { + if (strpos($trace[$i]['class'], $part) !== false) { + $i++; + continue 2; + } + } + } elseif (in_array($trace[$i]['function'], $this->skipFunctions)) { + $i++; + continue; + } + + break; + } + + $i += $this->skipStackFramesCount; + + // we should have the call source now + $record['extra'] = array_merge( + $record['extra'], + array( + 'file' => isset($trace[$i - 1]['file']) ? $trace[$i - 1]['file'] : null, + 'line' => isset($trace[$i - 1]['line']) ? $trace[$i - 1]['line'] : null, + 'class' => isset($trace[$i]['class']) ? $trace[$i]['class'] : null, + 'function' => isset($trace[$i]['function']) ? $trace[$i]['function'] : null, + ) + ); + + return $record; + } + + private function isTraceClassOrSkippedFunction(array $trace, $index) + { + if (!isset($trace[$index])) { + return false; + } + + return isset($trace[$index]['class']) || in_array($trace[$index]['function'], $this->skipFunctions); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php new file mode 100644 index 0000000..0543e92 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +/** + * Injects memory_get_peak_usage in all records + * + * @see Monolog\Processor\MemoryProcessor::__construct() for options + * @author Rob Jensen + */ +class MemoryPeakUsageProcessor extends MemoryProcessor +{ + /** + * @param array $record + * @return array + */ + public function __invoke(array $record) + { + $bytes = memory_get_peak_usage($this->realUsage); + $formatted = $this->formatBytes($bytes); + + $record['extra']['memory_peak_usage'] = $formatted; + + return $record; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php new file mode 100644 index 0000000..2a379a3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +/** + * Some methods that are common for all memory processors + * + * @author Rob Jensen + */ +abstract class MemoryProcessor implements ProcessorInterface +{ + /** + * @var bool If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported. + */ + protected $realUsage; + + /** + * @var bool If true, then format memory size to human readable string (MB, KB, B depending on size) + */ + protected $useFormatting; + + /** + * @param bool $realUsage Set this to true to get the real size of memory allocated from system. + * @param bool $useFormatting If true, then format memory size to human readable string (MB, KB, B depending on size) + */ + public function __construct($realUsage = true, $useFormatting = true) + { + $this->realUsage = (bool) $realUsage; + $this->useFormatting = (bool) $useFormatting; + } + + /** + * Formats bytes into a human readable string if $this->useFormatting is true, otherwise return $bytes as is + * + * @param int $bytes + * @return string|int Formatted string if $this->useFormatting is true, otherwise return $bytes as is + */ + protected function formatBytes($bytes) + { + $bytes = (int) $bytes; + + if (!$this->useFormatting) { + return $bytes; + } + + if ($bytes > 1024 * 1024) { + return round($bytes / 1024 / 1024, 2).' MB'; + } elseif ($bytes > 1024) { + return round($bytes / 1024, 2).' KB'; + } + + return $bytes . ' B'; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php new file mode 100644 index 0000000..2783d65 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +/** + * Injects memory_get_usage in all records + * + * @see Monolog\Processor\MemoryProcessor::__construct() for options + * @author Rob Jensen + */ +class MemoryUsageProcessor extends MemoryProcessor +{ + /** + * @param array $record + * @return array + */ + public function __invoke(array $record) + { + $bytes = memory_get_usage($this->realUsage); + $formatted = $this->formatBytes($bytes); + + $record['extra']['memory_usage'] = $formatted; + + return $record; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php new file mode 100644 index 0000000..2f5b326 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +use Monolog\Logger; + +/** + * Injects Hg branch and Hg revision number in all records + * + * @author Jonathan A. Schweder + */ +class MercurialProcessor implements ProcessorInterface +{ + private $level; + private static $cache; + + public function __construct($level = Logger::DEBUG) + { + $this->level = Logger::toMonologLevel($level); + } + + /** + * @param array $record + * @return array + */ + public function __invoke(array $record) + { + // return if the level is not high enough + if ($record['level'] < $this->level) { + return $record; + } + + $record['extra']['hg'] = self::getMercurialInfo(); + + return $record; + } + + private static function getMercurialInfo() + { + if (self::$cache) { + return self::$cache; + } + + $result = explode(' ', trim(`hg id -nb`)); + if (count($result) >= 3) { + return self::$cache = array( + 'branch' => $result[1], + 'revision' => $result[2], + ); + } + + return self::$cache = array(); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php new file mode 100644 index 0000000..66b80fb --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +/** + * Adds value of getmypid into records + * + * @author Andreas Hörnicke + */ +class ProcessIdProcessor implements ProcessorInterface +{ + /** + * @param array $record + * @return array + */ + public function __invoke(array $record) + { + $record['extra']['process_id'] = getmypid(); + + return $record; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php new file mode 100644 index 0000000..7e64d4d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +/** + * An optional interface to allow labelling Monolog processors. + * + * @author Nicolas Grekas + */ +interface ProcessorInterface +{ + /** + * @return array The processed records + */ + public function __invoke(array $records); +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php new file mode 100644 index 0000000..0088505 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +use Monolog\Utils; + +/** + * Processes a record's message according to PSR-3 rules + * + * It replaces {foo} with the value from $context['foo'] + * + * @author Jordi Boggiano + */ +class PsrLogMessageProcessor implements ProcessorInterface +{ + /** + * @param array $record + * @return array + */ + public function __invoke(array $record) + { + if (false === strpos($record['message'], '{')) { + return $record; + } + + $replacements = array(); + foreach ($record['context'] as $key => $val) { + if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) { + $replacements['{'.$key.'}'] = $val; + } elseif (is_object($val)) { + $replacements['{'.$key.'}'] = '[object '.Utils::getClass($val).']'; + } else { + $replacements['{'.$key.'}'] = '['.gettype($val).']'; + } + } + + $record['message'] = strtr($record['message'], $replacements); + + return $record; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php new file mode 100644 index 0000000..615a4d9 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +/** + * Adds a tags array into record + * + * @author Martijn Riemers + */ +class TagProcessor implements ProcessorInterface +{ + private $tags; + + public function __construct(array $tags = array()) + { + $this->setTags($tags); + } + + public function addTags(array $tags = array()) + { + $this->tags = array_merge($this->tags, $tags); + } + + public function setTags(array $tags = array()) + { + $this->tags = $tags; + } + + public function __invoke(array $record) + { + $record['extra']['tags'] = $this->tags; + + return $record; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php new file mode 100644 index 0000000..d1f708c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +use Monolog\ResettableInterface; + +/** + * Adds a unique identifier into records + * + * @author Simon Mönch + */ +class UidProcessor implements ProcessorInterface, ResettableInterface +{ + private $uid; + + public function __construct($length = 7) + { + if (!is_int($length) || $length > 32 || $length < 1) { + throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32'); + } + + + $this->uid = $this->generateUid($length); + } + + public function __invoke(array $record) + { + $record['extra']['uid'] = $this->uid; + + return $record; + } + + /** + * @return string + */ + public function getUid() + { + return $this->uid; + } + + public function reset() + { + $this->uid = $this->generateUid(strlen($this->uid)); + } + + private function generateUid($length) + { + return substr(hash('md5', uniqid('', true)), 0, $length); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php new file mode 100644 index 0000000..684188f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php @@ -0,0 +1,113 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +/** + * Injects url/method and remote IP of the current web request in all records + * + * @author Jordi Boggiano + */ +class WebProcessor implements ProcessorInterface +{ + /** + * @var array|\ArrayAccess + */ + protected $serverData; + + /** + * Default fields + * + * Array is structured as [key in record.extra => key in $serverData] + * + * @var array + */ + protected $extraFields = array( + 'url' => 'REQUEST_URI', + 'ip' => 'REMOTE_ADDR', + 'http_method' => 'REQUEST_METHOD', + 'server' => 'SERVER_NAME', + 'referrer' => 'HTTP_REFERER', + ); + + /** + * @param array|\ArrayAccess $serverData Array or object w/ ArrayAccess that provides access to the $_SERVER data + * @param array|null $extraFields Field names and the related key inside $serverData to be added. If not provided it defaults to: url, ip, http_method, server, referrer + */ + public function __construct($serverData = null, array $extraFields = null) + { + if (null === $serverData) { + $this->serverData = &$_SERVER; + } elseif (is_array($serverData) || $serverData instanceof \ArrayAccess) { + $this->serverData = $serverData; + } else { + throw new \UnexpectedValueException('$serverData must be an array or object implementing ArrayAccess.'); + } + + if (null !== $extraFields) { + if (isset($extraFields[0])) { + foreach (array_keys($this->extraFields) as $fieldName) { + if (!in_array($fieldName, $extraFields)) { + unset($this->extraFields[$fieldName]); + } + } + } else { + $this->extraFields = $extraFields; + } + } + } + + /** + * @param array $record + * @return array + */ + public function __invoke(array $record) + { + // skip processing if for some reason request data + // is not present (CLI or wonky SAPIs) + if (!isset($this->serverData['REQUEST_URI'])) { + return $record; + } + + $record['extra'] = $this->appendExtraFields($record['extra']); + + return $record; + } + + /** + * @param string $extraName + * @param string $serverName + * @return $this + */ + public function addExtraField($extraName, $serverName) + { + $this->extraFields[$extraName] = $serverName; + + return $this; + } + + /** + * @param array $extra + * @return array + */ + private function appendExtraFields(array $extra) + { + foreach ($this->extraFields as $extraName => $serverName) { + $extra[$extraName] = isset($this->serverData[$serverName]) ? $this->serverData[$serverName] : null; + } + + if (isset($this->serverData['UNIQUE_ID'])) { + $extra['unique_id'] = $this->serverData['UNIQUE_ID']; + } + + return $extra; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Registry.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Registry.php new file mode 100644 index 0000000..159b751 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Registry.php @@ -0,0 +1,134 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog; + +use InvalidArgumentException; + +/** + * Monolog log registry + * + * Allows to get `Logger` instances in the global scope + * via static method calls on this class. + * + * + * $application = new Monolog\Logger('application'); + * $api = new Monolog\Logger('api'); + * + * Monolog\Registry::addLogger($application); + * Monolog\Registry::addLogger($api); + * + * function testLogger() + * { + * Monolog\Registry::api()->addError('Sent to $api Logger instance'); + * Monolog\Registry::application()->addError('Sent to $application Logger instance'); + * } + * + * + * @author Tomas Tatarko + */ +class Registry +{ + /** + * List of all loggers in the registry (by named indexes) + * + * @var Logger[] + */ + private static $loggers = array(); + + /** + * Adds new logging channel to the registry + * + * @param Logger $logger Instance of the logging channel + * @param string|null $name Name of the logging channel ($logger->getName() by default) + * @param bool $overwrite Overwrite instance in the registry if the given name already exists? + * @throws \InvalidArgumentException If $overwrite set to false and named Logger instance already exists + */ + public static function addLogger(Logger $logger, $name = null, $overwrite = false) + { + $name = $name ?: $logger->getName(); + + if (isset(self::$loggers[$name]) && !$overwrite) { + throw new InvalidArgumentException('Logger with the given name already exists'); + } + + self::$loggers[$name] = $logger; + } + + /** + * Checks if such logging channel exists by name or instance + * + * @param string|Logger $logger Name or logger instance + */ + public static function hasLogger($logger) + { + if ($logger instanceof Logger) { + $index = array_search($logger, self::$loggers, true); + + return false !== $index; + } else { + return isset(self::$loggers[$logger]); + } + } + + /** + * Removes instance from registry by name or instance + * + * @param string|Logger $logger Name or logger instance + */ + public static function removeLogger($logger) + { + if ($logger instanceof Logger) { + if (false !== ($idx = array_search($logger, self::$loggers, true))) { + unset(self::$loggers[$idx]); + } + } else { + unset(self::$loggers[$logger]); + } + } + + /** + * Clears the registry + */ + public static function clear() + { + self::$loggers = array(); + } + + /** + * Gets Logger instance from the registry + * + * @param string $name Name of the requested Logger instance + * @throws \InvalidArgumentException If named Logger instance is not in the registry + * @return Logger Requested instance of Logger + */ + public static function getInstance($name) + { + if (!isset(self::$loggers[$name])) { + throw new InvalidArgumentException(sprintf('Requested "%s" logger instance is not in the registry', $name)); + } + + return self::$loggers[$name]; + } + + /** + * Gets Logger instance from the registry via static method call + * + * @param string $name Name of the requested Logger instance + * @param array $arguments Arguments passed to static method call + * @throws \InvalidArgumentException If named Logger instance is not in the registry + * @return Logger Requested instance of Logger + */ + public static function __callStatic($name, $arguments) + { + return self::getInstance($name); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/ResettableInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/ResettableInterface.php new file mode 100644 index 0000000..635bc77 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/ResettableInterface.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog; + +/** + * Handler or Processor implementing this interface will be reset when Logger::reset() is called. + * + * Resetting ends a log cycle gets them back to their initial state. + * + * Resetting a Handler or a Processor means flushing/cleaning all buffers, resetting internal + * state, and getting it back to a state in which it can receive log records again. + * + * This is useful in case you want to avoid logs leaking between two requests or jobs when you + * have a long running process like a worker or an application server serving multiple requests + * in one process. + * + * @author Grégoire Pineau + */ +interface ResettableInterface +{ + public function reset(); +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/SignalHandler.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/SignalHandler.php new file mode 100644 index 0000000..d87018f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/SignalHandler.php @@ -0,0 +1,115 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog; + +use Psr\Log\LoggerInterface; +use Psr\Log\LogLevel; +use ReflectionExtension; + +/** + * Monolog POSIX signal handler + * + * @author Robert Gust-Bardon + */ +class SignalHandler +{ + private $logger; + + private $previousSignalHandler = array(); + private $signalLevelMap = array(); + private $signalRestartSyscalls = array(); + + public function __construct(LoggerInterface $logger) + { + $this->logger = $logger; + } + + public function registerSignalHandler($signo, $level = LogLevel::CRITICAL, $callPrevious = true, $restartSyscalls = true, $async = true) + { + if (!extension_loaded('pcntl') || !function_exists('pcntl_signal')) { + return $this; + } + + if ($callPrevious) { + if (function_exists('pcntl_signal_get_handler')) { + $handler = pcntl_signal_get_handler($signo); + if ($handler === false) { + return $this; + } + $this->previousSignalHandler[$signo] = $handler; + } else { + $this->previousSignalHandler[$signo] = true; + } + } else { + unset($this->previousSignalHandler[$signo]); + } + $this->signalLevelMap[$signo] = $level; + $this->signalRestartSyscalls[$signo] = $restartSyscalls; + + if (function_exists('pcntl_async_signals') && $async !== null) { + pcntl_async_signals($async); + } + + pcntl_signal($signo, array($this, 'handleSignal'), $restartSyscalls); + + return $this; + } + + public function handleSignal($signo, array $siginfo = null) + { + static $signals = array(); + + if (!$signals && extension_loaded('pcntl')) { + $pcntl = new ReflectionExtension('pcntl'); + $constants = $pcntl->getConstants(); + if (!$constants) { + // HHVM 3.24.2 returns an empty array. + $constants = get_defined_constants(true); + $constants = $constants['Core']; + } + foreach ($constants as $name => $value) { + if (substr($name, 0, 3) === 'SIG' && $name[3] !== '_' && is_int($value)) { + $signals[$value] = $name; + } + } + unset($constants); + } + + $level = isset($this->signalLevelMap[$signo]) ? $this->signalLevelMap[$signo] : LogLevel::CRITICAL; + $signal = isset($signals[$signo]) ? $signals[$signo] : $signo; + $context = isset($siginfo) ? $siginfo : array(); + $this->logger->log($level, sprintf('Program received signal %s', $signal), $context); + + if (!isset($this->previousSignalHandler[$signo])) { + return; + } + + if ($this->previousSignalHandler[$signo] === true || $this->previousSignalHandler[$signo] === SIG_DFL) { + if (extension_loaded('pcntl') && function_exists('pcntl_signal') && function_exists('pcntl_sigprocmask') && function_exists('pcntl_signal_dispatch') + && extension_loaded('posix') && function_exists('posix_getpid') && function_exists('posix_kill')) { + $restartSyscalls = isset($this->signalRestartSyscalls[$signo]) ? $this->signalRestartSyscalls[$signo] : true; + pcntl_signal($signo, SIG_DFL, $restartSyscalls); + pcntl_sigprocmask(SIG_UNBLOCK, array($signo), $oldset); + posix_kill(posix_getpid(), $signo); + pcntl_signal_dispatch(); + pcntl_sigprocmask(SIG_SETMASK, $oldset); + pcntl_signal($signo, array($this, 'handleSignal'), $restartSyscalls); + } + } elseif (is_callable($this->previousSignalHandler[$signo])) { + if (PHP_VERSION_ID >= 70100) { + $this->previousSignalHandler[$signo]($signo, $siginfo); + } else { + $this->previousSignalHandler[$signo]($signo); + } + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Utils.php b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Utils.php new file mode 100644 index 0000000..eb9be86 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/monolog/monolog/src/Monolog/Utils.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog; + +class Utils +{ + /** + * @internal + */ + public static function getClass($object) + { + $class = \get_class($object); + + return 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/LICENSE b/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/LICENSE new file mode 100644 index 0000000..e7214eb --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2011-2019 TerraFrost and other contributors + +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. \ No newline at end of file diff --git a/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php b/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php new file mode 100644 index 0000000..7d8cb8b --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php @@ -0,0 +1,126 @@ + + * setKey('abcdefghijklmnop'); + * + * $size = 10 * 1024; + * $plaintext = ''; + * for ($i = 0; $i < $size; $i++) { + * $plaintext.= 'a'; + * } + * + * echo $aes->decrypt($aes->encrypt($plaintext)); + * ?> + * + * + * @category Crypt + * @package AES + * @author Jim Wigginton + * @copyright 2008 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://phpseclib.sourceforge.net + */ + +namespace phpseclib\Crypt; + +/** + * Pure-PHP implementation of AES. + * + * @package AES + * @author Jim Wigginton + * @access public + */ +class AES extends Rijndael +{ + /** + * Dummy function + * + * Since \phpseclib\Crypt\AES extends \phpseclib\Crypt\Rijndael, this function is, technically, available, but it doesn't do anything. + * + * @see \phpseclib\Crypt\Rijndael::setBlockLength() + * @access public + * @param int $length + */ + function setBlockLength($length) + { + return; + } + + /** + * Sets the key length + * + * Valid key lengths are 128, 192, and 256. If the length is less than 128, it will be rounded up to + * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount. + * + * @see \phpseclib\Crypt\Rijndael:setKeyLength() + * @access public + * @param int $length + */ + function setKeyLength($length) + { + switch ($length) { + case 160: + $length = 192; + break; + case 224: + $length = 256; + } + parent::setKeyLength($length); + } + + /** + * Sets the key. + * + * Rijndael supports five different key lengths, AES only supports three. + * + * @see \phpseclib\Crypt\Rijndael:setKey() + * @see setKeyLength() + * @access public + * @param string $key + */ + function setKey($key) + { + parent::setKey($key); + + if (!$this->explicit_key_length) { + $length = strlen($key); + switch (true) { + case $length <= 16: + $this->key_length = 16; + break; + case $length <= 24: + $this->key_length = 24; + break; + default: + $this->key_length = 32; + } + $this->_setEngine(); + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php b/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php new file mode 100644 index 0000000..d2c6c7c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php @@ -0,0 +1,3201 @@ + + * createKey()); + * + * $plaintext = 'terrafrost'; + * + * $rsa->loadKey($privatekey); + * $ciphertext = $rsa->encrypt($plaintext); + * + * $rsa->loadKey($publickey); + * echo $rsa->decrypt($ciphertext); + * ?> + * + * + * Here's an example of how to create signatures and verify signatures with this library: + * + * createKey()); + * + * $plaintext = 'terrafrost'; + * + * $rsa->loadKey($privatekey); + * $signature = $rsa->sign($plaintext); + * + * $rsa->loadKey($publickey); + * echo $rsa->verify($plaintext, $signature) ? 'verified' : 'unverified'; + * ?> + * + * + * @category Crypt + * @package RSA + * @author Jim Wigginton + * @copyright 2009 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://phpseclib.sourceforge.net + */ + +namespace phpseclib\Crypt; + +use phpseclib\Math\BigInteger; + +/** + * Pure-PHP PKCS#1 compliant implementation of RSA. + * + * @package RSA + * @author Jim Wigginton + * @access public + */ +class RSA +{ + /**#@+ + * @access public + * @see self::encrypt() + * @see self::decrypt() + */ + /** + * Use {@link http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding Optimal Asymmetric Encryption Padding} + * (OAEP) for encryption / decryption. + * + * Uses sha1 by default. + * + * @see self::setHash() + * @see self::setMGFHash() + */ + const ENCRYPTION_OAEP = 1; + /** + * Use PKCS#1 padding. + * + * Although self::ENCRYPTION_OAEP offers more security, including PKCS#1 padding is necessary for purposes of backwards + * compatibility with protocols (like SSH-1) written before OAEP's introduction. + */ + const ENCRYPTION_PKCS1 = 2; + /** + * Do not use any padding + * + * Although this method is not recommended it can none-the-less sometimes be useful if you're trying to decrypt some legacy + * stuff, if you're trying to diagnose why an encrypted message isn't decrypting, etc. + */ + const ENCRYPTION_NONE = 3; + /**#@-*/ + + /**#@+ + * @access public + * @see self::sign() + * @see self::verify() + * @see self::setHash() + */ + /** + * Use the Probabilistic Signature Scheme for signing + * + * Uses sha1 by default. + * + * @see self::setSaltLength() + * @see self::setMGFHash() + */ + const SIGNATURE_PSS = 1; + /** + * Use the PKCS#1 scheme by default. + * + * Although self::SIGNATURE_PSS offers more security, including PKCS#1 signing is necessary for purposes of backwards + * compatibility with protocols (like SSH-2) written before PSS's introduction. + */ + const SIGNATURE_PKCS1 = 2; + /**#@-*/ + + /**#@+ + * @access private + * @see \phpseclib\Crypt\RSA::createKey() + */ + /** + * ASN1 Integer + */ + const ASN1_INTEGER = 2; + /** + * ASN1 Bit String + */ + const ASN1_BITSTRING = 3; + /** + * ASN1 Octet String + */ + const ASN1_OCTETSTRING = 4; + /** + * ASN1 Object Identifier + */ + const ASN1_OBJECT = 6; + /** + * ASN1 Sequence (with the constucted bit set) + */ + const ASN1_SEQUENCE = 48; + /**#@-*/ + + /**#@+ + * @access private + * @see \phpseclib\Crypt\RSA::__construct() + */ + /** + * To use the pure-PHP implementation + */ + const MODE_INTERNAL = 1; + /** + * To use the OpenSSL library + * + * (if enabled; otherwise, the internal implementation will be used) + */ + const MODE_OPENSSL = 2; + /**#@-*/ + + /**#@+ + * @access public + * @see \phpseclib\Crypt\RSA::createKey() + * @see \phpseclib\Crypt\RSA::setPrivateKeyFormat() + */ + /** + * PKCS#1 formatted private key + * + * Used by OpenSSH + */ + const PRIVATE_FORMAT_PKCS1 = 0; + /** + * PuTTY formatted private key + */ + const PRIVATE_FORMAT_PUTTY = 1; + /** + * XML formatted private key + */ + const PRIVATE_FORMAT_XML = 2; + /** + * PKCS#8 formatted private key + */ + const PRIVATE_FORMAT_PKCS8 = 8; + /** + * OpenSSH formatted private key + */ + const PRIVATE_FORMAT_OPENSSH = 9; + /**#@-*/ + + /**#@+ + * @access public + * @see \phpseclib\Crypt\RSA::createKey() + * @see \phpseclib\Crypt\RSA::setPublicKeyFormat() + */ + /** + * Raw public key + * + * An array containing two \phpseclib\Math\BigInteger objects. + * + * The exponent can be indexed with any of the following: + * + * 0, e, exponent, publicExponent + * + * The modulus can be indexed with any of the following: + * + * 1, n, modulo, modulus + */ + const PUBLIC_FORMAT_RAW = 3; + /** + * PKCS#1 formatted public key (raw) + * + * Used by File/X509.php + * + * Has the following header: + * + * -----BEGIN RSA PUBLIC KEY----- + * + * Analogous to ssh-keygen's pem format (as specified by -m) + */ + const PUBLIC_FORMAT_PKCS1 = 4; + const PUBLIC_FORMAT_PKCS1_RAW = 4; + /** + * XML formatted public key + */ + const PUBLIC_FORMAT_XML = 5; + /** + * OpenSSH formatted public key + * + * Place in $HOME/.ssh/authorized_keys + */ + const PUBLIC_FORMAT_OPENSSH = 6; + /** + * PKCS#1 formatted public key (encapsulated) + * + * Used by PHP's openssl_public_encrypt() and openssl's rsautl (when -pubin is set) + * + * Has the following header: + * + * -----BEGIN PUBLIC KEY----- + * + * Analogous to ssh-keygen's pkcs8 format (as specified by -m). Although PKCS8 + * is specific to private keys it's basically creating a DER-encoded wrapper + * for keys. This just extends that same concept to public keys (much like ssh-keygen) + */ + const PUBLIC_FORMAT_PKCS8 = 7; + /**#@-*/ + + /** + * Precomputed Zero + * + * @var \phpseclib\Math\BigInteger + * @access private + */ + var $zero; + + /** + * Precomputed One + * + * @var \phpseclib\Math\BigInteger + * @access private + */ + var $one; + + /** + * Private Key Format + * + * @var int + * @access private + */ + var $privateKeyFormat = self::PRIVATE_FORMAT_PKCS1; + + /** + * Public Key Format + * + * @var int + * @access public + */ + var $publicKeyFormat = self::PUBLIC_FORMAT_PKCS8; + + /** + * Modulus (ie. n) + * + * @var \phpseclib\Math\BigInteger + * @access private + */ + var $modulus; + + /** + * Modulus length + * + * @var \phpseclib\Math\BigInteger + * @access private + */ + var $k; + + /** + * Exponent (ie. e or d) + * + * @var \phpseclib\Math\BigInteger + * @access private + */ + var $exponent; + + /** + * Primes for Chinese Remainder Theorem (ie. p and q) + * + * @var array + * @access private + */ + var $primes; + + /** + * Exponents for Chinese Remainder Theorem (ie. dP and dQ) + * + * @var array + * @access private + */ + var $exponents; + + /** + * Coefficients for Chinese Remainder Theorem (ie. qInv) + * + * @var array + * @access private + */ + var $coefficients; + + /** + * Hash name + * + * @var string + * @access private + */ + var $hashName; + + /** + * Hash function + * + * @var \phpseclib\Crypt\Hash + * @access private + */ + var $hash; + + /** + * Length of hash function output + * + * @var int + * @access private + */ + var $hLen; + + /** + * Length of salt + * + * @var int + * @access private + */ + var $sLen; + + /** + * Hash function for the Mask Generation Function + * + * @var \phpseclib\Crypt\Hash + * @access private + */ + var $mgfHash; + + /** + * Length of MGF hash function output + * + * @var int + * @access private + */ + var $mgfHLen; + + /** + * Encryption mode + * + * @var int + * @access private + */ + var $encryptionMode = self::ENCRYPTION_OAEP; + + /** + * Signature mode + * + * @var int + * @access private + */ + var $signatureMode = self::SIGNATURE_PSS; + + /** + * Public Exponent + * + * @var mixed + * @access private + */ + var $publicExponent = false; + + /** + * Password + * + * @var string + * @access private + */ + var $password = false; + + /** + * Components + * + * For use with parsing XML formatted keys. PHP's XML Parser functions use utilized - instead of PHP's DOM functions - + * because PHP's XML Parser functions work on PHP4 whereas PHP's DOM functions - although surperior - don't. + * + * @see self::_start_element_handler() + * @var array + * @access private + */ + var $components = array(); + + /** + * Current String + * + * For use with parsing XML formatted keys. + * + * @see self::_character_handler() + * @see self::_stop_element_handler() + * @var mixed + * @access private + */ + var $current; + + /** + * OpenSSL configuration file name. + * + * Set to null to use system configuration file. + * @see self::createKey() + * @var mixed + * @Access public + */ + var $configFile; + + /** + * Public key comment field. + * + * @var string + * @access private + */ + var $comment = 'phpseclib-generated-key'; + + /** + * The constructor + * + * If you want to make use of the openssl extension, you'll need to set the mode manually, yourself. The reason + * \phpseclib\Crypt\RSA doesn't do it is because OpenSSL doesn't fail gracefully. openssl_pkey_new(), in particular, requires + * openssl.cnf be present somewhere and, unfortunately, the only real way to find out is too late. + * + * @return \phpseclib\Crypt\RSA + * @access public + */ + function __construct() + { + $this->configFile = dirname(__FILE__) . '/../openssl.cnf'; + + if (!defined('CRYPT_RSA_MODE')) { + switch (true) { + // Math/BigInteger's openssl requirements are a little less stringent than Crypt/RSA's. in particular, + // Math/BigInteger doesn't require an openssl.cfg file whereas Crypt/RSA does. so if Math/BigInteger + // can't use OpenSSL it can be pretty trivially assumed, then, that Crypt/RSA can't either. + case defined('MATH_BIGINTEGER_OPENSSL_DISABLE'): + define('CRYPT_RSA_MODE', self::MODE_INTERNAL); + break; + case extension_loaded('openssl') && file_exists($this->configFile): + // some versions of XAMPP have mismatched versions of OpenSSL which causes it not to work + $versions = array(); + + // avoid generating errors (even with suppression) when phpinfo() is disabled (common in production systems) + if (strpos(ini_get('disable_functions'), 'phpinfo') === false) { + ob_start(); + @phpinfo(); + $content = ob_get_contents(); + ob_end_clean(); + + preg_match_all('#OpenSSL (Header|Library) Version(.*)#im', $content, $matches); + + if (!empty($matches[1])) { + for ($i = 0; $i < count($matches[1]); $i++) { + $fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i]))); + + // Remove letter part in OpenSSL version + if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) { + $versions[$matches[1][$i]] = $fullVersion; + } else { + $versions[$matches[1][$i]] = $m[0]; + } + } + } + } + + // it doesn't appear that OpenSSL versions were reported upon until PHP 5.3+ + switch (true) { + case !isset($versions['Header']): + case !isset($versions['Library']): + case $versions['Header'] == $versions['Library']: + case version_compare($versions['Header'], '1.0.0') >= 0 && version_compare($versions['Library'], '1.0.0') >= 0: + define('CRYPT_RSA_MODE', self::MODE_OPENSSL); + break; + default: + define('CRYPT_RSA_MODE', self::MODE_INTERNAL); + define('MATH_BIGINTEGER_OPENSSL_DISABLE', true); + } + break; + default: + define('CRYPT_RSA_MODE', self::MODE_INTERNAL); + } + } + + $this->zero = new BigInteger(); + $this->one = new BigInteger(1); + + $this->hash = new Hash('sha1'); + $this->hLen = $this->hash->getLength(); + $this->hashName = 'sha1'; + $this->mgfHash = new Hash('sha1'); + $this->mgfHLen = $this->mgfHash->getLength(); + } + + /** + * Create public / private key pair + * + * Returns an array with the following three elements: + * - 'privatekey': The private key. + * - 'publickey': The public key. + * - 'partialkey': A partially computed key (if the execution time exceeded $timeout). + * Will need to be passed back to \phpseclib\Crypt\RSA::createKey() as the third parameter for further processing. + * + * @access public + * @param int $bits + * @param int $timeout + * @param array $p + */ + function createKey($bits = 1024, $timeout = false, $partial = array()) + { + if (!defined('CRYPT_RSA_EXPONENT')) { + // http://en.wikipedia.org/wiki/65537_%28number%29 + define('CRYPT_RSA_EXPONENT', '65537'); + } + // per , this number ought not result in primes smaller + // than 256 bits. as a consequence if the key you're trying to create is 1024 bits and you've set CRYPT_RSA_SMALLEST_PRIME + // to 384 bits then you're going to get a 384 bit prime and a 640 bit prime (384 + 1024 % 384). at least if + // CRYPT_RSA_MODE is set to self::MODE_INTERNAL. if CRYPT_RSA_MODE is set to self::MODE_OPENSSL then + // CRYPT_RSA_SMALLEST_PRIME is ignored (ie. multi-prime RSA support is more intended as a way to speed up RSA key + // generation when there's a chance neither gmp nor OpenSSL are installed) + if (!defined('CRYPT_RSA_SMALLEST_PRIME')) { + define('CRYPT_RSA_SMALLEST_PRIME', 4096); + } + + // OpenSSL uses 65537 as the exponent and requires RSA keys be 384 bits minimum + if (CRYPT_RSA_MODE == self::MODE_OPENSSL && $bits >= 384 && CRYPT_RSA_EXPONENT == 65537) { + $config = array(); + if (isset($this->configFile)) { + $config['config'] = $this->configFile; + } + $rsa = openssl_pkey_new(array('private_key_bits' => $bits) + $config); + openssl_pkey_export($rsa, $privatekey, null, $config); + $publickey = openssl_pkey_get_details($rsa); + $publickey = $publickey['key']; + + $privatekey = call_user_func_array(array($this, '_convertPrivateKey'), array_values($this->_parseKey($privatekey, self::PRIVATE_FORMAT_PKCS1))); + $publickey = call_user_func_array(array($this, '_convertPublicKey'), array_values($this->_parseKey($publickey, self::PUBLIC_FORMAT_PKCS1))); + + // clear the buffer of error strings stemming from a minimalistic openssl.cnf + while (openssl_error_string() !== false) { + } + + return array( + 'privatekey' => $privatekey, + 'publickey' => $publickey, + 'partialkey' => false + ); + } + + static $e; + if (!isset($e)) { + $e = new BigInteger(CRYPT_RSA_EXPONENT); + } + + extract($this->_generateMinMax($bits)); + $absoluteMin = $min; + $temp = $bits >> 1; // divide by two to see how many bits P and Q would be + if ($temp > CRYPT_RSA_SMALLEST_PRIME) { + $num_primes = floor($bits / CRYPT_RSA_SMALLEST_PRIME); + $temp = CRYPT_RSA_SMALLEST_PRIME; + } else { + $num_primes = 2; + } + extract($this->_generateMinMax($temp + $bits % $temp)); + $finalMax = $max; + extract($this->_generateMinMax($temp)); + + $generator = new BigInteger(); + + $n = $this->one->copy(); + if (!empty($partial)) { + extract(unserialize($partial)); + } else { + $exponents = $coefficients = $primes = array(); + $lcm = array( + 'top' => $this->one->copy(), + 'bottom' => false + ); + } + + $start = time(); + $i0 = count($primes) + 1; + + do { + for ($i = $i0; $i <= $num_primes; $i++) { + if ($timeout !== false) { + $timeout-= time() - $start; + $start = time(); + if ($timeout <= 0) { + return array( + 'privatekey' => '', + 'publickey' => '', + 'partialkey' => serialize(array( + 'primes' => $primes, + 'coefficients' => $coefficients, + 'lcm' => $lcm, + 'exponents' => $exponents + )) + ); + } + } + + if ($i == $num_primes) { + list($min, $temp) = $absoluteMin->divide($n); + if (!$temp->equals($this->zero)) { + $min = $min->add($this->one); // ie. ceil() + } + $primes[$i] = $generator->randomPrime($min, $finalMax, $timeout); + } else { + $primes[$i] = $generator->randomPrime($min, $max, $timeout); + } + + if ($primes[$i] === false) { // if we've reached the timeout + if (count($primes) > 1) { + $partialkey = ''; + } else { + array_pop($primes); + $partialkey = serialize(array( + 'primes' => $primes, + 'coefficients' => $coefficients, + 'lcm' => $lcm, + 'exponents' => $exponents + )); + } + + return array( + 'privatekey' => '', + 'publickey' => '', + 'partialkey' => $partialkey + ); + } + + // the first coefficient is calculated differently from the rest + // ie. instead of being $primes[1]->modInverse($primes[2]), it's $primes[2]->modInverse($primes[1]) + if ($i > 2) { + $coefficients[$i] = $n->modInverse($primes[$i]); + } + + $n = $n->multiply($primes[$i]); + + $temp = $primes[$i]->subtract($this->one); + + // textbook RSA implementations use Euler's totient function instead of the least common multiple. + // see http://en.wikipedia.org/wiki/Euler%27s_totient_function + $lcm['top'] = $lcm['top']->multiply($temp); + $lcm['bottom'] = $lcm['bottom'] === false ? $temp : $lcm['bottom']->gcd($temp); + + $exponents[$i] = $e->modInverse($temp); + } + + list($temp) = $lcm['top']->divide($lcm['bottom']); + $gcd = $temp->gcd($e); + $i0 = 1; + } while (!$gcd->equals($this->one)); + + $d = $e->modInverse($temp); + + $coefficients[2] = $primes[2]->modInverse($primes[1]); + + // from : + // RSAPrivateKey ::= SEQUENCE { + // version Version, + // modulus INTEGER, -- n + // publicExponent INTEGER, -- e + // privateExponent INTEGER, -- d + // prime1 INTEGER, -- p + // prime2 INTEGER, -- q + // exponent1 INTEGER, -- d mod (p-1) + // exponent2 INTEGER, -- d mod (q-1) + // coefficient INTEGER, -- (inverse of q) mod p + // otherPrimeInfos OtherPrimeInfos OPTIONAL + // } + + return array( + 'privatekey' => $this->_convertPrivateKey($n, $e, $d, $primes, $exponents, $coefficients), + 'publickey' => $this->_convertPublicKey($n, $e), + 'partialkey' => false + ); + } + + /** + * Convert a private key to the appropriate format. + * + * @access private + * @see self::setPrivateKeyFormat() + * @param string $RSAPrivateKey + * @return string + */ + function _convertPrivateKey($n, $e, $d, $primes, $exponents, $coefficients) + { + $signed = $this->privateKeyFormat != self::PRIVATE_FORMAT_XML; + $num_primes = count($primes); + $raw = array( + 'version' => $num_primes == 2 ? chr(0) : chr(1), // two-prime vs. multi + 'modulus' => $n->toBytes($signed), + 'publicExponent' => $e->toBytes($signed), + 'privateExponent' => $d->toBytes($signed), + 'prime1' => $primes[1]->toBytes($signed), + 'prime2' => $primes[2]->toBytes($signed), + 'exponent1' => $exponents[1]->toBytes($signed), + 'exponent2' => $exponents[2]->toBytes($signed), + 'coefficient' => $coefficients[2]->toBytes($signed) + ); + + // if the format in question does not support multi-prime rsa and multi-prime rsa was used, + // call _convertPublicKey() instead. + switch ($this->privateKeyFormat) { + case self::PRIVATE_FORMAT_XML: + if ($num_primes != 2) { + return false; + } + return "\r\n" . + ' ' . base64_encode($raw['modulus']) . "\r\n" . + ' ' . base64_encode($raw['publicExponent']) . "\r\n" . + '

        ' . base64_encode($raw['prime1']) . "

        \r\n" . + ' ' . base64_encode($raw['prime2']) . "\r\n" . + ' ' . base64_encode($raw['exponent1']) . "\r\n" . + ' ' . base64_encode($raw['exponent2']) . "\r\n" . + ' ' . base64_encode($raw['coefficient']) . "\r\n" . + ' ' . base64_encode($raw['privateExponent']) . "\r\n" . + '
        '; + break; + case self::PRIVATE_FORMAT_PUTTY: + if ($num_primes != 2) { + return false; + } + $key = "PuTTY-User-Key-File-2: ssh-rsa\r\nEncryption: "; + $encryption = (!empty($this->password) || is_string($this->password)) ? 'aes256-cbc' : 'none'; + $key.= $encryption; + $key.= "\r\nComment: " . $this->comment . "\r\n"; + $public = pack( + 'Na*Na*Na*', + strlen('ssh-rsa'), + 'ssh-rsa', + strlen($raw['publicExponent']), + $raw['publicExponent'], + strlen($raw['modulus']), + $raw['modulus'] + ); + $source = pack( + 'Na*Na*Na*Na*', + strlen('ssh-rsa'), + 'ssh-rsa', + strlen($encryption), + $encryption, + strlen($this->comment), + $this->comment, + strlen($public), + $public + ); + $public = base64_encode($public); + $key.= "Public-Lines: " . ((strlen($public) + 63) >> 6) . "\r\n"; + $key.= chunk_split($public, 64); + $private = pack( + 'Na*Na*Na*Na*', + strlen($raw['privateExponent']), + $raw['privateExponent'], + strlen($raw['prime1']), + $raw['prime1'], + strlen($raw['prime2']), + $raw['prime2'], + strlen($raw['coefficient']), + $raw['coefficient'] + ); + if (empty($this->password) && !is_string($this->password)) { + $source.= pack('Na*', strlen($private), $private); + $hashkey = 'putty-private-key-file-mac-key'; + } else { + $private.= Random::string(16 - (strlen($private) & 15)); + $source.= pack('Na*', strlen($private), $private); + $sequence = 0; + $symkey = ''; + while (strlen($symkey) < 32) { + $temp = pack('Na*', $sequence++, $this->password); + $symkey.= pack('H*', sha1($temp)); + } + $symkey = substr($symkey, 0, 32); + $crypto = new AES(); + + $crypto->setKey($symkey); + $crypto->disablePadding(); + $private = $crypto->encrypt($private); + $hashkey = 'putty-private-key-file-mac-key' . $this->password; + } + + $private = base64_encode($private); + $key.= 'Private-Lines: ' . ((strlen($private) + 63) >> 6) . "\r\n"; + $key.= chunk_split($private, 64); + $hash = new Hash('sha1'); + $hash->setKey(pack('H*', sha1($hashkey))); + $key.= 'Private-MAC: ' . bin2hex($hash->hash($source)) . "\r\n"; + + return $key; + case self::PRIVATE_FORMAT_OPENSSH: + if ($num_primes != 2) { + return false; + } + $publicKey = pack('Na*Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($raw['publicExponent']), $raw['publicExponent'], strlen($raw['modulus']), $raw['modulus']); + $privateKey = pack( + 'Na*Na*Na*Na*Na*Na*Na*', + strlen('ssh-rsa'), + 'ssh-rsa', + strlen($raw['modulus']), + $raw['modulus'], + strlen($raw['publicExponent']), + $raw['publicExponent'], + strlen($raw['privateExponent']), + $raw['privateExponent'], + strlen($raw['coefficient']), + $raw['coefficient'], + strlen($raw['prime1']), + $raw['prime1'], + strlen($raw['prime2']), + $raw['prime2'] + ); + $checkint = Random::string(4); + $paddedKey = pack( + 'a*Na*', + $checkint . $checkint . $privateKey, + strlen($this->comment), + $this->comment + ); + $paddingLength = (7 * strlen($paddedKey)) % 8; + for ($i = 1; $i <= $paddingLength; $i++) { + $paddedKey.= chr($i); + } + $key = pack( + 'Na*Na*Na*NNa*Na*', + strlen('none'), + 'none', + strlen('none'), + 'none', + 0, + '', + 1, + strlen($publicKey), + $publicKey, + strlen($paddedKey), + $paddedKey + ); + $key = "openssh-key-v1\0$key"; + + return "-----BEGIN OPENSSH PRIVATE KEY-----\r\n" . + chunk_split(base64_encode($key), 70) . + "-----END OPENSSH PRIVATE KEY-----"; + default: // eg. self::PRIVATE_FORMAT_PKCS1 + $components = array(); + foreach ($raw as $name => $value) { + $components[$name] = pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($value)), $value); + } + + $RSAPrivateKey = implode('', $components); + + if ($num_primes > 2) { + $OtherPrimeInfos = ''; + for ($i = 3; $i <= $num_primes; $i++) { + // OtherPrimeInfos ::= SEQUENCE SIZE(1..MAX) OF OtherPrimeInfo + // + // OtherPrimeInfo ::= SEQUENCE { + // prime INTEGER, -- ri + // exponent INTEGER, -- di + // coefficient INTEGER -- ti + // } + $OtherPrimeInfo = pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($primes[$i]->toBytes(true))), $primes[$i]->toBytes(true)); + $OtherPrimeInfo.= pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($exponents[$i]->toBytes(true))), $exponents[$i]->toBytes(true)); + $OtherPrimeInfo.= pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($coefficients[$i]->toBytes(true))), $coefficients[$i]->toBytes(true)); + $OtherPrimeInfos.= pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($OtherPrimeInfo)), $OtherPrimeInfo); + } + $RSAPrivateKey.= pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($OtherPrimeInfos)), $OtherPrimeInfos); + } + + $RSAPrivateKey = pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($RSAPrivateKey)), $RSAPrivateKey); + + if ($this->privateKeyFormat == self::PRIVATE_FORMAT_PKCS8) { + $rsaOID = pack('H*', '300d06092a864886f70d0101010500'); // hex version of MA0GCSqGSIb3DQEBAQUA + $RSAPrivateKey = pack( + 'Ca*a*Ca*a*', + self::ASN1_INTEGER, + "\01\00", + $rsaOID, + 4, + $this->_encodeLength(strlen($RSAPrivateKey)), + $RSAPrivateKey + ); + $RSAPrivateKey = pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($RSAPrivateKey)), $RSAPrivateKey); + if (!empty($this->password) || is_string($this->password)) { + $salt = Random::string(8); + $iterationCount = 2048; + + $crypto = new DES(); + $crypto->setPassword($this->password, 'pbkdf1', 'md5', $salt, $iterationCount); + $RSAPrivateKey = $crypto->encrypt($RSAPrivateKey); + + $parameters = pack( + 'Ca*a*Ca*N', + self::ASN1_OCTETSTRING, + $this->_encodeLength(strlen($salt)), + $salt, + self::ASN1_INTEGER, + $this->_encodeLength(4), + $iterationCount + ); + $pbeWithMD5AndDES_CBC = "\x2a\x86\x48\x86\xf7\x0d\x01\x05\x03"; + + $encryptionAlgorithm = pack( + 'Ca*a*Ca*a*', + self::ASN1_OBJECT, + $this->_encodeLength(strlen($pbeWithMD5AndDES_CBC)), + $pbeWithMD5AndDES_CBC, + self::ASN1_SEQUENCE, + $this->_encodeLength(strlen($parameters)), + $parameters + ); + + $RSAPrivateKey = pack( + 'Ca*a*Ca*a*', + self::ASN1_SEQUENCE, + $this->_encodeLength(strlen($encryptionAlgorithm)), + $encryptionAlgorithm, + self::ASN1_OCTETSTRING, + $this->_encodeLength(strlen($RSAPrivateKey)), + $RSAPrivateKey + ); + + $RSAPrivateKey = pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($RSAPrivateKey)), $RSAPrivateKey); + + $RSAPrivateKey = "-----BEGIN ENCRYPTED PRIVATE KEY-----\r\n" . + chunk_split(base64_encode($RSAPrivateKey), 64) . + '-----END ENCRYPTED PRIVATE KEY-----'; + } else { + $RSAPrivateKey = "-----BEGIN PRIVATE KEY-----\r\n" . + chunk_split(base64_encode($RSAPrivateKey), 64) . + '-----END PRIVATE KEY-----'; + } + return $RSAPrivateKey; + } + + if (!empty($this->password) || is_string($this->password)) { + $iv = Random::string(8); + $symkey = pack('H*', md5($this->password . $iv)); // symkey is short for symmetric key + $symkey.= substr(pack('H*', md5($symkey . $this->password . $iv)), 0, 8); + $des = new TripleDES(); + $des->setKey($symkey); + $des->setIV($iv); + $iv = strtoupper(bin2hex($iv)); + $RSAPrivateKey = "-----BEGIN RSA PRIVATE KEY-----\r\n" . + "Proc-Type: 4,ENCRYPTED\r\n" . + "DEK-Info: DES-EDE3-CBC,$iv\r\n" . + "\r\n" . + chunk_split(base64_encode($des->encrypt($RSAPrivateKey)), 64) . + '-----END RSA PRIVATE KEY-----'; + } else { + $RSAPrivateKey = "-----BEGIN RSA PRIVATE KEY-----\r\n" . + chunk_split(base64_encode($RSAPrivateKey), 64) . + '-----END RSA PRIVATE KEY-----'; + } + + return $RSAPrivateKey; + } + } + + /** + * Convert a public key to the appropriate format + * + * @access private + * @see self::setPublicKeyFormat() + * @param string $RSAPrivateKey + * @return string + */ + function _convertPublicKey($n, $e) + { + $signed = $this->publicKeyFormat != self::PUBLIC_FORMAT_XML; + + $modulus = $n->toBytes($signed); + $publicExponent = $e->toBytes($signed); + + switch ($this->publicKeyFormat) { + case self::PUBLIC_FORMAT_RAW: + return array('e' => $e->copy(), 'n' => $n->copy()); + case self::PUBLIC_FORMAT_XML: + return "\r\n" . + ' ' . base64_encode($modulus) . "\r\n" . + ' ' . base64_encode($publicExponent) . "\r\n" . + ''; + break; + case self::PUBLIC_FORMAT_OPENSSH: + // from : + // string "ssh-rsa" + // mpint e + // mpint n + $RSAPublicKey = pack('Na*Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($publicExponent), $publicExponent, strlen($modulus), $modulus); + $RSAPublicKey = 'ssh-rsa ' . base64_encode($RSAPublicKey) . ' ' . $this->comment; + + return $RSAPublicKey; + default: // eg. self::PUBLIC_FORMAT_PKCS1_RAW or self::PUBLIC_FORMAT_PKCS1 + // from : + // RSAPublicKey ::= SEQUENCE { + // modulus INTEGER, -- n + // publicExponent INTEGER -- e + // } + $components = array( + 'modulus' => pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($modulus)), $modulus), + 'publicExponent' => pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($publicExponent)), $publicExponent) + ); + + $RSAPublicKey = pack( + 'Ca*a*a*', + self::ASN1_SEQUENCE, + $this->_encodeLength(strlen($components['modulus']) + strlen($components['publicExponent'])), + $components['modulus'], + $components['publicExponent'] + ); + + if ($this->publicKeyFormat == self::PUBLIC_FORMAT_PKCS1_RAW) { + $RSAPublicKey = "-----BEGIN RSA PUBLIC KEY-----\r\n" . + chunk_split(base64_encode($RSAPublicKey), 64) . + '-----END RSA PUBLIC KEY-----'; + } else { + // sequence(oid(1.2.840.113549.1.1.1), null)) = rsaEncryption. + $rsaOID = pack('H*', '300d06092a864886f70d0101010500'); // hex version of MA0GCSqGSIb3DQEBAQUA + $RSAPublicKey = chr(0) . $RSAPublicKey; + $RSAPublicKey = chr(3) . $this->_encodeLength(strlen($RSAPublicKey)) . $RSAPublicKey; + + $RSAPublicKey = pack( + 'Ca*a*', + self::ASN1_SEQUENCE, + $this->_encodeLength(strlen($rsaOID . $RSAPublicKey)), + $rsaOID . $RSAPublicKey + ); + + $RSAPublicKey = "-----BEGIN PUBLIC KEY-----\r\n" . + chunk_split(base64_encode($RSAPublicKey), 64) . + '-----END PUBLIC KEY-----'; + } + + return $RSAPublicKey; + } + } + + /** + * Break a public or private key down into its constituant components + * + * @access private + * @see self::_convertPublicKey() + * @see self::_convertPrivateKey() + * @param string|array $key + * @param int $type + * @return array|bool + */ + function _parseKey($key, $type) + { + if ($type != self::PUBLIC_FORMAT_RAW && !is_string($key)) { + return false; + } + + switch ($type) { + case self::PUBLIC_FORMAT_RAW: + if (!is_array($key)) { + return false; + } + $components = array(); + switch (true) { + case isset($key['e']): + $components['publicExponent'] = $key['e']->copy(); + break; + case isset($key['exponent']): + $components['publicExponent'] = $key['exponent']->copy(); + break; + case isset($key['publicExponent']): + $components['publicExponent'] = $key['publicExponent']->copy(); + break; + case isset($key[0]): + $components['publicExponent'] = $key[0]->copy(); + } + switch (true) { + case isset($key['n']): + $components['modulus'] = $key['n']->copy(); + break; + case isset($key['modulo']): + $components['modulus'] = $key['modulo']->copy(); + break; + case isset($key['modulus']): + $components['modulus'] = $key['modulus']->copy(); + break; + case isset($key[1]): + $components['modulus'] = $key[1]->copy(); + } + return isset($components['modulus']) && isset($components['publicExponent']) ? $components : false; + case self::PRIVATE_FORMAT_PKCS1: + case self::PRIVATE_FORMAT_PKCS8: + case self::PUBLIC_FORMAT_PKCS1: + /* Although PKCS#1 proposes a format that public and private keys can use, encrypting them is + "outside the scope" of PKCS#1. PKCS#1 then refers you to PKCS#12 and PKCS#15 if you're wanting to + protect private keys, however, that's not what OpenSSL* does. OpenSSL protects private keys by adding + two new "fields" to the key - DEK-Info and Proc-Type. These fields are discussed here: + + http://tools.ietf.org/html/rfc1421#section-4.6.1.1 + http://tools.ietf.org/html/rfc1421#section-4.6.1.3 + + DES-EDE3-CBC as an algorithm, however, is not discussed anywhere, near as I can tell. + DES-CBC and DES-EDE are discussed in RFC1423, however, DES-EDE3-CBC isn't, nor is its key derivation + function. As is, the definitive authority on this encoding scheme isn't the IETF but rather OpenSSL's + own implementation. ie. the implementation *is* the standard and any bugs that may exist in that + implementation are part of the standard, as well. + + * OpenSSL is the de facto standard. It's utilized by OpenSSH and other projects */ + if (preg_match('#DEK-Info: (.+),(.+)#', $key, $matches)) { + $iv = pack('H*', trim($matches[2])); + $symkey = pack('H*', md5($this->password . substr($iv, 0, 8))); // symkey is short for symmetric key + $symkey.= pack('H*', md5($symkey . $this->password . substr($iv, 0, 8))); + // remove the Proc-Type / DEK-Info sections as they're no longer needed + $key = preg_replace('#^(?:Proc-Type|DEK-Info): .*#m', '', $key); + $ciphertext = $this->_extractBER($key); + if ($ciphertext === false) { + $ciphertext = $key; + } + switch ($matches[1]) { + case 'AES-256-CBC': + $crypto = new AES(); + break; + case 'AES-128-CBC': + $symkey = substr($symkey, 0, 16); + $crypto = new AES(); + break; + case 'DES-EDE3-CFB': + $crypto = new TripleDES(Base::MODE_CFB); + break; + case 'DES-EDE3-CBC': + $symkey = substr($symkey, 0, 24); + $crypto = new TripleDES(); + break; + case 'DES-CBC': + $crypto = new DES(); + break; + default: + return false; + } + $crypto->setKey($symkey); + $crypto->setIV($iv); + $decoded = $crypto->decrypt($ciphertext); + } else { + $decoded = $this->_extractBER($key); + } + + if ($decoded !== false) { + $key = $decoded; + } + + $components = array(); + + if (ord($this->_string_shift($key)) != self::ASN1_SEQUENCE) { + return false; + } + if ($this->_decodeLength($key) != strlen($key)) { + return false; + } + + $tag = ord($this->_string_shift($key)); + /* intended for keys for which OpenSSL's asn1parse returns the following: + + 0:d=0 hl=4 l= 631 cons: SEQUENCE + 4:d=1 hl=2 l= 1 prim: INTEGER :00 + 7:d=1 hl=2 l= 13 cons: SEQUENCE + 9:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption + 20:d=2 hl=2 l= 0 prim: NULL + 22:d=1 hl=4 l= 609 prim: OCTET STRING + + ie. PKCS8 keys*/ + + if ($tag == self::ASN1_INTEGER && substr($key, 0, 3) == "\x01\x00\x30") { + $this->_string_shift($key, 3); + $tag = self::ASN1_SEQUENCE; + } + + if ($tag == self::ASN1_SEQUENCE) { + $temp = $this->_string_shift($key, $this->_decodeLength($key)); + if (ord($this->_string_shift($temp)) != self::ASN1_OBJECT) { + return false; + } + $length = $this->_decodeLength($temp); + switch ($this->_string_shift($temp, $length)) { + case "\x2a\x86\x48\x86\xf7\x0d\x01\x01\x01": // rsaEncryption + break; + case "\x2a\x86\x48\x86\xf7\x0d\x01\x05\x03": // pbeWithMD5AndDES-CBC + /* + PBEParameter ::= SEQUENCE { + salt OCTET STRING (SIZE(8)), + iterationCount INTEGER } + */ + if (ord($this->_string_shift($temp)) != self::ASN1_SEQUENCE) { + return false; + } + if ($this->_decodeLength($temp) != strlen($temp)) { + return false; + } + $this->_string_shift($temp); // assume it's an octet string + $salt = $this->_string_shift($temp, $this->_decodeLength($temp)); + if (ord($this->_string_shift($temp)) != self::ASN1_INTEGER) { + return false; + } + $this->_decodeLength($temp); + list(, $iterationCount) = unpack('N', str_pad($temp, 4, chr(0), STR_PAD_LEFT)); + $this->_string_shift($key); // assume it's an octet string + $length = $this->_decodeLength($key); + if (strlen($key) != $length) { + return false; + } + + $crypto = new DES(); + $crypto->setPassword($this->password, 'pbkdf1', 'md5', $salt, $iterationCount); + $key = $crypto->decrypt($key); + if ($key === false) { + return false; + } + return $this->_parseKey($key, self::PRIVATE_FORMAT_PKCS1); + default: + return false; + } + /* intended for keys for which OpenSSL's asn1parse returns the following: + + 0:d=0 hl=4 l= 290 cons: SEQUENCE + 4:d=1 hl=2 l= 13 cons: SEQUENCE + 6:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption + 17:d=2 hl=2 l= 0 prim: NULL + 19:d=1 hl=4 l= 271 prim: BIT STRING */ + $tag = ord($this->_string_shift($key)); // skip over the BIT STRING / OCTET STRING tag + $this->_decodeLength($key); // skip over the BIT STRING / OCTET STRING length + // "The initial octet shall encode, as an unsigned binary integer wtih bit 1 as the least significant bit, the number of + // unused bits in the final subsequent octet. The number shall be in the range zero to seven." + // -- http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf (section 8.6.2.2) + if ($tag == self::ASN1_BITSTRING) { + $this->_string_shift($key); + } + if (ord($this->_string_shift($key)) != self::ASN1_SEQUENCE) { + return false; + } + if ($this->_decodeLength($key) != strlen($key)) { + return false; + } + $tag = ord($this->_string_shift($key)); + } + if ($tag != self::ASN1_INTEGER) { + return false; + } + + $length = $this->_decodeLength($key); + $temp = $this->_string_shift($key, $length); + if (strlen($temp) != 1 || ord($temp) > 2) { + $components['modulus'] = new BigInteger($temp, 256); + $this->_string_shift($key); // skip over self::ASN1_INTEGER + $length = $this->_decodeLength($key); + $components[$type == self::PUBLIC_FORMAT_PKCS1 ? 'publicExponent' : 'privateExponent'] = new BigInteger($this->_string_shift($key, $length), 256); + + return $components; + } + if (ord($this->_string_shift($key)) != self::ASN1_INTEGER) { + return false; + } + $length = $this->_decodeLength($key); + $components['modulus'] = new BigInteger($this->_string_shift($key, $length), 256); + $this->_string_shift($key); + $length = $this->_decodeLength($key); + $components['publicExponent'] = new BigInteger($this->_string_shift($key, $length), 256); + $this->_string_shift($key); + $length = $this->_decodeLength($key); + $components['privateExponent'] = new BigInteger($this->_string_shift($key, $length), 256); + $this->_string_shift($key); + $length = $this->_decodeLength($key); + $components['primes'] = array(1 => new BigInteger($this->_string_shift($key, $length), 256)); + $this->_string_shift($key); + $length = $this->_decodeLength($key); + $components['primes'][] = new BigInteger($this->_string_shift($key, $length), 256); + $this->_string_shift($key); + $length = $this->_decodeLength($key); + $components['exponents'] = array(1 => new BigInteger($this->_string_shift($key, $length), 256)); + $this->_string_shift($key); + $length = $this->_decodeLength($key); + $components['exponents'][] = new BigInteger($this->_string_shift($key, $length), 256); + $this->_string_shift($key); + $length = $this->_decodeLength($key); + $components['coefficients'] = array(2 => new BigInteger($this->_string_shift($key, $length), 256)); + + if (!empty($key)) { + if (ord($this->_string_shift($key)) != self::ASN1_SEQUENCE) { + return false; + } + $this->_decodeLength($key); + while (!empty($key)) { + if (ord($this->_string_shift($key)) != self::ASN1_SEQUENCE) { + return false; + } + $this->_decodeLength($key); + $key = substr($key, 1); + $length = $this->_decodeLength($key); + $components['primes'][] = new BigInteger($this->_string_shift($key, $length), 256); + $this->_string_shift($key); + $length = $this->_decodeLength($key); + $components['exponents'][] = new BigInteger($this->_string_shift($key, $length), 256); + $this->_string_shift($key); + $length = $this->_decodeLength($key); + $components['coefficients'][] = new BigInteger($this->_string_shift($key, $length), 256); + } + } + + return $components; + case self::PUBLIC_FORMAT_OPENSSH: + $parts = explode(' ', $key, 3); + + $key = isset($parts[1]) ? base64_decode($parts[1]) : false; + if ($key === false) { + return false; + } + + $comment = isset($parts[2]) ? $parts[2] : false; + + $cleanup = substr($key, 0, 11) == "\0\0\0\7ssh-rsa"; + + if (strlen($key) <= 4) { + return false; + } + extract(unpack('Nlength', $this->_string_shift($key, 4))); + $publicExponent = new BigInteger($this->_string_shift($key, $length), -256); + if (strlen($key) <= 4) { + return false; + } + extract(unpack('Nlength', $this->_string_shift($key, 4))); + $modulus = new BigInteger($this->_string_shift($key, $length), -256); + + if ($cleanup && strlen($key)) { + if (strlen($key) <= 4) { + return false; + } + extract(unpack('Nlength', $this->_string_shift($key, 4))); + $realModulus = new BigInteger($this->_string_shift($key, $length), -256); + return strlen($key) ? false : array( + 'modulus' => $realModulus, + 'publicExponent' => $modulus, + 'comment' => $comment + ); + } else { + return strlen($key) ? false : array( + 'modulus' => $modulus, + 'publicExponent' => $publicExponent, + 'comment' => $comment + ); + } + // http://www.w3.org/TR/xmldsig-core/#sec-RSAKeyValue + // http://en.wikipedia.org/wiki/XML_Signature + case self::PRIVATE_FORMAT_XML: + case self::PUBLIC_FORMAT_XML: + $this->components = array(); + + $xml = xml_parser_create('UTF-8'); + xml_set_object($xml, $this); + xml_set_element_handler($xml, '_start_element_handler', '_stop_element_handler'); + xml_set_character_data_handler($xml, '_data_handler'); + // add to account for "dangling" tags like ... that are sometimes added + if (!xml_parse($xml, '' . $key . '')) { + xml_parser_free($xml); + unset($xml); + return false; + } + + xml_parser_free($xml); + unset($xml); + + return isset($this->components['modulus']) && isset($this->components['publicExponent']) ? $this->components : false; + // from PuTTY's SSHPUBK.C + case self::PRIVATE_FORMAT_PUTTY: + $components = array(); + $key = preg_split('#\r\n|\r|\n#', $key); + $type = trim(preg_replace('#PuTTY-User-Key-File-2: (.+)#', '$1', $key[0])); + if ($type != 'ssh-rsa') { + return false; + } + $encryption = trim(preg_replace('#Encryption: (.+)#', '$1', $key[1])); + $comment = trim(preg_replace('#Comment: (.+)#', '$1', $key[2])); + + $publicLength = trim(preg_replace('#Public-Lines: (\d+)#', '$1', $key[3])); + $public = base64_decode(implode('', array_map('trim', array_slice($key, 4, $publicLength)))); + $public = substr($public, 11); + extract(unpack('Nlength', $this->_string_shift($public, 4))); + $components['publicExponent'] = new BigInteger($this->_string_shift($public, $length), -256); + extract(unpack('Nlength', $this->_string_shift($public, 4))); + $components['modulus'] = new BigInteger($this->_string_shift($public, $length), -256); + + $privateLength = trim(preg_replace('#Private-Lines: (\d+)#', '$1', $key[$publicLength + 4])); + $private = base64_decode(implode('', array_map('trim', array_slice($key, $publicLength + 5, $privateLength)))); + + switch ($encryption) { + case 'aes256-cbc': + $symkey = ''; + $sequence = 0; + while (strlen($symkey) < 32) { + $temp = pack('Na*', $sequence++, $this->password); + $symkey.= pack('H*', sha1($temp)); + } + $symkey = substr($symkey, 0, 32); + $crypto = new AES(); + } + + if ($encryption != 'none') { + $crypto->setKey($symkey); + $crypto->disablePadding(); + $private = $crypto->decrypt($private); + if ($private === false) { + return false; + } + } + + extract(unpack('Nlength', $this->_string_shift($private, 4))); + if (strlen($private) < $length) { + return false; + } + $components['privateExponent'] = new BigInteger($this->_string_shift($private, $length), -256); + extract(unpack('Nlength', $this->_string_shift($private, 4))); + if (strlen($private) < $length) { + return false; + } + $components['primes'] = array(1 => new BigInteger($this->_string_shift($private, $length), -256)); + extract(unpack('Nlength', $this->_string_shift($private, 4))); + if (strlen($private) < $length) { + return false; + } + $components['primes'][] = new BigInteger($this->_string_shift($private, $length), -256); + + $temp = $components['primes'][1]->subtract($this->one); + $components['exponents'] = array(1 => $components['publicExponent']->modInverse($temp)); + $temp = $components['primes'][2]->subtract($this->one); + $components['exponents'][] = $components['publicExponent']->modInverse($temp); + + extract(unpack('Nlength', $this->_string_shift($private, 4))); + if (strlen($private) < $length) { + return false; + } + $components['coefficients'] = array(2 => new BigInteger($this->_string_shift($private, $length), -256)); + + return $components; + case self::PRIVATE_FORMAT_OPENSSH: + $components = array(); + $decoded = $this->_extractBER($key); + $magic = $this->_string_shift($decoded, 15); + if ($magic !== "openssh-key-v1\0") { + return false; + } + $options = $this->_string_shift($decoded, 24); + // \0\0\0\4none = ciphername + // \0\0\0\4none = kdfname + // \0\0\0\0 = kdfoptions + // \0\0\0\1 = numkeys + if ($options != "\0\0\0\4none\0\0\0\4none\0\0\0\0\0\0\0\1") { + return false; + } + extract(unpack('Nlength', $this->_string_shift($decoded, 4))); + if (strlen($decoded) < $length) { + return false; + } + $publicKey = $this->_string_shift($decoded, $length); + extract(unpack('Nlength', $this->_string_shift($decoded, 4))); + if (strlen($decoded) < $length) { + return false; + } + $paddedKey = $this->_string_shift($decoded, $length); + + if ($this->_string_shift($publicKey, 11) !== "\0\0\0\7ssh-rsa") { + return false; + } + + $checkint1 = $this->_string_shift($paddedKey, 4); + $checkint2 = $this->_string_shift($paddedKey, 4); + if (strlen($checkint1) != 4 || $checkint1 !== $checkint2) { + return false; + } + + if ($this->_string_shift($paddedKey, 11) !== "\0\0\0\7ssh-rsa") { + return false; + } + + $values = array( + &$components['modulus'], + &$components['publicExponent'], + &$components['privateExponent'], + &$components['coefficients'][2], + &$components['primes'][1], + &$components['primes'][2] + ); + + foreach ($values as &$value) { + extract(unpack('Nlength', $this->_string_shift($paddedKey, 4))); + if (strlen($paddedKey) < $length) { + return false; + } + $value = new BigInteger($this->_string_shift($paddedKey, $length), -256); + } + + extract(unpack('Nlength', $this->_string_shift($paddedKey, 4))); + if (strlen($paddedKey) < $length) { + return false; + } + $components['comment'] = $this->_string_shift($decoded, $length); + + $temp = $components['primes'][1]->subtract($this->one); + $components['exponents'] = array(1 => $components['publicExponent']->modInverse($temp)); + $temp = $components['primes'][2]->subtract($this->one); + $components['exponents'][] = $components['publicExponent']->modInverse($temp); + + return $components; + } + } + + /** + * Returns the key size + * + * More specifically, this returns the size of the modulo in bits. + * + * @access public + * @return int + */ + function getSize() + { + return !isset($this->modulus) ? 0 : strlen($this->modulus->toBits()); + } + + /** + * Start Element Handler + * + * Called by xml_set_element_handler() + * + * @access private + * @param resource $parser + * @param string $name + * @param array $attribs + */ + function _start_element_handler($parser, $name, $attribs) + { + //$name = strtoupper($name); + switch ($name) { + case 'MODULUS': + $this->current = &$this->components['modulus']; + break; + case 'EXPONENT': + $this->current = &$this->components['publicExponent']; + break; + case 'P': + $this->current = &$this->components['primes'][1]; + break; + case 'Q': + $this->current = &$this->components['primes'][2]; + break; + case 'DP': + $this->current = &$this->components['exponents'][1]; + break; + case 'DQ': + $this->current = &$this->components['exponents'][2]; + break; + case 'INVERSEQ': + $this->current = &$this->components['coefficients'][2]; + break; + case 'D': + $this->current = &$this->components['privateExponent']; + } + $this->current = ''; + } + + /** + * Stop Element Handler + * + * Called by xml_set_element_handler() + * + * @access private + * @param resource $parser + * @param string $name + */ + function _stop_element_handler($parser, $name) + { + if (isset($this->current)) { + $this->current = new BigInteger(base64_decode($this->current), 256); + unset($this->current); + } + } + + /** + * Data Handler + * + * Called by xml_set_character_data_handler() + * + * @access private + * @param resource $parser + * @param string $data + */ + function _data_handler($parser, $data) + { + if (!isset($this->current) || is_object($this->current)) { + return; + } + $this->current.= trim($data); + } + + /** + * Loads a public or private key + * + * Returns true on success and false on failure (ie. an incorrect password was provided or the key was malformed) + * + * @access public + * @param string|RSA|array $key + * @param bool|int $type optional + * @return bool + */ + function loadKey($key, $type = false) + { + if ($key instanceof RSA) { + $this->privateKeyFormat = $key->privateKeyFormat; + $this->publicKeyFormat = $key->publicKeyFormat; + $this->k = $key->k; + $this->hLen = $key->hLen; + $this->sLen = $key->sLen; + $this->mgfHLen = $key->mgfHLen; + $this->encryptionMode = $key->encryptionMode; + $this->signatureMode = $key->signatureMode; + $this->password = $key->password; + $this->configFile = $key->configFile; + $this->comment = $key->comment; + + if (is_object($key->hash)) { + $this->hash = new Hash($key->hash->getHash()); + } + if (is_object($key->mgfHash)) { + $this->mgfHash = new Hash($key->mgfHash->getHash()); + } + + if (is_object($key->modulus)) { + $this->modulus = $key->modulus->copy(); + } + if (is_object($key->exponent)) { + $this->exponent = $key->exponent->copy(); + } + if (is_object($key->publicExponent)) { + $this->publicExponent = $key->publicExponent->copy(); + } + + $this->primes = array(); + $this->exponents = array(); + $this->coefficients = array(); + + foreach ($this->primes as $prime) { + $this->primes[] = $prime->copy(); + } + foreach ($this->exponents as $exponent) { + $this->exponents[] = $exponent->copy(); + } + foreach ($this->coefficients as $coefficient) { + $this->coefficients[] = $coefficient->copy(); + } + + return true; + } + + if ($type === false) { + $types = array( + self::PUBLIC_FORMAT_RAW, + self::PRIVATE_FORMAT_PKCS1, + self::PRIVATE_FORMAT_XML, + self::PRIVATE_FORMAT_PUTTY, + self::PUBLIC_FORMAT_OPENSSH, + self::PRIVATE_FORMAT_OPENSSH + ); + foreach ($types as $type) { + $components = $this->_parseKey($key, $type); + if ($components !== false) { + break; + } + } + } else { + $components = $this->_parseKey($key, $type); + } + + if ($components === false) { + $this->comment = null; + $this->modulus = null; + $this->k = null; + $this->exponent = null; + $this->primes = null; + $this->exponents = null; + $this->coefficients = null; + $this->publicExponent = null; + + return false; + } + + if (isset($components['comment']) && $components['comment'] !== false) { + $this->comment = $components['comment']; + } + $this->modulus = $components['modulus']; + $this->k = strlen($this->modulus->toBytes()); + $this->exponent = isset($components['privateExponent']) ? $components['privateExponent'] : $components['publicExponent']; + if (isset($components['primes'])) { + $this->primes = $components['primes']; + $this->exponents = $components['exponents']; + $this->coefficients = $components['coefficients']; + $this->publicExponent = $components['publicExponent']; + } else { + $this->primes = array(); + $this->exponents = array(); + $this->coefficients = array(); + $this->publicExponent = false; + } + + switch ($type) { + case self::PUBLIC_FORMAT_OPENSSH: + case self::PUBLIC_FORMAT_RAW: + $this->setPublicKey(); + break; + case self::PRIVATE_FORMAT_PKCS1: + switch (true) { + case strpos($key, '-BEGIN PUBLIC KEY-') !== false: + case strpos($key, '-BEGIN RSA PUBLIC KEY-') !== false: + $this->setPublicKey(); + } + } + + return true; + } + + /** + * Sets the password + * + * Private keys can be encrypted with a password. To unset the password, pass in the empty string or false. + * Or rather, pass in $password such that empty($password) && !is_string($password) is true. + * + * @see self::createKey() + * @see self::loadKey() + * @access public + * @param string $password + */ + function setPassword($password = false) + { + $this->password = $password; + } + + /** + * Defines the public key + * + * Some private key formats define the public exponent and some don't. Those that don't define it are problematic when + * used in certain contexts. For example, in SSH-2, RSA authentication works by sending the public key along with a + * message signed by the private key to the server. The SSH-2 server looks the public key up in an index of public keys + * and if it's present then proceeds to verify the signature. Problem is, if your private key doesn't include the public + * exponent this won't work unless you manually add the public exponent. phpseclib tries to guess if the key being used + * is the public key but in the event that it guesses incorrectly you might still want to explicitly set the key as being + * public. + * + * Do note that when a new key is loaded the index will be cleared. + * + * Returns true on success, false on failure + * + * @see self::getPublicKey() + * @access public + * @param string $key optional + * @param int $type optional + * @return bool + */ + function setPublicKey($key = false, $type = false) + { + // if a public key has already been loaded return false + if (!empty($this->publicExponent)) { + return false; + } + + if ($key === false && !empty($this->modulus)) { + $this->publicExponent = $this->exponent; + return true; + } + + if ($type === false) { + $types = array( + self::PUBLIC_FORMAT_RAW, + self::PUBLIC_FORMAT_PKCS1, + self::PUBLIC_FORMAT_XML, + self::PUBLIC_FORMAT_OPENSSH + ); + foreach ($types as $type) { + $components = $this->_parseKey($key, $type); + if ($components !== false) { + break; + } + } + } else { + $components = $this->_parseKey($key, $type); + } + + if ($components === false) { + return false; + } + + if (empty($this->modulus) || !$this->modulus->equals($components['modulus'])) { + $this->modulus = $components['modulus']; + $this->exponent = $this->publicExponent = $components['publicExponent']; + return true; + } + + $this->publicExponent = $components['publicExponent']; + + return true; + } + + /** + * Defines the private key + * + * If phpseclib guessed a private key was a public key and loaded it as such it might be desirable to force + * phpseclib to treat the key as a private key. This function will do that. + * + * Do note that when a new key is loaded the index will be cleared. + * + * Returns true on success, false on failure + * + * @see self::getPublicKey() + * @access public + * @param string $key optional + * @param int $type optional + * @return bool + */ + function setPrivateKey($key = false, $type = false) + { + if ($key === false && !empty($this->publicExponent)) { + $this->publicExponent = false; + return true; + } + + $rsa = new RSA(); + if (!$rsa->loadKey($key, $type)) { + return false; + } + $rsa->publicExponent = false; + + // don't overwrite the old key if the new key is invalid + $this->loadKey($rsa); + return true; + } + + /** + * Returns the public key + * + * The public key is only returned under two circumstances - if the private key had the public key embedded within it + * or if the public key was set via setPublicKey(). If the currently loaded key is supposed to be the public key this + * function won't return it since this library, for the most part, doesn't distinguish between public and private keys. + * + * @see self::getPublicKey() + * @access public + * @param string $key + * @param int $type optional + */ + function getPublicKey($type = self::PUBLIC_FORMAT_PKCS8) + { + if (empty($this->modulus) || empty($this->publicExponent)) { + return false; + } + + $oldFormat = $this->publicKeyFormat; + $this->publicKeyFormat = $type; + $temp = $this->_convertPublicKey($this->modulus, $this->publicExponent); + $this->publicKeyFormat = $oldFormat; + return $temp; + } + + /** + * Returns the public key's fingerprint + * + * The public key's fingerprint is returned, which is equivalent to running `ssh-keygen -lf rsa.pub`. If there is + * no public key currently loaded, false is returned. + * Example output (md5): "c1:b1:30:29:d7:b8:de:6c:97:77:10:d7:46:41:63:87" (as specified by RFC 4716) + * + * @access public + * @param string $algorithm The hashing algorithm to be used. Valid options are 'md5' and 'sha256'. False is returned + * for invalid values. + * @return mixed + */ + function getPublicKeyFingerprint($algorithm = 'md5') + { + if (empty($this->modulus) || empty($this->publicExponent)) { + return false; + } + + $modulus = $this->modulus->toBytes(true); + $publicExponent = $this->publicExponent->toBytes(true); + + $RSAPublicKey = pack('Na*Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($publicExponent), $publicExponent, strlen($modulus), $modulus); + + switch ($algorithm) { + case 'sha256': + $hash = new Hash('sha256'); + $base = base64_encode($hash->hash($RSAPublicKey)); + return substr($base, 0, strlen($base) - 1); + case 'md5': + return substr(chunk_split(md5($RSAPublicKey), 2, ':'), 0, -1); + default: + return false; + } + } + + /** + * Returns the private key + * + * The private key is only returned if the currently loaded key contains the constituent prime numbers. + * + * @see self::getPublicKey() + * @access public + * @param string $key + * @param int $type optional + * @return mixed + */ + function getPrivateKey($type = self::PUBLIC_FORMAT_PKCS1) + { + if (empty($this->primes)) { + return false; + } + + $oldFormat = $this->privateKeyFormat; + $this->privateKeyFormat = $type; + $temp = $this->_convertPrivateKey($this->modulus, $this->publicExponent, $this->exponent, $this->primes, $this->exponents, $this->coefficients); + $this->privateKeyFormat = $oldFormat; + return $temp; + } + + /** + * Returns a minimalistic private key + * + * Returns the private key without the prime number constituants. Structurally identical to a public key that + * hasn't been set as the public key + * + * @see self::getPrivateKey() + * @access private + * @param string $key + * @param int $type optional + */ + function _getPrivatePublicKey($mode = self::PUBLIC_FORMAT_PKCS8) + { + if (empty($this->modulus) || empty($this->exponent)) { + return false; + } + + $oldFormat = $this->publicKeyFormat; + $this->publicKeyFormat = $mode; + $temp = $this->_convertPublicKey($this->modulus, $this->exponent); + $this->publicKeyFormat = $oldFormat; + return $temp; + } + + /** + * __toString() magic method + * + * @access public + * @return string + */ + function __toString() + { + $key = $this->getPrivateKey($this->privateKeyFormat); + if ($key !== false) { + return $key; + } + $key = $this->_getPrivatePublicKey($this->publicKeyFormat); + return $key !== false ? $key : ''; + } + + /** + * __clone() magic method + * + * @access public + * @return Crypt_RSA + */ + function __clone() + { + $key = new RSA(); + $key->loadKey($this); + return $key; + } + + /** + * Generates the smallest and largest numbers requiring $bits bits + * + * @access private + * @param int $bits + * @return array + */ + function _generateMinMax($bits) + { + $bytes = $bits >> 3; + $min = str_repeat(chr(0), $bytes); + $max = str_repeat(chr(0xFF), $bytes); + $msb = $bits & 7; + if ($msb) { + $min = chr(1 << ($msb - 1)) . $min; + $max = chr((1 << $msb) - 1) . $max; + } else { + $min[0] = chr(0x80); + } + + return array( + 'min' => new BigInteger($min, 256), + 'max' => new BigInteger($max, 256) + ); + } + + /** + * DER-decode the length + * + * DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See + * {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information. + * + * @access private + * @param string $string + * @return int + */ + function _decodeLength(&$string) + { + $length = ord($this->_string_shift($string)); + if ($length & 0x80) { // definite length, long form + $length&= 0x7F; + $temp = $this->_string_shift($string, $length); + list(, $length) = unpack('N', substr(str_pad($temp, 4, chr(0), STR_PAD_LEFT), -4)); + } + return $length; + } + + /** + * DER-encode the length + * + * DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See + * {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information. + * + * @access private + * @param int $length + * @return string + */ + function _encodeLength($length) + { + if ($length <= 0x7F) { + return chr($length); + } + + $temp = ltrim(pack('N', $length), chr(0)); + return pack('Ca*', 0x80 | strlen($temp), $temp); + } + + /** + * String Shift + * + * Inspired by array_shift + * + * @param string $string + * @param int $index + * @return string + * @access private + */ + function _string_shift(&$string, $index = 1) + { + $substr = substr($string, 0, $index); + $string = substr($string, $index); + return $substr; + } + + /** + * Determines the private key format + * + * @see self::createKey() + * @access public + * @param int $format + */ + function setPrivateKeyFormat($format) + { + $this->privateKeyFormat = $format; + } + + /** + * Determines the public key format + * + * @see self::createKey() + * @access public + * @param int $format + */ + function setPublicKeyFormat($format) + { + $this->publicKeyFormat = $format; + } + + /** + * Determines which hashing function should be used + * + * Used with signature production / verification and (if the encryption mode is self::ENCRYPTION_OAEP) encryption and + * decryption. If $hash isn't supported, sha1 is used. + * + * @access public + * @param string $hash + */ + function setHash($hash) + { + // \phpseclib\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example. + switch ($hash) { + case 'md2': + case 'md5': + case 'sha1': + case 'sha256': + case 'sha384': + case 'sha512': + $this->hash = new Hash($hash); + $this->hashName = $hash; + break; + default: + $this->hash = new Hash('sha1'); + $this->hashName = 'sha1'; + } + $this->hLen = $this->hash->getLength(); + } + + /** + * Determines which hashing function should be used for the mask generation function + * + * The mask generation function is used by self::ENCRYPTION_OAEP and self::SIGNATURE_PSS and although it's + * best if Hash and MGFHash are set to the same thing this is not a requirement. + * + * @access public + * @param string $hash + */ + function setMGFHash($hash) + { + // \phpseclib\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example. + switch ($hash) { + case 'md2': + case 'md5': + case 'sha1': + case 'sha256': + case 'sha384': + case 'sha512': + $this->mgfHash = new Hash($hash); + break; + default: + $this->mgfHash = new Hash('sha1'); + } + $this->mgfHLen = $this->mgfHash->getLength(); + } + + /** + * Determines the salt length + * + * To quote from {@link http://tools.ietf.org/html/rfc3447#page-38 RFC3447#page-38}: + * + * Typical salt lengths in octets are hLen (the length of the output + * of the hash function Hash) and 0. + * + * @access public + * @param int $format + */ + function setSaltLength($sLen) + { + $this->sLen = $sLen; + } + + /** + * Integer-to-Octet-String primitive + * + * See {@link http://tools.ietf.org/html/rfc3447#section-4.1 RFC3447#section-4.1}. + * + * @access private + * @param \phpseclib\Math\BigInteger $x + * @param int $xLen + * @return string + */ + function _i2osp($x, $xLen) + { + $x = $x->toBytes(); + if (strlen($x) > $xLen) { + user_error('Integer too large'); + return false; + } + return str_pad($x, $xLen, chr(0), STR_PAD_LEFT); + } + + /** + * Octet-String-to-Integer primitive + * + * See {@link http://tools.ietf.org/html/rfc3447#section-4.2 RFC3447#section-4.2}. + * + * @access private + * @param string $x + * @return \phpseclib\Math\BigInteger + */ + function _os2ip($x) + { + return new BigInteger($x, 256); + } + + /** + * Exponentiate with or without Chinese Remainder Theorem + * + * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.1 RFC3447#section-5.1.2}. + * + * @access private + * @param \phpseclib\Math\BigInteger $x + * @return \phpseclib\Math\BigInteger + */ + function _exponentiate($x) + { + switch (true) { + case empty($this->primes): + case $this->primes[1]->equals($this->zero): + case empty($this->coefficients): + case $this->coefficients[2]->equals($this->zero): + case empty($this->exponents): + case $this->exponents[1]->equals($this->zero): + return $x->modPow($this->exponent, $this->modulus); + } + + $num_primes = count($this->primes); + + if (defined('CRYPT_RSA_DISABLE_BLINDING')) { + $m_i = array( + 1 => $x->modPow($this->exponents[1], $this->primes[1]), + 2 => $x->modPow($this->exponents[2], $this->primes[2]) + ); + $h = $m_i[1]->subtract($m_i[2]); + $h = $h->multiply($this->coefficients[2]); + list(, $h) = $h->divide($this->primes[1]); + $m = $m_i[2]->add($h->multiply($this->primes[2])); + + $r = $this->primes[1]; + for ($i = 3; $i <= $num_primes; $i++) { + $m_i = $x->modPow($this->exponents[$i], $this->primes[$i]); + + $r = $r->multiply($this->primes[$i - 1]); + + $h = $m_i->subtract($m); + $h = $h->multiply($this->coefficients[$i]); + list(, $h) = $h->divide($this->primes[$i]); + + $m = $m->add($r->multiply($h)); + } + } else { + $smallest = $this->primes[1]; + for ($i = 2; $i <= $num_primes; $i++) { + if ($smallest->compare($this->primes[$i]) > 0) { + $smallest = $this->primes[$i]; + } + } + + $one = new BigInteger(1); + + $r = $one->random($one, $smallest->subtract($one)); + + $m_i = array( + 1 => $this->_blind($x, $r, 1), + 2 => $this->_blind($x, $r, 2) + ); + $h = $m_i[1]->subtract($m_i[2]); + $h = $h->multiply($this->coefficients[2]); + list(, $h) = $h->divide($this->primes[1]); + $m = $m_i[2]->add($h->multiply($this->primes[2])); + + $r = $this->primes[1]; + for ($i = 3; $i <= $num_primes; $i++) { + $m_i = $this->_blind($x, $r, $i); + + $r = $r->multiply($this->primes[$i - 1]); + + $h = $m_i->subtract($m); + $h = $h->multiply($this->coefficients[$i]); + list(, $h) = $h->divide($this->primes[$i]); + + $m = $m->add($r->multiply($h)); + } + } + + return $m; + } + + /** + * Performs RSA Blinding + * + * Protects against timing attacks by employing RSA Blinding. + * Returns $x->modPow($this->exponents[$i], $this->primes[$i]) + * + * @access private + * @param \phpseclib\Math\BigInteger $x + * @param \phpseclib\Math\BigInteger $r + * @param int $i + * @return \phpseclib\Math\BigInteger + */ + function _blind($x, $r, $i) + { + $x = $x->multiply($r->modPow($this->publicExponent, $this->primes[$i])); + $x = $x->modPow($this->exponents[$i], $this->primes[$i]); + + $r = $r->modInverse($this->primes[$i]); + $x = $x->multiply($r); + list(, $x) = $x->divide($this->primes[$i]); + + return $x; + } + + /** + * Performs blinded RSA equality testing + * + * Protects against a particular type of timing attack described. + * + * See {@link http://codahale.com/a-lesson-in-timing-attacks/ A Lesson In Timing Attacks (or, Don't use MessageDigest.isEquals)} + * + * Thanks for the heads up singpolyma! + * + * @access private + * @param string $x + * @param string $y + * @return bool + */ + function _equals($x, $y) + { + if (function_exists('hash_equals')) { + return hash_equals($x, $y); + } + + if (strlen($x) != strlen($y)) { + return false; + } + + $result = "\0"; + $x^= $y; + for ($i = 0; $i < strlen($x); $i++) { + $result|= $x[$i]; + } + + return $result === "\0"; + } + + /** + * RSAEP + * + * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.1 RFC3447#section-5.1.1}. + * + * @access private + * @param \phpseclib\Math\BigInteger $m + * @return \phpseclib\Math\BigInteger + */ + function _rsaep($m) + { + if ($m->compare($this->zero) < 0 || $m->compare($this->modulus) > 0) { + user_error('Message representative out of range'); + return false; + } + return $this->_exponentiate($m); + } + + /** + * RSADP + * + * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.2 RFC3447#section-5.1.2}. + * + * @access private + * @param \phpseclib\Math\BigInteger $c + * @return \phpseclib\Math\BigInteger + */ + function _rsadp($c) + { + if ($c->compare($this->zero) < 0 || $c->compare($this->modulus) > 0) { + user_error('Ciphertext representative out of range'); + return false; + } + return $this->_exponentiate($c); + } + + /** + * RSASP1 + * + * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.1 RFC3447#section-5.2.1}. + * + * @access private + * @param \phpseclib\Math\BigInteger $m + * @return \phpseclib\Math\BigInteger + */ + function _rsasp1($m) + { + if ($m->compare($this->zero) < 0 || $m->compare($this->modulus) > 0) { + user_error('Message representative out of range'); + return false; + } + return $this->_exponentiate($m); + } + + /** + * RSAVP1 + * + * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.2 RFC3447#section-5.2.2}. + * + * @access private + * @param \phpseclib\Math\BigInteger $s + * @return \phpseclib\Math\BigInteger + */ + function _rsavp1($s) + { + if ($s->compare($this->zero) < 0 || $s->compare($this->modulus) > 0) { + user_error('Signature representative out of range'); + return false; + } + return $this->_exponentiate($s); + } + + /** + * MGF1 + * + * See {@link http://tools.ietf.org/html/rfc3447#appendix-B.2.1 RFC3447#appendix-B.2.1}. + * + * @access private + * @param string $mgfSeed + * @param int $mgfLen + * @return string + */ + function _mgf1($mgfSeed, $maskLen) + { + // if $maskLen would yield strings larger than 4GB, PKCS#1 suggests a "Mask too long" error be output. + + $t = ''; + $count = ceil($maskLen / $this->mgfHLen); + for ($i = 0; $i < $count; $i++) { + $c = pack('N', $i); + $t.= $this->mgfHash->hash($mgfSeed . $c); + } + + return substr($t, 0, $maskLen); + } + + /** + * RSAES-OAEP-ENCRYPT + * + * See {@link http://tools.ietf.org/html/rfc3447#section-7.1.1 RFC3447#section-7.1.1} and + * {http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding OAES}. + * + * @access private + * @param string $m + * @param string $l + * @return string + */ + function _rsaes_oaep_encrypt($m, $l = '') + { + $mLen = strlen($m); + + // Length checking + + // if $l is larger than two million terrabytes and you're using sha1, PKCS#1 suggests a "Label too long" error + // be output. + + if ($mLen > $this->k - 2 * $this->hLen - 2) { + user_error('Message too long'); + return false; + } + + // EME-OAEP encoding + + $lHash = $this->hash->hash($l); + $ps = str_repeat(chr(0), $this->k - $mLen - 2 * $this->hLen - 2); + $db = $lHash . $ps . chr(1) . $m; + $seed = Random::string($this->hLen); + $dbMask = $this->_mgf1($seed, $this->k - $this->hLen - 1); + $maskedDB = $db ^ $dbMask; + $seedMask = $this->_mgf1($maskedDB, $this->hLen); + $maskedSeed = $seed ^ $seedMask; + $em = chr(0) . $maskedSeed . $maskedDB; + + // RSA encryption + + $m = $this->_os2ip($em); + $c = $this->_rsaep($m); + $c = $this->_i2osp($c, $this->k); + + // Output the ciphertext C + + return $c; + } + + /** + * RSAES-OAEP-DECRYPT + * + * See {@link http://tools.ietf.org/html/rfc3447#section-7.1.2 RFC3447#section-7.1.2}. The fact that the error + * messages aren't distinguishable from one another hinders debugging, but, to quote from RFC3447#section-7.1.2: + * + * Note. Care must be taken to ensure that an opponent cannot + * distinguish the different error conditions in Step 3.g, whether by + * error message or timing, or, more generally, learn partial + * information about the encoded message EM. Otherwise an opponent may + * be able to obtain useful information about the decryption of the + * ciphertext C, leading to a chosen-ciphertext attack such as the one + * observed by Manger [36]. + * + * As for $l... to quote from {@link http://tools.ietf.org/html/rfc3447#page-17 RFC3447#page-17}: + * + * Both the encryption and the decryption operations of RSAES-OAEP take + * the value of a label L as input. In this version of PKCS #1, L is + * the empty string; other uses of the label are outside the scope of + * this document. + * + * @access private + * @param string $c + * @param string $l + * @return string + */ + function _rsaes_oaep_decrypt($c, $l = '') + { + // Length checking + + // if $l is larger than two million terrabytes and you're using sha1, PKCS#1 suggests a "Label too long" error + // be output. + + if (strlen($c) != $this->k || $this->k < 2 * $this->hLen + 2) { + user_error('Decryption error'); + return false; + } + + // RSA decryption + + $c = $this->_os2ip($c); + $m = $this->_rsadp($c); + if ($m === false) { + user_error('Decryption error'); + return false; + } + $em = $this->_i2osp($m, $this->k); + + // EME-OAEP decoding + + $lHash = $this->hash->hash($l); + $y = ord($em[0]); + $maskedSeed = substr($em, 1, $this->hLen); + $maskedDB = substr($em, $this->hLen + 1); + $seedMask = $this->_mgf1($maskedDB, $this->hLen); + $seed = $maskedSeed ^ $seedMask; + $dbMask = $this->_mgf1($seed, $this->k - $this->hLen - 1); + $db = $maskedDB ^ $dbMask; + $lHash2 = substr($db, 0, $this->hLen); + $m = substr($db, $this->hLen); + $hashesMatch = $this->_equals($lHash, $lHash2); + $leadingZeros = 1; + $patternMatch = 0; + $offset = 0; + for ($i = 0; $i < strlen($m); $i++) { + $patternMatch|= $leadingZeros & ($m[$i] === "\1"); + $leadingZeros&= $m[$i] === "\0"; + $offset+= $patternMatch ? 0 : 1; + } + + // we do & instead of && to avoid https://en.wikipedia.org/wiki/Short-circuit_evaluation + // to protect against timing attacks + if (!$hashesMatch & !$patternMatch) { + user_error('Decryption error'); + return false; + } + + // Output the message M + + return substr($m, $offset + 1); + } + + /** + * Raw Encryption / Decryption + * + * Doesn't use padding and is not recommended. + * + * @access private + * @param string $m + * @return string + */ + function _raw_encrypt($m) + { + $temp = $this->_os2ip($m); + $temp = $this->_rsaep($temp); + return $this->_i2osp($temp, $this->k); + } + + /** + * RSAES-PKCS1-V1_5-ENCRYPT + * + * See {@link http://tools.ietf.org/html/rfc3447#section-7.2.1 RFC3447#section-7.2.1}. + * + * @access private + * @param string $m + * @return string + */ + function _rsaes_pkcs1_v1_5_encrypt($m) + { + $mLen = strlen($m); + + // Length checking + + if ($mLen > $this->k - 11) { + user_error('Message too long'); + return false; + } + + // EME-PKCS1-v1_5 encoding + + $psLen = $this->k - $mLen - 3; + $ps = ''; + while (strlen($ps) != $psLen) { + $temp = Random::string($psLen - strlen($ps)); + $temp = str_replace("\x00", '', $temp); + $ps.= $temp; + } + $type = 2; + // see the comments of _rsaes_pkcs1_v1_5_decrypt() to understand why this is being done + if (defined('CRYPT_RSA_PKCS15_COMPAT') && (!isset($this->publicExponent) || $this->exponent !== $this->publicExponent)) { + $type = 1; + // "The padding string PS shall consist of k-3-||D|| octets. ... for block type 01, they shall have value FF" + $ps = str_repeat("\xFF", $psLen); + } + $em = chr(0) . chr($type) . $ps . chr(0) . $m; + + // RSA encryption + $m = $this->_os2ip($em); + $c = $this->_rsaep($m); + $c = $this->_i2osp($c, $this->k); + + // Output the ciphertext C + + return $c; + } + + /** + * RSAES-PKCS1-V1_5-DECRYPT + * + * See {@link http://tools.ietf.org/html/rfc3447#section-7.2.2 RFC3447#section-7.2.2}. + * + * For compatibility purposes, this function departs slightly from the description given in RFC3447. + * The reason being that RFC2313#section-8.1 (PKCS#1 v1.5) states that ciphertext's encrypted by the + * private key should have the second byte set to either 0 or 1 and that ciphertext's encrypted by the + * public key should have the second byte set to 2. In RFC3447 (PKCS#1 v2.1), the second byte is supposed + * to be 2 regardless of which key is used. For compatibility purposes, we'll just check to make sure the + * second byte is 2 or less. If it is, we'll accept the decrypted string as valid. + * + * As a consequence of this, a private key encrypted ciphertext produced with \phpseclib\Crypt\RSA may not decrypt + * with a strictly PKCS#1 v1.5 compliant RSA implementation. Public key encrypted ciphertext's should but + * not private key encrypted ciphertext's. + * + * @access private + * @param string $c + * @return string + */ + function _rsaes_pkcs1_v1_5_decrypt($c) + { + // Length checking + + if (strlen($c) != $this->k) { // or if k < 11 + user_error('Decryption error'); + return false; + } + + // RSA decryption + + $c = $this->_os2ip($c); + $m = $this->_rsadp($c); + + if ($m === false) { + user_error('Decryption error'); + return false; + } + $em = $this->_i2osp($m, $this->k); + + // EME-PKCS1-v1_5 decoding + + if (ord($em[0]) != 0 || ord($em[1]) > 2) { + user_error('Decryption error'); + return false; + } + + $ps = substr($em, 2, strpos($em, chr(0), 2) - 2); + $m = substr($em, strlen($ps) + 3); + + if (strlen($ps) < 8) { + user_error('Decryption error'); + return false; + } + + // Output M + + return $m; + } + + /** + * EMSA-PSS-ENCODE + * + * See {@link http://tools.ietf.org/html/rfc3447#section-9.1.1 RFC3447#section-9.1.1}. + * + * @access private + * @param string $m + * @param int $emBits + */ + function _emsa_pss_encode($m, $emBits) + { + // if $m is larger than two million terrabytes and you're using sha1, PKCS#1 suggests a "Label too long" error + // be output. + + $emLen = ($emBits + 1) >> 3; // ie. ceil($emBits / 8) + $sLen = $this->sLen !== null ? $this->sLen : $this->hLen; + + $mHash = $this->hash->hash($m); + if ($emLen < $this->hLen + $sLen + 2) { + user_error('Encoding error'); + return false; + } + + $salt = Random::string($sLen); + $m2 = "\0\0\0\0\0\0\0\0" . $mHash . $salt; + $h = $this->hash->hash($m2); + $ps = str_repeat(chr(0), $emLen - $sLen - $this->hLen - 2); + $db = $ps . chr(1) . $salt; + $dbMask = $this->_mgf1($h, $emLen - $this->hLen - 1); + $maskedDB = $db ^ $dbMask; + $maskedDB[0] = ~chr(0xFF << ($emBits & 7)) & $maskedDB[0]; + $em = $maskedDB . $h . chr(0xBC); + + return $em; + } + + /** + * EMSA-PSS-VERIFY + * + * See {@link http://tools.ietf.org/html/rfc3447#section-9.1.2 RFC3447#section-9.1.2}. + * + * @access private + * @param string $m + * @param string $em + * @param int $emBits + * @return string + */ + function _emsa_pss_verify($m, $em, $emBits) + { + // if $m is larger than two million terrabytes and you're using sha1, PKCS#1 suggests a "Label too long" error + // be output. + + $emLen = ($emBits + 1) >> 3; // ie. ceil($emBits / 8); + $sLen = $this->sLen !== null ? $this->sLen : $this->hLen; + + $mHash = $this->hash->hash($m); + if ($emLen < $this->hLen + $sLen + 2) { + return false; + } + + if ($em[strlen($em) - 1] != chr(0xBC)) { + return false; + } + + $maskedDB = substr($em, 0, -$this->hLen - 1); + $h = substr($em, -$this->hLen - 1, $this->hLen); + $temp = chr(0xFF << ($emBits & 7)); + if ((~$maskedDB[0] & $temp) != $temp) { + return false; + } + $dbMask = $this->_mgf1($h, $emLen - $this->hLen - 1); + $db = $maskedDB ^ $dbMask; + $db[0] = ~chr(0xFF << ($emBits & 7)) & $db[0]; + $temp = $emLen - $this->hLen - $sLen - 2; + if (substr($db, 0, $temp) != str_repeat(chr(0), $temp) || ord($db[$temp]) != 1) { + return false; + } + $salt = substr($db, $temp + 1); // should be $sLen long + $m2 = "\0\0\0\0\0\0\0\0" . $mHash . $salt; + $h2 = $this->hash->hash($m2); + return $this->_equals($h, $h2); + } + + /** + * RSASSA-PSS-SIGN + * + * See {@link http://tools.ietf.org/html/rfc3447#section-8.1.1 RFC3447#section-8.1.1}. + * + * @access private + * @param string $m + * @return string + */ + function _rsassa_pss_sign($m) + { + // EMSA-PSS encoding + + $em = $this->_emsa_pss_encode($m, 8 * $this->k - 1); + + // RSA signature + + $m = $this->_os2ip($em); + $s = $this->_rsasp1($m); + $s = $this->_i2osp($s, $this->k); + + // Output the signature S + + return $s; + } + + /** + * RSASSA-PSS-VERIFY + * + * See {@link http://tools.ietf.org/html/rfc3447#section-8.1.2 RFC3447#section-8.1.2}. + * + * @access private + * @param string $m + * @param string $s + * @return string + */ + function _rsassa_pss_verify($m, $s) + { + // Length checking + + if (strlen($s) != $this->k) { + user_error('Invalid signature'); + return false; + } + + // RSA verification + + $modBits = 8 * $this->k; + + $s2 = $this->_os2ip($s); + $m2 = $this->_rsavp1($s2); + if ($m2 === false) { + user_error('Invalid signature'); + return false; + } + $em = $this->_i2osp($m2, $modBits >> 3); + if ($em === false) { + user_error('Invalid signature'); + return false; + } + + // EMSA-PSS verification + + return $this->_emsa_pss_verify($m, $em, $modBits - 1); + } + + /** + * EMSA-PKCS1-V1_5-ENCODE + * + * See {@link http://tools.ietf.org/html/rfc3447#section-9.2 RFC3447#section-9.2}. + * + * @access private + * @param string $m + * @param int $emLen + * @return string + */ + function _emsa_pkcs1_v1_5_encode($m, $emLen) + { + $h = $this->hash->hash($m); + if ($h === false) { + return false; + } + + // see http://tools.ietf.org/html/rfc3447#page-43 + switch ($this->hashName) { + case 'md2': + $t = pack('H*', '3020300c06082a864886f70d020205000410'); + break; + case 'md5': + $t = pack('H*', '3020300c06082a864886f70d020505000410'); + break; + case 'sha1': + $t = pack('H*', '3021300906052b0e03021a05000414'); + break; + case 'sha256': + $t = pack('H*', '3031300d060960864801650304020105000420'); + break; + case 'sha384': + $t = pack('H*', '3041300d060960864801650304020205000430'); + break; + case 'sha512': + $t = pack('H*', '3051300d060960864801650304020305000440'); + } + $t.= $h; + $tLen = strlen($t); + + if ($emLen < $tLen + 11) { + user_error('Intended encoded message length too short'); + return false; + } + + $ps = str_repeat(chr(0xFF), $emLen - $tLen - 3); + + $em = "\0\1$ps\0$t"; + + return $em; + } + + /** + * RSASSA-PKCS1-V1_5-SIGN + * + * See {@link http://tools.ietf.org/html/rfc3447#section-8.2.1 RFC3447#section-8.2.1}. + * + * @access private + * @param string $m + * @return string + */ + function _rsassa_pkcs1_v1_5_sign($m) + { + // EMSA-PKCS1-v1_5 encoding + + $em = $this->_emsa_pkcs1_v1_5_encode($m, $this->k); + if ($em === false) { + user_error('RSA modulus too short'); + return false; + } + + // RSA signature + + $m = $this->_os2ip($em); + $s = $this->_rsasp1($m); + $s = $this->_i2osp($s, $this->k); + + // Output the signature S + + return $s; + } + + /** + * RSASSA-PKCS1-V1_5-VERIFY + * + * See {@link http://tools.ietf.org/html/rfc3447#section-8.2.2 RFC3447#section-8.2.2}. + * + * @access private + * @param string $m + * @return string + */ + function _rsassa_pkcs1_v1_5_verify($m, $s) + { + // Length checking + + if (strlen($s) != $this->k) { + user_error('Invalid signature'); + return false; + } + + // RSA verification + + $s = $this->_os2ip($s); + $m2 = $this->_rsavp1($s); + if ($m2 === false) { + user_error('Invalid signature'); + return false; + } + $em = $this->_i2osp($m2, $this->k); + if ($em === false) { + user_error('Invalid signature'); + return false; + } + + // EMSA-PKCS1-v1_5 encoding + + $em2 = $this->_emsa_pkcs1_v1_5_encode($m, $this->k); + if ($em2 === false) { + user_error('RSA modulus too short'); + return false; + } + + // Compare + return $this->_equals($em, $em2); + } + + /** + * Set Encryption Mode + * + * Valid values include self::ENCRYPTION_OAEP and self::ENCRYPTION_PKCS1. + * + * @access public + * @param int $mode + */ + function setEncryptionMode($mode) + { + $this->encryptionMode = $mode; + } + + /** + * Set Signature Mode + * + * Valid values include self::SIGNATURE_PSS and self::SIGNATURE_PKCS1 + * + * @access public + * @param int $mode + */ + function setSignatureMode($mode) + { + $this->signatureMode = $mode; + } + + /** + * Set public key comment. + * + * @access public + * @param string $comment + */ + function setComment($comment) + { + $this->comment = $comment; + } + + /** + * Get public key comment. + * + * @access public + * @return string + */ + function getComment() + { + return $this->comment; + } + + /** + * Encryption + * + * Both self::ENCRYPTION_OAEP and self::ENCRYPTION_PKCS1 both place limits on how long $plaintext can be. + * If $plaintext exceeds those limits it will be broken up so that it does and the resultant ciphertext's will + * be concatenated together. + * + * @see self::decrypt() + * @access public + * @param string $plaintext + * @return string + */ + function encrypt($plaintext) + { + switch ($this->encryptionMode) { + case self::ENCRYPTION_NONE: + $plaintext = str_split($plaintext, $this->k); + $ciphertext = ''; + foreach ($plaintext as $m) { + $ciphertext.= $this->_raw_encrypt($m); + } + return $ciphertext; + case self::ENCRYPTION_PKCS1: + $length = $this->k - 11; + if ($length <= 0) { + return false; + } + + $plaintext = str_split($plaintext, $length); + $ciphertext = ''; + foreach ($plaintext as $m) { + $ciphertext.= $this->_rsaes_pkcs1_v1_5_encrypt($m); + } + return $ciphertext; + //case self::ENCRYPTION_OAEP: + default: + $length = $this->k - 2 * $this->hLen - 2; + if ($length <= 0) { + return false; + } + + $plaintext = str_split($plaintext, $length); + $ciphertext = ''; + foreach ($plaintext as $m) { + $ciphertext.= $this->_rsaes_oaep_encrypt($m); + } + return $ciphertext; + } + } + + /** + * Decryption + * + * @see self::encrypt() + * @access public + * @param string $plaintext + * @return string + */ + function decrypt($ciphertext) + { + if ($this->k <= 0) { + return false; + } + + $ciphertext = str_split($ciphertext, $this->k); + $ciphertext[count($ciphertext) - 1] = str_pad($ciphertext[count($ciphertext) - 1], $this->k, chr(0), STR_PAD_LEFT); + + $plaintext = ''; + + switch ($this->encryptionMode) { + case self::ENCRYPTION_NONE: + $decrypt = '_raw_encrypt'; + break; + case self::ENCRYPTION_PKCS1: + $decrypt = '_rsaes_pkcs1_v1_5_decrypt'; + break; + //case self::ENCRYPTION_OAEP: + default: + $decrypt = '_rsaes_oaep_decrypt'; + } + + foreach ($ciphertext as $c) { + $temp = $this->$decrypt($c); + if ($temp === false) { + return false; + } + $plaintext.= $temp; + } + + return $plaintext; + } + + /** + * Create a signature + * + * @see self::verify() + * @access public + * @param string $message + * @return string + */ + function sign($message) + { + if (empty($this->modulus) || empty($this->exponent)) { + return false; + } + + switch ($this->signatureMode) { + case self::SIGNATURE_PKCS1: + return $this->_rsassa_pkcs1_v1_5_sign($message); + //case self::SIGNATURE_PSS: + default: + return $this->_rsassa_pss_sign($message); + } + } + + /** + * Verifies a signature + * + * @see self::sign() + * @access public + * @param string $message + * @param string $signature + * @return bool + */ + function verify($message, $signature) + { + if (empty($this->modulus) || empty($this->exponent)) { + return false; + } + + switch ($this->signatureMode) { + case self::SIGNATURE_PKCS1: + return $this->_rsassa_pkcs1_v1_5_verify($message, $signature); + //case self::SIGNATURE_PSS: + default: + return $this->_rsassa_pss_verify($message, $signature); + } + } + + /** + * Extract raw BER from Base64 encoding + * + * @access private + * @param string $str + * @return string + */ + function _extractBER($str) + { + /* X.509 certs are assumed to be base64 encoded but sometimes they'll have additional things in them + * above and beyond the ceritificate. + * ie. some may have the following preceding the -----BEGIN CERTIFICATE----- line: + * + * Bag Attributes + * localKeyID: 01 00 00 00 + * subject=/O=organization/OU=org unit/CN=common name + * issuer=/O=organization/CN=common name + */ + $temp = preg_replace('#.*?^-+[^-]+-+[\r\n ]*$#ms', '', $str, 1); + // remove the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- stuff + $temp = preg_replace('#-+[^-]+-+#', '', $temp); + // remove new lines + $temp = str_replace(array("\r", "\n", ' '), '', $temp); + $temp = preg_match('#^[a-zA-Z\d/+]*={0,2}$#', $temp) ? base64_decode($temp) : false; + return $temp != false ? $temp : $str; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php b/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php new file mode 100644 index 0000000..01e34cc --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php @@ -0,0 +1,274 @@ + + * + * + * + * @category Crypt + * @package Random + * @author Jim Wigginton + * @copyright 2007 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://phpseclib.sourceforge.net + */ + +namespace phpseclib\Crypt; + +/** + * Pure-PHP Random Number Generator + * + * @package Random + * @author Jim Wigginton + * @access public + */ +class Random +{ + /** + * Generate a random string. + * + * Although microoptimizations are generally discouraged as they impair readability this function is ripe with + * microoptimizations because this function has the potential of being called a huge number of times. + * eg. for RSA key generation. + * + * @param int $length + * @return string + */ + static function string($length) + { + if (!$length) { + return ''; + } + + if (version_compare(PHP_VERSION, '7.0.0', '>=')) { + try { + return \random_bytes($length); + } catch (\Throwable $e) { + // If a sufficient source of randomness is unavailable, random_bytes() will throw an + // object that implements the Throwable interface (Exception, TypeError, Error). + // We don't actually need to do anything here. The string() method should just continue + // as normal. Note, however, that if we don't have a sufficient source of randomness for + // random_bytes(), most of the other calls here will fail too, so we'll end up using + // the PHP implementation. + } + } + + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + // method 1. prior to PHP 5.3 this would call rand() on windows hence the function_exists('class_alias') call. + // ie. class_alias is a function that was introduced in PHP 5.3 + if (extension_loaded('mcrypt') && function_exists('class_alias')) { + return @mcrypt_create_iv($length); + } + // method 2. openssl_random_pseudo_bytes was introduced in PHP 5.3.0 but prior to PHP 5.3.4 there was, + // to quote , "possible blocking behavior". as of 5.3.4 + // openssl_random_pseudo_bytes and mcrypt_create_iv do the exact same thing on Windows. ie. they both + // call php_win32_get_random_bytes(): + // + // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/openssl/openssl.c#L5008 + // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1392 + // + // php_win32_get_random_bytes() is defined thusly: + // + // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/win32/winutil.c#L80 + // + // we're calling it, all the same, in the off chance that the mcrypt extension is not available + if (extension_loaded('openssl') && version_compare(PHP_VERSION, '5.3.4', '>=')) { + return openssl_random_pseudo_bytes($length); + } + } else { + // method 1. the fastest + if (extension_loaded('openssl')) { + return openssl_random_pseudo_bytes($length); + } + // method 2 + static $fp = true; + if ($fp === true) { + // warning's will be output unles the error suppression operator is used. errors such as + // "open_basedir restriction in effect", "Permission denied", "No such file or directory", etc. + $fp = @fopen('/dev/urandom', 'rb'); + } + if ($fp !== true && $fp !== false) { // surprisingly faster than !is_bool() or is_resource() + return fread($fp, $length); + } + // method 3. pretty much does the same thing as method 2 per the following url: + // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1391 + // surprisingly slower than method 2. maybe that's because mcrypt_create_iv does a bunch of error checking that we're + // not doing. regardless, this'll only be called if this PHP script couldn't open /dev/urandom due to open_basedir + // restrictions or some such + if (extension_loaded('mcrypt')) { + return @mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); + } + } + // at this point we have no choice but to use a pure-PHP CSPRNG + + // cascade entropy across multiple PHP instances by fixing the session and collecting all + // environmental variables, including the previous session data and the current session + // data. + // + // mt_rand seeds itself by looking at the PID and the time, both of which are (relatively) + // easy to guess at. linux uses mouse clicks, keyboard timings, etc, as entropy sources, but + // PHP isn't low level to be able to use those as sources and on a web server there's not likely + // going to be a ton of keyboard or mouse action. web servers do have one thing that we can use + // however, a ton of people visiting the website. obviously you don't want to base your seeding + // soley on parameters a potential attacker sends but (1) not everything in $_SERVER is controlled + // by the user and (2) this isn't just looking at the data sent by the current user - it's based + // on the data sent by all users. one user requests the page and a hash of their info is saved. + // another user visits the page and the serialization of their data is utilized along with the + // server envirnment stuff and a hash of the previous http request data (which itself utilizes + // a hash of the session data before that). certainly an attacker should be assumed to have + // full control over his own http requests. he, however, is not going to have control over + // everyone's http requests. + static $crypto = false, $v; + if ($crypto === false) { + // save old session data + $old_session_id = session_id(); + $old_use_cookies = ini_get('session.use_cookies'); + $old_session_cache_limiter = session_cache_limiter(); + $_OLD_SESSION = isset($_SESSION) ? $_SESSION : false; + if ($old_session_id != '') { + session_write_close(); + } + + session_id(1); + ini_set('session.use_cookies', 0); + session_cache_limiter(''); + session_start(); + + $v = $seed = $_SESSION['seed'] = pack('H*', sha1( + (isset($_SERVER) ? phpseclib_safe_serialize($_SERVER) : '') . + (isset($_POST) ? phpseclib_safe_serialize($_POST) : '') . + (isset($_GET) ? phpseclib_safe_serialize($_GET) : '') . + (isset($_COOKIE) ? phpseclib_safe_serialize($_COOKIE) : '') . + phpseclib_safe_serialize($GLOBALS) . + phpseclib_safe_serialize($_SESSION) . + phpseclib_safe_serialize($_OLD_SESSION) + )); + if (!isset($_SESSION['count'])) { + $_SESSION['count'] = 0; + } + $_SESSION['count']++; + + session_write_close(); + + // restore old session data + if ($old_session_id != '') { + session_id($old_session_id); + session_start(); + ini_set('session.use_cookies', $old_use_cookies); + session_cache_limiter($old_session_cache_limiter); + } else { + if ($_OLD_SESSION !== false) { + $_SESSION = $_OLD_SESSION; + unset($_OLD_SESSION); + } else { + unset($_SESSION); + } + } + + // in SSH2 a shared secret and an exchange hash are generated through the key exchange process. + // the IV client to server is the hash of that "nonce" with the letter A and for the encryption key it's the letter C. + // if the hash doesn't produce enough a key or an IV that's long enough concat successive hashes of the + // original hash and the current hash. we'll be emulating that. for more info see the following URL: + // + // http://tools.ietf.org/html/rfc4253#section-7.2 + // + // see the is_string($crypto) part for an example of how to expand the keys + $key = pack('H*', sha1($seed . 'A')); + $iv = pack('H*', sha1($seed . 'C')); + + // ciphers are used as per the nist.gov link below. also, see this link: + // + // http://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator#Designs_based_on_cryptographic_primitives + switch (true) { + case class_exists('\phpseclib\Crypt\AES'): + $crypto = new AES(Base::MODE_CTR); + break; + case class_exists('\phpseclib\Crypt\Twofish'): + $crypto = new Twofish(Base::MODE_CTR); + break; + case class_exists('\phpseclib\Crypt\Blowfish'): + $crypto = new Blowfish(Base::MODE_CTR); + break; + case class_exists('\phpseclib\Crypt\TripleDES'): + $crypto = new TripleDES(Base::MODE_CTR); + break; + case class_exists('\phpseclib\Crypt\DES'): + $crypto = new DES(Base::MODE_CTR); + break; + case class_exists('\phpseclib\Crypt\RC4'): + $crypto = new RC4(); + break; + default: + user_error(__CLASS__ . ' requires at least one symmetric cipher be loaded'); + return false; + } + + $crypto->setKey($key); + $crypto->setIV($iv); + $crypto->enableContinuousBuffer(); + } + + //return $crypto->encrypt(str_repeat("\0", $length)); + + // the following is based off of ANSI X9.31: + // + // http://csrc.nist.gov/groups/STM/cavp/documents/rng/931rngext.pdf + // + // OpenSSL uses that same standard for it's random numbers: + // + // http://www.opensource.apple.com/source/OpenSSL/OpenSSL-38/openssl/fips-1.0/rand/fips_rand.c + // (do a search for "ANS X9.31 A.2.4") + $result = ''; + while (strlen($result) < $length) { + $i = $crypto->encrypt(microtime()); // strlen(microtime()) == 21 + $r = $crypto->encrypt($i ^ $v); // strlen($v) == 20 + $v = $crypto->encrypt($r ^ $i); // strlen($r) == 20 + $result.= $r; + } + return substr($result, 0, $length); + } +} + +if (!function_exists('phpseclib_safe_serialize')) { + /** + * Safely serialize variables + * + * If a class has a private __sleep() method it'll give a fatal error on PHP 5.2 and earlier. + * PHP 5.3 will emit a warning. + * + * @param mixed $arr + * @access public + */ + function phpseclib_safe_serialize(&$arr) + { + if (is_object($arr)) { + return ''; + } + if (!is_array($arr)) { + return serialize($arr); + } + // prevent circular array recursion + if (isset($arr['__phpseclib_marker'])) { + return ''; + } + $safearr = array(); + $arr['__phpseclib_marker'] = true; + foreach (array_keys($arr) as $key) { + // do not recurse on the '__phpseclib_marker' key itself, for smaller memory usage + if ($key !== '__phpseclib_marker') { + $safearr[$key] = phpseclib_safe_serialize($arr[$key]); + } + } + unset($arr['__phpseclib_marker']); + return serialize($safearr); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php b/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php new file mode 100644 index 0000000..3648a19 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php @@ -0,0 +1,936 @@ + + * setKey('abcdefghijklmnop'); + * + * $size = 10 * 1024; + * $plaintext = ''; + * for ($i = 0; $i < $size; $i++) { + * $plaintext.= 'a'; + * } + * + * echo $rijndael->decrypt($rijndael->encrypt($plaintext)); + * ?> + * + * + * @category Crypt + * @package Rijndael + * @author Jim Wigginton + * @copyright 2008 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://phpseclib.sourceforge.net + */ + +namespace phpseclib\Crypt; + +/** + * Pure-PHP implementation of Rijndael. + * + * @package Rijndael + * @author Jim Wigginton + * @access public + */ +class Rijndael extends Base +{ + /** + * The mcrypt specific name of the cipher + * + * Mcrypt is useable for 128/192/256-bit $block_size/$key_length. For 160/224 not. + * \phpseclib\Crypt\Rijndael determines automatically whether mcrypt is useable + * or not for the current $block_size/$key_length. + * In case of, $cipher_name_mcrypt will be set dynamically at run time accordingly. + * + * @see \phpseclib\Crypt\Base::cipher_name_mcrypt + * @see \phpseclib\Crypt\Base::engine + * @see self::isValidEngine() + * @var string + * @access private + */ + var $cipher_name_mcrypt = 'rijndael-128'; + + /** + * The default salt used by setPassword() + * + * @see \phpseclib\Crypt\Base::password_default_salt + * @see \phpseclib\Crypt\Base::setPassword() + * @var string + * @access private + */ + var $password_default_salt = 'phpseclib'; + + /** + * The Key Schedule + * + * @see self::_setup() + * @var array + * @access private + */ + var $w; + + /** + * The Inverse Key Schedule + * + * @see self::_setup() + * @var array + * @access private + */ + var $dw; + + /** + * The Block Length divided by 32 + * + * @see self::setBlockLength() + * @var int + * @access private + * @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4. Exists in conjunction with $block_size + * because the encryption / decryption / key schedule creation requires this number and not $block_size. We could + * derive this from $block_size or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu + * of that, we'll just precompute it once. + */ + var $Nb = 4; + + /** + * The Key Length (in bytes) + * + * @see self::setKeyLength() + * @var int + * @access private + * @internal The max value is 256 / 8 = 32, the min value is 128 / 8 = 16. Exists in conjunction with $Nk + * because the encryption / decryption / key schedule creation requires this number and not $key_length. We could + * derive this from $key_length or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu + * of that, we'll just precompute it once. + */ + var $key_length = 16; + + /** + * The Key Length divided by 32 + * + * @see self::setKeyLength() + * @var int + * @access private + * @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4 + */ + var $Nk = 4; + + /** + * The Number of Rounds + * + * @var int + * @access private + * @internal The max value is 14, the min value is 10. + */ + var $Nr; + + /** + * Shift offsets + * + * @var array + * @access private + */ + var $c; + + /** + * Holds the last used key- and block_size information + * + * @var array + * @access private + */ + var $kl; + + /** + * Sets the key length. + * + * Valid key lengths are 128, 160, 192, 224, and 256. If the length is less than 128, it will be rounded up to + * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount. + * + * Note: phpseclib extends Rijndael (and AES) for using 160- and 224-bit keys but they are officially not defined + * and the most (if not all) implementations are not able using 160/224-bit keys but round/pad them up to + * 192/256 bits as, for example, mcrypt will do. + * + * That said, if you want be compatible with other Rijndael and AES implementations, + * you should not setKeyLength(160) or setKeyLength(224). + * + * Additional: In case of 160- and 224-bit keys, phpseclib will/can, for that reason, not use + * the mcrypt php extension, even if available. + * This results then in slower encryption. + * + * @access public + * @param int $length + */ + function setKeyLength($length) + { + switch (true) { + case $length <= 128: + $this->key_length = 16; + break; + case $length <= 160: + $this->key_length = 20; + break; + case $length <= 192: + $this->key_length = 24; + break; + case $length <= 224: + $this->key_length = 28; + break; + default: + $this->key_length = 32; + } + + parent::setKeyLength($length); + } + + /** + * Sets the block length + * + * Valid block lengths are 128, 160, 192, 224, and 256. If the length is less than 128, it will be rounded up to + * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount. + * + * @access public + * @param int $length + */ + function setBlockLength($length) + { + $length >>= 5; + if ($length > 8) { + $length = 8; + } elseif ($length < 4) { + $length = 4; + } + $this->Nb = $length; + $this->block_size = $length << 2; + $this->changed = true; + $this->_setEngine(); + } + + /** + * Test for engine validity + * + * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Base::isValidEngine() + * + * @see \phpseclib\Crypt\Base::__construct() + * @param int $engine + * @access public + * @return bool + */ + function isValidEngine($engine) + { + switch ($engine) { + case self::ENGINE_OPENSSL: + if ($this->block_size != 16) { + return false; + } + $this->cipher_name_openssl_ecb = 'aes-' . ($this->key_length << 3) . '-ecb'; + $this->cipher_name_openssl = 'aes-' . ($this->key_length << 3) . '-' . $this->_openssl_translate_mode(); + break; + case self::ENGINE_MCRYPT: + $this->cipher_name_mcrypt = 'rijndael-' . ($this->block_size << 3); + if ($this->key_length % 8) { // is it a 160/224-bit key? + // mcrypt is not usable for them, only for 128/192/256-bit keys + return false; + } + } + + return parent::isValidEngine($engine); + } + + /** + * Encrypts a block + * + * @access private + * @param string $in + * @return string + */ + function _encryptBlock($in) + { + static $tables; + if (empty($tables)) { + $tables = &$this->_getTables(); + } + $t0 = $tables[0]; + $t1 = $tables[1]; + $t2 = $tables[2]; + $t3 = $tables[3]; + $sbox = $tables[4]; + + $state = array(); + $words = unpack('N*', $in); + + $c = $this->c; + $w = $this->w; + $Nb = $this->Nb; + $Nr = $this->Nr; + + // addRoundKey + $wc = $Nb - 1; + foreach ($words as $word) { + $state[] = $word ^ $w[++$wc]; + } + + // fips-197.pdf#page=19, "Figure 5. Pseudo Code for the Cipher", states that this loop has four components - + // subBytes, shiftRows, mixColumns, and addRoundKey. fips-197.pdf#page=30, "Implementation Suggestions Regarding + // Various Platforms" suggests that performs enhanced implementations are described in Rijndael-ammended.pdf. + // Rijndael-ammended.pdf#page=20, "Implementation aspects / 32-bit processor", discusses such an optimization. + // Unfortunately, the description given there is not quite correct. Per aes.spec.v316.pdf#page=19 [1], + // equation (7.4.7) is supposed to use addition instead of subtraction, so we'll do that here, as well. + + // [1] http://fp.gladman.plus.com/cryptography_technology/rijndael/aes.spec.v316.pdf + $temp = array(); + for ($round = 1; $round < $Nr; ++$round) { + $i = 0; // $c[0] == 0 + $j = $c[1]; + $k = $c[2]; + $l = $c[3]; + + while ($i < $Nb) { + $temp[$i] = $t0[$state[$i] >> 24 & 0x000000FF] ^ + $t1[$state[$j] >> 16 & 0x000000FF] ^ + $t2[$state[$k] >> 8 & 0x000000FF] ^ + $t3[$state[$l] & 0x000000FF] ^ + $w[++$wc]; + ++$i; + $j = ($j + 1) % $Nb; + $k = ($k + 1) % $Nb; + $l = ($l + 1) % $Nb; + } + $state = $temp; + } + + // subWord + for ($i = 0; $i < $Nb; ++$i) { + $state[$i] = $sbox[$state[$i] & 0x000000FF] | + ($sbox[$state[$i] >> 8 & 0x000000FF] << 8) | + ($sbox[$state[$i] >> 16 & 0x000000FF] << 16) | + ($sbox[$state[$i] >> 24 & 0x000000FF] << 24); + } + + // shiftRows + addRoundKey + $i = 0; // $c[0] == 0 + $j = $c[1]; + $k = $c[2]; + $l = $c[3]; + while ($i < $Nb) { + $temp[$i] = ($state[$i] & 0xFF000000) ^ + ($state[$j] & 0x00FF0000) ^ + ($state[$k] & 0x0000FF00) ^ + ($state[$l] & 0x000000FF) ^ + $w[$i]; + ++$i; + $j = ($j + 1) % $Nb; + $k = ($k + 1) % $Nb; + $l = ($l + 1) % $Nb; + } + + switch ($Nb) { + case 8: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6], $temp[7]); + case 7: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6]); + case 6: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5]); + case 5: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4]); + default: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3]); + } + } + + /** + * Decrypts a block + * + * @access private + * @param string $in + * @return string + */ + function _decryptBlock($in) + { + static $invtables; + if (empty($invtables)) { + $invtables = &$this->_getInvTables(); + } + $dt0 = $invtables[0]; + $dt1 = $invtables[1]; + $dt2 = $invtables[2]; + $dt3 = $invtables[3]; + $isbox = $invtables[4]; + + $state = array(); + $words = unpack('N*', $in); + + $c = $this->c; + $dw = $this->dw; + $Nb = $this->Nb; + $Nr = $this->Nr; + + // addRoundKey + $wc = $Nb - 1; + foreach ($words as $word) { + $state[] = $word ^ $dw[++$wc]; + } + + $temp = array(); + for ($round = $Nr - 1; $round > 0; --$round) { + $i = 0; // $c[0] == 0 + $j = $Nb - $c[1]; + $k = $Nb - $c[2]; + $l = $Nb - $c[3]; + + while ($i < $Nb) { + $temp[$i] = $dt0[$state[$i] >> 24 & 0x000000FF] ^ + $dt1[$state[$j] >> 16 & 0x000000FF] ^ + $dt2[$state[$k] >> 8 & 0x000000FF] ^ + $dt3[$state[$l] & 0x000000FF] ^ + $dw[++$wc]; + ++$i; + $j = ($j + 1) % $Nb; + $k = ($k + 1) % $Nb; + $l = ($l + 1) % $Nb; + } + $state = $temp; + } + + // invShiftRows + invSubWord + addRoundKey + $i = 0; // $c[0] == 0 + $j = $Nb - $c[1]; + $k = $Nb - $c[2]; + $l = $Nb - $c[3]; + + while ($i < $Nb) { + $word = ($state[$i] & 0xFF000000) | + ($state[$j] & 0x00FF0000) | + ($state[$k] & 0x0000FF00) | + ($state[$l] & 0x000000FF); + + $temp[$i] = $dw[$i] ^ ($isbox[$word & 0x000000FF] | + ($isbox[$word >> 8 & 0x000000FF] << 8) | + ($isbox[$word >> 16 & 0x000000FF] << 16) | + ($isbox[$word >> 24 & 0x000000FF] << 24)); + ++$i; + $j = ($j + 1) % $Nb; + $k = ($k + 1) % $Nb; + $l = ($l + 1) % $Nb; + } + + switch ($Nb) { + case 8: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6], $temp[7]); + case 7: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6]); + case 6: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5]); + case 5: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4]); + default: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3]); + } + } + + /** + * Setup the key (expansion) + * + * @see \phpseclib\Crypt\Base::_setupKey() + * @access private + */ + function _setupKey() + { + // Each number in $rcon is equal to the previous number multiplied by two in Rijndael's finite field. + // See http://en.wikipedia.org/wiki/Finite_field_arithmetic#Multiplicative_inverse + static $rcon = array(0, + 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000, + 0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000, + 0x6C000000, 0xD8000000, 0xAB000000, 0x4D000000, 0x9A000000, + 0x2F000000, 0x5E000000, 0xBC000000, 0x63000000, 0xC6000000, + 0x97000000, 0x35000000, 0x6A000000, 0xD4000000, 0xB3000000, + 0x7D000000, 0xFA000000, 0xEF000000, 0xC5000000, 0x91000000 + ); + + if (isset($this->kl['key']) && $this->key === $this->kl['key'] && $this->key_length === $this->kl['key_length'] && $this->block_size === $this->kl['block_size']) { + // already expanded + return; + } + $this->kl = array('key' => $this->key, 'key_length' => $this->key_length, 'block_size' => $this->block_size); + + $this->Nk = $this->key_length >> 2; + // see Rijndael-ammended.pdf#page=44 + $this->Nr = max($this->Nk, $this->Nb) + 6; + + // shift offsets for Nb = 5, 7 are defined in Rijndael-ammended.pdf#page=44, + // "Table 8: Shift offsets in Shiftrow for the alternative block lengths" + // shift offsets for Nb = 4, 6, 8 are defined in Rijndael-ammended.pdf#page=14, + // "Table 2: Shift offsets for different block lengths" + switch ($this->Nb) { + case 4: + case 5: + case 6: + $this->c = array(0, 1, 2, 3); + break; + case 7: + $this->c = array(0, 1, 2, 4); + break; + case 8: + $this->c = array(0, 1, 3, 4); + } + + $w = array_values(unpack('N*words', $this->key)); + + $length = $this->Nb * ($this->Nr + 1); + for ($i = $this->Nk; $i < $length; $i++) { + $temp = $w[$i - 1]; + if ($i % $this->Nk == 0) { + // according to , "the size of an integer is platform-dependent". + // on a 32-bit machine, it's 32-bits, and on a 64-bit machine, it's 64-bits. on a 32-bit machine, + // 0xFFFFFFFF << 8 == 0xFFFFFF00, but on a 64-bit machine, it equals 0xFFFFFFFF00. as such, doing 'and' + // with 0xFFFFFFFF (or 0xFFFFFF00) on a 32-bit machine is unnecessary, but on a 64-bit machine, it is. + $temp = (($temp << 8) & 0xFFFFFF00) | (($temp >> 24) & 0x000000FF); // rotWord + $temp = $this->_subWord($temp) ^ $rcon[$i / $this->Nk]; + } elseif ($this->Nk > 6 && $i % $this->Nk == 4) { + $temp = $this->_subWord($temp); + } + $w[$i] = $w[$i - $this->Nk] ^ $temp; + } + + // convert the key schedule from a vector of $Nb * ($Nr + 1) length to a matrix with $Nr + 1 rows and $Nb columns + // and generate the inverse key schedule. more specifically, + // according to (section 5.3.3), + // "The key expansion for the Inverse Cipher is defined as follows: + // 1. Apply the Key Expansion. + // 2. Apply InvMixColumn to all Round Keys except the first and the last one." + // also, see fips-197.pdf#page=27, "5.3.5 Equivalent Inverse Cipher" + list($dt0, $dt1, $dt2, $dt3) = $this->_getInvTables(); + $temp = $this->w = $this->dw = array(); + for ($i = $row = $col = 0; $i < $length; $i++, $col++) { + if ($col == $this->Nb) { + if ($row == 0) { + $this->dw[0] = $this->w[0]; + } else { + // subWord + invMixColumn + invSubWord = invMixColumn + $j = 0; + while ($j < $this->Nb) { + $dw = $this->_subWord($this->w[$row][$j]); + $temp[$j] = $dt0[$dw >> 24 & 0x000000FF] ^ + $dt1[$dw >> 16 & 0x000000FF] ^ + $dt2[$dw >> 8 & 0x000000FF] ^ + $dt3[$dw & 0x000000FF]; + $j++; + } + $this->dw[$row] = $temp; + } + + $col = 0; + $row++; + } + $this->w[$row][$col] = $w[$i]; + } + + $this->dw[$row] = $this->w[$row]; + + // Converting to 1-dim key arrays (both ascending) + $this->dw = array_reverse($this->dw); + $w = array_pop($this->w); + $dw = array_pop($this->dw); + foreach ($this->w as $r => $wr) { + foreach ($wr as $c => $wc) { + $w[] = $wc; + $dw[] = $this->dw[$r][$c]; + } + } + $this->w = $w; + $this->dw = $dw; + } + + /** + * Performs S-Box substitutions + * + * @access private + * @param int $word + */ + function _subWord($word) + { + static $sbox; + if (empty($sbox)) { + list(, , , , $sbox) = $this->_getTables(); + } + + return $sbox[$word & 0x000000FF] | + ($sbox[$word >> 8 & 0x000000FF] << 8) | + ($sbox[$word >> 16 & 0x000000FF] << 16) | + ($sbox[$word >> 24 & 0x000000FF] << 24); + } + + /** + * Provides the mixColumns and sboxes tables + * + * @see self::_encryptBlock() + * @see self::_setupInlineCrypt() + * @see self::_subWord() + * @access private + * @return array &$tables + */ + function &_getTables() + { + static $tables; + if (empty($tables)) { + // according to (section 5.2.1), + // precomputed tables can be used in the mixColumns phase. in that example, they're assigned t0...t3, so + // those are the names we'll use. + $t3 = array_map('intval', array( + // with array_map('intval', ...) we ensure we have only int's and not + // some slower floats converted by php automatically on high values + 0x6363A5C6, 0x7C7C84F8, 0x777799EE, 0x7B7B8DF6, 0xF2F20DFF, 0x6B6BBDD6, 0x6F6FB1DE, 0xC5C55491, + 0x30305060, 0x01010302, 0x6767A9CE, 0x2B2B7D56, 0xFEFE19E7, 0xD7D762B5, 0xABABE64D, 0x76769AEC, + 0xCACA458F, 0x82829D1F, 0xC9C94089, 0x7D7D87FA, 0xFAFA15EF, 0x5959EBB2, 0x4747C98E, 0xF0F00BFB, + 0xADADEC41, 0xD4D467B3, 0xA2A2FD5F, 0xAFAFEA45, 0x9C9CBF23, 0xA4A4F753, 0x727296E4, 0xC0C05B9B, + 0xB7B7C275, 0xFDFD1CE1, 0x9393AE3D, 0x26266A4C, 0x36365A6C, 0x3F3F417E, 0xF7F702F5, 0xCCCC4F83, + 0x34345C68, 0xA5A5F451, 0xE5E534D1, 0xF1F108F9, 0x717193E2, 0xD8D873AB, 0x31315362, 0x15153F2A, + 0x04040C08, 0xC7C75295, 0x23236546, 0xC3C35E9D, 0x18182830, 0x9696A137, 0x05050F0A, 0x9A9AB52F, + 0x0707090E, 0x12123624, 0x80809B1B, 0xE2E23DDF, 0xEBEB26CD, 0x2727694E, 0xB2B2CD7F, 0x75759FEA, + 0x09091B12, 0x83839E1D, 0x2C2C7458, 0x1A1A2E34, 0x1B1B2D36, 0x6E6EB2DC, 0x5A5AEEB4, 0xA0A0FB5B, + 0x5252F6A4, 0x3B3B4D76, 0xD6D661B7, 0xB3B3CE7D, 0x29297B52, 0xE3E33EDD, 0x2F2F715E, 0x84849713, + 0x5353F5A6, 0xD1D168B9, 0x00000000, 0xEDED2CC1, 0x20206040, 0xFCFC1FE3, 0xB1B1C879, 0x5B5BEDB6, + 0x6A6ABED4, 0xCBCB468D, 0xBEBED967, 0x39394B72, 0x4A4ADE94, 0x4C4CD498, 0x5858E8B0, 0xCFCF4A85, + 0xD0D06BBB, 0xEFEF2AC5, 0xAAAAE54F, 0xFBFB16ED, 0x4343C586, 0x4D4DD79A, 0x33335566, 0x85859411, + 0x4545CF8A, 0xF9F910E9, 0x02020604, 0x7F7F81FE, 0x5050F0A0, 0x3C3C4478, 0x9F9FBA25, 0xA8A8E34B, + 0x5151F3A2, 0xA3A3FE5D, 0x4040C080, 0x8F8F8A05, 0x9292AD3F, 0x9D9DBC21, 0x38384870, 0xF5F504F1, + 0xBCBCDF63, 0xB6B6C177, 0xDADA75AF, 0x21216342, 0x10103020, 0xFFFF1AE5, 0xF3F30EFD, 0xD2D26DBF, + 0xCDCD4C81, 0x0C0C1418, 0x13133526, 0xECEC2FC3, 0x5F5FE1BE, 0x9797A235, 0x4444CC88, 0x1717392E, + 0xC4C45793, 0xA7A7F255, 0x7E7E82FC, 0x3D3D477A, 0x6464ACC8, 0x5D5DE7BA, 0x19192B32, 0x737395E6, + 0x6060A0C0, 0x81819819, 0x4F4FD19E, 0xDCDC7FA3, 0x22226644, 0x2A2A7E54, 0x9090AB3B, 0x8888830B, + 0x4646CA8C, 0xEEEE29C7, 0xB8B8D36B, 0x14143C28, 0xDEDE79A7, 0x5E5EE2BC, 0x0B0B1D16, 0xDBDB76AD, + 0xE0E03BDB, 0x32325664, 0x3A3A4E74, 0x0A0A1E14, 0x4949DB92, 0x06060A0C, 0x24246C48, 0x5C5CE4B8, + 0xC2C25D9F, 0xD3D36EBD, 0xACACEF43, 0x6262A6C4, 0x9191A839, 0x9595A431, 0xE4E437D3, 0x79798BF2, + 0xE7E732D5, 0xC8C8438B, 0x3737596E, 0x6D6DB7DA, 0x8D8D8C01, 0xD5D564B1, 0x4E4ED29C, 0xA9A9E049, + 0x6C6CB4D8, 0x5656FAAC, 0xF4F407F3, 0xEAEA25CF, 0x6565AFCA, 0x7A7A8EF4, 0xAEAEE947, 0x08081810, + 0xBABAD56F, 0x787888F0, 0x25256F4A, 0x2E2E725C, 0x1C1C2438, 0xA6A6F157, 0xB4B4C773, 0xC6C65197, + 0xE8E823CB, 0xDDDD7CA1, 0x74749CE8, 0x1F1F213E, 0x4B4BDD96, 0xBDBDDC61, 0x8B8B860D, 0x8A8A850F, + 0x707090E0, 0x3E3E427C, 0xB5B5C471, 0x6666AACC, 0x4848D890, 0x03030506, 0xF6F601F7, 0x0E0E121C, + 0x6161A3C2, 0x35355F6A, 0x5757F9AE, 0xB9B9D069, 0x86869117, 0xC1C15899, 0x1D1D273A, 0x9E9EB927, + 0xE1E138D9, 0xF8F813EB, 0x9898B32B, 0x11113322, 0x6969BBD2, 0xD9D970A9, 0x8E8E8907, 0x9494A733, + 0x9B9BB62D, 0x1E1E223C, 0x87879215, 0xE9E920C9, 0xCECE4987, 0x5555FFAA, 0x28287850, 0xDFDF7AA5, + 0x8C8C8F03, 0xA1A1F859, 0x89898009, 0x0D0D171A, 0xBFBFDA65, 0xE6E631D7, 0x4242C684, 0x6868B8D0, + 0x4141C382, 0x9999B029, 0x2D2D775A, 0x0F0F111E, 0xB0B0CB7B, 0x5454FCA8, 0xBBBBD66D, 0x16163A2C + )); + + foreach ($t3 as $t3i) { + $t0[] = (($t3i << 24) & 0xFF000000) | (($t3i >> 8) & 0x00FFFFFF); + $t1[] = (($t3i << 16) & 0xFFFF0000) | (($t3i >> 16) & 0x0000FFFF); + $t2[] = (($t3i << 8) & 0xFFFFFF00) | (($t3i >> 24) & 0x000000FF); + } + + $tables = array( + // The Precomputed mixColumns tables t0 - t3 + $t0, + $t1, + $t2, + $t3, + // The SubByte S-Box + array( + 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, + 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0, + 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15, + 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75, + 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84, + 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF, + 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8, + 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2, + 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73, + 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB, + 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79, + 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08, + 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A, + 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E, + 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF, + 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16 + ) + ); + } + return $tables; + } + + /** + * Provides the inverse mixColumns and inverse sboxes tables + * + * @see self::_decryptBlock() + * @see self::_setupInlineCrypt() + * @see self::_setupKey() + * @access private + * @return array &$tables + */ + function &_getInvTables() + { + static $tables; + if (empty($tables)) { + $dt3 = array_map('intval', array( + 0xF4A75051, 0x4165537E, 0x17A4C31A, 0x275E963A, 0xAB6BCB3B, 0x9D45F11F, 0xFA58ABAC, 0xE303934B, + 0x30FA5520, 0x766DF6AD, 0xCC769188, 0x024C25F5, 0xE5D7FC4F, 0x2ACBD7C5, 0x35448026, 0x62A38FB5, + 0xB15A49DE, 0xBA1B6725, 0xEA0E9845, 0xFEC0E15D, 0x2F7502C3, 0x4CF01281, 0x4697A38D, 0xD3F9C66B, + 0x8F5FE703, 0x929C9515, 0x6D7AEBBF, 0x5259DA95, 0xBE832DD4, 0x7421D358, 0xE0692949, 0xC9C8448E, + 0xC2896A75, 0x8E7978F4, 0x583E6B99, 0xB971DD27, 0xE14FB6BE, 0x88AD17F0, 0x20AC66C9, 0xCE3AB47D, + 0xDF4A1863, 0x1A3182E5, 0x51336097, 0x537F4562, 0x6477E0B1, 0x6BAE84BB, 0x81A01CFE, 0x082B94F9, + 0x48685870, 0x45FD198F, 0xDE6C8794, 0x7BF8B752, 0x73D323AB, 0x4B02E272, 0x1F8F57E3, 0x55AB2A66, + 0xEB2807B2, 0xB5C2032F, 0xC57B9A86, 0x3708A5D3, 0x2887F230, 0xBFA5B223, 0x036ABA02, 0x16825CED, + 0xCF1C2B8A, 0x79B492A7, 0x07F2F0F3, 0x69E2A14E, 0xDAF4CD65, 0x05BED506, 0x34621FD1, 0xA6FE8AC4, + 0x2E539D34, 0xF355A0A2, 0x8AE13205, 0xF6EB75A4, 0x83EC390B, 0x60EFAA40, 0x719F065E, 0x6E1051BD, + 0x218AF93E, 0xDD063D96, 0x3E05AEDD, 0xE6BD464D, 0x548DB591, 0xC45D0571, 0x06D46F04, 0x5015FF60, + 0x98FB2419, 0xBDE997D6, 0x4043CC89, 0xD99E7767, 0xE842BDB0, 0x898B8807, 0x195B38E7, 0xC8EEDB79, + 0x7C0A47A1, 0x420FE97C, 0x841EC9F8, 0x00000000, 0x80868309, 0x2BED4832, 0x1170AC1E, 0x5A724E6C, + 0x0EFFFBFD, 0x8538560F, 0xAED51E3D, 0x2D392736, 0x0FD9640A, 0x5CA62168, 0x5B54D19B, 0x362E3A24, + 0x0A67B10C, 0x57E70F93, 0xEE96D2B4, 0x9B919E1B, 0xC0C54F80, 0xDC20A261, 0x774B695A, 0x121A161C, + 0x93BA0AE2, 0xA02AE5C0, 0x22E0433C, 0x1B171D12, 0x090D0B0E, 0x8BC7ADF2, 0xB6A8B92D, 0x1EA9C814, + 0xF1198557, 0x75074CAF, 0x99DDBBEE, 0x7F60FDA3, 0x01269FF7, 0x72F5BC5C, 0x663BC544, 0xFB7E345B, + 0x4329768B, 0x23C6DCCB, 0xEDFC68B6, 0xE4F163B8, 0x31DCCAD7, 0x63851042, 0x97224013, 0xC6112084, + 0x4A247D85, 0xBB3DF8D2, 0xF93211AE, 0x29A16DC7, 0x9E2F4B1D, 0xB230F3DC, 0x8652EC0D, 0xC1E3D077, + 0xB3166C2B, 0x70B999A9, 0x9448FA11, 0xE9642247, 0xFC8CC4A8, 0xF03F1AA0, 0x7D2CD856, 0x3390EF22, + 0x494EC787, 0x38D1C1D9, 0xCAA2FE8C, 0xD40B3698, 0xF581CFA6, 0x7ADE28A5, 0xB78E26DA, 0xADBFA43F, + 0x3A9DE42C, 0x78920D50, 0x5FCC9B6A, 0x7E466254, 0x8D13C2F6, 0xD8B8E890, 0x39F75E2E, 0xC3AFF582, + 0x5D80BE9F, 0xD0937C69, 0xD52DA96F, 0x2512B3CF, 0xAC993BC8, 0x187DA710, 0x9C636EE8, 0x3BBB7BDB, + 0x267809CD, 0x5918F46E, 0x9AB701EC, 0x4F9AA883, 0x956E65E6, 0xFFE67EAA, 0xBCCF0821, 0x15E8E6EF, + 0xE79BD9BA, 0x6F36CE4A, 0x9F09D4EA, 0xB07CD629, 0xA4B2AF31, 0x3F23312A, 0xA59430C6, 0xA266C035, + 0x4EBC3774, 0x82CAA6FC, 0x90D0B0E0, 0xA7D81533, 0x04984AF1, 0xECDAF741, 0xCD500E7F, 0x91F62F17, + 0x4DD68D76, 0xEFB04D43, 0xAA4D54CC, 0x9604DFE4, 0xD1B5E39E, 0x6A881B4C, 0x2C1FB8C1, 0x65517F46, + 0x5EEA049D, 0x8C355D01, 0x877473FA, 0x0B412EFB, 0x671D5AB3, 0xDBD25292, 0x105633E9, 0xD647136D, + 0xD7618C9A, 0xA10C7A37, 0xF8148E59, 0x133C89EB, 0xA927EECE, 0x61C935B7, 0x1CE5EDE1, 0x47B13C7A, + 0xD2DF599C, 0xF2733F55, 0x14CE7918, 0xC737BF73, 0xF7CDEA53, 0xFDAA5B5F, 0x3D6F14DF, 0x44DB8678, + 0xAFF381CA, 0x68C43EB9, 0x24342C38, 0xA3405FC2, 0x1DC37216, 0xE2250CBC, 0x3C498B28, 0x0D9541FF, + 0xA8017139, 0x0CB3DE08, 0xB4E49CD8, 0x56C19064, 0xCB84617B, 0x32B670D5, 0x6C5C7448, 0xB85742D0 + )); + + foreach ($dt3 as $dt3i) { + $dt0[] = (($dt3i << 24) & 0xFF000000) | (($dt3i >> 8) & 0x00FFFFFF); + $dt1[] = (($dt3i << 16) & 0xFFFF0000) | (($dt3i >> 16) & 0x0000FFFF); + $dt2[] = (($dt3i << 8) & 0xFFFFFF00) | (($dt3i >> 24) & 0x000000FF); + }; + + $tables = array( + // The Precomputed inverse mixColumns tables dt0 - dt3 + $dt0, + $dt1, + $dt2, + $dt3, + // The inverse SubByte S-Box + array( + 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, 0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB, + 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB, + 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E, + 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25, + 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92, + 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84, + 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06, + 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B, + 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73, + 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E, + 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B, + 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4, + 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F, + 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF, + 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D + ) + ); + } + return $tables; + } + + /** + * Setup the performance-optimized function for de/encrypt() + * + * @see \phpseclib\Crypt\Base::_setupInlineCrypt() + * @access private + */ + function _setupInlineCrypt() + { + // Note: _setupInlineCrypt() will be called only if $this->changed === true + // So here we are'nt under the same heavy timing-stress as we are in _de/encryptBlock() or de/encrypt(). + // However...the here generated function- $code, stored as php callback in $this->inline_crypt, must work as fast as even possible. + + $lambda_functions =& self::_getLambdaFunctions(); + + // We create max. 10 hi-optimized code for memory reason. Means: For each $key one ultra fast inline-crypt function. + // (Currently, for Crypt_Rijndael/AES, one generated $lambda_function cost on php5.5@32bit ~80kb unfreeable mem and ~130kb on php5.5@64bit) + // After that, we'll still create very fast optimized code but not the hi-ultimative code, for each $mode one. + $gen_hi_opt_code = (bool)(count($lambda_functions) < 10); + + // Generation of a uniqe hash for our generated code + $code_hash = "Crypt_Rijndael, {$this->mode}, {$this->Nr}, {$this->Nb}"; + if ($gen_hi_opt_code) { + $code_hash = str_pad($code_hash, 32) . $this->_hashInlineCryptFunction($this->key); + } + + if (!isset($lambda_functions[$code_hash])) { + switch (true) { + case $gen_hi_opt_code: + // The hi-optimized $lambda_functions will use the key-words hardcoded for better performance. + $w = $this->w; + $dw = $this->dw; + $init_encrypt = ''; + $init_decrypt = ''; + break; + default: + for ($i = 0, $cw = count($this->w); $i < $cw; ++$i) { + $w[] = '$w[' . $i . ']'; + $dw[] = '$dw[' . $i . ']'; + } + $init_encrypt = '$w = $self->w;'; + $init_decrypt = '$dw = $self->dw;'; + } + + $Nr = $this->Nr; + $Nb = $this->Nb; + $c = $this->c; + + // Generating encrypt code: + $init_encrypt.= ' + static $tables; + if (empty($tables)) { + $tables = &$self->_getTables(); + } + $t0 = $tables[0]; + $t1 = $tables[1]; + $t2 = $tables[2]; + $t3 = $tables[3]; + $sbox = $tables[4]; + '; + + $s = 'e'; + $e = 's'; + $wc = $Nb - 1; + + // Preround: addRoundKey + $encrypt_block = '$in = unpack("N*", $in);'."\n"; + for ($i = 0; $i < $Nb; ++$i) { + $encrypt_block .= '$s'.$i.' = $in['.($i + 1).'] ^ '.$w[++$wc].";\n"; + } + + // Mainrounds: shiftRows + subWord + mixColumns + addRoundKey + for ($round = 1; $round < $Nr; ++$round) { + list($s, $e) = array($e, $s); + for ($i = 0; $i < $Nb; ++$i) { + $encrypt_block.= + '$'.$e.$i.' = + $t0[($'.$s.$i .' >> 24) & 0xff] ^ + $t1[($'.$s.(($i + $c[1]) % $Nb).' >> 16) & 0xff] ^ + $t2[($'.$s.(($i + $c[2]) % $Nb).' >> 8) & 0xff] ^ + $t3[ $'.$s.(($i + $c[3]) % $Nb).' & 0xff] ^ + '.$w[++$wc].";\n"; + } + } + + // Finalround: subWord + shiftRows + addRoundKey + for ($i = 0; $i < $Nb; ++$i) { + $encrypt_block.= + '$'.$e.$i.' = + $sbox[ $'.$e.$i.' & 0xff] | + ($sbox[($'.$e.$i.' >> 8) & 0xff] << 8) | + ($sbox[($'.$e.$i.' >> 16) & 0xff] << 16) | + ($sbox[($'.$e.$i.' >> 24) & 0xff] << 24);'."\n"; + } + $encrypt_block .= '$in = pack("N*"'."\n"; + for ($i = 0; $i < $Nb; ++$i) { + $encrypt_block.= ', + ($'.$e.$i .' & '.((int)0xFF000000).') ^ + ($'.$e.(($i + $c[1]) % $Nb).' & 0x00FF0000 ) ^ + ($'.$e.(($i + $c[2]) % $Nb).' & 0x0000FF00 ) ^ + ($'.$e.(($i + $c[3]) % $Nb).' & 0x000000FF ) ^ + '.$w[$i]."\n"; + } + $encrypt_block .= ');'; + + // Generating decrypt code: + $init_decrypt.= ' + static $invtables; + if (empty($invtables)) { + $invtables = &$self->_getInvTables(); + } + $dt0 = $invtables[0]; + $dt1 = $invtables[1]; + $dt2 = $invtables[2]; + $dt3 = $invtables[3]; + $isbox = $invtables[4]; + '; + + $s = 'e'; + $e = 's'; + $wc = $Nb - 1; + + // Preround: addRoundKey + $decrypt_block = '$in = unpack("N*", $in);'."\n"; + for ($i = 0; $i < $Nb; ++$i) { + $decrypt_block .= '$s'.$i.' = $in['.($i + 1).'] ^ '.$dw[++$wc].';'."\n"; + } + + // Mainrounds: shiftRows + subWord + mixColumns + addRoundKey + for ($round = 1; $round < $Nr; ++$round) { + list($s, $e) = array($e, $s); + for ($i = 0; $i < $Nb; ++$i) { + $decrypt_block.= + '$'.$e.$i.' = + $dt0[($'.$s.$i .' >> 24) & 0xff] ^ + $dt1[($'.$s.(($Nb + $i - $c[1]) % $Nb).' >> 16) & 0xff] ^ + $dt2[($'.$s.(($Nb + $i - $c[2]) % $Nb).' >> 8) & 0xff] ^ + $dt3[ $'.$s.(($Nb + $i - $c[3]) % $Nb).' & 0xff] ^ + '.$dw[++$wc].";\n"; + } + } + + // Finalround: subWord + shiftRows + addRoundKey + for ($i = 0; $i < $Nb; ++$i) { + $decrypt_block.= + '$'.$e.$i.' = + $isbox[ $'.$e.$i.' & 0xff] | + ($isbox[($'.$e.$i.' >> 8) & 0xff] << 8) | + ($isbox[($'.$e.$i.' >> 16) & 0xff] << 16) | + ($isbox[($'.$e.$i.' >> 24) & 0xff] << 24);'."\n"; + } + $decrypt_block .= '$in = pack("N*"'."\n"; + for ($i = 0; $i < $Nb; ++$i) { + $decrypt_block.= ', + ($'.$e.$i. ' & '.((int)0xFF000000).') ^ + ($'.$e.(($Nb + $i - $c[1]) % $Nb).' & 0x00FF0000 ) ^ + ($'.$e.(($Nb + $i - $c[2]) % $Nb).' & 0x0000FF00 ) ^ + ($'.$e.(($Nb + $i - $c[3]) % $Nb).' & 0x000000FF ) ^ + '.$dw[$i]."\n"; + } + $decrypt_block .= ');'; + + $lambda_functions[$code_hash] = $this->_createInlineCryptFunction( + array( + 'init_crypt' => '', + 'init_encrypt' => $init_encrypt, + 'init_decrypt' => $init_decrypt, + 'encrypt_block' => $encrypt_block, + 'decrypt_block' => $decrypt_block + ) + ); + } + $this->inline_crypt = $lambda_functions[$code_hash]; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php b/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php new file mode 100644 index 0000000..e7f6646 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php @@ -0,0 +1,3787 @@ +> and << cannot be used, nor can the modulo operator %, + * which only supports integers. Although this fact will slow this library down, the fact that such a high + * base is being used should more than compensate. + * + * Numbers are stored in {@link http://en.wikipedia.org/wiki/Endianness little endian} format. ie. + * (new \phpseclib\Math\BigInteger(pow(2, 26)))->value = array(0, 1) + * + * Useful resources are as follows: + * + * - {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf Handbook of Applied Cryptography (HAC)} + * - {@link http://math.libtomcrypt.com/files/tommath.pdf Multi-Precision Math (MPM)} + * - Java's BigInteger classes. See /j2se/src/share/classes/java/math in jdk-1_5_0-src-jrl.zip + * + * Here's an example of how to use this library: + * + * add($b); + * + * echo $c->toString(); // outputs 5 + * ?> + * + * + * @category Math + * @package BigInteger + * @author Jim Wigginton + * @copyright 2006 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + */ + +namespace phpseclib\Math; + +use phpseclib\Crypt\Random; + +/** + * Pure-PHP arbitrary precision integer arithmetic library. Supports base-2, base-10, base-16, and base-256 + * numbers. + * + * @package BigInteger + * @author Jim Wigginton + * @access public + */ +class BigInteger +{ + /**#@+ + * Reduction constants + * + * @access private + * @see BigInteger::_reduce() + */ + /** + * @see BigInteger::_montgomery() + * @see BigInteger::_prepMontgomery() + */ + const MONTGOMERY = 0; + /** + * @see BigInteger::_barrett() + */ + const BARRETT = 1; + /** + * @see BigInteger::_mod2() + */ + const POWEROF2 = 2; + /** + * @see BigInteger::_remainder() + */ + const CLASSIC = 3; + /** + * @see BigInteger::__clone() + */ + const NONE = 4; + /**#@-*/ + + /**#@+ + * Array constants + * + * Rather than create a thousands and thousands of new BigInteger objects in repeated function calls to add() and + * multiply() or whatever, we'll just work directly on arrays, taking them in as parameters and returning them. + * + * @access private + */ + /** + * $result[self::VALUE] contains the value. + */ + const VALUE = 0; + /** + * $result[self::SIGN] contains the sign. + */ + const SIGN = 1; + /**#@-*/ + + /**#@+ + * @access private + * @see BigInteger::_montgomery() + * @see BigInteger::_barrett() + */ + /** + * Cache constants + * + * $cache[self::VARIABLE] tells us whether or not the cached data is still valid. + */ + const VARIABLE = 0; + /** + * $cache[self::DATA] contains the cached data. + */ + const DATA = 1; + /**#@-*/ + + /**#@+ + * Mode constants. + * + * @access private + * @see BigInteger::__construct() + */ + /** + * To use the pure-PHP implementation + */ + const MODE_INTERNAL = 1; + /** + * To use the BCMath library + * + * (if enabled; otherwise, the internal implementation will be used) + */ + const MODE_BCMATH = 2; + /** + * To use the GMP library + * + * (if present; otherwise, either the BCMath or the internal implementation will be used) + */ + const MODE_GMP = 3; + /**#@-*/ + + /** + * Karatsuba Cutoff + * + * At what point do we switch between Karatsuba multiplication and schoolbook long multiplication? + * + * @access private + */ + const KARATSUBA_CUTOFF = 25; + + /**#@+ + * Static properties used by the pure-PHP implementation. + * + * @see __construct() + */ + protected static $base; + protected static $baseFull; + protected static $maxDigit; + protected static $msb; + + /** + * $max10 in greatest $max10Len satisfying + * $max10 = 10**$max10Len <= 2**$base. + */ + protected static $max10; + + /** + * $max10Len in greatest $max10Len satisfying + * $max10 = 10**$max10Len <= 2**$base. + */ + protected static $max10Len; + protected static $maxDigit2; + /**#@-*/ + + /** + * Holds the BigInteger's value. + * + * @var array + * @access private + */ + var $value; + + /** + * Holds the BigInteger's magnitude. + * + * @var bool + * @access private + */ + var $is_negative = false; + + /** + * Precision + * + * @see self::setPrecision() + * @access private + */ + var $precision = -1; + + /** + * Precision Bitmask + * + * @see self::setPrecision() + * @access private + */ + var $bitmask = false; + + /** + * Mode independent value used for serialization. + * + * If the bcmath or gmp extensions are installed $this->value will be a non-serializable resource, hence the need for + * a variable that'll be serializable regardless of whether or not extensions are being used. Unlike $this->value, + * however, $this->hex is only calculated when $this->__sleep() is called. + * + * @see self::__sleep() + * @see self::__wakeup() + * @var string + * @access private + */ + var $hex; + + /** + * Converts base-2, base-10, base-16, and binary strings (base-256) to BigIntegers. + * + * If the second parameter - $base - is negative, then it will be assumed that the number's are encoded using + * two's compliment. The sole exception to this is -10, which is treated the same as 10 is. + * + * Here's an example: + * + * toString(); // outputs 50 + * ?> + * + * + * @param $x base-10 number or base-$base number if $base set. + * @param int $base + * @return \phpseclib\Math\BigInteger + * @access public + */ + function __construct($x = 0, $base = 10) + { + if (!defined('MATH_BIGINTEGER_MODE')) { + switch (true) { + case extension_loaded('gmp'): + define('MATH_BIGINTEGER_MODE', self::MODE_GMP); + break; + case extension_loaded('bcmath'): + define('MATH_BIGINTEGER_MODE', self::MODE_BCMATH); + break; + default: + define('MATH_BIGINTEGER_MODE', self::MODE_INTERNAL); + } + } + + if (extension_loaded('openssl') && !defined('MATH_BIGINTEGER_OPENSSL_DISABLE') && !defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) { + // some versions of XAMPP have mismatched versions of OpenSSL which causes it not to work + $versions = array(); + + // avoid generating errors (even with suppression) when phpinfo() is disabled (common in production systems) + if (strpos(ini_get('disable_functions'), 'phpinfo') === false) { + ob_start(); + @phpinfo(); + $content = ob_get_contents(); + ob_end_clean(); + + preg_match_all('#OpenSSL (Header|Library) Version(.*)#im', $content, $matches); + + if (!empty($matches[1])) { + for ($i = 0; $i < count($matches[1]); $i++) { + $fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i]))); + + // Remove letter part in OpenSSL version + if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) { + $versions[$matches[1][$i]] = $fullVersion; + } else { + $versions[$matches[1][$i]] = $m[0]; + } + } + } + } + + // it doesn't appear that OpenSSL versions were reported upon until PHP 5.3+ + switch (true) { + case !isset($versions['Header']): + case !isset($versions['Library']): + case $versions['Header'] == $versions['Library']: + case version_compare($versions['Header'], '1.0.0') >= 0 && version_compare($versions['Library'], '1.0.0') >= 0: + define('MATH_BIGINTEGER_OPENSSL_ENABLED', true); + break; + default: + define('MATH_BIGINTEGER_OPENSSL_DISABLE', true); + } + } + + if (!defined('PHP_INT_SIZE')) { + define('PHP_INT_SIZE', 4); + } + + if (empty(self::$base) && MATH_BIGINTEGER_MODE == self::MODE_INTERNAL) { + switch (PHP_INT_SIZE) { + case 8: // use 64-bit integers if int size is 8 bytes + self::$base = 31; + self::$baseFull = 0x80000000; + self::$maxDigit = 0x7FFFFFFF; + self::$msb = 0x40000000; + self::$max10 = 1000000000; + self::$max10Len = 9; + self::$maxDigit2 = pow(2, 62); + break; + //case 4: // use 64-bit floats if int size is 4 bytes + default: + self::$base = 26; + self::$baseFull = 0x4000000; + self::$maxDigit = 0x3FFFFFF; + self::$msb = 0x2000000; + self::$max10 = 10000000; + self::$max10Len = 7; + self::$maxDigit2 = pow(2, 52); // pow() prevents truncation + } + } + + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + switch (true) { + case is_resource($x) && get_resource_type($x) == 'GMP integer': + // PHP 5.6 switched GMP from using resources to objects + case $x instanceof \GMP: + $this->value = $x; + return; + } + $this->value = gmp_init(0); + break; + case self::MODE_BCMATH: + $this->value = '0'; + break; + default: + $this->value = array(); + } + + // '0' counts as empty() but when the base is 256 '0' is equal to ord('0') or 48 + // '0' is the only value like this per http://php.net/empty + if (empty($x) && (abs($base) != 256 || $x !== '0')) { + return; + } + + switch ($base) { + case -256: + if (ord($x[0]) & 0x80) { + $x = ~$x; + $this->is_negative = true; + } + case 256: + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + $this->value = function_exists('gmp_import') ? + gmp_import($x) : + gmp_init('0x' . bin2hex($x)); + if ($this->is_negative) { + $this->value = gmp_neg($this->value); + } + break; + case self::MODE_BCMATH: + // round $len to the nearest 4 (thanks, DavidMJ!) + $len = (strlen($x) + 3) & 0xFFFFFFFC; + + $x = str_pad($x, $len, chr(0), STR_PAD_LEFT); + + for ($i = 0; $i < $len; $i+= 4) { + $this->value = bcmul($this->value, '4294967296', 0); // 4294967296 == 2**32 + $this->value = bcadd($this->value, 0x1000000 * ord($x[$i]) + ((ord($x[$i + 1]) << 16) | (ord($x[$i + 2]) << 8) | ord($x[$i + 3])), 0); + } + + if ($this->is_negative) { + $this->value = '-' . $this->value; + } + + break; + // converts a base-2**8 (big endian / msb) number to base-2**26 (little endian / lsb) + default: + while (strlen($x)) { + $this->value[] = $this->_bytes2int($this->_base256_rshift($x, self::$base)); + } + } + + if ($this->is_negative) { + if (MATH_BIGINTEGER_MODE != self::MODE_INTERNAL) { + $this->is_negative = false; + } + $temp = $this->add(new static('-1')); + $this->value = $temp->value; + } + break; + case 16: + case -16: + if ($base > 0 && $x[0] == '-') { + $this->is_negative = true; + $x = substr($x, 1); + } + + $x = preg_replace('#^(?:0x)?([A-Fa-f0-9]*).*#', '$1', $x); + + $is_negative = false; + if ($base < 0 && hexdec($x[0]) >= 8) { + $this->is_negative = $is_negative = true; + $x = bin2hex(~pack('H*', $x)); + } + + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + $temp = $this->is_negative ? '-0x' . $x : '0x' . $x; + $this->value = gmp_init($temp); + $this->is_negative = false; + break; + case self::MODE_BCMATH: + $x = (strlen($x) & 1) ? '0' . $x : $x; + $temp = new static(pack('H*', $x), 256); + $this->value = $this->is_negative ? '-' . $temp->value : $temp->value; + $this->is_negative = false; + break; + default: + $x = (strlen($x) & 1) ? '0' . $x : $x; + $temp = new static(pack('H*', $x), 256); + $this->value = $temp->value; + } + + if ($is_negative) { + $temp = $this->add(new static('-1')); + $this->value = $temp->value; + } + break; + case 10: + case -10: + // (?value = gmp_init($x); + break; + case self::MODE_BCMATH: + // explicitly casting $x to a string is necessary, here, since doing $x[0] on -1 yields different + // results then doing it on '-1' does (modInverse does $x[0]) + $this->value = $x === '-' ? '0' : (string) $x; + break; + default: + $temp = new static(); + + $multiplier = new static(); + $multiplier->value = array(self::$max10); + + if ($x[0] == '-') { + $this->is_negative = true; + $x = substr($x, 1); + } + + $x = str_pad($x, strlen($x) + ((self::$max10Len - 1) * strlen($x)) % self::$max10Len, 0, STR_PAD_LEFT); + while (strlen($x)) { + $temp = $temp->multiply($multiplier); + $temp = $temp->add(new static($this->_int2bytes(substr($x, 0, self::$max10Len)), 256)); + $x = substr($x, self::$max10Len); + } + + $this->value = $temp->value; + } + break; + case 2: // base-2 support originally implemented by Lluis Pamies - thanks! + case -2: + if ($base > 0 && $x[0] == '-') { + $this->is_negative = true; + $x = substr($x, 1); + } + + $x = preg_replace('#^([01]*).*#', '$1', $x); + $x = str_pad($x, strlen($x) + (3 * strlen($x)) % 4, 0, STR_PAD_LEFT); + + $str = '0x'; + while (strlen($x)) { + $part = substr($x, 0, 4); + $str.= dechex(bindec($part)); + $x = substr($x, 4); + } + + if ($this->is_negative) { + $str = '-' . $str; + } + + $temp = new static($str, 8 * $base); // ie. either -16 or +16 + $this->value = $temp->value; + $this->is_negative = $temp->is_negative; + + break; + default: + // base not supported, so we'll let $this == 0 + } + } + + /** + * Converts a BigInteger to a byte string (eg. base-256). + * + * Negative numbers are saved as positive numbers, unless $twos_compliment is set to true, at which point, they're + * saved as two's compliment. + * + * Here's an example: + * + * toBytes(); // outputs chr(65) + * ?> + * + * + * @param bool $twos_compliment + * @return string + * @access public + * @internal Converts a base-2**26 number to base-2**8 + */ + function toBytes($twos_compliment = false) + { + if ($twos_compliment) { + $comparison = $this->compare(new static()); + if ($comparison == 0) { + return $this->precision > 0 ? str_repeat(chr(0), ($this->precision + 1) >> 3) : ''; + } + + $temp = $comparison < 0 ? $this->add(new static(1)) : $this->copy(); + $bytes = $temp->toBytes(); + + if (!strlen($bytes)) { // eg. if the number we're trying to convert is -1 + $bytes = chr(0); + } + + if ($this->precision <= 0 && (ord($bytes[0]) & 0x80)) { + $bytes = chr(0) . $bytes; + } + + return $comparison < 0 ? ~$bytes : $bytes; + } + + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + if (gmp_cmp($this->value, gmp_init(0)) == 0) { + return $this->precision > 0 ? str_repeat(chr(0), ($this->precision + 1) >> 3) : ''; + } + + if (function_exists('gmp_export')) { + $temp = gmp_export($this->value); + } else { + $temp = gmp_strval(gmp_abs($this->value), 16); + $temp = (strlen($temp) & 1) ? '0' . $temp : $temp; + $temp = pack('H*', $temp); + } + + return $this->precision > 0 ? + substr(str_pad($temp, $this->precision >> 3, chr(0), STR_PAD_LEFT), -($this->precision >> 3)) : + ltrim($temp, chr(0)); + case self::MODE_BCMATH: + if ($this->value === '0') { + return $this->precision > 0 ? str_repeat(chr(0), ($this->precision + 1) >> 3) : ''; + } + + $value = ''; + $current = $this->value; + + if ($current[0] == '-') { + $current = substr($current, 1); + } + + while (bccomp($current, '0', 0) > 0) { + $temp = bcmod($current, '16777216'); + $value = chr($temp >> 16) . chr($temp >> 8) . chr($temp) . $value; + $current = bcdiv($current, '16777216', 0); + } + + return $this->precision > 0 ? + substr(str_pad($value, $this->precision >> 3, chr(0), STR_PAD_LEFT), -($this->precision >> 3)) : + ltrim($value, chr(0)); + } + + if (!count($this->value)) { + return $this->precision > 0 ? str_repeat(chr(0), ($this->precision + 1) >> 3) : ''; + } + $result = $this->_int2bytes($this->value[count($this->value) - 1]); + + $temp = $this->copy(); + + for ($i = count($temp->value) - 2; $i >= 0; --$i) { + $temp->_base256_lshift($result, self::$base); + $result = $result | str_pad($temp->_int2bytes($temp->value[$i]), strlen($result), chr(0), STR_PAD_LEFT); + } + + return $this->precision > 0 ? + str_pad(substr($result, -(($this->precision + 7) >> 3)), ($this->precision + 7) >> 3, chr(0), STR_PAD_LEFT) : + $result; + } + + /** + * Converts a BigInteger to a hex string (eg. base-16)). + * + * Negative numbers are saved as positive numbers, unless $twos_compliment is set to true, at which point, they're + * saved as two's compliment. + * + * Here's an example: + * + * toHex(); // outputs '41' + * ?> + * + * + * @param bool $twos_compliment + * @return string + * @access public + * @internal Converts a base-2**26 number to base-2**8 + */ + function toHex($twos_compliment = false) + { + return bin2hex($this->toBytes($twos_compliment)); + } + + /** + * Converts a BigInteger to a bit string (eg. base-2). + * + * Negative numbers are saved as positive numbers, unless $twos_compliment is set to true, at which point, they're + * saved as two's compliment. + * + * Here's an example: + * + * toBits(); // outputs '1000001' + * ?> + * + * + * @param bool $twos_compliment + * @return string + * @access public + * @internal Converts a base-2**26 number to base-2**2 + */ + function toBits($twos_compliment = false) + { + $hex = $this->toHex($twos_compliment); + $bits = ''; + for ($i = strlen($hex) - 8, $start = strlen($hex) & 7; $i >= $start; $i-=8) { + $bits = str_pad(decbin(hexdec(substr($hex, $i, 8))), 32, '0', STR_PAD_LEFT) . $bits; + } + if ($start) { // hexdec('') == 0 + $bits = str_pad(decbin(hexdec(substr($hex, 0, $start))), 8, '0', STR_PAD_LEFT) . $bits; + } + $result = $this->precision > 0 ? substr($bits, -$this->precision) : ltrim($bits, '0'); + + if ($twos_compliment && $this->compare(new static()) > 0 && $this->precision <= 0) { + return '0' . $result; + } + + return $result; + } + + /** + * Converts a BigInteger to a base-10 number. + * + * Here's an example: + * + * toString(); // outputs 50 + * ?> + * + * + * @return string + * @access public + * @internal Converts a base-2**26 number to base-10**7 (which is pretty much base-10) + */ + function toString() + { + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + return gmp_strval($this->value); + case self::MODE_BCMATH: + if ($this->value === '0') { + return '0'; + } + + return ltrim($this->value, '0'); + } + + if (!count($this->value)) { + return '0'; + } + + $temp = $this->copy(); + $temp->bitmask = false; + $temp->is_negative = false; + + $divisor = new static(); + $divisor->value = array(self::$max10); + $result = ''; + while (count($temp->value)) { + list($temp, $mod) = $temp->divide($divisor); + $result = str_pad(isset($mod->value[0]) ? $mod->value[0] : '', self::$max10Len, '0', STR_PAD_LEFT) . $result; + } + $result = ltrim($result, '0'); + if (empty($result)) { + $result = '0'; + } + + if ($this->is_negative) { + $result = '-' . $result; + } + + return $result; + } + + /** + * Copy an object + * + * PHP5 passes objects by reference while PHP4 passes by value. As such, we need a function to guarantee + * that all objects are passed by value, when appropriate. More information can be found here: + * + * {@link http://php.net/language.oop5.basic#51624} + * + * @access public + * @see self::__clone() + * @return \phpseclib\Math\BigInteger + */ + function copy() + { + $temp = new static(); + $temp->value = $this->value; + $temp->is_negative = $this->is_negative; + $temp->precision = $this->precision; + $temp->bitmask = $this->bitmask; + return $temp; + } + + /** + * __toString() magic method + * + * Will be called, automatically, if you're supporting just PHP5. If you're supporting PHP4, you'll need to call + * toString(). + * + * @access public + * @internal Implemented per a suggestion by Techie-Michael - thanks! + */ + function __toString() + { + return $this->toString(); + } + + /** + * __clone() magic method + * + * Although you can call BigInteger::__toString() directly in PHP5, you cannot call BigInteger::__clone() directly + * in PHP5. You can in PHP4 since it's not a magic method, but in PHP5, you have to call it by using the PHP5 + * only syntax of $y = clone $x. As such, if you're trying to write an application that works on both PHP4 and + * PHP5, call BigInteger::copy(), instead. + * + * @access public + * @see self::copy() + * @return \phpseclib\Math\BigInteger + */ + function __clone() + { + return $this->copy(); + } + + /** + * __sleep() magic method + * + * Will be called, automatically, when serialize() is called on a BigInteger object. + * + * @see self::__wakeup() + * @access public + */ + function __sleep() + { + $this->hex = $this->toHex(true); + $vars = array('hex'); + if ($this->precision > 0) { + $vars[] = 'precision'; + } + return $vars; + } + + /** + * __wakeup() magic method + * + * Will be called, automatically, when unserialize() is called on a BigInteger object. + * + * @see self::__sleep() + * @access public + */ + function __wakeup() + { + $temp = new static($this->hex, -16); + $this->value = $temp->value; + $this->is_negative = $temp->is_negative; + if ($this->precision > 0) { + // recalculate $this->bitmask + $this->setPrecision($this->precision); + } + } + + /** + * __debugInfo() magic method + * + * Will be called, automatically, when print_r() or var_dump() are called + * + * @access public + */ + function __debugInfo() + { + $opts = array(); + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + $engine = 'gmp'; + break; + case self::MODE_BCMATH: + $engine = 'bcmath'; + break; + case self::MODE_INTERNAL: + $engine = 'internal'; + $opts[] = PHP_INT_SIZE == 8 ? '64-bit' : '32-bit'; + } + if (MATH_BIGINTEGER_MODE != self::MODE_GMP && defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) { + $opts[] = 'OpenSSL'; + } + if (!empty($opts)) { + $engine.= ' (' . implode('.', $opts) . ')'; + } + return array( + 'value' => '0x' . $this->toHex(true), + 'engine' => $engine + ); + } + + /** + * Adds two BigIntegers. + * + * Here's an example: + * + * add($b); + * + * echo $c->toString(); // outputs 30 + * ?> + * + * + * @param \phpseclib\Math\BigInteger $y + * @return \phpseclib\Math\BigInteger + * @access public + * @internal Performs base-2**52 addition + */ + function add($y) + { + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + $temp = new static(); + $temp->value = gmp_add($this->value, $y->value); + + return $this->_normalize($temp); + case self::MODE_BCMATH: + $temp = new static(); + $temp->value = bcadd($this->value, $y->value, 0); + + return $this->_normalize($temp); + } + + $temp = $this->_add($this->value, $this->is_negative, $y->value, $y->is_negative); + + $result = new static(); + $result->value = $temp[self::VALUE]; + $result->is_negative = $temp[self::SIGN]; + + return $this->_normalize($result); + } + + /** + * Performs addition. + * + * @param array $x_value + * @param bool $x_negative + * @param array $y_value + * @param bool $y_negative + * @return array + * @access private + */ + function _add($x_value, $x_negative, $y_value, $y_negative) + { + $x_size = count($x_value); + $y_size = count($y_value); + + if ($x_size == 0) { + return array( + self::VALUE => $y_value, + self::SIGN => $y_negative + ); + } elseif ($y_size == 0) { + return array( + self::VALUE => $x_value, + self::SIGN => $x_negative + ); + } + + // subtract, if appropriate + if ($x_negative != $y_negative) { + if ($x_value == $y_value) { + return array( + self::VALUE => array(), + self::SIGN => false + ); + } + + $temp = $this->_subtract($x_value, false, $y_value, false); + $temp[self::SIGN] = $this->_compare($x_value, false, $y_value, false) > 0 ? + $x_negative : $y_negative; + + return $temp; + } + + if ($x_size < $y_size) { + $size = $x_size; + $value = $y_value; + } else { + $size = $y_size; + $value = $x_value; + } + + $value[count($value)] = 0; // just in case the carry adds an extra digit + + $carry = 0; + for ($i = 0, $j = 1; $j < $size; $i+=2, $j+=2) { + $sum = $x_value[$j] * self::$baseFull + $x_value[$i] + $y_value[$j] * self::$baseFull + $y_value[$i] + $carry; + $carry = $sum >= self::$maxDigit2; // eg. floor($sum / 2**52); only possible values (in any base) are 0 and 1 + $sum = $carry ? $sum - self::$maxDigit2 : $sum; + + $temp = self::$base === 26 ? intval($sum / 0x4000000) : ($sum >> 31); + + $value[$i] = (int) ($sum - self::$baseFull * $temp); // eg. a faster alternative to fmod($sum, 0x4000000) + $value[$j] = $temp; + } + + if ($j == $size) { // ie. if $y_size is odd + $sum = $x_value[$i] + $y_value[$i] + $carry; + $carry = $sum >= self::$baseFull; + $value[$i] = $carry ? $sum - self::$baseFull : $sum; + ++$i; // ie. let $i = $j since we've just done $value[$i] + } + + if ($carry) { + for (; $value[$i] == self::$maxDigit; ++$i) { + $value[$i] = 0; + } + ++$value[$i]; + } + + return array( + self::VALUE => $this->_trim($value), + self::SIGN => $x_negative + ); + } + + /** + * Subtracts two BigIntegers. + * + * Here's an example: + * + * subtract($b); + * + * echo $c->toString(); // outputs -10 + * ?> + * + * + * @param \phpseclib\Math\BigInteger $y + * @return \phpseclib\Math\BigInteger + * @access public + * @internal Performs base-2**52 subtraction + */ + function subtract($y) + { + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + $temp = new static(); + $temp->value = gmp_sub($this->value, $y->value); + + return $this->_normalize($temp); + case self::MODE_BCMATH: + $temp = new static(); + $temp->value = bcsub($this->value, $y->value, 0); + + return $this->_normalize($temp); + } + + $temp = $this->_subtract($this->value, $this->is_negative, $y->value, $y->is_negative); + + $result = new static(); + $result->value = $temp[self::VALUE]; + $result->is_negative = $temp[self::SIGN]; + + return $this->_normalize($result); + } + + /** + * Performs subtraction. + * + * @param array $x_value + * @param bool $x_negative + * @param array $y_value + * @param bool $y_negative + * @return array + * @access private + */ + function _subtract($x_value, $x_negative, $y_value, $y_negative) + { + $x_size = count($x_value); + $y_size = count($y_value); + + if ($x_size == 0) { + return array( + self::VALUE => $y_value, + self::SIGN => !$y_negative + ); + } elseif ($y_size == 0) { + return array( + self::VALUE => $x_value, + self::SIGN => $x_negative + ); + } + + // add, if appropriate (ie. -$x - +$y or +$x - -$y) + if ($x_negative != $y_negative) { + $temp = $this->_add($x_value, false, $y_value, false); + $temp[self::SIGN] = $x_negative; + + return $temp; + } + + $diff = $this->_compare($x_value, $x_negative, $y_value, $y_negative); + + if (!$diff) { + return array( + self::VALUE => array(), + self::SIGN => false + ); + } + + // switch $x and $y around, if appropriate. + if ((!$x_negative && $diff < 0) || ($x_negative && $diff > 0)) { + $temp = $x_value; + $x_value = $y_value; + $y_value = $temp; + + $x_negative = !$x_negative; + + $x_size = count($x_value); + $y_size = count($y_value); + } + + // at this point, $x_value should be at least as big as - if not bigger than - $y_value + + $carry = 0; + for ($i = 0, $j = 1; $j < $y_size; $i+=2, $j+=2) { + $sum = $x_value[$j] * self::$baseFull + $x_value[$i] - $y_value[$j] * self::$baseFull - $y_value[$i] - $carry; + $carry = $sum < 0; // eg. floor($sum / 2**52); only possible values (in any base) are 0 and 1 + $sum = $carry ? $sum + self::$maxDigit2 : $sum; + + $temp = self::$base === 26 ? intval($sum / 0x4000000) : ($sum >> 31); + + $x_value[$i] = (int) ($sum - self::$baseFull * $temp); + $x_value[$j] = $temp; + } + + if ($j == $y_size) { // ie. if $y_size is odd + $sum = $x_value[$i] - $y_value[$i] - $carry; + $carry = $sum < 0; + $x_value[$i] = $carry ? $sum + self::$baseFull : $sum; + ++$i; + } + + if ($carry) { + for (; !$x_value[$i]; ++$i) { + $x_value[$i] = self::$maxDigit; + } + --$x_value[$i]; + } + + return array( + self::VALUE => $this->_trim($x_value), + self::SIGN => $x_negative + ); + } + + /** + * Multiplies two BigIntegers + * + * Here's an example: + * + * multiply($b); + * + * echo $c->toString(); // outputs 200 + * ?> + * + * + * @param \phpseclib\Math\BigInteger $x + * @return \phpseclib\Math\BigInteger + * @access public + */ + function multiply($x) + { + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + $temp = new static(); + $temp->value = gmp_mul($this->value, $x->value); + + return $this->_normalize($temp); + case self::MODE_BCMATH: + $temp = new static(); + $temp->value = bcmul($this->value, $x->value, 0); + + return $this->_normalize($temp); + } + + $temp = $this->_multiply($this->value, $this->is_negative, $x->value, $x->is_negative); + + $product = new static(); + $product->value = $temp[self::VALUE]; + $product->is_negative = $temp[self::SIGN]; + + return $this->_normalize($product); + } + + /** + * Performs multiplication. + * + * @param array $x_value + * @param bool $x_negative + * @param array $y_value + * @param bool $y_negative + * @return array + * @access private + */ + function _multiply($x_value, $x_negative, $y_value, $y_negative) + { + //if ( $x_value == $y_value ) { + // return array( + // self::VALUE => $this->_square($x_value), + // self::SIGN => $x_sign != $y_value + // ); + //} + + $x_length = count($x_value); + $y_length = count($y_value); + + if (!$x_length || !$y_length) { // a 0 is being multiplied + return array( + self::VALUE => array(), + self::SIGN => false + ); + } + + return array( + self::VALUE => min($x_length, $y_length) < 2 * self::KARATSUBA_CUTOFF ? + $this->_trim($this->_regularMultiply($x_value, $y_value)) : + $this->_trim($this->_karatsuba($x_value, $y_value)), + self::SIGN => $x_negative != $y_negative + ); + } + + /** + * Performs long multiplication on two BigIntegers + * + * Modeled after 'multiply' in MutableBigInteger.java. + * + * @param array $x_value + * @param array $y_value + * @return array + * @access private + */ + function _regularMultiply($x_value, $y_value) + { + $x_length = count($x_value); + $y_length = count($y_value); + + if (!$x_length || !$y_length) { // a 0 is being multiplied + return array(); + } + + if ($x_length < $y_length) { + $temp = $x_value; + $x_value = $y_value; + $y_value = $temp; + + $x_length = count($x_value); + $y_length = count($y_value); + } + + $product_value = $this->_array_repeat(0, $x_length + $y_length); + + // the following for loop could be removed if the for loop following it + // (the one with nested for loops) initially set $i to 0, but + // doing so would also make the result in one set of unnecessary adds, + // since on the outermost loops first pass, $product->value[$k] is going + // to always be 0 + + $carry = 0; + + for ($j = 0; $j < $x_length; ++$j) { // ie. $i = 0 + $temp = $x_value[$j] * $y_value[0] + $carry; // $product_value[$k] == 0 + $carry = self::$base === 26 ? intval($temp / 0x4000000) : ($temp >> 31); + $product_value[$j] = (int) ($temp - self::$baseFull * $carry); + } + + $product_value[$j] = $carry; + + // the above for loop is what the previous comment was talking about. the + // following for loop is the "one with nested for loops" + for ($i = 1; $i < $y_length; ++$i) { + $carry = 0; + + for ($j = 0, $k = $i; $j < $x_length; ++$j, ++$k) { + $temp = $product_value[$k] + $x_value[$j] * $y_value[$i] + $carry; + $carry = self::$base === 26 ? intval($temp / 0x4000000) : ($temp >> 31); + $product_value[$k] = (int) ($temp - self::$baseFull * $carry); + } + + $product_value[$k] = $carry; + } + + return $product_value; + } + + /** + * Performs Karatsuba multiplication on two BigIntegers + * + * See {@link http://en.wikipedia.org/wiki/Karatsuba_algorithm Karatsuba algorithm} and + * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=120 MPM 5.2.3}. + * + * @param array $x_value + * @param array $y_value + * @return array + * @access private + */ + function _karatsuba($x_value, $y_value) + { + $m = min(count($x_value) >> 1, count($y_value) >> 1); + + if ($m < self::KARATSUBA_CUTOFF) { + return $this->_regularMultiply($x_value, $y_value); + } + + $x1 = array_slice($x_value, $m); + $x0 = array_slice($x_value, 0, $m); + $y1 = array_slice($y_value, $m); + $y0 = array_slice($y_value, 0, $m); + + $z2 = $this->_karatsuba($x1, $y1); + $z0 = $this->_karatsuba($x0, $y0); + + $z1 = $this->_add($x1, false, $x0, false); + $temp = $this->_add($y1, false, $y0, false); + $z1 = $this->_karatsuba($z1[self::VALUE], $temp[self::VALUE]); + $temp = $this->_add($z2, false, $z0, false); + $z1 = $this->_subtract($z1, false, $temp[self::VALUE], false); + + $z2 = array_merge(array_fill(0, 2 * $m, 0), $z2); + $z1[self::VALUE] = array_merge(array_fill(0, $m, 0), $z1[self::VALUE]); + + $xy = $this->_add($z2, false, $z1[self::VALUE], $z1[self::SIGN]); + $xy = $this->_add($xy[self::VALUE], $xy[self::SIGN], $z0, false); + + return $xy[self::VALUE]; + } + + /** + * Performs squaring + * + * @param array $x + * @return array + * @access private + */ + function _square($x = false) + { + return count($x) < 2 * self::KARATSUBA_CUTOFF ? + $this->_trim($this->_baseSquare($x)) : + $this->_trim($this->_karatsubaSquare($x)); + } + + /** + * Performs traditional squaring on two BigIntegers + * + * Squaring can be done faster than multiplying a number by itself can be. See + * {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=7 HAC 14.2.4} / + * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=141 MPM 5.3} for more information. + * + * @param array $value + * @return array + * @access private + */ + function _baseSquare($value) + { + if (empty($value)) { + return array(); + } + $square_value = $this->_array_repeat(0, 2 * count($value)); + + for ($i = 0, $max_index = count($value) - 1; $i <= $max_index; ++$i) { + $i2 = $i << 1; + + $temp = $square_value[$i2] + $value[$i] * $value[$i]; + $carry = self::$base === 26 ? intval($temp / 0x4000000) : ($temp >> 31); + $square_value[$i2] = (int) ($temp - self::$baseFull * $carry); + + // note how we start from $i+1 instead of 0 as we do in multiplication. + for ($j = $i + 1, $k = $i2 + 1; $j <= $max_index; ++$j, ++$k) { + $temp = $square_value[$k] + 2 * $value[$j] * $value[$i] + $carry; + $carry = self::$base === 26 ? intval($temp / 0x4000000) : ($temp >> 31); + $square_value[$k] = (int) ($temp - self::$baseFull * $carry); + } + + // the following line can yield values larger 2**15. at this point, PHP should switch + // over to floats. + $square_value[$i + $max_index + 1] = $carry; + } + + return $square_value; + } + + /** + * Performs Karatsuba "squaring" on two BigIntegers + * + * See {@link http://en.wikipedia.org/wiki/Karatsuba_algorithm Karatsuba algorithm} and + * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=151 MPM 5.3.4}. + * + * @param array $value + * @return array + * @access private + */ + function _karatsubaSquare($value) + { + $m = count($value) >> 1; + + if ($m < self::KARATSUBA_CUTOFF) { + return $this->_baseSquare($value); + } + + $x1 = array_slice($value, $m); + $x0 = array_slice($value, 0, $m); + + $z2 = $this->_karatsubaSquare($x1); + $z0 = $this->_karatsubaSquare($x0); + + $z1 = $this->_add($x1, false, $x0, false); + $z1 = $this->_karatsubaSquare($z1[self::VALUE]); + $temp = $this->_add($z2, false, $z0, false); + $z1 = $this->_subtract($z1, false, $temp[self::VALUE], false); + + $z2 = array_merge(array_fill(0, 2 * $m, 0), $z2); + $z1[self::VALUE] = array_merge(array_fill(0, $m, 0), $z1[self::VALUE]); + + $xx = $this->_add($z2, false, $z1[self::VALUE], $z1[self::SIGN]); + $xx = $this->_add($xx[self::VALUE], $xx[self::SIGN], $z0, false); + + return $xx[self::VALUE]; + } + + /** + * Divides two BigIntegers. + * + * Returns an array whose first element contains the quotient and whose second element contains the + * "common residue". If the remainder would be positive, the "common residue" and the remainder are the + * same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder + * and the divisor (basically, the "common residue" is the first positive modulo). + * + * Here's an example: + * + * divide($b); + * + * echo $quotient->toString(); // outputs 0 + * echo "\r\n"; + * echo $remainder->toString(); // outputs 10 + * ?> + * + * + * @param \phpseclib\Math\BigInteger $y + * @return array + * @access public + * @internal This function is based off of {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=9 HAC 14.20}. + */ + function divide($y) + { + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + $quotient = new static(); + $remainder = new static(); + + list($quotient->value, $remainder->value) = gmp_div_qr($this->value, $y->value); + + if (gmp_sign($remainder->value) < 0) { + $remainder->value = gmp_add($remainder->value, gmp_abs($y->value)); + } + + return array($this->_normalize($quotient), $this->_normalize($remainder)); + case self::MODE_BCMATH: + $quotient = new static(); + $remainder = new static(); + + $quotient->value = bcdiv($this->value, $y->value, 0); + $remainder->value = bcmod($this->value, $y->value); + + if ($remainder->value[0] == '-') { + $remainder->value = bcadd($remainder->value, $y->value[0] == '-' ? substr($y->value, 1) : $y->value, 0); + } + + return array($this->_normalize($quotient), $this->_normalize($remainder)); + } + + if (count($y->value) == 1) { + list($q, $r) = $this->_divide_digit($this->value, $y->value[0]); + $quotient = new static(); + $remainder = new static(); + $quotient->value = $q; + $remainder->value = array($r); + $quotient->is_negative = $this->is_negative != $y->is_negative; + return array($this->_normalize($quotient), $this->_normalize($remainder)); + } + + static $zero; + if (!isset($zero)) { + $zero = new static(); + } + + $x = $this->copy(); + $y = $y->copy(); + + $x_sign = $x->is_negative; + $y_sign = $y->is_negative; + + $x->is_negative = $y->is_negative = false; + + $diff = $x->compare($y); + + if (!$diff) { + $temp = new static(); + $temp->value = array(1); + $temp->is_negative = $x_sign != $y_sign; + return array($this->_normalize($temp), $this->_normalize(new static())); + } + + if ($diff < 0) { + // if $x is negative, "add" $y. + if ($x_sign) { + $x = $y->subtract($x); + } + return array($this->_normalize(new static()), $this->_normalize($x)); + } + + // normalize $x and $y as described in HAC 14.23 / 14.24 + $msb = $y->value[count($y->value) - 1]; + for ($shift = 0; !($msb & self::$msb); ++$shift) { + $msb <<= 1; + } + $x->_lshift($shift); + $y->_lshift($shift); + $y_value = &$y->value; + + $x_max = count($x->value) - 1; + $y_max = count($y->value) - 1; + + $quotient = new static(); + $quotient_value = &$quotient->value; + $quotient_value = $this->_array_repeat(0, $x_max - $y_max + 1); + + static $temp, $lhs, $rhs; + if (!isset($temp)) { + $temp = new static(); + $lhs = new static(); + $rhs = new static(); + } + $temp_value = &$temp->value; + $rhs_value = &$rhs->value; + + // $temp = $y << ($x_max - $y_max-1) in base 2**26 + $temp_value = array_merge($this->_array_repeat(0, $x_max - $y_max), $y_value); + + while ($x->compare($temp) >= 0) { + // calculate the "common residue" + ++$quotient_value[$x_max - $y_max]; + $x = $x->subtract($temp); + $x_max = count($x->value) - 1; + } + + for ($i = $x_max; $i >= $y_max + 1; --$i) { + $x_value = &$x->value; + $x_window = array( + isset($x_value[$i]) ? $x_value[$i] : 0, + isset($x_value[$i - 1]) ? $x_value[$i - 1] : 0, + isset($x_value[$i - 2]) ? $x_value[$i - 2] : 0 + ); + $y_window = array( + $y_value[$y_max], + ($y_max > 0) ? $y_value[$y_max - 1] : 0 + ); + + $q_index = $i - $y_max - 1; + if ($x_window[0] == $y_window[0]) { + $quotient_value[$q_index] = self::$maxDigit; + } else { + $quotient_value[$q_index] = $this->_safe_divide( + $x_window[0] * self::$baseFull + $x_window[1], + $y_window[0] + ); + } + + $temp_value = array($y_window[1], $y_window[0]); + + $lhs->value = array($quotient_value[$q_index]); + $lhs = $lhs->multiply($temp); + + $rhs_value = array($x_window[2], $x_window[1], $x_window[0]); + + while ($lhs->compare($rhs) > 0) { + --$quotient_value[$q_index]; + + $lhs->value = array($quotient_value[$q_index]); + $lhs = $lhs->multiply($temp); + } + + $adjust = $this->_array_repeat(0, $q_index); + $temp_value = array($quotient_value[$q_index]); + $temp = $temp->multiply($y); + $temp_value = &$temp->value; + if (count($temp_value)) { + $temp_value = array_merge($adjust, $temp_value); + } + + $x = $x->subtract($temp); + + if ($x->compare($zero) < 0) { + $temp_value = array_merge($adjust, $y_value); + $x = $x->add($temp); + + --$quotient_value[$q_index]; + } + + $x_max = count($x_value) - 1; + } + + // unnormalize the remainder + $x->_rshift($shift); + + $quotient->is_negative = $x_sign != $y_sign; + + // calculate the "common residue", if appropriate + if ($x_sign) { + $y->_rshift($shift); + $x = $y->subtract($x); + } + + return array($this->_normalize($quotient), $this->_normalize($x)); + } + + /** + * Divides a BigInteger by a regular integer + * + * abc / x = a00 / x + b0 / x + c / x + * + * @param array $dividend + * @param array $divisor + * @return array + * @access private + */ + function _divide_digit($dividend, $divisor) + { + $carry = 0; + $result = array(); + + for ($i = count($dividend) - 1; $i >= 0; --$i) { + $temp = self::$baseFull * $carry + $dividend[$i]; + $result[$i] = $this->_safe_divide($temp, $divisor); + $carry = (int) ($temp - $divisor * $result[$i]); + } + + return array($result, $carry); + } + + /** + * Performs modular exponentiation. + * + * Here's an example: + * + * modPow($b, $c); + * + * echo $c->toString(); // outputs 10 + * ?> + * + * + * @param \phpseclib\Math\BigInteger $e + * @param \phpseclib\Math\BigInteger $n + * @return \phpseclib\Math\BigInteger + * @access public + * @internal The most naive approach to modular exponentiation has very unreasonable requirements, and + * and although the approach involving repeated squaring does vastly better, it, too, is impractical + * for our purposes. The reason being that division - by far the most complicated and time-consuming + * of the basic operations (eg. +,-,*,/) - occurs multiple times within it. + * + * Modular reductions resolve this issue. Although an individual modular reduction takes more time + * then an individual division, when performed in succession (with the same modulo), they're a lot faster. + * + * The two most commonly used modular reductions are Barrett and Montgomery reduction. Montgomery reduction, + * although faster, only works when the gcd of the modulo and of the base being used is 1. In RSA, when the + * base is a power of two, the modulo - a product of two primes - is always going to have a gcd of 1 (because + * the product of two odd numbers is odd), but what about when RSA isn't used? + * + * In contrast, Barrett reduction has no such constraint. As such, some bigint implementations perform a + * Barrett reduction after every operation in the modpow function. Others perform Barrett reductions when the + * modulo is even and Montgomery reductions when the modulo is odd. BigInteger.java's modPow method, however, + * uses a trick involving the Chinese Remainder Theorem to factor the even modulo into two numbers - one odd and + * the other, a power of two - and recombine them, later. This is the method that this modPow function uses. + * {@link http://islab.oregonstate.edu/papers/j34monex.pdf Montgomery Reduction with Even Modulus} elaborates. + */ + function modPow($e, $n) + { + $n = $this->bitmask !== false && $this->bitmask->compare($n) < 0 ? $this->bitmask : $n->abs(); + + if ($e->compare(new static()) < 0) { + $e = $e->abs(); + + $temp = $this->modInverse($n); + if ($temp === false) { + return false; + } + + return $this->_normalize($temp->modPow($e, $n)); + } + + if (MATH_BIGINTEGER_MODE == self::MODE_GMP) { + $temp = new static(); + $temp->value = gmp_powm($this->value, $e->value, $n->value); + + return $this->_normalize($temp); + } + + if ($this->compare(new static()) < 0 || $this->compare($n) > 0) { + list(, $temp) = $this->divide($n); + return $temp->modPow($e, $n); + } + + if (defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) { + $components = array( + 'modulus' => $n->toBytes(true), + 'publicExponent' => $e->toBytes(true) + ); + + $components = array( + 'modulus' => pack('Ca*a*', 2, $this->_encodeASN1Length(strlen($components['modulus'])), $components['modulus']), + 'publicExponent' => pack('Ca*a*', 2, $this->_encodeASN1Length(strlen($components['publicExponent'])), $components['publicExponent']) + ); + + $RSAPublicKey = pack( + 'Ca*a*a*', + 48, + $this->_encodeASN1Length(strlen($components['modulus']) + strlen($components['publicExponent'])), + $components['modulus'], + $components['publicExponent'] + ); + + $rsaOID = pack('H*', '300d06092a864886f70d0101010500'); // hex version of MA0GCSqGSIb3DQEBAQUA + $RSAPublicKey = chr(0) . $RSAPublicKey; + $RSAPublicKey = chr(3) . $this->_encodeASN1Length(strlen($RSAPublicKey)) . $RSAPublicKey; + + $encapsulated = pack( + 'Ca*a*', + 48, + $this->_encodeASN1Length(strlen($rsaOID . $RSAPublicKey)), + $rsaOID . $RSAPublicKey + ); + + $RSAPublicKey = "-----BEGIN PUBLIC KEY-----\r\n" . + chunk_split(base64_encode($encapsulated)) . + '-----END PUBLIC KEY-----'; + + $plaintext = str_pad($this->toBytes(), strlen($n->toBytes(true)) - 1, "\0", STR_PAD_LEFT); + + if (openssl_public_encrypt($plaintext, $result, $RSAPublicKey, OPENSSL_NO_PADDING)) { + return new static($result, 256); + } + } + + if (MATH_BIGINTEGER_MODE == self::MODE_BCMATH) { + $temp = new static(); + $temp->value = bcpowmod($this->value, $e->value, $n->value, 0); + + return $this->_normalize($temp); + } + + if (empty($e->value)) { + $temp = new static(); + $temp->value = array(1); + return $this->_normalize($temp); + } + + if ($e->value == array(1)) { + list(, $temp) = $this->divide($n); + return $this->_normalize($temp); + } + + if ($e->value == array(2)) { + $temp = new static(); + $temp->value = $this->_square($this->value); + list(, $temp) = $temp->divide($n); + return $this->_normalize($temp); + } + + return $this->_normalize($this->_slidingWindow($e, $n, self::BARRETT)); + + // the following code, although not callable, can be run independently of the above code + // although the above code performed better in my benchmarks the following could might + // perform better under different circumstances. in lieu of deleting it it's just been + // made uncallable + + // is the modulo odd? + if ($n->value[0] & 1) { + return $this->_normalize($this->_slidingWindow($e, $n, self::MONTGOMERY)); + } + // if it's not, it's even + + // find the lowest set bit (eg. the max pow of 2 that divides $n) + for ($i = 0; $i < count($n->value); ++$i) { + if ($n->value[$i]) { + $temp = decbin($n->value[$i]); + $j = strlen($temp) - strrpos($temp, '1') - 1; + $j+= 26 * $i; + break; + } + } + // at this point, 2^$j * $n/(2^$j) == $n + + $mod1 = $n->copy(); + $mod1->_rshift($j); + $mod2 = new static(); + $mod2->value = array(1); + $mod2->_lshift($j); + + $part1 = ($mod1->value != array(1)) ? $this->_slidingWindow($e, $mod1, self::MONTGOMERY) : new static(); + $part2 = $this->_slidingWindow($e, $mod2, self::POWEROF2); + + $y1 = $mod2->modInverse($mod1); + $y2 = $mod1->modInverse($mod2); + + $result = $part1->multiply($mod2); + $result = $result->multiply($y1); + + $temp = $part2->multiply($mod1); + $temp = $temp->multiply($y2); + + $result = $result->add($temp); + list(, $result) = $result->divide($n); + + return $this->_normalize($result); + } + + /** + * Performs modular exponentiation. + * + * Alias for modPow(). + * + * @param \phpseclib\Math\BigInteger $e + * @param \phpseclib\Math\BigInteger $n + * @return \phpseclib\Math\BigInteger + * @access public + */ + function powMod($e, $n) + { + return $this->modPow($e, $n); + } + + /** + * Sliding Window k-ary Modular Exponentiation + * + * Based on {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=27 HAC 14.85} / + * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=210 MPM 7.7}. In a departure from those algorithims, + * however, this function performs a modular reduction after every multiplication and squaring operation. + * As such, this function has the same preconditions that the reductions being used do. + * + * @param \phpseclib\Math\BigInteger $e + * @param \phpseclib\Math\BigInteger $n + * @param int $mode + * @return \phpseclib\Math\BigInteger + * @access private + */ + function _slidingWindow($e, $n, $mode) + { + static $window_ranges = array(7, 25, 81, 241, 673, 1793); // from BigInteger.java's oddModPow function + //static $window_ranges = array(0, 7, 36, 140, 450, 1303, 3529); // from MPM 7.3.1 + + $e_value = $e->value; + $e_length = count($e_value) - 1; + $e_bits = decbin($e_value[$e_length]); + for ($i = $e_length - 1; $i >= 0; --$i) { + $e_bits.= str_pad(decbin($e_value[$i]), self::$base, '0', STR_PAD_LEFT); + } + + $e_length = strlen($e_bits); + + // calculate the appropriate window size. + // $window_size == 3 if $window_ranges is between 25 and 81, for example. + for ($i = 0, $window_size = 1; $i < count($window_ranges) && $e_length > $window_ranges[$i]; ++$window_size, ++$i) { + } + + $n_value = $n->value; + + // precompute $this^0 through $this^$window_size + $powers = array(); + $powers[1] = $this->_prepareReduce($this->value, $n_value, $mode); + $powers[2] = $this->_squareReduce($powers[1], $n_value, $mode); + + // we do every other number since substr($e_bits, $i, $j+1) (see below) is supposed to end + // in a 1. ie. it's supposed to be odd. + $temp = 1 << ($window_size - 1); + for ($i = 1; $i < $temp; ++$i) { + $i2 = $i << 1; + $powers[$i2 + 1] = $this->_multiplyReduce($powers[$i2 - 1], $powers[2], $n_value, $mode); + } + + $result = array(1); + $result = $this->_prepareReduce($result, $n_value, $mode); + + for ($i = 0; $i < $e_length;) { + if (!$e_bits[$i]) { + $result = $this->_squareReduce($result, $n_value, $mode); + ++$i; + } else { + for ($j = $window_size - 1; $j > 0; --$j) { + if (!empty($e_bits[$i + $j])) { + break; + } + } + + // eg. the length of substr($e_bits, $i, $j + 1) + for ($k = 0; $k <= $j; ++$k) { + $result = $this->_squareReduce($result, $n_value, $mode); + } + + $result = $this->_multiplyReduce($result, $powers[bindec(substr($e_bits, $i, $j + 1))], $n_value, $mode); + + $i += $j + 1; + } + } + + $temp = new static(); + $temp->value = $this->_reduce($result, $n_value, $mode); + + return $temp; + } + + /** + * Modular reduction + * + * For most $modes this will return the remainder. + * + * @see self::_slidingWindow() + * @access private + * @param array $x + * @param array $n + * @param int $mode + * @return array + */ + function _reduce($x, $n, $mode) + { + switch ($mode) { + case self::MONTGOMERY: + return $this->_montgomery($x, $n); + case self::BARRETT: + return $this->_barrett($x, $n); + case self::POWEROF2: + $lhs = new static(); + $lhs->value = $x; + $rhs = new static(); + $rhs->value = $n; + return $x->_mod2($n); + case self::CLASSIC: + $lhs = new static(); + $lhs->value = $x; + $rhs = new static(); + $rhs->value = $n; + list(, $temp) = $lhs->divide($rhs); + return $temp->value; + case self::NONE: + return $x; + default: + // an invalid $mode was provided + } + } + + /** + * Modular reduction preperation + * + * @see self::_slidingWindow() + * @access private + * @param array $x + * @param array $n + * @param int $mode + * @return array + */ + function _prepareReduce($x, $n, $mode) + { + if ($mode == self::MONTGOMERY) { + return $this->_prepMontgomery($x, $n); + } + return $this->_reduce($x, $n, $mode); + } + + /** + * Modular multiply + * + * @see self::_slidingWindow() + * @access private + * @param array $x + * @param array $y + * @param array $n + * @param int $mode + * @return array + */ + function _multiplyReduce($x, $y, $n, $mode) + { + if ($mode == self::MONTGOMERY) { + return $this->_montgomeryMultiply($x, $y, $n); + } + $temp = $this->_multiply($x, false, $y, false); + return $this->_reduce($temp[self::VALUE], $n, $mode); + } + + /** + * Modular square + * + * @see self::_slidingWindow() + * @access private + * @param array $x + * @param array $n + * @param int $mode + * @return array + */ + function _squareReduce($x, $n, $mode) + { + if ($mode == self::MONTGOMERY) { + return $this->_montgomeryMultiply($x, $x, $n); + } + return $this->_reduce($this->_square($x), $n, $mode); + } + + /** + * Modulos for Powers of Two + * + * Calculates $x%$n, where $n = 2**$e, for some $e. Since this is basically the same as doing $x & ($n-1), + * we'll just use this function as a wrapper for doing that. + * + * @see self::_slidingWindow() + * @access private + * @param \phpseclib\Math\BigInteger + * @return \phpseclib\Math\BigInteger + */ + function _mod2($n) + { + $temp = new static(); + $temp->value = array(1); + return $this->bitwise_and($n->subtract($temp)); + } + + /** + * Barrett Modular Reduction + * + * See {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=14 HAC 14.3.3} / + * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=165 MPM 6.2.5} for more information. Modified slightly, + * so as not to require negative numbers (initially, this script didn't support negative numbers). + * + * Employs "folding", as described at + * {@link http://www.cosic.esat.kuleuven.be/publications/thesis-149.pdf#page=66 thesis-149.pdf#page=66}. To quote from + * it, "the idea [behind folding] is to find a value x' such that x (mod m) = x' (mod m), with x' being smaller than x." + * + * Unfortunately, the "Barrett Reduction with Folding" algorithm described in thesis-149.pdf is not, as written, all that + * usable on account of (1) its not using reasonable radix points as discussed in + * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=162 MPM 6.2.2} and (2) the fact that, even with reasonable + * radix points, it only works when there are an even number of digits in the denominator. The reason for (2) is that + * (x >> 1) + (x >> 1) != x / 2 + x / 2. If x is even, they're the same, but if x is odd, they're not. See the in-line + * comments for details. + * + * @see self::_slidingWindow() + * @access private + * @param array $n + * @param array $m + * @return array + */ + function _barrett($n, $m) + { + static $cache = array( + self::VARIABLE => array(), + self::DATA => array() + ); + + $m_length = count($m); + + // if ($this->_compare($n, $this->_square($m)) >= 0) { + if (count($n) > 2 * $m_length) { + $lhs = new static(); + $rhs = new static(); + $lhs->value = $n; + $rhs->value = $m; + list(, $temp) = $lhs->divide($rhs); + return $temp->value; + } + + // if (m.length >> 1) + 2 <= m.length then m is too small and n can't be reduced + if ($m_length < 5) { + return $this->_regularBarrett($n, $m); + } + + // n = 2 * m.length + + if (($key = array_search($m, $cache[self::VARIABLE])) === false) { + $key = count($cache[self::VARIABLE]); + $cache[self::VARIABLE][] = $m; + + $lhs = new static(); + $lhs_value = &$lhs->value; + $lhs_value = $this->_array_repeat(0, $m_length + ($m_length >> 1)); + $lhs_value[] = 1; + $rhs = new static(); + $rhs->value = $m; + + list($u, $m1) = $lhs->divide($rhs); + $u = $u->value; + $m1 = $m1->value; + + $cache[self::DATA][] = array( + 'u' => $u, // m.length >> 1 (technically (m.length >> 1) + 1) + 'm1'=> $m1 // m.length + ); + } else { + extract($cache[self::DATA][$key]); + } + + $cutoff = $m_length + ($m_length >> 1); + $lsd = array_slice($n, 0, $cutoff); // m.length + (m.length >> 1) + $msd = array_slice($n, $cutoff); // m.length >> 1 + $lsd = $this->_trim($lsd); + $temp = $this->_multiply($msd, false, $m1, false); + $n = $this->_add($lsd, false, $temp[self::VALUE], false); // m.length + (m.length >> 1) + 1 + + if ($m_length & 1) { + return $this->_regularBarrett($n[self::VALUE], $m); + } + + // (m.length + (m.length >> 1) + 1) - (m.length - 1) == (m.length >> 1) + 2 + $temp = array_slice($n[self::VALUE], $m_length - 1); + // if even: ((m.length >> 1) + 2) + (m.length >> 1) == m.length + 2 + // if odd: ((m.length >> 1) + 2) + (m.length >> 1) == (m.length - 1) + 2 == m.length + 1 + $temp = $this->_multiply($temp, false, $u, false); + // if even: (m.length + 2) - ((m.length >> 1) + 1) = m.length - (m.length >> 1) + 1 + // if odd: (m.length + 1) - ((m.length >> 1) + 1) = m.length - (m.length >> 1) + $temp = array_slice($temp[self::VALUE], ($m_length >> 1) + 1); + // if even: (m.length - (m.length >> 1) + 1) + m.length = 2 * m.length - (m.length >> 1) + 1 + // if odd: (m.length - (m.length >> 1)) + m.length = 2 * m.length - (m.length >> 1) + $temp = $this->_multiply($temp, false, $m, false); + + // at this point, if m had an odd number of digits, we'd be subtracting a 2 * m.length - (m.length >> 1) digit + // number from a m.length + (m.length >> 1) + 1 digit number. ie. there'd be an extra digit and the while loop + // following this comment would loop a lot (hence our calling _regularBarrett() in that situation). + + $result = $this->_subtract($n[self::VALUE], false, $temp[self::VALUE], false); + + while ($this->_compare($result[self::VALUE], $result[self::SIGN], $m, false) >= 0) { + $result = $this->_subtract($result[self::VALUE], $result[self::SIGN], $m, false); + } + + return $result[self::VALUE]; + } + + /** + * (Regular) Barrett Modular Reduction + * + * For numbers with more than four digits BigInteger::_barrett() is faster. The difference between that and this + * is that this function does not fold the denominator into a smaller form. + * + * @see self::_slidingWindow() + * @access private + * @param array $x + * @param array $n + * @return array + */ + function _regularBarrett($x, $n) + { + static $cache = array( + self::VARIABLE => array(), + self::DATA => array() + ); + + $n_length = count($n); + + if (count($x) > 2 * $n_length) { + $lhs = new static(); + $rhs = new static(); + $lhs->value = $x; + $rhs->value = $n; + list(, $temp) = $lhs->divide($rhs); + return $temp->value; + } + + if (($key = array_search($n, $cache[self::VARIABLE])) === false) { + $key = count($cache[self::VARIABLE]); + $cache[self::VARIABLE][] = $n; + $lhs = new static(); + $lhs_value = &$lhs->value; + $lhs_value = $this->_array_repeat(0, 2 * $n_length); + $lhs_value[] = 1; + $rhs = new static(); + $rhs->value = $n; + list($temp, ) = $lhs->divide($rhs); // m.length + $cache[self::DATA][] = $temp->value; + } + + // 2 * m.length - (m.length - 1) = m.length + 1 + $temp = array_slice($x, $n_length - 1); + // (m.length + 1) + m.length = 2 * m.length + 1 + $temp = $this->_multiply($temp, false, $cache[self::DATA][$key], false); + // (2 * m.length + 1) - (m.length - 1) = m.length + 2 + $temp = array_slice($temp[self::VALUE], $n_length + 1); + + // m.length + 1 + $result = array_slice($x, 0, $n_length + 1); + // m.length + 1 + $temp = $this->_multiplyLower($temp, false, $n, false, $n_length + 1); + // $temp == array_slice($temp->_multiply($temp, false, $n, false)->value, 0, $n_length + 1) + + if ($this->_compare($result, false, $temp[self::VALUE], $temp[self::SIGN]) < 0) { + $corrector_value = $this->_array_repeat(0, $n_length + 1); + $corrector_value[count($corrector_value)] = 1; + $result = $this->_add($result, false, $corrector_value, false); + $result = $result[self::VALUE]; + } + + // at this point, we're subtracting a number with m.length + 1 digits from another number with m.length + 1 digits + $result = $this->_subtract($result, false, $temp[self::VALUE], $temp[self::SIGN]); + while ($this->_compare($result[self::VALUE], $result[self::SIGN], $n, false) > 0) { + $result = $this->_subtract($result[self::VALUE], $result[self::SIGN], $n, false); + } + + return $result[self::VALUE]; + } + + /** + * Performs long multiplication up to $stop digits + * + * If you're going to be doing array_slice($product->value, 0, $stop), some cycles can be saved. + * + * @see self::_regularBarrett() + * @param array $x_value + * @param bool $x_negative + * @param array $y_value + * @param bool $y_negative + * @param int $stop + * @return array + * @access private + */ + function _multiplyLower($x_value, $x_negative, $y_value, $y_negative, $stop) + { + $x_length = count($x_value); + $y_length = count($y_value); + + if (!$x_length || !$y_length) { // a 0 is being multiplied + return array( + self::VALUE => array(), + self::SIGN => false + ); + } + + if ($x_length < $y_length) { + $temp = $x_value; + $x_value = $y_value; + $y_value = $temp; + + $x_length = count($x_value); + $y_length = count($y_value); + } + + $product_value = $this->_array_repeat(0, $x_length + $y_length); + + // the following for loop could be removed if the for loop following it + // (the one with nested for loops) initially set $i to 0, but + // doing so would also make the result in one set of unnecessary adds, + // since on the outermost loops first pass, $product->value[$k] is going + // to always be 0 + + $carry = 0; + + for ($j = 0; $j < $x_length; ++$j) { // ie. $i = 0, $k = $i + $temp = $x_value[$j] * $y_value[0] + $carry; // $product_value[$k] == 0 + $carry = self::$base === 26 ? intval($temp / 0x4000000) : ($temp >> 31); + $product_value[$j] = (int) ($temp - self::$baseFull * $carry); + } + + if ($j < $stop) { + $product_value[$j] = $carry; + } + + // the above for loop is what the previous comment was talking about. the + // following for loop is the "one with nested for loops" + + for ($i = 1; $i < $y_length; ++$i) { + $carry = 0; + + for ($j = 0, $k = $i; $j < $x_length && $k < $stop; ++$j, ++$k) { + $temp = $product_value[$k] + $x_value[$j] * $y_value[$i] + $carry; + $carry = self::$base === 26 ? intval($temp / 0x4000000) : ($temp >> 31); + $product_value[$k] = (int) ($temp - self::$baseFull * $carry); + } + + if ($k < $stop) { + $product_value[$k] = $carry; + } + } + + return array( + self::VALUE => $this->_trim($product_value), + self::SIGN => $x_negative != $y_negative + ); + } + + /** + * Montgomery Modular Reduction + * + * ($x->_prepMontgomery($n))->_montgomery($n) yields $x % $n. + * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=170 MPM 6.3} provides insights on how this can be + * improved upon (basically, by using the comba method). gcd($n, 2) must be equal to one for this function + * to work correctly. + * + * @see self::_prepMontgomery() + * @see self::_slidingWindow() + * @access private + * @param array $x + * @param array $n + * @return array + */ + function _montgomery($x, $n) + { + static $cache = array( + self::VARIABLE => array(), + self::DATA => array() + ); + + if (($key = array_search($n, $cache[self::VARIABLE])) === false) { + $key = count($cache[self::VARIABLE]); + $cache[self::VARIABLE][] = $x; + $cache[self::DATA][] = $this->_modInverse67108864($n); + } + + $k = count($n); + + $result = array(self::VALUE => $x); + + for ($i = 0; $i < $k; ++$i) { + $temp = $result[self::VALUE][$i] * $cache[self::DATA][$key]; + $temp = $temp - self::$baseFull * (self::$base === 26 ? intval($temp / 0x4000000) : ($temp >> 31)); + $temp = $this->_regularMultiply(array($temp), $n); + $temp = array_merge($this->_array_repeat(0, $i), $temp); + $result = $this->_add($result[self::VALUE], false, $temp, false); + } + + $result[self::VALUE] = array_slice($result[self::VALUE], $k); + + if ($this->_compare($result, false, $n, false) >= 0) { + $result = $this->_subtract($result[self::VALUE], false, $n, false); + } + + return $result[self::VALUE]; + } + + /** + * Montgomery Multiply + * + * Interleaves the montgomery reduction and long multiplication algorithms together as described in + * {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=13 HAC 14.36} + * + * @see self::_prepMontgomery() + * @see self::_montgomery() + * @access private + * @param array $x + * @param array $y + * @param array $m + * @return array + */ + function _montgomeryMultiply($x, $y, $m) + { + $temp = $this->_multiply($x, false, $y, false); + return $this->_montgomery($temp[self::VALUE], $m); + + // the following code, although not callable, can be run independently of the above code + // although the above code performed better in my benchmarks the following could might + // perform better under different circumstances. in lieu of deleting it it's just been + // made uncallable + + static $cache = array( + self::VARIABLE => array(), + self::DATA => array() + ); + + if (($key = array_search($m, $cache[self::VARIABLE])) === false) { + $key = count($cache[self::VARIABLE]); + $cache[self::VARIABLE][] = $m; + $cache[self::DATA][] = $this->_modInverse67108864($m); + } + + $n = max(count($x), count($y), count($m)); + $x = array_pad($x, $n, 0); + $y = array_pad($y, $n, 0); + $m = array_pad($m, $n, 0); + $a = array(self::VALUE => $this->_array_repeat(0, $n + 1)); + for ($i = 0; $i < $n; ++$i) { + $temp = $a[self::VALUE][0] + $x[$i] * $y[0]; + $temp = $temp - self::$baseFull * (self::$base === 26 ? intval($temp / 0x4000000) : ($temp >> 31)); + $temp = $temp * $cache[self::DATA][$key]; + $temp = $temp - self::$baseFull * (self::$base === 26 ? intval($temp / 0x4000000) : ($temp >> 31)); + $temp = $this->_add($this->_regularMultiply(array($x[$i]), $y), false, $this->_regularMultiply(array($temp), $m), false); + $a = $this->_add($a[self::VALUE], false, $temp[self::VALUE], false); + $a[self::VALUE] = array_slice($a[self::VALUE], 1); + } + if ($this->_compare($a[self::VALUE], false, $m, false) >= 0) { + $a = $this->_subtract($a[self::VALUE], false, $m, false); + } + return $a[self::VALUE]; + } + + /** + * Prepare a number for use in Montgomery Modular Reductions + * + * @see self::_montgomery() + * @see self::_slidingWindow() + * @access private + * @param array $x + * @param array $n + * @return array + */ + function _prepMontgomery($x, $n) + { + $lhs = new static(); + $lhs->value = array_merge($this->_array_repeat(0, count($n)), $x); + $rhs = new static(); + $rhs->value = $n; + + list(, $temp) = $lhs->divide($rhs); + return $temp->value; + } + + /** + * Modular Inverse of a number mod 2**26 (eg. 67108864) + * + * Based off of the bnpInvDigit function implemented and justified in the following URL: + * + * {@link http://www-cs-students.stanford.edu/~tjw/jsbn/jsbn.js} + * + * The following URL provides more info: + * + * {@link http://groups.google.com/group/sci.crypt/msg/7a137205c1be7d85} + * + * As for why we do all the bitmasking... strange things can happen when converting from floats to ints. For + * instance, on some computers, var_dump((int) -4294967297) yields int(-1) and on others, it yields + * int(-2147483648). To avoid problems stemming from this, we use bitmasks to guarantee that ints aren't + * auto-converted to floats. The outermost bitmask is present because without it, there's no guarantee that + * the "residue" returned would be the so-called "common residue". We use fmod, in the last step, because the + * maximum possible $x is 26 bits and the maximum $result is 16 bits. Thus, we have to be able to handle up to + * 40 bits, which only 64-bit floating points will support. + * + * Thanks to Pedro Gimeno Fortea for input! + * + * @see self::_montgomery() + * @access private + * @param array $x + * @return int + */ + function _modInverse67108864($x) // 2**26 == 67,108,864 + { + $x = -$x[0]; + $result = $x & 0x3; // x**-1 mod 2**2 + $result = ($result * (2 - $x * $result)) & 0xF; // x**-1 mod 2**4 + $result = ($result * (2 - ($x & 0xFF) * $result)) & 0xFF; // x**-1 mod 2**8 + $result = ($result * ((2 - ($x & 0xFFFF) * $result) & 0xFFFF)) & 0xFFFF; // x**-1 mod 2**16 + $result = fmod($result * (2 - fmod($x * $result, self::$baseFull)), self::$baseFull); // x**-1 mod 2**26 + return $result & self::$maxDigit; + } + + /** + * Calculates modular inverses. + * + * Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses. + * + * Here's an example: + * + * modInverse($b); + * echo $c->toString(); // outputs 4 + * + * echo "\r\n"; + * + * $d = $a->multiply($c); + * list(, $d) = $d->divide($b); + * echo $d; // outputs 1 (as per the definition of modular inverse) + * ?> + * + * + * @param \phpseclib\Math\BigInteger $n + * @return \phpseclib\Math\BigInteger|false + * @access public + * @internal See {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=21 HAC 14.64} for more information. + */ + function modInverse($n) + { + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + $temp = new static(); + $temp->value = gmp_invert($this->value, $n->value); + + return ($temp->value === false) ? false : $this->_normalize($temp); + } + + static $zero, $one; + if (!isset($zero)) { + $zero = new static(); + $one = new static(1); + } + + // $x mod -$n == $x mod $n. + $n = $n->abs(); + + if ($this->compare($zero) < 0) { + $temp = $this->abs(); + $temp = $temp->modInverse($n); + return $this->_normalize($n->subtract($temp)); + } + + extract($this->extendedGCD($n)); + + if (!$gcd->equals($one)) { + return false; + } + + $x = $x->compare($zero) < 0 ? $x->add($n) : $x; + + return $this->compare($zero) < 0 ? $this->_normalize($n->subtract($x)) : $this->_normalize($x); + } + + /** + * Calculates the greatest common divisor and Bezout's identity. + * + * Say you have 693 and 609. The GCD is 21. Bezout's identity states that there exist integers x and y such that + * 693*x + 609*y == 21. In point of fact, there are actually an infinite number of x and y combinations and which + * combination is returned is dependent upon which mode is in use. See + * {@link http://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity Bezout's identity - Wikipedia} for more information. + * + * Here's an example: + * + * extendedGCD($b)); + * + * echo $gcd->toString() . "\r\n"; // outputs 21 + * echo $a->toString() * $x->toString() + $b->toString() * $y->toString(); // outputs 21 + * ?> + * + * + * @param \phpseclib\Math\BigInteger $n + * @return \phpseclib\Math\BigInteger + * @access public + * @internal Calculates the GCD using the binary xGCD algorithim described in + * {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=19 HAC 14.61}. As the text above 14.61 notes, + * the more traditional algorithim requires "relatively costly multiple-precision divisions". + */ + function extendedGCD($n) + { + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + extract(gmp_gcdext($this->value, $n->value)); + + return array( + 'gcd' => $this->_normalize(new static($g)), + 'x' => $this->_normalize(new static($s)), + 'y' => $this->_normalize(new static($t)) + ); + case self::MODE_BCMATH: + // it might be faster to use the binary xGCD algorithim here, as well, but (1) that algorithim works + // best when the base is a power of 2 and (2) i don't think it'd make much difference, anyway. as is, + // the basic extended euclidean algorithim is what we're using. + + $u = $this->value; + $v = $n->value; + + $a = '1'; + $b = '0'; + $c = '0'; + $d = '1'; + + while (bccomp($v, '0', 0) != 0) { + $q = bcdiv($u, $v, 0); + + $temp = $u; + $u = $v; + $v = bcsub($temp, bcmul($v, $q, 0), 0); + + $temp = $a; + $a = $c; + $c = bcsub($temp, bcmul($a, $q, 0), 0); + + $temp = $b; + $b = $d; + $d = bcsub($temp, bcmul($b, $q, 0), 0); + } + + return array( + 'gcd' => $this->_normalize(new static($u)), + 'x' => $this->_normalize(new static($a)), + 'y' => $this->_normalize(new static($b)) + ); + } + + $y = $n->copy(); + $x = $this->copy(); + $g = new static(); + $g->value = array(1); + + while (!(($x->value[0] & 1)|| ($y->value[0] & 1))) { + $x->_rshift(1); + $y->_rshift(1); + $g->_lshift(1); + } + + $u = $x->copy(); + $v = $y->copy(); + + $a = new static(); + $b = new static(); + $c = new static(); + $d = new static(); + + $a->value = $d->value = $g->value = array(1); + $b->value = $c->value = array(); + + while (!empty($u->value)) { + while (!($u->value[0] & 1)) { + $u->_rshift(1); + if ((!empty($a->value) && ($a->value[0] & 1)) || (!empty($b->value) && ($b->value[0] & 1))) { + $a = $a->add($y); + $b = $b->subtract($x); + } + $a->_rshift(1); + $b->_rshift(1); + } + + while (!($v->value[0] & 1)) { + $v->_rshift(1); + if ((!empty($d->value) && ($d->value[0] & 1)) || (!empty($c->value) && ($c->value[0] & 1))) { + $c = $c->add($y); + $d = $d->subtract($x); + } + $c->_rshift(1); + $d->_rshift(1); + } + + if ($u->compare($v) >= 0) { + $u = $u->subtract($v); + $a = $a->subtract($c); + $b = $b->subtract($d); + } else { + $v = $v->subtract($u); + $c = $c->subtract($a); + $d = $d->subtract($b); + } + } + + return array( + 'gcd' => $this->_normalize($g->multiply($v)), + 'x' => $this->_normalize($c), + 'y' => $this->_normalize($d) + ); + } + + /** + * Calculates the greatest common divisor + * + * Say you have 693 and 609. The GCD is 21. + * + * Here's an example: + * + * extendedGCD($b); + * + * echo $gcd->toString() . "\r\n"; // outputs 21 + * ?> + * + * + * @param \phpseclib\Math\BigInteger $n + * @return \phpseclib\Math\BigInteger + * @access public + */ + function gcd($n) + { + extract($this->extendedGCD($n)); + return $gcd; + } + + /** + * Absolute value. + * + * @return \phpseclib\Math\BigInteger + * @access public + */ + function abs() + { + $temp = new static(); + + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + $temp->value = gmp_abs($this->value); + break; + case self::MODE_BCMATH: + $temp->value = (bccomp($this->value, '0', 0) < 0) ? substr($this->value, 1) : $this->value; + break; + default: + $temp->value = $this->value; + } + + return $temp; + } + + /** + * Compares two numbers. + * + * Although one might think !$x->compare($y) means $x != $y, it, in fact, means the opposite. The reason for this is + * demonstrated thusly: + * + * $x > $y: $x->compare($y) > 0 + * $x < $y: $x->compare($y) < 0 + * $x == $y: $x->compare($y) == 0 + * + * Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y). + * + * @param \phpseclib\Math\BigInteger $y + * @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal. + * @access public + * @see self::equals() + * @internal Could return $this->subtract($x), but that's not as fast as what we do do. + */ + function compare($y) + { + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + $r = gmp_cmp($this->value, $y->value); + if ($r < -1) { + $r = -1; + } + if ($r > 1) { + $r = 1; + } + return $r; + case self::MODE_BCMATH: + return bccomp($this->value, $y->value, 0); + } + + return $this->_compare($this->value, $this->is_negative, $y->value, $y->is_negative); + } + + /** + * Compares two numbers. + * + * @param array $x_value + * @param bool $x_negative + * @param array $y_value + * @param bool $y_negative + * @return int + * @see self::compare() + * @access private + */ + function _compare($x_value, $x_negative, $y_value, $y_negative) + { + if ($x_negative != $y_negative) { + return (!$x_negative && $y_negative) ? 1 : -1; + } + + $result = $x_negative ? -1 : 1; + + if (count($x_value) != count($y_value)) { + return (count($x_value) > count($y_value)) ? $result : -$result; + } + $size = max(count($x_value), count($y_value)); + + $x_value = array_pad($x_value, $size, 0); + $y_value = array_pad($y_value, $size, 0); + + for ($i = count($x_value) - 1; $i >= 0; --$i) { + if ($x_value[$i] != $y_value[$i]) { + return ($x_value[$i] > $y_value[$i]) ? $result : -$result; + } + } + + return 0; + } + + /** + * Tests the equality of two numbers. + * + * If you need to see if one number is greater than or less than another number, use BigInteger::compare() + * + * @param \phpseclib\Math\BigInteger $x + * @return bool + * @access public + * @see self::compare() + */ + function equals($x) + { + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + return gmp_cmp($this->value, $x->value) == 0; + default: + return $this->value === $x->value && $this->is_negative == $x->is_negative; + } + } + + /** + * Set Precision + * + * Some bitwise operations give different results depending on the precision being used. Examples include left + * shift, not, and rotates. + * + * @param int $bits + * @access public + */ + function setPrecision($bits) + { + $this->precision = $bits; + if (MATH_BIGINTEGER_MODE != self::MODE_BCMATH) { + $this->bitmask = new static(chr((1 << ($bits & 0x7)) - 1) . str_repeat(chr(0xFF), $bits >> 3), 256); + } else { + $this->bitmask = new static(bcpow('2', $bits, 0)); + } + + $temp = $this->_normalize($this); + $this->value = $temp->value; + } + + /** + * Logical And + * + * @param \phpseclib\Math\BigInteger $x + * @access public + * @internal Implemented per a request by Lluis Pamies i Juarez + * @return \phpseclib\Math\BigInteger + */ + function bitwise_and($x) + { + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + $temp = new static(); + $temp->value = gmp_and($this->value, $x->value); + + return $this->_normalize($temp); + case self::MODE_BCMATH: + $left = $this->toBytes(); + $right = $x->toBytes(); + + $length = max(strlen($left), strlen($right)); + + $left = str_pad($left, $length, chr(0), STR_PAD_LEFT); + $right = str_pad($right, $length, chr(0), STR_PAD_LEFT); + + return $this->_normalize(new static($left & $right, 256)); + } + + $result = $this->copy(); + + $length = min(count($x->value), count($this->value)); + + $result->value = array_slice($result->value, 0, $length); + + for ($i = 0; $i < $length; ++$i) { + $result->value[$i]&= $x->value[$i]; + } + + return $this->_normalize($result); + } + + /** + * Logical Or + * + * @param \phpseclib\Math\BigInteger $x + * @access public + * @internal Implemented per a request by Lluis Pamies i Juarez + * @return \phpseclib\Math\BigInteger + */ + function bitwise_or($x) + { + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + $temp = new static(); + $temp->value = gmp_or($this->value, $x->value); + + return $this->_normalize($temp); + case self::MODE_BCMATH: + $left = $this->toBytes(); + $right = $x->toBytes(); + + $length = max(strlen($left), strlen($right)); + + $left = str_pad($left, $length, chr(0), STR_PAD_LEFT); + $right = str_pad($right, $length, chr(0), STR_PAD_LEFT); + + return $this->_normalize(new static($left | $right, 256)); + } + + $length = max(count($this->value), count($x->value)); + $result = $this->copy(); + $result->value = array_pad($result->value, $length, 0); + $x->value = array_pad($x->value, $length, 0); + + for ($i = 0; $i < $length; ++$i) { + $result->value[$i]|= $x->value[$i]; + } + + return $this->_normalize($result); + } + + /** + * Logical Exclusive-Or + * + * @param \phpseclib\Math\BigInteger $x + * @access public + * @internal Implemented per a request by Lluis Pamies i Juarez + * @return \phpseclib\Math\BigInteger + */ + function bitwise_xor($x) + { + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + $temp = new static(); + $temp->value = gmp_xor(gmp_abs($this->value), gmp_abs($x->value)); + return $this->_normalize($temp); + case self::MODE_BCMATH: + $left = $this->toBytes(); + $right = $x->toBytes(); + + $length = max(strlen($left), strlen($right)); + + $left = str_pad($left, $length, chr(0), STR_PAD_LEFT); + $right = str_pad($right, $length, chr(0), STR_PAD_LEFT); + + return $this->_normalize(new static($left ^ $right, 256)); + } + + $length = max(count($this->value), count($x->value)); + $result = $this->copy(); + $result->is_negative = false; + $result->value = array_pad($result->value, $length, 0); + $x->value = array_pad($x->value, $length, 0); + + for ($i = 0; $i < $length; ++$i) { + $result->value[$i]^= $x->value[$i]; + } + + return $this->_normalize($result); + } + + /** + * Logical Not + * + * @access public + * @internal Implemented per a request by Lluis Pamies i Juarez + * @return \phpseclib\Math\BigInteger + */ + function bitwise_not() + { + // calculuate "not" without regard to $this->precision + // (will always result in a smaller number. ie. ~1 isn't 1111 1110 - it's 0) + $temp = $this->toBytes(); + if ($temp == '') { + return $this->_normalize(new static()); + } + $pre_msb = decbin(ord($temp[0])); + $temp = ~$temp; + $msb = decbin(ord($temp[0])); + if (strlen($msb) == 8) { + $msb = substr($msb, strpos($msb, '0')); + } + $temp[0] = chr(bindec($msb)); + + // see if we need to add extra leading 1's + $current_bits = strlen($pre_msb) + 8 * strlen($temp) - 8; + $new_bits = $this->precision - $current_bits; + if ($new_bits <= 0) { + return $this->_normalize(new static($temp, 256)); + } + + // generate as many leading 1's as we need to. + $leading_ones = chr((1 << ($new_bits & 0x7)) - 1) . str_repeat(chr(0xFF), $new_bits >> 3); + $this->_base256_lshift($leading_ones, $current_bits); + + $temp = str_pad($temp, strlen($leading_ones), chr(0), STR_PAD_LEFT); + + return $this->_normalize(new static($leading_ones | $temp, 256)); + } + + /** + * Logical Right Shift + * + * Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift. + * + * @param int $shift + * @return \phpseclib\Math\BigInteger + * @access public + * @internal The only version that yields any speed increases is the internal version. + */ + function bitwise_rightShift($shift) + { + $temp = new static(); + + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + static $two; + + if (!isset($two)) { + $two = gmp_init('2'); + } + + $temp->value = gmp_div_q($this->value, gmp_pow($two, $shift)); + + break; + case self::MODE_BCMATH: + $temp->value = bcdiv($this->value, bcpow('2', $shift, 0), 0); + + break; + default: // could just replace _lshift with this, but then all _lshift() calls would need to be rewritten + // and I don't want to do that... + $temp->value = $this->value; + $temp->_rshift($shift); + } + + return $this->_normalize($temp); + } + + /** + * Logical Left Shift + * + * Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift. + * + * @param int $shift + * @return \phpseclib\Math\BigInteger + * @access public + * @internal The only version that yields any speed increases is the internal version. + */ + function bitwise_leftShift($shift) + { + $temp = new static(); + + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + static $two; + + if (!isset($two)) { + $two = gmp_init('2'); + } + + $temp->value = gmp_mul($this->value, gmp_pow($two, $shift)); + + break; + case self::MODE_BCMATH: + $temp->value = bcmul($this->value, bcpow('2', $shift, 0), 0); + + break; + default: // could just replace _rshift with this, but then all _lshift() calls would need to be rewritten + // and I don't want to do that... + $temp->value = $this->value; + $temp->_lshift($shift); + } + + return $this->_normalize($temp); + } + + /** + * Logical Left Rotate + * + * Instead of the top x bits being dropped they're appended to the shifted bit string. + * + * @param int $shift + * @return \phpseclib\Math\BigInteger + * @access public + */ + function bitwise_leftRotate($shift) + { + $bits = $this->toBytes(); + + if ($this->precision > 0) { + $precision = $this->precision; + if (MATH_BIGINTEGER_MODE == self::MODE_BCMATH) { + $mask = $this->bitmask->subtract(new static(1)); + $mask = $mask->toBytes(); + } else { + $mask = $this->bitmask->toBytes(); + } + } else { + $temp = ord($bits[0]); + for ($i = 0; $temp >> $i; ++$i) { + } + $precision = 8 * strlen($bits) - 8 + $i; + $mask = chr((1 << ($precision & 0x7)) - 1) . str_repeat(chr(0xFF), $precision >> 3); + } + + if ($shift < 0) { + $shift+= $precision; + } + $shift%= $precision; + + if (!$shift) { + return $this->copy(); + } + + $left = $this->bitwise_leftShift($shift); + $left = $left->bitwise_and(new static($mask, 256)); + $right = $this->bitwise_rightShift($precision - $shift); + $result = MATH_BIGINTEGER_MODE != self::MODE_BCMATH ? $left->bitwise_or($right) : $left->add($right); + return $this->_normalize($result); + } + + /** + * Logical Right Rotate + * + * Instead of the bottom x bits being dropped they're prepended to the shifted bit string. + * + * @param int $shift + * @return \phpseclib\Math\BigInteger + * @access public + */ + function bitwise_rightRotate($shift) + { + return $this->bitwise_leftRotate(-$shift); + } + + /** + * Generates a random BigInteger + * + * Byte length is equal to $length. Uses \phpseclib\Crypt\Random if it's loaded and mt_rand if it's not. + * + * @param int $length + * @return \phpseclib\Math\BigInteger + * @access private + */ + function _random_number_helper($size) + { + if (class_exists('\phpseclib\Crypt\Random')) { + $random = Random::string($size); + } else { + $random = ''; + + if ($size & 1) { + $random.= chr(mt_rand(0, 255)); + } + + $blocks = $size >> 1; + for ($i = 0; $i < $blocks; ++$i) { + // mt_rand(-2147483648, 0x7FFFFFFF) always produces -2147483648 on some systems + $random.= pack('n', mt_rand(0, 0xFFFF)); + } + } + + return new static($random, 256); + } + + /** + * Generate a random number + * + * Returns a random number between $min and $max where $min and $max + * can be defined using one of the two methods: + * + * $min->random($max) + * $max->random($min) + * + * @param \phpseclib\Math\BigInteger $arg1 + * @param \phpseclib\Math\BigInteger $arg2 + * @return \phpseclib\Math\BigInteger + * @access public + * @internal The API for creating random numbers used to be $a->random($min, $max), where $a was a BigInteger object. + * That method is still supported for BC purposes. + */ + function random($arg1, $arg2 = false) + { + if ($arg1 === false) { + return false; + } + + if ($arg2 === false) { + $max = $arg1; + $min = $this; + } else { + $min = $arg1; + $max = $arg2; + } + + $compare = $max->compare($min); + + if (!$compare) { + return $this->_normalize($min); + } elseif ($compare < 0) { + // if $min is bigger then $max, swap $min and $max + $temp = $max; + $max = $min; + $min = $temp; + } + + static $one; + if (!isset($one)) { + $one = new static(1); + } + + $max = $max->subtract($min->subtract($one)); + $size = strlen(ltrim($max->toBytes(), chr(0))); + + /* + doing $random % $max doesn't work because some numbers will be more likely to occur than others. + eg. if $max is 140 and $random's max is 255 then that'd mean both $random = 5 and $random = 145 + would produce 5 whereas the only value of random that could produce 139 would be 139. ie. + not all numbers would be equally likely. some would be more likely than others. + + creating a whole new random number until you find one that is within the range doesn't work + because, for sufficiently small ranges, the likelihood that you'd get a number within that range + would be pretty small. eg. with $random's max being 255 and if your $max being 1 the probability + would be pretty high that $random would be greater than $max. + + phpseclib works around this using the technique described here: + + http://crypto.stackexchange.com/questions/5708/creating-a-small-number-from-a-cryptographically-secure-random-string + */ + $random_max = new static(chr(1) . str_repeat("\0", $size), 256); + $random = $this->_random_number_helper($size); + + list($max_multiple) = $random_max->divide($max); + $max_multiple = $max_multiple->multiply($max); + + while ($random->compare($max_multiple) >= 0) { + $random = $random->subtract($max_multiple); + $random_max = $random_max->subtract($max_multiple); + $random = $random->bitwise_leftShift(8); + $random = $random->add($this->_random_number_helper(1)); + $random_max = $random_max->bitwise_leftShift(8); + list($max_multiple) = $random_max->divide($max); + $max_multiple = $max_multiple->multiply($max); + } + list(, $random) = $random->divide($max); + + return $this->_normalize($random->add($min)); + } + + /** + * Generate a random prime number. + * + * If there's not a prime within the given range, false will be returned. + * If more than $timeout seconds have elapsed, give up and return false. + * + * @param \phpseclib\Math\BigInteger $arg1 + * @param \phpseclib\Math\BigInteger $arg2 + * @param int $timeout + * @return Math_BigInteger|false + * @access public + * @internal See {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap4.pdf#page=15 HAC 4.44}. + */ + function randomPrime($arg1, $arg2 = false, $timeout = false) + { + if ($arg1 === false) { + return false; + } + + if ($arg2 === false) { + $max = $arg1; + $min = $this; + } else { + $min = $arg1; + $max = $arg2; + } + + $compare = $max->compare($min); + + if (!$compare) { + return $min->isPrime() ? $min : false; + } elseif ($compare < 0) { + // if $min is bigger then $max, swap $min and $max + $temp = $max; + $max = $min; + $min = $temp; + } + + static $one, $two; + if (!isset($one)) { + $one = new static(1); + $two = new static(2); + } + + $start = time(); + + $x = $this->random($min, $max); + + // gmp_nextprime() requires PHP 5 >= 5.2.0 per . + if (MATH_BIGINTEGER_MODE == self::MODE_GMP && extension_loaded('gmp')) { + $p = new static(); + $p->value = gmp_nextprime($x->value); + + if ($p->compare($max) <= 0) { + return $p; + } + + if (!$min->equals($x)) { + $x = $x->subtract($one); + } + + return $x->randomPrime($min, $x); + } + + if ($x->equals($two)) { + return $x; + } + + $x->_make_odd(); + if ($x->compare($max) > 0) { + // if $x > $max then $max is even and if $min == $max then no prime number exists between the specified range + if ($min->equals($max)) { + return false; + } + $x = $min->copy(); + $x->_make_odd(); + } + + $initial_x = $x->copy(); + + while (true) { + if ($timeout !== false && time() - $start > $timeout) { + return false; + } + + if ($x->isPrime()) { + return $x; + } + + $x = $x->add($two); + + if ($x->compare($max) > 0) { + $x = $min->copy(); + if ($x->equals($two)) { + return $x; + } + $x->_make_odd(); + } + + if ($x->equals($initial_x)) { + return false; + } + } + } + + /** + * Make the current number odd + * + * If the current number is odd it'll be unchanged. If it's even, one will be added to it. + * + * @see self::randomPrime() + * @access private + */ + function _make_odd() + { + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + gmp_setbit($this->value, 0); + break; + case self::MODE_BCMATH: + if ($this->value[strlen($this->value) - 1] % 2 == 0) { + $this->value = bcadd($this->value, '1'); + } + break; + default: + $this->value[0] |= 1; + } + } + + /** + * Checks a numer to see if it's prime + * + * Assuming the $t parameter is not set, this function has an error rate of 2**-80. The main motivation for the + * $t parameter is distributability. BigInteger::randomPrime() can be distributed across multiple pageloads + * on a website instead of just one. + * + * @param \phpseclib\Math\BigInteger $t + * @return bool + * @access public + * @internal Uses the + * {@link http://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test Miller-Rabin primality test}. See + * {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap4.pdf#page=8 HAC 4.24}. + */ + function isPrime($t = false) + { + $length = strlen($this->toBytes()); + + if (!$t) { + // see HAC 4.49 "Note (controlling the error probability)" + // @codingStandardsIgnoreStart + if ($length >= 163) { $t = 2; } // floor(1300 / 8) + else if ($length >= 106) { $t = 3; } // floor( 850 / 8) + else if ($length >= 81 ) { $t = 4; } // floor( 650 / 8) + else if ($length >= 68 ) { $t = 5; } // floor( 550 / 8) + else if ($length >= 56 ) { $t = 6; } // floor( 450 / 8) + else if ($length >= 50 ) { $t = 7; } // floor( 400 / 8) + else if ($length >= 43 ) { $t = 8; } // floor( 350 / 8) + else if ($length >= 37 ) { $t = 9; } // floor( 300 / 8) + else if ($length >= 31 ) { $t = 12; } // floor( 250 / 8) + else if ($length >= 25 ) { $t = 15; } // floor( 200 / 8) + else if ($length >= 18 ) { $t = 18; } // floor( 150 / 8) + else { $t = 27; } + // @codingStandardsIgnoreEnd + } + + // ie. gmp_testbit($this, 0) + // ie. isEven() or !isOdd() + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + return gmp_prob_prime($this->value, $t) != 0; + case self::MODE_BCMATH: + if ($this->value === '2') { + return true; + } + if ($this->value[strlen($this->value) - 1] % 2 == 0) { + return false; + } + break; + default: + if ($this->value == array(2)) { + return true; + } + if (~$this->value[0] & 1) { + return false; + } + } + + static $primes, $zero, $one, $two; + + if (!isset($primes)) { + $primes = array( + 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, + 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, + 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, + 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, + 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, + 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, + 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, + 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, + 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, + 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, + 953, 967, 971, 977, 983, 991, 997 + ); + + if (MATH_BIGINTEGER_MODE != self::MODE_INTERNAL) { + for ($i = 0; $i < count($primes); ++$i) { + $primes[$i] = new static($primes[$i]); + } + } + + $zero = new static(); + $one = new static(1); + $two = new static(2); + } + + if ($this->equals($one)) { + return false; + } + + // see HAC 4.4.1 "Random search for probable primes" + if (MATH_BIGINTEGER_MODE != self::MODE_INTERNAL) { + foreach ($primes as $prime) { + list(, $r) = $this->divide($prime); + if ($r->equals($zero)) { + return $this->equals($prime); + } + } + } else { + $value = $this->value; + foreach ($primes as $prime) { + list(, $r) = $this->_divide_digit($value, $prime); + if (!$r) { + return count($value) == 1 && $value[0] == $prime; + } + } + } + + $n = $this->copy(); + $n_1 = $n->subtract($one); + $n_2 = $n->subtract($two); + + $r = $n_1->copy(); + $r_value = $r->value; + // ie. $s = gmp_scan1($n, 0) and $r = gmp_div_q($n, gmp_pow(gmp_init('2'), $s)); + if (MATH_BIGINTEGER_MODE == self::MODE_BCMATH) { + $s = 0; + // if $n was 1, $r would be 0 and this would be an infinite loop, hence our $this->equals($one) check earlier + while ($r->value[strlen($r->value) - 1] % 2 == 0) { + $r->value = bcdiv($r->value, '2', 0); + ++$s; + } + } else { + for ($i = 0, $r_length = count($r_value); $i < $r_length; ++$i) { + $temp = ~$r_value[$i] & 0xFFFFFF; + for ($j = 1; ($temp >> $j) & 1; ++$j) { + } + if ($j != 25) { + break; + } + } + $s = 26 * $i + $j; + $r->_rshift($s); + } + + for ($i = 0; $i < $t; ++$i) { + $a = $this->random($two, $n_2); + $y = $a->modPow($r, $n); + + if (!$y->equals($one) && !$y->equals($n_1)) { + for ($j = 1; $j < $s && !$y->equals($n_1); ++$j) { + $y = $y->modPow($two, $n); + if ($y->equals($one)) { + return false; + } + } + + if (!$y->equals($n_1)) { + return false; + } + } + } + return true; + } + + /** + * Logical Left Shift + * + * Shifts BigInteger's by $shift bits. + * + * @param int $shift + * @access private + */ + function _lshift($shift) + { + if ($shift == 0) { + return; + } + + $num_digits = (int) ($shift / self::$base); + $shift %= self::$base; + $shift = 1 << $shift; + + $carry = 0; + + for ($i = 0; $i < count($this->value); ++$i) { + $temp = $this->value[$i] * $shift + $carry; + $carry = self::$base === 26 ? intval($temp / 0x4000000) : ($temp >> 31); + $this->value[$i] = (int) ($temp - $carry * self::$baseFull); + } + + if ($carry) { + $this->value[count($this->value)] = $carry; + } + + while ($num_digits--) { + array_unshift($this->value, 0); + } + } + + /** + * Logical Right Shift + * + * Shifts BigInteger's by $shift bits. + * + * @param int $shift + * @access private + */ + function _rshift($shift) + { + if ($shift == 0) { + return; + } + + $num_digits = (int) ($shift / self::$base); + $shift %= self::$base; + $carry_shift = self::$base - $shift; + $carry_mask = (1 << $shift) - 1; + + if ($num_digits) { + $this->value = array_slice($this->value, $num_digits); + } + + $carry = 0; + + for ($i = count($this->value) - 1; $i >= 0; --$i) { + $temp = $this->value[$i] >> $shift | $carry; + $carry = ($this->value[$i] & $carry_mask) << $carry_shift; + $this->value[$i] = $temp; + } + + $this->value = $this->_trim($this->value); + } + + /** + * Normalize + * + * Removes leading zeros and truncates (if necessary) to maintain the appropriate precision + * + * @param \phpseclib\Math\BigInteger + * @return \phpseclib\Math\BigInteger + * @see self::_trim() + * @access private + */ + function _normalize($result) + { + $result->precision = $this->precision; + $result->bitmask = $this->bitmask; + + switch (MATH_BIGINTEGER_MODE) { + case self::MODE_GMP: + if ($this->bitmask !== false) { + $flip = gmp_cmp($result->value, gmp_init(0)) < 0; + if ($flip) { + $result->value = gmp_neg($result->value); + } + $result->value = gmp_and($result->value, $result->bitmask->value); + if ($flip) { + $result->value = gmp_neg($result->value); + } + } + + return $result; + case self::MODE_BCMATH: + if (!empty($result->bitmask->value)) { + $result->value = bcmod($result->value, $result->bitmask->value); + } + + return $result; + } + + $value = &$result->value; + + if (!count($value)) { + $result->is_negative = false; + return $result; + } + + $value = $this->_trim($value); + + if (!empty($result->bitmask->value)) { + $length = min(count($value), count($this->bitmask->value)); + $value = array_slice($value, 0, $length); + + for ($i = 0; $i < $length; ++$i) { + $value[$i] = $value[$i] & $this->bitmask->value[$i]; + } + } + + return $result; + } + + /** + * Trim + * + * Removes leading zeros + * + * @param array $value + * @return \phpseclib\Math\BigInteger + * @access private + */ + function _trim($value) + { + for ($i = count($value) - 1; $i >= 0; --$i) { + if ($value[$i]) { + break; + } + unset($value[$i]); + } + + return $value; + } + + /** + * Array Repeat + * + * @param $input Array + * @param $multiplier mixed + * @return array + * @access private + */ + function _array_repeat($input, $multiplier) + { + return ($multiplier) ? array_fill(0, $multiplier, $input) : array(); + } + + /** + * Logical Left Shift + * + * Shifts binary strings $shift bits, essentially multiplying by 2**$shift. + * + * @param $x String + * @param $shift Integer + * @return string + * @access private + */ + function _base256_lshift(&$x, $shift) + { + if ($shift == 0) { + return; + } + + $num_bytes = $shift >> 3; // eg. floor($shift/8) + $shift &= 7; // eg. $shift % 8 + + $carry = 0; + for ($i = strlen($x) - 1; $i >= 0; --$i) { + $temp = ord($x[$i]) << $shift | $carry; + $x[$i] = chr($temp); + $carry = $temp >> 8; + } + $carry = ($carry != 0) ? chr($carry) : ''; + $x = $carry . $x . str_repeat(chr(0), $num_bytes); + } + + /** + * Logical Right Shift + * + * Shifts binary strings $shift bits, essentially dividing by 2**$shift and returning the remainder. + * + * @param $x String + * @param $shift Integer + * @return string + * @access private + */ + function _base256_rshift(&$x, $shift) + { + if ($shift == 0) { + $x = ltrim($x, chr(0)); + return ''; + } + + $num_bytes = $shift >> 3; // eg. floor($shift/8) + $shift &= 7; // eg. $shift % 8 + + $remainder = ''; + if ($num_bytes) { + $start = $num_bytes > strlen($x) ? -strlen($x) : -$num_bytes; + $remainder = substr($x, $start); + $x = substr($x, 0, -$num_bytes); + } + + $carry = 0; + $carry_shift = 8 - $shift; + for ($i = 0; $i < strlen($x); ++$i) { + $temp = (ord($x[$i]) >> $shift) | $carry; + $carry = (ord($x[$i]) << $carry_shift) & 0xFF; + $x[$i] = chr($temp); + } + $x = ltrim($x, chr(0)); + + $remainder = chr($carry >> $carry_shift) . $remainder; + + return ltrim($remainder, chr(0)); + } + + // one quirk about how the following functions are implemented is that PHP defines N to be an unsigned long + // at 32-bits, while java's longs are 64-bits. + + /** + * Converts 32-bit integers to bytes. + * + * @param int $x + * @return string + * @access private + */ + function _int2bytes($x) + { + return ltrim(pack('N', $x), chr(0)); + } + + /** + * Converts bytes to 32-bit integers + * + * @param string $x + * @return int + * @access private + */ + function _bytes2int($x) + { + $temp = unpack('Nint', str_pad($x, 4, chr(0), STR_PAD_LEFT)); + return $temp['int']; + } + + /** + * DER-encode an integer + * + * The ability to DER-encode integers is needed to create RSA public keys for use with OpenSSL + * + * @see self::modPow() + * @access private + * @param int $length + * @return string + */ + function _encodeASN1Length($length) + { + if ($length <= 0x7F) { + return chr($length); + } + + $temp = ltrim(pack('N', $length), chr(0)); + return pack('Ca*', 0x80 | strlen($temp), $temp); + } + + /** + * Single digit division + * + * Even if int64 is being used the division operator will return a float64 value + * if the dividend is not evenly divisible by the divisor. Since a float64 doesn't + * have the precision of int64 this is a problem so, when int64 is being used, + * we'll guarantee that the dividend is divisible by first subtracting the remainder. + * + * @access private + * @param int $x + * @param int $y + * @return int + */ + function _safe_divide($x, $y) + { + if (self::$base === 26) { + return (int) ($x / $y); + } + + // self::$base === 31 + return ($x - ($x % $y)) / $y; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php b/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php new file mode 100644 index 0000000..0da0999 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php @@ -0,0 +1,16 @@ +getHeaders() as $name => $values) { + * echo $name . ": " . implode(", ", $values); + * } + * + * // Emit headers iteratively: + * foreach ($message->getHeaders() as $name => $values) { + * foreach ($values as $value) { + * header(sprintf('%s: %s', $name, $value), false); + * } + * } + * + * While header names are not case-sensitive, getHeaders() will preserve the + * exact case in which headers were originally specified. + * + * @return string[][] Returns an associative array of the message's headers. Each + * key MUST be a header name, and each value MUST be an array of strings + * for that header. + */ + public function getHeaders(); + + /** + * Checks if a header exists by the given case-insensitive name. + * + * @param string $name Case-insensitive header field name. + * @return bool Returns true if any header names match the given header + * name using a case-insensitive string comparison. Returns false if + * no matching header name is found in the message. + */ + public function hasHeader($name); + + /** + * Retrieves a message header value by the given case-insensitive name. + * + * This method returns an array of all the header values of the given + * case-insensitive header name. + * + * If the header does not appear in the message, this method MUST return an + * empty array. + * + * @param string $name Case-insensitive header field name. + * @return string[] An array of string values as provided for the given + * header. If the header does not appear in the message, this method MUST + * return an empty array. + */ + public function getHeader($name); + + /** + * Retrieves a comma-separated string of the values for a single header. + * + * This method returns all of the header values of the given + * case-insensitive header name as a string concatenated together using + * a comma. + * + * NOTE: Not all header values may be appropriately represented using + * comma concatenation. For such headers, use getHeader() instead + * and supply your own delimiter when concatenating. + * + * If the header does not appear in the message, this method MUST return + * an empty string. + * + * @param string $name Case-insensitive header field name. + * @return string A string of values as provided for the given header + * concatenated together using a comma. If the header does not appear in + * the message, this method MUST return an empty string. + */ + public function getHeaderLine($name); + + /** + * Return an instance with the provided value replacing the specified header. + * + * While header names are case-insensitive, the casing of the header will + * be preserved by this function, and returned from getHeaders(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * new and/or updated header and value. + * + * @param string $name Case-insensitive header field name. + * @param string|string[] $value Header value(s). + * @return static + * @throws \InvalidArgumentException for invalid header names or values. + */ + public function withHeader($name, $value); + + /** + * Return an instance with the specified header appended with the given value. + * + * Existing values for the specified header will be maintained. The new + * value(s) will be appended to the existing list. If the header did not + * exist previously, it will be added. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * new header and/or value. + * + * @param string $name Case-insensitive header field name to add. + * @param string|string[] $value Header value(s). + * @return static + * @throws \InvalidArgumentException for invalid header names or values. + */ + public function withAddedHeader($name, $value); + + /** + * Return an instance without the specified header. + * + * Header resolution MUST be done without case-sensitivity. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that removes + * the named header. + * + * @param string $name Case-insensitive header field name to remove. + * @return static + */ + public function withoutHeader($name); + + /** + * Gets the body of the message. + * + * @return StreamInterface Returns the body as a stream. + */ + public function getBody(); + + /** + * Return an instance with the specified message body. + * + * The body MUST be a StreamInterface object. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return a new instance that has the + * new body stream. + * + * @param StreamInterface $body Body. + * @return static + * @throws \InvalidArgumentException When the body is not valid. + */ + public function withBody(StreamInterface $body); +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/psr/http-message/src/RequestInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/psr/http-message/src/RequestInterface.php new file mode 100644 index 0000000..a96d4fd --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/psr/http-message/src/RequestInterface.php @@ -0,0 +1,129 @@ +getQuery()` + * or from the `QUERY_STRING` server param. + * + * @return array + */ + public function getQueryParams(); + + /** + * Return an instance with the specified query string arguments. + * + * These values SHOULD remain immutable over the course of the incoming + * request. They MAY be injected during instantiation, such as from PHP's + * $_GET superglobal, or MAY be derived from some other value such as the + * URI. In cases where the arguments are parsed from the URI, the data + * MUST be compatible with what PHP's parse_str() would return for + * purposes of how duplicate query parameters are handled, and how nested + * sets are handled. + * + * Setting query string arguments MUST NOT change the URI stored by the + * request, nor the values in the server params. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated query string arguments. + * + * @param array $query Array of query string arguments, typically from + * $_GET. + * @return static + */ + public function withQueryParams(array $query); + + /** + * Retrieve normalized file upload data. + * + * This method returns upload metadata in a normalized tree, with each leaf + * an instance of Psr\Http\Message\UploadedFileInterface. + * + * These values MAY be prepared from $_FILES or the message body during + * instantiation, or MAY be injected via withUploadedFiles(). + * + * @return array An array tree of UploadedFileInterface instances; an empty + * array MUST be returned if no data is present. + */ + public function getUploadedFiles(); + + /** + * Create a new instance with the specified uploaded files. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated body parameters. + * + * @param array $uploadedFiles An array tree of UploadedFileInterface instances. + * @return static + * @throws \InvalidArgumentException if an invalid structure is provided. + */ + public function withUploadedFiles(array $uploadedFiles); + + /** + * Retrieve any parameters provided in the request body. + * + * If the request Content-Type is either application/x-www-form-urlencoded + * or multipart/form-data, and the request method is POST, this method MUST + * return the contents of $_POST. + * + * Otherwise, this method may return any results of deserializing + * the request body content; as parsing returns structured content, the + * potential types MUST be arrays or objects only. A null value indicates + * the absence of body content. + * + * @return null|array|object The deserialized body parameters, if any. + * These will typically be an array or object. + */ + public function getParsedBody(); + + /** + * Return an instance with the specified body parameters. + * + * These MAY be injected during instantiation. + * + * If the request Content-Type is either application/x-www-form-urlencoded + * or multipart/form-data, and the request method is POST, use this method + * ONLY to inject the contents of $_POST. + * + * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of + * deserializing the request body content. Deserialization/parsing returns + * structured data, and, as such, this method ONLY accepts arrays or objects, + * or a null value if nothing was available to parse. + * + * As an example, if content negotiation determines that the request data + * is a JSON payload, this method could be used to create a request + * instance with the deserialized parameters. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated body parameters. + * + * @param null|array|object $data The deserialized body data. This will + * typically be in an array or object. + * @return static + * @throws \InvalidArgumentException if an unsupported argument type is + * provided. + */ + public function withParsedBody($data); + + /** + * Retrieve attributes derived from the request. + * + * The request "attributes" may be used to allow injection of any + * parameters derived from the request: e.g., the results of path + * match operations; the results of decrypting cookies; the results of + * deserializing non-form-encoded message bodies; etc. Attributes + * will be application and request specific, and CAN be mutable. + * + * @return array Attributes derived from the request. + */ + public function getAttributes(); + + /** + * Retrieve a single derived request attribute. + * + * Retrieves a single derived request attribute as described in + * getAttributes(). If the attribute has not been previously set, returns + * the default value as provided. + * + * This method obviates the need for a hasAttribute() method, as it allows + * specifying a default value to return if the attribute is not found. + * + * @see getAttributes() + * @param string $name The attribute name. + * @param mixed $default Default value to return if the attribute does not exist. + * @return mixed + */ + public function getAttribute($name, $default = null); + + /** + * Return an instance with the specified derived request attribute. + * + * This method allows setting a single derived request attribute as + * described in getAttributes(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated attribute. + * + * @see getAttributes() + * @param string $name The attribute name. + * @param mixed $value The value of the attribute. + * @return static + */ + public function withAttribute($name, $value); + + /** + * Return an instance that removes the specified derived request attribute. + * + * This method allows removing a single derived request attribute as + * described in getAttributes(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that removes + * the attribute. + * + * @see getAttributes() + * @param string $name The attribute name. + * @return static + */ + public function withoutAttribute($name); +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/psr/http-message/src/StreamInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/psr/http-message/src/StreamInterface.php new file mode 100644 index 0000000..f68f391 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/psr/http-message/src/StreamInterface.php @@ -0,0 +1,158 @@ + + * [user-info@]host[:port] + * + * + * If the port component is not set or is the standard port for the current + * scheme, it SHOULD NOT be included. + * + * @see https://tools.ietf.org/html/rfc3986#section-3.2 + * @return string The URI authority, in "[user-info@]host[:port]" format. + */ + public function getAuthority(); + + /** + * Retrieve the user information component of the URI. + * + * If no user information is present, this method MUST return an empty + * string. + * + * If a user is present in the URI, this will return that value; + * additionally, if the password is also present, it will be appended to the + * user value, with a colon (":") separating the values. + * + * The trailing "@" character is not part of the user information and MUST + * NOT be added. + * + * @return string The URI user information, in "username[:password]" format. + */ + public function getUserInfo(); + + /** + * Retrieve the host component of the URI. + * + * If no host is present, this method MUST return an empty string. + * + * The value returned MUST be normalized to lowercase, per RFC 3986 + * Section 3.2.2. + * + * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 + * @return string The URI host. + */ + public function getHost(); + + /** + * Retrieve the port component of the URI. + * + * If a port is present, and it is non-standard for the current scheme, + * this method MUST return it as an integer. If the port is the standard port + * used with the current scheme, this method SHOULD return null. + * + * If no port is present, and no scheme is present, this method MUST return + * a null value. + * + * If no port is present, but a scheme is present, this method MAY return + * the standard port for that scheme, but SHOULD return null. + * + * @return null|int The URI port. + */ + public function getPort(); + + /** + * Retrieve the path component of the URI. + * + * The path can either be empty or absolute (starting with a slash) or + * rootless (not starting with a slash). Implementations MUST support all + * three syntaxes. + * + * Normally, the empty path "" and absolute path "/" are considered equal as + * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically + * do this normalization because in contexts with a trimmed base path, e.g. + * the front controller, this difference becomes significant. It's the task + * of the user to handle both "" and "/". + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.3. + * + * As an example, if the value should include a slash ("/") not intended as + * delimiter between path segments, that value MUST be passed in encoded + * form (e.g., "%2F") to the instance. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.3 + * @return string The URI path. + */ + public function getPath(); + + /** + * Retrieve the query string of the URI. + * + * If no query string is present, this method MUST return an empty string. + * + * The leading "?" character is not part of the query and MUST NOT be + * added. + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.4. + * + * As an example, if a value in a key/value pair of the query string should + * include an ampersand ("&") not intended as a delimiter between values, + * that value MUST be passed in encoded form (e.g., "%26") to the instance. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.4 + * @return string The URI query string. + */ + public function getQuery(); + + /** + * Retrieve the fragment component of the URI. + * + * If no fragment is present, this method MUST return an empty string. + * + * The leading "#" character is not part of the fragment and MUST NOT be + * added. + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.5. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.5 + * @return string The URI fragment. + */ + public function getFragment(); + + /** + * Return an instance with the specified scheme. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified scheme. + * + * Implementations MUST support the schemes "http" and "https" case + * insensitively, and MAY accommodate other schemes if required. + * + * An empty scheme is equivalent to removing the scheme. + * + * @param string $scheme The scheme to use with the new instance. + * @return static A new instance with the specified scheme. + * @throws \InvalidArgumentException for invalid or unsupported schemes. + */ + public function withScheme($scheme); + + /** + * Return an instance with the specified user information. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified user information. + * + * Password is optional, but the user information MUST include the + * user; an empty string for the user is equivalent to removing user + * information. + * + * @param string $user The user name to use for authority. + * @param null|string $password The password associated with $user. + * @return static A new instance with the specified user information. + */ + public function withUserInfo($user, $password = null); + + /** + * Return an instance with the specified host. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified host. + * + * An empty host value is equivalent to removing the host. + * + * @param string $host The hostname to use with the new instance. + * @return static A new instance with the specified host. + * @throws \InvalidArgumentException for invalid hostnames. + */ + public function withHost($host); + + /** + * Return an instance with the specified port. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified port. + * + * Implementations MUST raise an exception for ports outside the + * established TCP and UDP port ranges. + * + * A null value provided for the port is equivalent to removing the port + * information. + * + * @param null|int $port The port to use with the new instance; a null value + * removes the port information. + * @return static A new instance with the specified port. + * @throws \InvalidArgumentException for invalid ports. + */ + public function withPort($port); + + /** + * Return an instance with the specified path. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified path. + * + * The path can either be empty or absolute (starting with a slash) or + * rootless (not starting with a slash). Implementations MUST support all + * three syntaxes. + * + * If the path is intended to be domain-relative rather than path relative then + * it must begin with a slash ("/"). Paths not starting with a slash ("/") + * are assumed to be relative to some base path known to the application or + * consumer. + * + * Users can provide both encoded and decoded path characters. + * Implementations ensure the correct encoding as outlined in getPath(). + * + * @param string $path The path to use with the new instance. + * @return static A new instance with the specified path. + * @throws \InvalidArgumentException for invalid paths. + */ + public function withPath($path); + + /** + * Return an instance with the specified query string. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified query string. + * + * Users can provide both encoded and decoded query characters. + * Implementations ensure the correct encoding as outlined in getQuery(). + * + * An empty query string value is equivalent to removing the query string. + * + * @param string $query The query string to use with the new instance. + * @return static A new instance with the specified query string. + * @throws \InvalidArgumentException for invalid query strings. + */ + public function withQuery($query); + + /** + * Return an instance with the specified URI fragment. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified URI fragment. + * + * Users can provide both encoded and decoded fragment characters. + * Implementations ensure the correct encoding as outlined in getFragment(). + * + * An empty fragment value is equivalent to removing the fragment. + * + * @param string $fragment The fragment to use with the new instance. + * @return static A new instance with the specified fragment. + */ + public function withFragment($fragment); + + /** + * Return the string representation as a URI reference. + * + * Depending on which components of the URI are present, the resulting + * string is either a full URI or relative reference according to RFC 3986, + * Section 4.1. The method concatenates the various components of the URI, + * using the appropriate delimiters: + * + * - If a scheme is present, it MUST be suffixed by ":". + * - If an authority is present, it MUST be prefixed by "//". + * - The path can be concatenated without delimiters. But there are two + * cases where the path has to be adjusted to make the URI reference + * valid as PHP does not allow to throw an exception in __toString(): + * - If the path is rootless and an authority is present, the path MUST + * be prefixed by "/". + * - If the path is starting with more than one "/" and no authority is + * present, the starting slashes MUST be reduced to one. + * - If a query is present, it MUST be prefixed by "?". + * - If a fragment is present, it MUST be prefixed by "#". + * + * @see http://tools.ietf.org/html/rfc3986#section-4.1 + * @return string + */ + public function __toString(); +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/psr/log/LICENSE b/wp-content/plugins/wp-mail-smtp/vendor/psr/log/LICENSE new file mode 100644 index 0000000..474c952 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/psr/log/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 PHP Framework Interoperability Group + +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. diff --git a/wp-content/plugins/wp-mail-smtp/vendor/psr/log/Psr/Log/AbstractLogger.php b/wp-content/plugins/wp-mail-smtp/vendor/psr/log/Psr/Log/AbstractLogger.php new file mode 100644 index 0000000..90e721a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/psr/log/Psr/Log/AbstractLogger.php @@ -0,0 +1,128 @@ +log(LogLevel::EMERGENCY, $message, $context); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function alert($message, array $context = array()) + { + $this->log(LogLevel::ALERT, $message, $context); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function critical($message, array $context = array()) + { + $this->log(LogLevel::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function error($message, array $context = array()) + { + $this->log(LogLevel::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function warning($message, array $context = array()) + { + $this->log(LogLevel::WARNING, $message, $context); + } + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function notice($message, array $context = array()) + { + $this->log(LogLevel::NOTICE, $message, $context); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function info($message, array $context = array()) + { + $this->log(LogLevel::INFO, $message, $context); + } + + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function debug($message, array $context = array()) + { + $this->log(LogLevel::DEBUG, $message, $context); + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/psr/log/Psr/Log/InvalidArgumentException.php b/wp-content/plugins/wp-mail-smtp/vendor/psr/log/Psr/Log/InvalidArgumentException.php new file mode 100644 index 0000000..67f852d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/psr/log/Psr/Log/InvalidArgumentException.php @@ -0,0 +1,7 @@ +logger = $logger; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/psr/log/Psr/Log/LoggerInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/psr/log/Psr/Log/LoggerInterface.php new file mode 100644 index 0000000..e695046 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/psr/log/Psr/Log/LoggerInterface.php @@ -0,0 +1,125 @@ +log(LogLevel::EMERGENCY, $message, $context); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function alert($message, array $context = array()) + { + $this->log(LogLevel::ALERT, $message, $context); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function critical($message, array $context = array()) + { + $this->log(LogLevel::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function error($message, array $context = array()) + { + $this->log(LogLevel::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function warning($message, array $context = array()) + { + $this->log(LogLevel::WARNING, $message, $context); + } + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function notice($message, array $context = array()) + { + $this->log(LogLevel::NOTICE, $message, $context); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function info($message, array $context = array()) + { + $this->log(LogLevel::INFO, $message, $context); + } + + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function debug($message, array $context = array()) + { + $this->log(LogLevel::DEBUG, $message, $context); + } + + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * + * @return void + * + * @throws \Psr\Log\InvalidArgumentException + */ + abstract public function log($level, $message, array $context = array()); +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/psr/log/Psr/Log/NullLogger.php b/wp-content/plugins/wp-mail-smtp/vendor/psr/log/Psr/Log/NullLogger.php new file mode 100644 index 0000000..c8f7293 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/psr/log/Psr/Log/NullLogger.php @@ -0,0 +1,30 @@ +logger) { }` + * blocks. + */ +class NullLogger extends AbstractLogger +{ + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * + * @return void + * + * @throws \Psr\Log\InvalidArgumentException + */ + public function log($level, $message, array $context = array()) + { + // noop + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/ralouphie/getallheaders/LICENSE b/wp-content/plugins/wp-mail-smtp/vendor/ralouphie/getallheaders/LICENSE new file mode 100644 index 0000000..be5540c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/ralouphie/getallheaders/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Ralph Khattar + +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. diff --git a/wp-content/plugins/wp-mail-smtp/vendor/ralouphie/getallheaders/src/getallheaders.php b/wp-content/plugins/wp-mail-smtp/vendor/ralouphie/getallheaders/src/getallheaders.php new file mode 100644 index 0000000..c7285a5 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/ralouphie/getallheaders/src/getallheaders.php @@ -0,0 +1,46 @@ + 'Content-Type', + 'CONTENT_LENGTH' => 'Content-Length', + 'CONTENT_MD5' => 'Content-Md5', + ); + + foreach ($_SERVER as $key => $value) { + if (substr($key, 0, 5) === 'HTTP_') { + $key = substr($key, 5); + if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { + $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); + $headers[$key] = $value; + } + } elseif (isset($copy_server[$key])) { + $headers[$copy_server[$key]] = $value; + } + } + + if (!isset($headers['Authorization'])) { + if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { + $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; + } elseif (isset($_SERVER['PHP_AUTH_USER'])) { + $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; + $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); + } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { + $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; + } + } + + return $headers; + } + +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/AccountApi.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/AccountApi.php new file mode 100644 index 0000000..18cc8ed --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/AccountApi.php @@ -0,0 +1,356 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getAccount + * + * Get your account informations, plans and credits details + * + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetAccount + */ + public function getAccount() + { + list($response) = $this->getAccountWithHttpInfo(); + return $response; + } + + /** + * Operation getAccountWithHttpInfo + * + * Get your account informations, plans and credits details + * + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetAccount, HTTP status code, HTTP response headers (array of strings) + */ + public function getAccountWithHttpInfo() + { + $returnType = '\SendinBlue\Client\Model\GetAccount'; + $request = $this->getAccountRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetAccount', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAccountAsync + * + * Get your account informations, plans and credits details + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAccountAsync() + { + return $this->getAccountAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAccountAsyncWithHttpInfo + * + * Get your account informations, plans and credits details + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAccountAsyncWithHttpInfo() + { + $returnType = '\SendinBlue\Client\Model\GetAccount'; + $request = $this->getAccountRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAccount' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getAccountRequest() + { + + $resourcePath = '/account'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/AttributesApi.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/AttributesApi.php new file mode 100644 index 0000000..a0b5df3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/AttributesApi.php @@ -0,0 +1,1186 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createAttribute + * + * Creates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the attribute (required) + * @param \SendinBlue\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function createAttribute($attributeCategory, $attributeName, $createAttribute) + { + $this->createAttributeWithHttpInfo($attributeCategory, $attributeName, $createAttribute); + } + + /** + * Operation createAttributeWithHttpInfo + * + * Creates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the attribute (required) + * @param \SendinBlue\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createAttributeWithHttpInfo($attributeCategory, $attributeName, $createAttribute) + { + $returnType = ''; + $request = $this->createAttributeRequest($attributeCategory, $attributeName, $createAttribute); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createAttributeAsync + * + * Creates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the attribute (required) + * @param \SendinBlue\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createAttributeAsync($attributeCategory, $attributeName, $createAttribute) + { + return $this->createAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $createAttribute) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createAttributeAsyncWithHttpInfo + * + * Creates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the attribute (required) + * @param \SendinBlue\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $createAttribute) + { + $returnType = ''; + $request = $this->createAttributeRequest($attributeCategory, $attributeName, $createAttribute); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createAttribute' + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the attribute (required) + * @param \SendinBlue\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createAttributeRequest($attributeCategory, $attributeName, $createAttribute) + { + // verify the required parameter 'attributeCategory' is set + if ($attributeCategory === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attributeCategory when calling createAttribute' + ); + } + // verify the required parameter 'attributeName' is set + if ($attributeName === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attributeName when calling createAttribute' + ); + } + // verify the required parameter 'createAttribute' is set + if ($createAttribute === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $createAttribute when calling createAttribute' + ); + } + + $resourcePath = '/contacts/attributes/{attributeCategory}/{attributeName}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($attributeCategory !== null) { + $resourcePath = str_replace( + '{' . 'attributeCategory' . '}', + ObjectSerializer::toPathValue($attributeCategory), + $resourcePath + ); + } + // path params + if ($attributeName !== null) { + $resourcePath = str_replace( + '{' . 'attributeName' . '}', + ObjectSerializer::toPathValue($attributeName), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($createAttribute)) { + $_tempBody = $createAttribute; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteAttribute + * + * Deletes an attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteAttribute($attributeCategory, $attributeName) + { + $this->deleteAttributeWithHttpInfo($attributeCategory, $attributeName); + } + + /** + * Operation deleteAttributeWithHttpInfo + * + * Deletes an attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteAttributeWithHttpInfo($attributeCategory, $attributeName) + { + $returnType = ''; + $request = $this->deleteAttributeRequest($attributeCategory, $attributeName); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteAttributeAsync + * + * Deletes an attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteAttributeAsync($attributeCategory, $attributeName) + { + return $this->deleteAttributeAsyncWithHttpInfo($attributeCategory, $attributeName) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAttributeAsyncWithHttpInfo + * + * Deletes an attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteAttributeAsyncWithHttpInfo($attributeCategory, $attributeName) + { + $returnType = ''; + $request = $this->deleteAttributeRequest($attributeCategory, $attributeName); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteAttribute' + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteAttributeRequest($attributeCategory, $attributeName) + { + // verify the required parameter 'attributeCategory' is set + if ($attributeCategory === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attributeCategory when calling deleteAttribute' + ); + } + // verify the required parameter 'attributeName' is set + if ($attributeName === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attributeName when calling deleteAttribute' + ); + } + + $resourcePath = '/contacts/attributes/{attributeCategory}/{attributeName}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($attributeCategory !== null) { + $resourcePath = str_replace( + '{' . 'attributeCategory' . '}', + ObjectSerializer::toPathValue($attributeCategory), + $resourcePath + ); + } + // path params + if ($attributeName !== null) { + $resourcePath = str_replace( + '{' . 'attributeName' . '}', + ObjectSerializer::toPathValue($attributeName), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAttributes + * + * Lists all attributes + * + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetAttributes + */ + public function getAttributes() + { + list($response) = $this->getAttributesWithHttpInfo(); + return $response; + } + + /** + * Operation getAttributesWithHttpInfo + * + * Lists all attributes + * + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetAttributes, HTTP status code, HTTP response headers (array of strings) + */ + public function getAttributesWithHttpInfo() + { + $returnType = '\SendinBlue\Client\Model\GetAttributes'; + $request = $this->getAttributesRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetAttributes', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAttributesAsync + * + * Lists all attributes + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAttributesAsync() + { + return $this->getAttributesAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAttributesAsyncWithHttpInfo + * + * Lists all attributes + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAttributesAsyncWithHttpInfo() + { + $returnType = '\SendinBlue\Client\Model\GetAttributes'; + $request = $this->getAttributesRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAttributes' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getAttributesRequest() + { + + $resourcePath = '/contacts/attributes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateAttribute + * + * Updates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * @param \SendinBlue\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateAttribute($attributeCategory, $attributeName, $updateAttribute) + { + $this->updateAttributeWithHttpInfo($attributeCategory, $attributeName, $updateAttribute); + } + + /** + * Operation updateAttributeWithHttpInfo + * + * Updates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * @param \SendinBlue\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateAttributeWithHttpInfo($attributeCategory, $attributeName, $updateAttribute) + { + $returnType = ''; + $request = $this->updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateAttributeAsync + * + * Updates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * @param \SendinBlue\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateAttributeAsync($attributeCategory, $attributeName, $updateAttribute) + { + return $this->updateAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $updateAttribute) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateAttributeAsyncWithHttpInfo + * + * Updates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * @param \SendinBlue\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $updateAttribute) + { + $returnType = ''; + $request = $this->updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateAttribute' + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * @param \SendinBlue\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute) + { + // verify the required parameter 'attributeCategory' is set + if ($attributeCategory === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attributeCategory when calling updateAttribute' + ); + } + // verify the required parameter 'attributeName' is set + if ($attributeName === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attributeName when calling updateAttribute' + ); + } + // verify the required parameter 'updateAttribute' is set + if ($updateAttribute === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $updateAttribute when calling updateAttribute' + ); + } + + $resourcePath = '/contacts/attributes/{attributeCategory}/{attributeName}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($attributeCategory !== null) { + $resourcePath = str_replace( + '{' . 'attributeCategory' . '}', + ObjectSerializer::toPathValue($attributeCategory), + $resourcePath + ); + } + // path params + if ($attributeName !== null) { + $resourcePath = str_replace( + '{' . 'attributeName' . '}', + ObjectSerializer::toPathValue($attributeName), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($updateAttribute)) { + $_tempBody = $updateAttribute; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/ContactsApi.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/ContactsApi.php new file mode 100644 index 0000000..f8cadee --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/ContactsApi.php @@ -0,0 +1,7380 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation addContactToList + * + * Add existing contacts to a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\AddContactToList $contactEmails Emails addresses of the contacts (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\PostContactInfo + */ + public function addContactToList($listId, $contactEmails) + { + list($response) = $this->addContactToListWithHttpInfo($listId, $contactEmails); + return $response; + } + + /** + * Operation addContactToListWithHttpInfo + * + * Add existing contacts to a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\AddContactToList $contactEmails Emails addresses of the contacts (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\PostContactInfo, HTTP status code, HTTP response headers (array of strings) + */ + public function addContactToListWithHttpInfo($listId, $contactEmails) + { + $returnType = '\SendinBlue\Client\Model\PostContactInfo'; + $request = $this->addContactToListRequest($listId, $contactEmails); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\PostContactInfo', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addContactToListAsync + * + * Add existing contacts to a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\AddContactToList $contactEmails Emails addresses of the contacts (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function addContactToListAsync($listId, $contactEmails) + { + return $this->addContactToListAsyncWithHttpInfo($listId, $contactEmails) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addContactToListAsyncWithHttpInfo + * + * Add existing contacts to a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\AddContactToList $contactEmails Emails addresses of the contacts (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function addContactToListAsyncWithHttpInfo($listId, $contactEmails) + { + $returnType = '\SendinBlue\Client\Model\PostContactInfo'; + $request = $this->addContactToListRequest($listId, $contactEmails); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addContactToList' + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\AddContactToList $contactEmails Emails addresses of the contacts (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function addContactToListRequest($listId, $contactEmails) + { + // verify the required parameter 'listId' is set + if ($listId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $listId when calling addContactToList' + ); + } + // verify the required parameter 'contactEmails' is set + if ($contactEmails === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $contactEmails when calling addContactToList' + ); + } + + $resourcePath = '/contacts/lists/{listId}/contacts/add'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($listId !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($listId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($contactEmails)) { + $_tempBody = $contactEmails; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createAttribute + * + * Creates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the attribute (required) + * @param \SendinBlue\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function createAttribute($attributeCategory, $attributeName, $createAttribute) + { + $this->createAttributeWithHttpInfo($attributeCategory, $attributeName, $createAttribute); + } + + /** + * Operation createAttributeWithHttpInfo + * + * Creates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the attribute (required) + * @param \SendinBlue\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createAttributeWithHttpInfo($attributeCategory, $attributeName, $createAttribute) + { + $returnType = ''; + $request = $this->createAttributeRequest($attributeCategory, $attributeName, $createAttribute); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createAttributeAsync + * + * Creates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the attribute (required) + * @param \SendinBlue\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createAttributeAsync($attributeCategory, $attributeName, $createAttribute) + { + return $this->createAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $createAttribute) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createAttributeAsyncWithHttpInfo + * + * Creates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the attribute (required) + * @param \SendinBlue\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $createAttribute) + { + $returnType = ''; + $request = $this->createAttributeRequest($attributeCategory, $attributeName, $createAttribute); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createAttribute' + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the attribute (required) + * @param \SendinBlue\Client\Model\CreateAttribute $createAttribute Values to create an attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createAttributeRequest($attributeCategory, $attributeName, $createAttribute) + { + // verify the required parameter 'attributeCategory' is set + if ($attributeCategory === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attributeCategory when calling createAttribute' + ); + } + // verify the required parameter 'attributeName' is set + if ($attributeName === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attributeName when calling createAttribute' + ); + } + // verify the required parameter 'createAttribute' is set + if ($createAttribute === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $createAttribute when calling createAttribute' + ); + } + + $resourcePath = '/contacts/attributes/{attributeCategory}/{attributeName}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($attributeCategory !== null) { + $resourcePath = str_replace( + '{' . 'attributeCategory' . '}', + ObjectSerializer::toPathValue($attributeCategory), + $resourcePath + ); + } + // path params + if ($attributeName !== null) { + $resourcePath = str_replace( + '{' . 'attributeName' . '}', + ObjectSerializer::toPathValue($attributeName), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($createAttribute)) { + $_tempBody = $createAttribute; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createContact + * + * Create a contact + * + * @param \SendinBlue\Client\Model\CreateContact $createContact Values to create a contact (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreateUpdateContactModel + */ + public function createContact($createContact) + { + list($response) = $this->createContactWithHttpInfo($createContact); + return $response; + } + + /** + * Operation createContactWithHttpInfo + * + * Create a contact + * + * @param \SendinBlue\Client\Model\CreateContact $createContact Values to create a contact (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreateUpdateContactModel, HTTP status code, HTTP response headers (array of strings) + */ + public function createContactWithHttpInfo($createContact) + { + $returnType = '\SendinBlue\Client\Model\CreateUpdateContactModel'; + $request = $this->createContactRequest($createContact); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreateUpdateContactModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 204: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreateUpdateContactModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createContactAsync + * + * Create a contact + * + * @param \SendinBlue\Client\Model\CreateContact $createContact Values to create a contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createContactAsync($createContact) + { + return $this->createContactAsyncWithHttpInfo($createContact) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createContactAsyncWithHttpInfo + * + * Create a contact + * + * @param \SendinBlue\Client\Model\CreateContact $createContact Values to create a contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createContactAsyncWithHttpInfo($createContact) + { + $returnType = '\SendinBlue\Client\Model\CreateUpdateContactModel'; + $request = $this->createContactRequest($createContact); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createContact' + * + * @param \SendinBlue\Client\Model\CreateContact $createContact Values to create a contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createContactRequest($createContact) + { + // verify the required parameter 'createContact' is set + if ($createContact === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $createContact when calling createContact' + ); + } + + $resourcePath = '/contacts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($createContact)) { + $_tempBody = $createContact; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createFolder + * + * Create a folder + * + * @param \SendinBlue\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreateModel + */ + public function createFolder($createFolder) + { + list($response) = $this->createFolderWithHttpInfo($createFolder); + return $response; + } + + /** + * Operation createFolderWithHttpInfo + * + * Create a folder + * + * @param \SendinBlue\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings) + */ + public function createFolderWithHttpInfo($createFolder) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createFolderRequest($createFolder); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreateModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createFolderAsync + * + * Create a folder + * + * @param \SendinBlue\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createFolderAsync($createFolder) + { + return $this->createFolderAsyncWithHttpInfo($createFolder) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createFolderAsyncWithHttpInfo + * + * Create a folder + * + * @param \SendinBlue\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createFolderAsyncWithHttpInfo($createFolder) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createFolderRequest($createFolder); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createFolder' + * + * @param \SendinBlue\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createFolderRequest($createFolder) + { + // verify the required parameter 'createFolder' is set + if ($createFolder === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $createFolder when calling createFolder' + ); + } + + $resourcePath = '/contacts/folders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($createFolder)) { + $_tempBody = $createFolder; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createList + * + * Create a list + * + * @param \SendinBlue\Client\Model\CreateList $createList Values to create a list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreateModel + */ + public function createList($createList) + { + list($response) = $this->createListWithHttpInfo($createList); + return $response; + } + + /** + * Operation createListWithHttpInfo + * + * Create a list + * + * @param \SendinBlue\Client\Model\CreateList $createList Values to create a list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings) + */ + public function createListWithHttpInfo($createList) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createListRequest($createList); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreateModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createListAsync + * + * Create a list + * + * @param \SendinBlue\Client\Model\CreateList $createList Values to create a list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createListAsync($createList) + { + return $this->createListAsyncWithHttpInfo($createList) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createListAsyncWithHttpInfo + * + * Create a list + * + * @param \SendinBlue\Client\Model\CreateList $createList Values to create a list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createListAsyncWithHttpInfo($createList) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createListRequest($createList); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createList' + * + * @param \SendinBlue\Client\Model\CreateList $createList Values to create a list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createListRequest($createList) + { + // verify the required parameter 'createList' is set + if ($createList === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $createList when calling createList' + ); + } + + $resourcePath = '/contacts/lists'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($createList)) { + $_tempBody = $createList; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteAttribute + * + * Deletes an attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteAttribute($attributeCategory, $attributeName) + { + $this->deleteAttributeWithHttpInfo($attributeCategory, $attributeName); + } + + /** + * Operation deleteAttributeWithHttpInfo + * + * Deletes an attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteAttributeWithHttpInfo($attributeCategory, $attributeName) + { + $returnType = ''; + $request = $this->deleteAttributeRequest($attributeCategory, $attributeName); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteAttributeAsync + * + * Deletes an attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteAttributeAsync($attributeCategory, $attributeName) + { + return $this->deleteAttributeAsyncWithHttpInfo($attributeCategory, $attributeName) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteAttributeAsyncWithHttpInfo + * + * Deletes an attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteAttributeAsyncWithHttpInfo($attributeCategory, $attributeName) + { + $returnType = ''; + $request = $this->deleteAttributeRequest($attributeCategory, $attributeName); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteAttribute' + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteAttributeRequest($attributeCategory, $attributeName) + { + // verify the required parameter 'attributeCategory' is set + if ($attributeCategory === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attributeCategory when calling deleteAttribute' + ); + } + // verify the required parameter 'attributeName' is set + if ($attributeName === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attributeName when calling deleteAttribute' + ); + } + + $resourcePath = '/contacts/attributes/{attributeCategory}/{attributeName}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($attributeCategory !== null) { + $resourcePath = str_replace( + '{' . 'attributeCategory' . '}', + ObjectSerializer::toPathValue($attributeCategory), + $resourcePath + ); + } + // path params + if ($attributeName !== null) { + $resourcePath = str_replace( + '{' . 'attributeName' . '}', + ObjectSerializer::toPathValue($attributeName), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteContact + * + * Deletes a contact + * + * @param string $email Email (urlencoded) of the contact (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteContact($email) + { + $this->deleteContactWithHttpInfo($email); + } + + /** + * Operation deleteContactWithHttpInfo + * + * Deletes a contact + * + * @param string $email Email (urlencoded) of the contact (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteContactWithHttpInfo($email) + { + $returnType = ''; + $request = $this->deleteContactRequest($email); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 405: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteContactAsync + * + * Deletes a contact + * + * @param string $email Email (urlencoded) of the contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteContactAsync($email) + { + return $this->deleteContactAsyncWithHttpInfo($email) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteContactAsyncWithHttpInfo + * + * Deletes a contact + * + * @param string $email Email (urlencoded) of the contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteContactAsyncWithHttpInfo($email) + { + $returnType = ''; + $request = $this->deleteContactRequest($email); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteContact' + * + * @param string $email Email (urlencoded) of the contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteContactRequest($email) + { + // verify the required parameter 'email' is set + if ($email === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $email when calling deleteContact' + ); + } + + $resourcePath = '/contacts/{email}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($email !== null) { + $resourcePath = str_replace( + '{' . 'email' . '}', + ObjectSerializer::toPathValue($email), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteFolder + * + * Delete a folder (and all its lists) + * + * @param int $folderId Id of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteFolder($folderId) + { + $this->deleteFolderWithHttpInfo($folderId); + } + + /** + * Operation deleteFolderWithHttpInfo + * + * Delete a folder (and all its lists) + * + * @param int $folderId Id of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteFolderWithHttpInfo($folderId) + { + $returnType = ''; + $request = $this->deleteFolderRequest($folderId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteFolderAsync + * + * Delete a folder (and all its lists) + * + * @param int $folderId Id of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteFolderAsync($folderId) + { + return $this->deleteFolderAsyncWithHttpInfo($folderId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteFolderAsyncWithHttpInfo + * + * Delete a folder (and all its lists) + * + * @param int $folderId Id of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteFolderAsyncWithHttpInfo($folderId) + { + $returnType = ''; + $request = $this->deleteFolderRequest($folderId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteFolder' + * + * @param int $folderId Id of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteFolderRequest($folderId) + { + // verify the required parameter 'folderId' is set + if ($folderId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $folderId when calling deleteFolder' + ); + } + + $resourcePath = '/contacts/folders/{folderId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($folderId !== null) { + $resourcePath = str_replace( + '{' . 'folderId' . '}', + ObjectSerializer::toPathValue($folderId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteList + * + * Delete a list + * + * @param int $listId Id of the list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteList($listId) + { + $this->deleteListWithHttpInfo($listId); + } + + /** + * Operation deleteListWithHttpInfo + * + * Delete a list + * + * @param int $listId Id of the list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteListWithHttpInfo($listId) + { + $returnType = ''; + $request = $this->deleteListRequest($listId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteListAsync + * + * Delete a list + * + * @param int $listId Id of the list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteListAsync($listId) + { + return $this->deleteListAsyncWithHttpInfo($listId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteListAsyncWithHttpInfo + * + * Delete a list + * + * @param int $listId Id of the list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteListAsyncWithHttpInfo($listId) + { + $returnType = ''; + $request = $this->deleteListRequest($listId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteList' + * + * @param int $listId Id of the list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteListRequest($listId) + { + // verify the required parameter 'listId' is set + if ($listId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $listId when calling deleteList' + ); + } + + $resourcePath = '/contacts/lists/{listId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($listId !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($listId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAttributes + * + * Lists all attributes + * + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetAttributes + */ + public function getAttributes() + { + list($response) = $this->getAttributesWithHttpInfo(); + return $response; + } + + /** + * Operation getAttributesWithHttpInfo + * + * Lists all attributes + * + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetAttributes, HTTP status code, HTTP response headers (array of strings) + */ + public function getAttributesWithHttpInfo() + { + $returnType = '\SendinBlue\Client\Model\GetAttributes'; + $request = $this->getAttributesRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetAttributes', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAttributesAsync + * + * Lists all attributes + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAttributesAsync() + { + return $this->getAttributesAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAttributesAsyncWithHttpInfo + * + * Lists all attributes + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAttributesAsyncWithHttpInfo() + { + $returnType = '\SendinBlue\Client\Model\GetAttributes'; + $request = $this->getAttributesRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAttributes' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getAttributesRequest() + { + + $resourcePath = '/contacts/attributes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getContactInfo + * + * Retrieves contact informations + * + * @param string $email Email (urlencoded) of the contact OR its SMS attribute value (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetExtendedContactDetails + */ + public function getContactInfo($email) + { + list($response) = $this->getContactInfoWithHttpInfo($email); + return $response; + } + + /** + * Operation getContactInfoWithHttpInfo + * + * Retrieves contact informations + * + * @param string $email Email (urlencoded) of the contact OR its SMS attribute value (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetExtendedContactDetails, HTTP status code, HTTP response headers (array of strings) + */ + public function getContactInfoWithHttpInfo($email) + { + $returnType = '\SendinBlue\Client\Model\GetExtendedContactDetails'; + $request = $this->getContactInfoRequest($email); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetExtendedContactDetails', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getContactInfoAsync + * + * Retrieves contact informations + * + * @param string $email Email (urlencoded) of the contact OR its SMS attribute value (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getContactInfoAsync($email) + { + return $this->getContactInfoAsyncWithHttpInfo($email) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getContactInfoAsyncWithHttpInfo + * + * Retrieves contact informations + * + * @param string $email Email (urlencoded) of the contact OR its SMS attribute value (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getContactInfoAsyncWithHttpInfo($email) + { + $returnType = '\SendinBlue\Client\Model\GetExtendedContactDetails'; + $request = $this->getContactInfoRequest($email); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getContactInfo' + * + * @param string $email Email (urlencoded) of the contact OR its SMS attribute value (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getContactInfoRequest($email) + { + // verify the required parameter 'email' is set + if ($email === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $email when calling getContactInfo' + ); + } + + $resourcePath = '/contacts/{email}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($email !== null) { + $resourcePath = str_replace( + '{' . 'email' . '}', + ObjectSerializer::toPathValue($email), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getContactStats + * + * Get the campaigns statistics for a contact + * + * @param string $email Email address (urlencoded) of the contact (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetContactCampaignStats + */ + public function getContactStats($email) + { + list($response) = $this->getContactStatsWithHttpInfo($email); + return $response; + } + + /** + * Operation getContactStatsWithHttpInfo + * + * Get the campaigns statistics for a contact + * + * @param string $email Email address (urlencoded) of the contact (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetContactCampaignStats, HTTP status code, HTTP response headers (array of strings) + */ + public function getContactStatsWithHttpInfo($email) + { + $returnType = '\SendinBlue\Client\Model\GetContactCampaignStats'; + $request = $this->getContactStatsRequest($email); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetContactCampaignStats', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getContactStatsAsync + * + * Get the campaigns statistics for a contact + * + * @param string $email Email address (urlencoded) of the contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getContactStatsAsync($email) + { + return $this->getContactStatsAsyncWithHttpInfo($email) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getContactStatsAsyncWithHttpInfo + * + * Get the campaigns statistics for a contact + * + * @param string $email Email address (urlencoded) of the contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getContactStatsAsyncWithHttpInfo($email) + { + $returnType = '\SendinBlue\Client\Model\GetContactCampaignStats'; + $request = $this->getContactStatsRequest($email); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getContactStats' + * + * @param string $email Email address (urlencoded) of the contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getContactStatsRequest($email) + { + // verify the required parameter 'email' is set + if ($email === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $email when calling getContactStats' + ); + } + + $resourcePath = '/contacts/{email}/campaignStats'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($email !== null) { + $resourcePath = str_replace( + '{' . 'email' . '}', + ObjectSerializer::toPathValue($email), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getContacts + * + * Get all the contacts + * + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetContacts + */ + public function getContacts($limit = '50', $offset = '0', $modifiedSince = null) + { + list($response) = $this->getContactsWithHttpInfo($limit, $offset, $modifiedSince); + return $response; + } + + /** + * Operation getContactsWithHttpInfo + * + * Get all the contacts + * + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetContacts, HTTP status code, HTTP response headers (array of strings) + */ + public function getContactsWithHttpInfo($limit = '50', $offset = '0', $modifiedSince = null) + { + $returnType = '\SendinBlue\Client\Model\GetContacts'; + $request = $this->getContactsRequest($limit, $offset, $modifiedSince); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetContacts', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getContactsAsync + * + * Get all the contacts + * + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getContactsAsync($limit = '50', $offset = '0', $modifiedSince = null) + { + return $this->getContactsAsyncWithHttpInfo($limit, $offset, $modifiedSince) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getContactsAsyncWithHttpInfo + * + * Get all the contacts + * + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getContactsAsyncWithHttpInfo($limit = '50', $offset = '0', $modifiedSince = null) + { + $returnType = '\SendinBlue\Client\Model\GetContacts'; + $request = $this->getContactsRequest($limit, $offset, $modifiedSince); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getContacts' + * + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getContactsRequest($limit = '50', $offset = '0', $modifiedSince = null) + { + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getContacts, must be smaller than or equal to 1000.'); + } + + + $resourcePath = '/contacts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + // query params + if ($modifiedSince !== null) { + $queryParams['modifiedSince'] = ObjectSerializer::toQueryValue($modifiedSince); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getContactsFromList + * + * Get the contacts in a list + * + * @param int $listId Id of the list (required) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetContacts + */ + public function getContactsFromList($listId, $modifiedSince = null, $limit = '50', $offset = '0') + { + list($response) = $this->getContactsFromListWithHttpInfo($listId, $modifiedSince, $limit, $offset); + return $response; + } + + /** + * Operation getContactsFromListWithHttpInfo + * + * Get the contacts in a list + * + * @param int $listId Id of the list (required) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetContacts, HTTP status code, HTTP response headers (array of strings) + */ + public function getContactsFromListWithHttpInfo($listId, $modifiedSince = null, $limit = '50', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetContacts'; + $request = $this->getContactsFromListRequest($listId, $modifiedSince, $limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetContacts', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getContactsFromListAsync + * + * Get the contacts in a list + * + * @param int $listId Id of the list (required) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getContactsFromListAsync($listId, $modifiedSince = null, $limit = '50', $offset = '0') + { + return $this->getContactsFromListAsyncWithHttpInfo($listId, $modifiedSince, $limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getContactsFromListAsyncWithHttpInfo + * + * Get the contacts in a list + * + * @param int $listId Id of the list (required) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getContactsFromListAsyncWithHttpInfo($listId, $modifiedSince = null, $limit = '50', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetContacts'; + $request = $this->getContactsFromListRequest($listId, $modifiedSince, $limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getContactsFromList' + * + * @param int $listId Id of the list (required) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getContactsFromListRequest($listId, $modifiedSince = null, $limit = '50', $offset = '0') + { + // verify the required parameter 'listId' is set + if ($listId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $listId when calling getContactsFromList' + ); + } + if ($limit !== null && $limit > 500) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getContactsFromList, must be smaller than or equal to 500.'); + } + + + $resourcePath = '/contacts/lists/{listId}/contacts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($modifiedSince !== null) { + $queryParams['modifiedSince'] = ObjectSerializer::toQueryValue($modifiedSince); + } + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + + // path params + if ($listId !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($listId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFolder + * + * Returns folder details + * + * @param int $folderId id of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetFolder + */ + public function getFolder($folderId) + { + list($response) = $this->getFolderWithHttpInfo($folderId); + return $response; + } + + /** + * Operation getFolderWithHttpInfo + * + * Returns folder details + * + * @param int $folderId id of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetFolder, HTTP status code, HTTP response headers (array of strings) + */ + public function getFolderWithHttpInfo($folderId) + { + $returnType = '\SendinBlue\Client\Model\GetFolder'; + $request = $this->getFolderRequest($folderId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetFolder', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFolderAsync + * + * Returns folder details + * + * @param int $folderId id of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFolderAsync($folderId) + { + return $this->getFolderAsyncWithHttpInfo($folderId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFolderAsyncWithHttpInfo + * + * Returns folder details + * + * @param int $folderId id of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFolderAsyncWithHttpInfo($folderId) + { + $returnType = '\SendinBlue\Client\Model\GetFolder'; + $request = $this->getFolderRequest($folderId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFolder' + * + * @param int $folderId id of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getFolderRequest($folderId) + { + // verify the required parameter 'folderId' is set + if ($folderId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $folderId when calling getFolder' + ); + } + + $resourcePath = '/contacts/folders/{folderId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($folderId !== null) { + $resourcePath = str_replace( + '{' . 'folderId' . '}', + ObjectSerializer::toPathValue($folderId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFolderLists + * + * Get the lists in a folder + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetFolderLists + */ + public function getFolderLists($folderId, $limit = '10', $offset = '0') + { + list($response) = $this->getFolderListsWithHttpInfo($folderId, $limit, $offset); + return $response; + } + + /** + * Operation getFolderListsWithHttpInfo + * + * Get the lists in a folder + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetFolderLists, HTTP status code, HTTP response headers (array of strings) + */ + public function getFolderListsWithHttpInfo($folderId, $limit = '10', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetFolderLists'; + $request = $this->getFolderListsRequest($folderId, $limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetFolderLists', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFolderListsAsync + * + * Get the lists in a folder + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFolderListsAsync($folderId, $limit = '10', $offset = '0') + { + return $this->getFolderListsAsyncWithHttpInfo($folderId, $limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFolderListsAsyncWithHttpInfo + * + * Get the lists in a folder + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFolderListsAsyncWithHttpInfo($folderId, $limit = '10', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetFolderLists'; + $request = $this->getFolderListsRequest($folderId, $limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFolderLists' + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0') + { + // verify the required parameter 'folderId' is set + if ($folderId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $folderId when calling getFolderLists' + ); + } + if ($limit !== null && $limit > 50) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getFolderLists, must be smaller than or equal to 50.'); + } + + + $resourcePath = '/contacts/folders/{folderId}/lists'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + + // path params + if ($folderId !== null) { + $resourcePath = str_replace( + '{' . 'folderId' . '}', + ObjectSerializer::toPathValue($folderId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFolders + * + * Get all the folders + * + * @param int $limit Number of documents per page (required) + * @param int $offset Index of the first document of the page (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetFolders + */ + public function getFolders($limit, $offset) + { + list($response) = $this->getFoldersWithHttpInfo($limit, $offset); + return $response; + } + + /** + * Operation getFoldersWithHttpInfo + * + * Get all the folders + * + * @param int $limit Number of documents per page (required) + * @param int $offset Index of the first document of the page (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetFolders, HTTP status code, HTTP response headers (array of strings) + */ + public function getFoldersWithHttpInfo($limit, $offset) + { + $returnType = '\SendinBlue\Client\Model\GetFolders'; + $request = $this->getFoldersRequest($limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetFolders', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFoldersAsync + * + * Get all the folders + * + * @param int $limit Number of documents per page (required) + * @param int $offset Index of the first document of the page (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFoldersAsync($limit, $offset) + { + return $this->getFoldersAsyncWithHttpInfo($limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFoldersAsyncWithHttpInfo + * + * Get all the folders + * + * @param int $limit Number of documents per page (required) + * @param int $offset Index of the first document of the page (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFoldersAsyncWithHttpInfo($limit, $offset) + { + $returnType = '\SendinBlue\Client\Model\GetFolders'; + $request = $this->getFoldersRequest($limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFolders' + * + * @param int $limit Number of documents per page (required) + * @param int $offset Index of the first document of the page (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getFoldersRequest($limit, $offset) + { + // verify the required parameter 'limit' is set + if ($limit === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $limit when calling getFolders' + ); + } + if ($limit > 50) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getFolders, must be smaller than or equal to 50.'); + } + + // verify the required parameter 'offset' is set + if ($offset === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $offset when calling getFolders' + ); + } + + $resourcePath = '/contacts/folders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getList + * + * Get the details of a list + * + * @param int $listId Id of the list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetExtendedList + */ + public function getList($listId) + { + list($response) = $this->getListWithHttpInfo($listId); + return $response; + } + + /** + * Operation getListWithHttpInfo + * + * Get the details of a list + * + * @param int $listId Id of the list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetExtendedList, HTTP status code, HTTP response headers (array of strings) + */ + public function getListWithHttpInfo($listId) + { + $returnType = '\SendinBlue\Client\Model\GetExtendedList'; + $request = $this->getListRequest($listId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetExtendedList', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getListAsync + * + * Get the details of a list + * + * @param int $listId Id of the list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getListAsync($listId) + { + return $this->getListAsyncWithHttpInfo($listId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getListAsyncWithHttpInfo + * + * Get the details of a list + * + * @param int $listId Id of the list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getListAsyncWithHttpInfo($listId) + { + $returnType = '\SendinBlue\Client\Model\GetExtendedList'; + $request = $this->getListRequest($listId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getList' + * + * @param int $listId Id of the list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getListRequest($listId) + { + // verify the required parameter 'listId' is set + if ($listId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $listId when calling getList' + ); + } + + $resourcePath = '/contacts/lists/{listId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($listId !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($listId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLists + * + * Get all the lists + * + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetLists + */ + public function getLists($limit = '10', $offset = '0') + { + list($response) = $this->getListsWithHttpInfo($limit, $offset); + return $response; + } + + /** + * Operation getListsWithHttpInfo + * + * Get all the lists + * + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetLists, HTTP status code, HTTP response headers (array of strings) + */ + public function getListsWithHttpInfo($limit = '10', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetLists'; + $request = $this->getListsRequest($limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetLists', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getListsAsync + * + * Get all the lists + * + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getListsAsync($limit = '10', $offset = '0') + { + return $this->getListsAsyncWithHttpInfo($limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getListsAsyncWithHttpInfo + * + * Get all the lists + * + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getListsAsyncWithHttpInfo($limit = '10', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetLists'; + $request = $this->getListsRequest($limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLists' + * + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getListsRequest($limit = '10', $offset = '0') + { + if ($limit !== null && $limit > 50) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getLists, must be smaller than or equal to 50.'); + } + + + $resourcePath = '/contacts/lists'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation importContacts + * + * Import contacts + * + * @param \SendinBlue\Client\Model\RequestContactImport $requestContactImport Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreatedProcessId + */ + public function importContacts($requestContactImport) + { + list($response) = $this->importContactsWithHttpInfo($requestContactImport); + return $response; + } + + /** + * Operation importContactsWithHttpInfo + * + * Import contacts + * + * @param \SendinBlue\Client\Model\RequestContactImport $requestContactImport Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreatedProcessId, HTTP status code, HTTP response headers (array of strings) + */ + public function importContactsWithHttpInfo($requestContactImport) + { + $returnType = '\SendinBlue\Client\Model\CreatedProcessId'; + $request = $this->importContactsRequest($requestContactImport); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreatedProcessId', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation importContactsAsync + * + * Import contacts + * + * @param \SendinBlue\Client\Model\RequestContactImport $requestContactImport Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importContactsAsync($requestContactImport) + { + return $this->importContactsAsyncWithHttpInfo($requestContactImport) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation importContactsAsyncWithHttpInfo + * + * Import contacts + * + * @param \SendinBlue\Client\Model\RequestContactImport $requestContactImport Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function importContactsAsyncWithHttpInfo($requestContactImport) + { + $returnType = '\SendinBlue\Client\Model\CreatedProcessId'; + $request = $this->importContactsRequest($requestContactImport); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'importContacts' + * + * @param \SendinBlue\Client\Model\RequestContactImport $requestContactImport Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function importContactsRequest($requestContactImport) + { + // verify the required parameter 'requestContactImport' is set + if ($requestContactImport === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $requestContactImport when calling importContacts' + ); + } + + $resourcePath = '/contacts/import'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($requestContactImport)) { + $_tempBody = $requestContactImport; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation removeContactFromList + * + * Remove existing contacts from a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\RemoveContactFromList $contactEmails Emails adresses of the contact (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\PostContactInfo + */ + public function removeContactFromList($listId, $contactEmails) + { + list($response) = $this->removeContactFromListWithHttpInfo($listId, $contactEmails); + return $response; + } + + /** + * Operation removeContactFromListWithHttpInfo + * + * Remove existing contacts from a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\RemoveContactFromList $contactEmails Emails adresses of the contact (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\PostContactInfo, HTTP status code, HTTP response headers (array of strings) + */ + public function removeContactFromListWithHttpInfo($listId, $contactEmails) + { + $returnType = '\SendinBlue\Client\Model\PostContactInfo'; + $request = $this->removeContactFromListRequest($listId, $contactEmails); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\PostContactInfo', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation removeContactFromListAsync + * + * Remove existing contacts from a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\RemoveContactFromList $contactEmails Emails adresses of the contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeContactFromListAsync($listId, $contactEmails) + { + return $this->removeContactFromListAsyncWithHttpInfo($listId, $contactEmails) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation removeContactFromListAsyncWithHttpInfo + * + * Remove existing contacts from a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\RemoveContactFromList $contactEmails Emails adresses of the contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeContactFromListAsyncWithHttpInfo($listId, $contactEmails) + { + $returnType = '\SendinBlue\Client\Model\PostContactInfo'; + $request = $this->removeContactFromListRequest($listId, $contactEmails); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'removeContactFromList' + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\RemoveContactFromList $contactEmails Emails adresses of the contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function removeContactFromListRequest($listId, $contactEmails) + { + // verify the required parameter 'listId' is set + if ($listId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $listId when calling removeContactFromList' + ); + } + // verify the required parameter 'contactEmails' is set + if ($contactEmails === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $contactEmails when calling removeContactFromList' + ); + } + + $resourcePath = '/contacts/lists/{listId}/contacts/remove'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($listId !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($listId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($contactEmails)) { + $_tempBody = $contactEmails; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation requestContactExport + * + * Export contacts + * + * @param \SendinBlue\Client\Model\RequestContactExport $requestContactExport Values to request a contact export (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreatedProcessId + */ + public function requestContactExport($requestContactExport) + { + list($response) = $this->requestContactExportWithHttpInfo($requestContactExport); + return $response; + } + + /** + * Operation requestContactExportWithHttpInfo + * + * Export contacts + * + * @param \SendinBlue\Client\Model\RequestContactExport $requestContactExport Values to request a contact export (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreatedProcessId, HTTP status code, HTTP response headers (array of strings) + */ + public function requestContactExportWithHttpInfo($requestContactExport) + { + $returnType = '\SendinBlue\Client\Model\CreatedProcessId'; + $request = $this->requestContactExportRequest($requestContactExport); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreatedProcessId', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation requestContactExportAsync + * + * Export contacts + * + * @param \SendinBlue\Client\Model\RequestContactExport $requestContactExport Values to request a contact export (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function requestContactExportAsync($requestContactExport) + { + return $this->requestContactExportAsyncWithHttpInfo($requestContactExport) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation requestContactExportAsyncWithHttpInfo + * + * Export contacts + * + * @param \SendinBlue\Client\Model\RequestContactExport $requestContactExport Values to request a contact export (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function requestContactExportAsyncWithHttpInfo($requestContactExport) + { + $returnType = '\SendinBlue\Client\Model\CreatedProcessId'; + $request = $this->requestContactExportRequest($requestContactExport); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'requestContactExport' + * + * @param \SendinBlue\Client\Model\RequestContactExport $requestContactExport Values to request a contact export (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function requestContactExportRequest($requestContactExport) + { + // verify the required parameter 'requestContactExport' is set + if ($requestContactExport === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $requestContactExport when calling requestContactExport' + ); + } + + $resourcePath = '/contacts/export'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($requestContactExport)) { + $_tempBody = $requestContactExport; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateAttribute + * + * Updates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * @param \SendinBlue\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateAttribute($attributeCategory, $attributeName, $updateAttribute) + { + $this->updateAttributeWithHttpInfo($attributeCategory, $attributeName, $updateAttribute); + } + + /** + * Operation updateAttributeWithHttpInfo + * + * Updates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * @param \SendinBlue\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateAttributeWithHttpInfo($attributeCategory, $attributeName, $updateAttribute) + { + $returnType = ''; + $request = $this->updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateAttributeAsync + * + * Updates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * @param \SendinBlue\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateAttributeAsync($attributeCategory, $attributeName, $updateAttribute) + { + return $this->updateAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $updateAttribute) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateAttributeAsyncWithHttpInfo + * + * Updates contact attribute + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * @param \SendinBlue\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateAttributeAsyncWithHttpInfo($attributeCategory, $attributeName, $updateAttribute) + { + $returnType = ''; + $request = $this->updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateAttribute' + * + * @param string $attributeCategory Category of the attribute (required) + * @param string $attributeName Name of the existing attribute (required) + * @param \SendinBlue\Client\Model\UpdateAttribute $updateAttribute Values to update an attribute (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute) + { + // verify the required parameter 'attributeCategory' is set + if ($attributeCategory === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attributeCategory when calling updateAttribute' + ); + } + // verify the required parameter 'attributeName' is set + if ($attributeName === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attributeName when calling updateAttribute' + ); + } + // verify the required parameter 'updateAttribute' is set + if ($updateAttribute === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $updateAttribute when calling updateAttribute' + ); + } + + $resourcePath = '/contacts/attributes/{attributeCategory}/{attributeName}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($attributeCategory !== null) { + $resourcePath = str_replace( + '{' . 'attributeCategory' . '}', + ObjectSerializer::toPathValue($attributeCategory), + $resourcePath + ); + } + // path params + if ($attributeName !== null) { + $resourcePath = str_replace( + '{' . 'attributeName' . '}', + ObjectSerializer::toPathValue($attributeName), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($updateAttribute)) { + $_tempBody = $updateAttribute; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateContact + * + * Updates a contact + * + * @param string $email Email (urlencoded) of the contact (required) + * @param \SendinBlue\Client\Model\UpdateContact $updateContact Values to update a contact (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateContact($email, $updateContact) + { + $this->updateContactWithHttpInfo($email, $updateContact); + } + + /** + * Operation updateContactWithHttpInfo + * + * Updates a contact + * + * @param string $email Email (urlencoded) of the contact (required) + * @param \SendinBlue\Client\Model\UpdateContact $updateContact Values to update a contact (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateContactWithHttpInfo($email, $updateContact) + { + $returnType = ''; + $request = $this->updateContactRequest($email, $updateContact); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateContactAsync + * + * Updates a contact + * + * @param string $email Email (urlencoded) of the contact (required) + * @param \SendinBlue\Client\Model\UpdateContact $updateContact Values to update a contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateContactAsync($email, $updateContact) + { + return $this->updateContactAsyncWithHttpInfo($email, $updateContact) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateContactAsyncWithHttpInfo + * + * Updates a contact + * + * @param string $email Email (urlencoded) of the contact (required) + * @param \SendinBlue\Client\Model\UpdateContact $updateContact Values to update a contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateContactAsyncWithHttpInfo($email, $updateContact) + { + $returnType = ''; + $request = $this->updateContactRequest($email, $updateContact); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateContact' + * + * @param string $email Email (urlencoded) of the contact (required) + * @param \SendinBlue\Client\Model\UpdateContact $updateContact Values to update a contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateContactRequest($email, $updateContact) + { + // verify the required parameter 'email' is set + if ($email === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $email when calling updateContact' + ); + } + // verify the required parameter 'updateContact' is set + if ($updateContact === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $updateContact when calling updateContact' + ); + } + + $resourcePath = '/contacts/{email}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($email !== null) { + $resourcePath = str_replace( + '{' . 'email' . '}', + ObjectSerializer::toPathValue($email), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($updateContact)) { + $_tempBody = $updateContact; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateFolder + * + * Update a contact folder + * + * @param int $folderId Id of the folder (required) + * @param \SendinBlue\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateFolder($folderId, $updateFolder) + { + $this->updateFolderWithHttpInfo($folderId, $updateFolder); + } + + /** + * Operation updateFolderWithHttpInfo + * + * Update a contact folder + * + * @param int $folderId Id of the folder (required) + * @param \SendinBlue\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateFolderWithHttpInfo($folderId, $updateFolder) + { + $returnType = ''; + $request = $this->updateFolderRequest($folderId, $updateFolder); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateFolderAsync + * + * Update a contact folder + * + * @param int $folderId Id of the folder (required) + * @param \SendinBlue\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateFolderAsync($folderId, $updateFolder) + { + return $this->updateFolderAsyncWithHttpInfo($folderId, $updateFolder) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateFolderAsyncWithHttpInfo + * + * Update a contact folder + * + * @param int $folderId Id of the folder (required) + * @param \SendinBlue\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateFolderAsyncWithHttpInfo($folderId, $updateFolder) + { + $returnType = ''; + $request = $this->updateFolderRequest($folderId, $updateFolder); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateFolder' + * + * @param int $folderId Id of the folder (required) + * @param \SendinBlue\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateFolderRequest($folderId, $updateFolder) + { + // verify the required parameter 'folderId' is set + if ($folderId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $folderId when calling updateFolder' + ); + } + // verify the required parameter 'updateFolder' is set + if ($updateFolder === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $updateFolder when calling updateFolder' + ); + } + + $resourcePath = '/contacts/folders/{folderId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($folderId !== null) { + $resourcePath = str_replace( + '{' . 'folderId' . '}', + ObjectSerializer::toPathValue($folderId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($updateFolder)) { + $_tempBody = $updateFolder; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateList + * + * Update a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\UpdateList $updateList Values to update a list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateList($listId, $updateList) + { + $this->updateListWithHttpInfo($listId, $updateList); + } + + /** + * Operation updateListWithHttpInfo + * + * Update a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\UpdateList $updateList Values to update a list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateListWithHttpInfo($listId, $updateList) + { + $returnType = ''; + $request = $this->updateListRequest($listId, $updateList); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateListAsync + * + * Update a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\UpdateList $updateList Values to update a list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateListAsync($listId, $updateList) + { + return $this->updateListAsyncWithHttpInfo($listId, $updateList) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateListAsyncWithHttpInfo + * + * Update a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\UpdateList $updateList Values to update a list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateListAsyncWithHttpInfo($listId, $updateList) + { + $returnType = ''; + $request = $this->updateListRequest($listId, $updateList); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateList' + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\UpdateList $updateList Values to update a list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateListRequest($listId, $updateList) + { + // verify the required parameter 'listId' is set + if ($listId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $listId when calling updateList' + ); + } + // verify the required parameter 'updateList' is set + if ($updateList === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $updateList when calling updateList' + ); + } + + $resourcePath = '/contacts/lists/{listId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($listId !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($listId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($updateList)) { + $_tempBody = $updateList; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/EmailCampaignsApi.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/EmailCampaignsApi.php new file mode 100644 index 0000000..049f9df --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/EmailCampaignsApi.php @@ -0,0 +1,2851 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createEmailCampaign + * + * Create an email campaign + * + * @param \SendinBlue\Client\Model\CreateEmailCampaign $emailCampaigns Values to create a campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreateModel + */ + public function createEmailCampaign($emailCampaigns) + { + list($response) = $this->createEmailCampaignWithHttpInfo($emailCampaigns); + return $response; + } + + /** + * Operation createEmailCampaignWithHttpInfo + * + * Create an email campaign + * + * @param \SendinBlue\Client\Model\CreateEmailCampaign $emailCampaigns Values to create a campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings) + */ + public function createEmailCampaignWithHttpInfo($emailCampaigns) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createEmailCampaignRequest($emailCampaigns); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreateModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createEmailCampaignAsync + * + * Create an email campaign + * + * @param \SendinBlue\Client\Model\CreateEmailCampaign $emailCampaigns Values to create a campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createEmailCampaignAsync($emailCampaigns) + { + return $this->createEmailCampaignAsyncWithHttpInfo($emailCampaigns) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createEmailCampaignAsyncWithHttpInfo + * + * Create an email campaign + * + * @param \SendinBlue\Client\Model\CreateEmailCampaign $emailCampaigns Values to create a campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createEmailCampaignAsyncWithHttpInfo($emailCampaigns) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createEmailCampaignRequest($emailCampaigns); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createEmailCampaign' + * + * @param \SendinBlue\Client\Model\CreateEmailCampaign $emailCampaigns Values to create a campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createEmailCampaignRequest($emailCampaigns) + { + // verify the required parameter 'emailCampaigns' is set + if ($emailCampaigns === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $emailCampaigns when calling createEmailCampaign' + ); + } + + $resourcePath = '/emailCampaigns'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($emailCampaigns)) { + $_tempBody = $emailCampaigns; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteEmailCampaign + * + * Delete an email campaign + * + * @param int $campaignId id of the campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteEmailCampaign($campaignId) + { + $this->deleteEmailCampaignWithHttpInfo($campaignId); + } + + /** + * Operation deleteEmailCampaignWithHttpInfo + * + * Delete an email campaign + * + * @param int $campaignId id of the campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteEmailCampaignWithHttpInfo($campaignId) + { + $returnType = ''; + $request = $this->deleteEmailCampaignRequest($campaignId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteEmailCampaignAsync + * + * Delete an email campaign + * + * @param int $campaignId id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteEmailCampaignAsync($campaignId) + { + return $this->deleteEmailCampaignAsyncWithHttpInfo($campaignId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteEmailCampaignAsyncWithHttpInfo + * + * Delete an email campaign + * + * @param int $campaignId id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteEmailCampaignAsyncWithHttpInfo($campaignId) + { + $returnType = ''; + $request = $this->deleteEmailCampaignRequest($campaignId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteEmailCampaign' + * + * @param int $campaignId id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteEmailCampaignRequest($campaignId) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling deleteEmailCampaign' + ); + } + + $resourcePath = '/emailCampaigns/{campaignId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation emailExportRecipients + * + * Export the recipients of a campaign + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\EmailExportRecipients $recipientExport Values to send for a recipient export request (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreatedProcessId + */ + public function emailExportRecipients($campaignId, $recipientExport = null) + { + list($response) = $this->emailExportRecipientsWithHttpInfo($campaignId, $recipientExport); + return $response; + } + + /** + * Operation emailExportRecipientsWithHttpInfo + * + * Export the recipients of a campaign + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\EmailExportRecipients $recipientExport Values to send for a recipient export request (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreatedProcessId, HTTP status code, HTTP response headers (array of strings) + */ + public function emailExportRecipientsWithHttpInfo($campaignId, $recipientExport = null) + { + $returnType = '\SendinBlue\Client\Model\CreatedProcessId'; + $request = $this->emailExportRecipientsRequest($campaignId, $recipientExport); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreatedProcessId', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation emailExportRecipientsAsync + * + * Export the recipients of a campaign + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\EmailExportRecipients $recipientExport Values to send for a recipient export request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function emailExportRecipientsAsync($campaignId, $recipientExport = null) + { + return $this->emailExportRecipientsAsyncWithHttpInfo($campaignId, $recipientExport) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation emailExportRecipientsAsyncWithHttpInfo + * + * Export the recipients of a campaign + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\EmailExportRecipients $recipientExport Values to send for a recipient export request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function emailExportRecipientsAsyncWithHttpInfo($campaignId, $recipientExport = null) + { + $returnType = '\SendinBlue\Client\Model\CreatedProcessId'; + $request = $this->emailExportRecipientsRequest($campaignId, $recipientExport); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'emailExportRecipients' + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\EmailExportRecipients $recipientExport Values to send for a recipient export request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function emailExportRecipientsRequest($campaignId, $recipientExport = null) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling emailExportRecipients' + ); + } + + $resourcePath = '/emailCampaigns/{campaignId}/exportRecipients'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($recipientExport)) { + $_tempBody = $recipientExport; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEmailCampaign + * + * Get campaign informations + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetEmailCampaign + */ + public function getEmailCampaign($campaignId) + { + list($response) = $this->getEmailCampaignWithHttpInfo($campaignId); + return $response; + } + + /** + * Operation getEmailCampaignWithHttpInfo + * + * Get campaign informations + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetEmailCampaign, HTTP status code, HTTP response headers (array of strings) + */ + public function getEmailCampaignWithHttpInfo($campaignId) + { + $returnType = '\SendinBlue\Client\Model\GetEmailCampaign'; + $request = $this->getEmailCampaignRequest($campaignId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetEmailCampaign', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmailCampaignAsync + * + * Get campaign informations + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getEmailCampaignAsync($campaignId) + { + return $this->getEmailCampaignAsyncWithHttpInfo($campaignId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmailCampaignAsyncWithHttpInfo + * + * Get campaign informations + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getEmailCampaignAsyncWithHttpInfo($campaignId) + { + $returnType = '\SendinBlue\Client\Model\GetEmailCampaign'; + $request = $this->getEmailCampaignRequest($campaignId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmailCampaign' + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getEmailCampaignRequest($campaignId) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling getEmailCampaign' + ); + } + + $resourcePath = '/emailCampaigns/{campaignId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEmailCampaigns + * + * Return all your created campaigns + * + * @param string $type Filter on the type of the campaigns (optional) + * @param string $status Filter on the status of the campaign (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number of documents per page (optional, default to 500) + * @param int $offset Index of the first document in the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetEmailCampaigns + */ + public function getEmailCampaigns($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + { + list($response) = $this->getEmailCampaignsWithHttpInfo($type, $status, $startDate, $endDate, $limit, $offset); + return $response; + } + + /** + * Operation getEmailCampaignsWithHttpInfo + * + * Return all your created campaigns + * + * @param string $type Filter on the type of the campaigns (optional) + * @param string $status Filter on the status of the campaign (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number of documents per page (optional, default to 500) + * @param int $offset Index of the first document in the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetEmailCampaigns, HTTP status code, HTTP response headers (array of strings) + */ + public function getEmailCampaignsWithHttpInfo($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetEmailCampaigns'; + $request = $this->getEmailCampaignsRequest($type, $status, $startDate, $endDate, $limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetEmailCampaigns', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmailCampaignsAsync + * + * Return all your created campaigns + * + * @param string $type Filter on the type of the campaigns (optional) + * @param string $status Filter on the status of the campaign (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number of documents per page (optional, default to 500) + * @param int $offset Index of the first document in the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getEmailCampaignsAsync($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + { + return $this->getEmailCampaignsAsyncWithHttpInfo($type, $status, $startDate, $endDate, $limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmailCampaignsAsyncWithHttpInfo + * + * Return all your created campaigns + * + * @param string $type Filter on the type of the campaigns (optional) + * @param string $status Filter on the status of the campaign (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number of documents per page (optional, default to 500) + * @param int $offset Index of the first document in the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getEmailCampaignsAsyncWithHttpInfo($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetEmailCampaigns'; + $request = $this->getEmailCampaignsRequest($type, $status, $startDate, $endDate, $limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmailCampaigns' + * + * @param string $type Filter on the type of the campaigns (optional) + * @param string $status Filter on the status of the campaign (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number of documents per page (optional, default to 500) + * @param int $offset Index of the first document in the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getEmailCampaignsRequest($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + { + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling EmailCampaignsApi.getEmailCampaigns, must be smaller than or equal to 1000.'); + } + + + $resourcePath = '/emailCampaigns'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($type !== null) { + $queryParams['type'] = ObjectSerializer::toQueryValue($type); + } + // query params + if ($status !== null) { + $queryParams['status'] = ObjectSerializer::toQueryValue($status); + } + // query params + if ($startDate !== null) { + $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate); + } + // query params + if ($endDate !== null) { + $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate); + } + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendEmailCampaignNow + * + * Send an email campaign id of the campaign immediately + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function sendEmailCampaignNow($campaignId) + { + $this->sendEmailCampaignNowWithHttpInfo($campaignId); + } + + /** + * Operation sendEmailCampaignNowWithHttpInfo + * + * Send an email campaign id of the campaign immediately + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function sendEmailCampaignNowWithHttpInfo($campaignId) + { + $returnType = ''; + $request = $this->sendEmailCampaignNowRequest($campaignId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendEmailCampaignNowAsync + * + * Send an email campaign id of the campaign immediately + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendEmailCampaignNowAsync($campaignId) + { + return $this->sendEmailCampaignNowAsyncWithHttpInfo($campaignId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendEmailCampaignNowAsyncWithHttpInfo + * + * Send an email campaign id of the campaign immediately + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendEmailCampaignNowAsyncWithHttpInfo($campaignId) + { + $returnType = ''; + $request = $this->sendEmailCampaignNowRequest($campaignId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sendEmailCampaignNow' + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sendEmailCampaignNowRequest($campaignId) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling sendEmailCampaignNow' + ); + } + + $resourcePath = '/emailCampaigns/{campaignId}/sendNow'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendReport + * + * Send the report of a campaigns + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\SendReport $sendReport Values for send a report (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function sendReport($campaignId, $sendReport) + { + $this->sendReportWithHttpInfo($campaignId, $sendReport); + } + + /** + * Operation sendReportWithHttpInfo + * + * Send the report of a campaigns + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\SendReport $sendReport Values for send a report (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function sendReportWithHttpInfo($campaignId, $sendReport) + { + $returnType = ''; + $request = $this->sendReportRequest($campaignId, $sendReport); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendReportAsync + * + * Send the report of a campaigns + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\SendReport $sendReport Values for send a report (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendReportAsync($campaignId, $sendReport) + { + return $this->sendReportAsyncWithHttpInfo($campaignId, $sendReport) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendReportAsyncWithHttpInfo + * + * Send the report of a campaigns + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\SendReport $sendReport Values for send a report (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendReportAsyncWithHttpInfo($campaignId, $sendReport) + { + $returnType = ''; + $request = $this->sendReportRequest($campaignId, $sendReport); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sendReport' + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\SendReport $sendReport Values for send a report (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sendReportRequest($campaignId, $sendReport) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling sendReport' + ); + } + // verify the required parameter 'sendReport' is set + if ($sendReport === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sendReport when calling sendReport' + ); + } + + $resourcePath = '/emailCampaigns/{campaignId}/sendReport'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($sendReport)) { + $_tempBody = $sendReport; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendTestEmail + * + * Send an email campaign to your test list + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\SendTestEmail $emailTo emailTo (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function sendTestEmail($campaignId, $emailTo) + { + $this->sendTestEmailWithHttpInfo($campaignId, $emailTo); + } + + /** + * Operation sendTestEmailWithHttpInfo + * + * Send an email campaign to your test list + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\SendTestEmail $emailTo (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function sendTestEmailWithHttpInfo($campaignId, $emailTo) + { + $returnType = ''; + $request = $this->sendTestEmailRequest($campaignId, $emailTo); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\PostSendFailed', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendTestEmailAsync + * + * Send an email campaign to your test list + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\SendTestEmail $emailTo (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTestEmailAsync($campaignId, $emailTo) + { + return $this->sendTestEmailAsyncWithHttpInfo($campaignId, $emailTo) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendTestEmailAsyncWithHttpInfo + * + * Send an email campaign to your test list + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\SendTestEmail $emailTo (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTestEmailAsyncWithHttpInfo($campaignId, $emailTo) + { + $returnType = ''; + $request = $this->sendTestEmailRequest($campaignId, $emailTo); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sendTestEmail' + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\SendTestEmail $emailTo (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sendTestEmailRequest($campaignId, $emailTo) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling sendTestEmail' + ); + } + // verify the required parameter 'emailTo' is set + if ($emailTo === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $emailTo when calling sendTestEmail' + ); + } + + $resourcePath = '/emailCampaigns/{campaignId}/sendTest'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($emailTo)) { + $_tempBody = $emailTo; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateCampaignStatus + * + * Update a campaign status + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateCampaignStatus $status Status of the campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateCampaignStatus($campaignId, $status) + { + $this->updateCampaignStatusWithHttpInfo($campaignId, $status); + } + + /** + * Operation updateCampaignStatusWithHttpInfo + * + * Update a campaign status + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateCampaignStatus $status Status of the campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateCampaignStatusWithHttpInfo($campaignId, $status) + { + $returnType = ''; + $request = $this->updateCampaignStatusRequest($campaignId, $status); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateCampaignStatusAsync + * + * Update a campaign status + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateCampaignStatus $status Status of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateCampaignStatusAsync($campaignId, $status) + { + return $this->updateCampaignStatusAsyncWithHttpInfo($campaignId, $status) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateCampaignStatusAsyncWithHttpInfo + * + * Update a campaign status + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateCampaignStatus $status Status of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateCampaignStatusAsyncWithHttpInfo($campaignId, $status) + { + $returnType = ''; + $request = $this->updateCampaignStatusRequest($campaignId, $status); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateCampaignStatus' + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateCampaignStatus $status Status of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateCampaignStatusRequest($campaignId, $status) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling updateCampaignStatus' + ); + } + // verify the required parameter 'status' is set + if ($status === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $status when calling updateCampaignStatus' + ); + } + + $resourcePath = '/emailCampaigns/{campaignId}/status'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($status)) { + $_tempBody = $status; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateEmailCampaign + * + * Update a campaign + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateEmailCampaign $emailCampaign Values to update a campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateEmailCampaign($campaignId, $emailCampaign) + { + $this->updateEmailCampaignWithHttpInfo($campaignId, $emailCampaign); + } + + /** + * Operation updateEmailCampaignWithHttpInfo + * + * Update a campaign + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateEmailCampaign $emailCampaign Values to update a campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateEmailCampaignWithHttpInfo($campaignId, $emailCampaign) + { + $returnType = ''; + $request = $this->updateEmailCampaignRequest($campaignId, $emailCampaign); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateEmailCampaignAsync + * + * Update a campaign + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateEmailCampaign $emailCampaign Values to update a campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateEmailCampaignAsync($campaignId, $emailCampaign) + { + return $this->updateEmailCampaignAsyncWithHttpInfo($campaignId, $emailCampaign) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateEmailCampaignAsyncWithHttpInfo + * + * Update a campaign + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateEmailCampaign $emailCampaign Values to update a campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateEmailCampaignAsyncWithHttpInfo($campaignId, $emailCampaign) + { + $returnType = ''; + $request = $this->updateEmailCampaignRequest($campaignId, $emailCampaign); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateEmailCampaign' + * + * @param int $campaignId Id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateEmailCampaign $emailCampaign Values to update a campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateEmailCampaignRequest($campaignId, $emailCampaign) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling updateEmailCampaign' + ); + } + // verify the required parameter 'emailCampaign' is set + if ($emailCampaign === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $emailCampaign when calling updateEmailCampaign' + ); + } + + $resourcePath = '/emailCampaigns/{campaignId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($emailCampaign)) { + $_tempBody = $emailCampaign; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/FoldersApi.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/FoldersApi.php new file mode 100644 index 0000000..df78954 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/FoldersApi.php @@ -0,0 +1,1787 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createFolder + * + * Create a folder + * + * @param \SendinBlue\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreateModel + */ + public function createFolder($createFolder) + { + list($response) = $this->createFolderWithHttpInfo($createFolder); + return $response; + } + + /** + * Operation createFolderWithHttpInfo + * + * Create a folder + * + * @param \SendinBlue\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings) + */ + public function createFolderWithHttpInfo($createFolder) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createFolderRequest($createFolder); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreateModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createFolderAsync + * + * Create a folder + * + * @param \SendinBlue\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createFolderAsync($createFolder) + { + return $this->createFolderAsyncWithHttpInfo($createFolder) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createFolderAsyncWithHttpInfo + * + * Create a folder + * + * @param \SendinBlue\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createFolderAsyncWithHttpInfo($createFolder) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createFolderRequest($createFolder); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createFolder' + * + * @param \SendinBlue\Client\Model\CreateUpdateFolder $createFolder Name of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createFolderRequest($createFolder) + { + // verify the required parameter 'createFolder' is set + if ($createFolder === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $createFolder when calling createFolder' + ); + } + + $resourcePath = '/contacts/folders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($createFolder)) { + $_tempBody = $createFolder; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteFolder + * + * Delete a folder (and all its lists) + * + * @param int $folderId Id of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteFolder($folderId) + { + $this->deleteFolderWithHttpInfo($folderId); + } + + /** + * Operation deleteFolderWithHttpInfo + * + * Delete a folder (and all its lists) + * + * @param int $folderId Id of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteFolderWithHttpInfo($folderId) + { + $returnType = ''; + $request = $this->deleteFolderRequest($folderId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteFolderAsync + * + * Delete a folder (and all its lists) + * + * @param int $folderId Id of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteFolderAsync($folderId) + { + return $this->deleteFolderAsyncWithHttpInfo($folderId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteFolderAsyncWithHttpInfo + * + * Delete a folder (and all its lists) + * + * @param int $folderId Id of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteFolderAsyncWithHttpInfo($folderId) + { + $returnType = ''; + $request = $this->deleteFolderRequest($folderId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteFolder' + * + * @param int $folderId Id of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteFolderRequest($folderId) + { + // verify the required parameter 'folderId' is set + if ($folderId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $folderId when calling deleteFolder' + ); + } + + $resourcePath = '/contacts/folders/{folderId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($folderId !== null) { + $resourcePath = str_replace( + '{' . 'folderId' . '}', + ObjectSerializer::toPathValue($folderId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFolder + * + * Returns folder details + * + * @param int $folderId id of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetFolder + */ + public function getFolder($folderId) + { + list($response) = $this->getFolderWithHttpInfo($folderId); + return $response; + } + + /** + * Operation getFolderWithHttpInfo + * + * Returns folder details + * + * @param int $folderId id of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetFolder, HTTP status code, HTTP response headers (array of strings) + */ + public function getFolderWithHttpInfo($folderId) + { + $returnType = '\SendinBlue\Client\Model\GetFolder'; + $request = $this->getFolderRequest($folderId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetFolder', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFolderAsync + * + * Returns folder details + * + * @param int $folderId id of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFolderAsync($folderId) + { + return $this->getFolderAsyncWithHttpInfo($folderId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFolderAsyncWithHttpInfo + * + * Returns folder details + * + * @param int $folderId id of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFolderAsyncWithHttpInfo($folderId) + { + $returnType = '\SendinBlue\Client\Model\GetFolder'; + $request = $this->getFolderRequest($folderId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFolder' + * + * @param int $folderId id of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getFolderRequest($folderId) + { + // verify the required parameter 'folderId' is set + if ($folderId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $folderId when calling getFolder' + ); + } + + $resourcePath = '/contacts/folders/{folderId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($folderId !== null) { + $resourcePath = str_replace( + '{' . 'folderId' . '}', + ObjectSerializer::toPathValue($folderId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFolderLists + * + * Get the lists in a folder + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetFolderLists + */ + public function getFolderLists($folderId, $limit = '10', $offset = '0') + { + list($response) = $this->getFolderListsWithHttpInfo($folderId, $limit, $offset); + return $response; + } + + /** + * Operation getFolderListsWithHttpInfo + * + * Get the lists in a folder + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetFolderLists, HTTP status code, HTTP response headers (array of strings) + */ + public function getFolderListsWithHttpInfo($folderId, $limit = '10', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetFolderLists'; + $request = $this->getFolderListsRequest($folderId, $limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetFolderLists', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFolderListsAsync + * + * Get the lists in a folder + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFolderListsAsync($folderId, $limit = '10', $offset = '0') + { + return $this->getFolderListsAsyncWithHttpInfo($folderId, $limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFolderListsAsyncWithHttpInfo + * + * Get the lists in a folder + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFolderListsAsyncWithHttpInfo($folderId, $limit = '10', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetFolderLists'; + $request = $this->getFolderListsRequest($folderId, $limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFolderLists' + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0') + { + // verify the required parameter 'folderId' is set + if ($folderId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $folderId when calling getFolderLists' + ); + } + if ($limit !== null && $limit > 50) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FoldersApi.getFolderLists, must be smaller than or equal to 50.'); + } + + + $resourcePath = '/contacts/folders/{folderId}/lists'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + + // path params + if ($folderId !== null) { + $resourcePath = str_replace( + '{' . 'folderId' . '}', + ObjectSerializer::toPathValue($folderId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFolders + * + * Get all the folders + * + * @param int $limit Number of documents per page (required) + * @param int $offset Index of the first document of the page (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetFolders + */ + public function getFolders($limit, $offset) + { + list($response) = $this->getFoldersWithHttpInfo($limit, $offset); + return $response; + } + + /** + * Operation getFoldersWithHttpInfo + * + * Get all the folders + * + * @param int $limit Number of documents per page (required) + * @param int $offset Index of the first document of the page (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetFolders, HTTP status code, HTTP response headers (array of strings) + */ + public function getFoldersWithHttpInfo($limit, $offset) + { + $returnType = '\SendinBlue\Client\Model\GetFolders'; + $request = $this->getFoldersRequest($limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetFolders', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFoldersAsync + * + * Get all the folders + * + * @param int $limit Number of documents per page (required) + * @param int $offset Index of the first document of the page (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFoldersAsync($limit, $offset) + { + return $this->getFoldersAsyncWithHttpInfo($limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFoldersAsyncWithHttpInfo + * + * Get all the folders + * + * @param int $limit Number of documents per page (required) + * @param int $offset Index of the first document of the page (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFoldersAsyncWithHttpInfo($limit, $offset) + { + $returnType = '\SendinBlue\Client\Model\GetFolders'; + $request = $this->getFoldersRequest($limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFolders' + * + * @param int $limit Number of documents per page (required) + * @param int $offset Index of the first document of the page (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getFoldersRequest($limit, $offset) + { + // verify the required parameter 'limit' is set + if ($limit === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $limit when calling getFolders' + ); + } + if ($limit > 50) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling FoldersApi.getFolders, must be smaller than or equal to 50.'); + } + + // verify the required parameter 'offset' is set + if ($offset === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $offset when calling getFolders' + ); + } + + $resourcePath = '/contacts/folders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateFolder + * + * Update a contact folder + * + * @param int $folderId Id of the folder (required) + * @param \SendinBlue\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateFolder($folderId, $updateFolder) + { + $this->updateFolderWithHttpInfo($folderId, $updateFolder); + } + + /** + * Operation updateFolderWithHttpInfo + * + * Update a contact folder + * + * @param int $folderId Id of the folder (required) + * @param \SendinBlue\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateFolderWithHttpInfo($folderId, $updateFolder) + { + $returnType = ''; + $request = $this->updateFolderRequest($folderId, $updateFolder); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateFolderAsync + * + * Update a contact folder + * + * @param int $folderId Id of the folder (required) + * @param \SendinBlue\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateFolderAsync($folderId, $updateFolder) + { + return $this->updateFolderAsyncWithHttpInfo($folderId, $updateFolder) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateFolderAsyncWithHttpInfo + * + * Update a contact folder + * + * @param int $folderId Id of the folder (required) + * @param \SendinBlue\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateFolderAsyncWithHttpInfo($folderId, $updateFolder) + { + $returnType = ''; + $request = $this->updateFolderRequest($folderId, $updateFolder); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateFolder' + * + * @param int $folderId Id of the folder (required) + * @param \SendinBlue\Client\Model\CreateUpdateFolder $updateFolder Name of the folder (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateFolderRequest($folderId, $updateFolder) + { + // verify the required parameter 'folderId' is set + if ($folderId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $folderId when calling updateFolder' + ); + } + // verify the required parameter 'updateFolder' is set + if ($updateFolder === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $updateFolder when calling updateFolder' + ); + } + + $resourcePath = '/contacts/folders/{folderId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($folderId !== null) { + $resourcePath = str_replace( + '{' . 'folderId' . '}', + ObjectSerializer::toPathValue($folderId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($updateFolder)) { + $_tempBody = $updateFolder; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/ListsApi.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/ListsApi.php new file mode 100644 index 0000000..206c481 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/ListsApi.php @@ -0,0 +1,2698 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation addContactToList + * + * Add existing contacts to a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\AddContactToList $contactEmails Emails addresses of the contacts (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\PostContactInfo + */ + public function addContactToList($listId, $contactEmails) + { + list($response) = $this->addContactToListWithHttpInfo($listId, $contactEmails); + return $response; + } + + /** + * Operation addContactToListWithHttpInfo + * + * Add existing contacts to a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\AddContactToList $contactEmails Emails addresses of the contacts (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\PostContactInfo, HTTP status code, HTTP response headers (array of strings) + */ + public function addContactToListWithHttpInfo($listId, $contactEmails) + { + $returnType = '\SendinBlue\Client\Model\PostContactInfo'; + $request = $this->addContactToListRequest($listId, $contactEmails); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\PostContactInfo', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addContactToListAsync + * + * Add existing contacts to a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\AddContactToList $contactEmails Emails addresses of the contacts (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function addContactToListAsync($listId, $contactEmails) + { + return $this->addContactToListAsyncWithHttpInfo($listId, $contactEmails) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addContactToListAsyncWithHttpInfo + * + * Add existing contacts to a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\AddContactToList $contactEmails Emails addresses of the contacts (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function addContactToListAsyncWithHttpInfo($listId, $contactEmails) + { + $returnType = '\SendinBlue\Client\Model\PostContactInfo'; + $request = $this->addContactToListRequest($listId, $contactEmails); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addContactToList' + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\AddContactToList $contactEmails Emails addresses of the contacts (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function addContactToListRequest($listId, $contactEmails) + { + // verify the required parameter 'listId' is set + if ($listId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $listId when calling addContactToList' + ); + } + // verify the required parameter 'contactEmails' is set + if ($contactEmails === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $contactEmails when calling addContactToList' + ); + } + + $resourcePath = '/contacts/lists/{listId}/contacts/add'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($listId !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($listId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($contactEmails)) { + $_tempBody = $contactEmails; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createList + * + * Create a list + * + * @param \SendinBlue\Client\Model\CreateList $createList Values to create a list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreateModel + */ + public function createList($createList) + { + list($response) = $this->createListWithHttpInfo($createList); + return $response; + } + + /** + * Operation createListWithHttpInfo + * + * Create a list + * + * @param \SendinBlue\Client\Model\CreateList $createList Values to create a list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings) + */ + public function createListWithHttpInfo($createList) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createListRequest($createList); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreateModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createListAsync + * + * Create a list + * + * @param \SendinBlue\Client\Model\CreateList $createList Values to create a list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createListAsync($createList) + { + return $this->createListAsyncWithHttpInfo($createList) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createListAsyncWithHttpInfo + * + * Create a list + * + * @param \SendinBlue\Client\Model\CreateList $createList Values to create a list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createListAsyncWithHttpInfo($createList) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createListRequest($createList); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createList' + * + * @param \SendinBlue\Client\Model\CreateList $createList Values to create a list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createListRequest($createList) + { + // verify the required parameter 'createList' is set + if ($createList === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $createList when calling createList' + ); + } + + $resourcePath = '/contacts/lists'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($createList)) { + $_tempBody = $createList; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteList + * + * Delete a list + * + * @param int $listId Id of the list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteList($listId) + { + $this->deleteListWithHttpInfo($listId); + } + + /** + * Operation deleteListWithHttpInfo + * + * Delete a list + * + * @param int $listId Id of the list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteListWithHttpInfo($listId) + { + $returnType = ''; + $request = $this->deleteListRequest($listId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteListAsync + * + * Delete a list + * + * @param int $listId Id of the list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteListAsync($listId) + { + return $this->deleteListAsyncWithHttpInfo($listId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteListAsyncWithHttpInfo + * + * Delete a list + * + * @param int $listId Id of the list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteListAsyncWithHttpInfo($listId) + { + $returnType = ''; + $request = $this->deleteListRequest($listId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteList' + * + * @param int $listId Id of the list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteListRequest($listId) + { + // verify the required parameter 'listId' is set + if ($listId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $listId when calling deleteList' + ); + } + + $resourcePath = '/contacts/lists/{listId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($listId !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($listId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getContactsFromList + * + * Get the contacts in a list + * + * @param int $listId Id of the list (required) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetContacts + */ + public function getContactsFromList($listId, $modifiedSince = null, $limit = '50', $offset = '0') + { + list($response) = $this->getContactsFromListWithHttpInfo($listId, $modifiedSince, $limit, $offset); + return $response; + } + + /** + * Operation getContactsFromListWithHttpInfo + * + * Get the contacts in a list + * + * @param int $listId Id of the list (required) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetContacts, HTTP status code, HTTP response headers (array of strings) + */ + public function getContactsFromListWithHttpInfo($listId, $modifiedSince = null, $limit = '50', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetContacts'; + $request = $this->getContactsFromListRequest($listId, $modifiedSince, $limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetContacts', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getContactsFromListAsync + * + * Get the contacts in a list + * + * @param int $listId Id of the list (required) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getContactsFromListAsync($listId, $modifiedSince = null, $limit = '50', $offset = '0') + { + return $this->getContactsFromListAsyncWithHttpInfo($listId, $modifiedSince, $limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getContactsFromListAsyncWithHttpInfo + * + * Get the contacts in a list + * + * @param int $listId Id of the list (required) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getContactsFromListAsyncWithHttpInfo($listId, $modifiedSince = null, $limit = '50', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetContacts'; + $request = $this->getContactsFromListRequest($listId, $modifiedSince, $limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getContactsFromList' + * + * @param int $listId Id of the list (required) + * @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional) + * @param int $limit Number of documents per page (optional, default to 50) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getContactsFromListRequest($listId, $modifiedSince = null, $limit = '50', $offset = '0') + { + // verify the required parameter 'listId' is set + if ($listId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $listId when calling getContactsFromList' + ); + } + if ($limit !== null && $limit > 500) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ListsApi.getContactsFromList, must be smaller than or equal to 500.'); + } + + + $resourcePath = '/contacts/lists/{listId}/contacts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($modifiedSince !== null) { + $queryParams['modifiedSince'] = ObjectSerializer::toQueryValue($modifiedSince); + } + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + + // path params + if ($listId !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($listId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFolderLists + * + * Get the lists in a folder + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetFolderLists + */ + public function getFolderLists($folderId, $limit = '10', $offset = '0') + { + list($response) = $this->getFolderListsWithHttpInfo($folderId, $limit, $offset); + return $response; + } + + /** + * Operation getFolderListsWithHttpInfo + * + * Get the lists in a folder + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetFolderLists, HTTP status code, HTTP response headers (array of strings) + */ + public function getFolderListsWithHttpInfo($folderId, $limit = '10', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetFolderLists'; + $request = $this->getFolderListsRequest($folderId, $limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetFolderLists', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFolderListsAsync + * + * Get the lists in a folder + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFolderListsAsync($folderId, $limit = '10', $offset = '0') + { + return $this->getFolderListsAsyncWithHttpInfo($folderId, $limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFolderListsAsyncWithHttpInfo + * + * Get the lists in a folder + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFolderListsAsyncWithHttpInfo($folderId, $limit = '10', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetFolderLists'; + $request = $this->getFolderListsRequest($folderId, $limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFolderLists' + * + * @param int $folderId Id of the folder (required) + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0') + { + // verify the required parameter 'folderId' is set + if ($folderId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $folderId when calling getFolderLists' + ); + } + if ($limit !== null && $limit > 50) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ListsApi.getFolderLists, must be smaller than or equal to 50.'); + } + + + $resourcePath = '/contacts/folders/{folderId}/lists'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + + // path params + if ($folderId !== null) { + $resourcePath = str_replace( + '{' . 'folderId' . '}', + ObjectSerializer::toPathValue($folderId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getList + * + * Get the details of a list + * + * @param int $listId Id of the list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetExtendedList + */ + public function getList($listId) + { + list($response) = $this->getListWithHttpInfo($listId); + return $response; + } + + /** + * Operation getListWithHttpInfo + * + * Get the details of a list + * + * @param int $listId Id of the list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetExtendedList, HTTP status code, HTTP response headers (array of strings) + */ + public function getListWithHttpInfo($listId) + { + $returnType = '\SendinBlue\Client\Model\GetExtendedList'; + $request = $this->getListRequest($listId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetExtendedList', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getListAsync + * + * Get the details of a list + * + * @param int $listId Id of the list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getListAsync($listId) + { + return $this->getListAsyncWithHttpInfo($listId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getListAsyncWithHttpInfo + * + * Get the details of a list + * + * @param int $listId Id of the list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getListAsyncWithHttpInfo($listId) + { + $returnType = '\SendinBlue\Client\Model\GetExtendedList'; + $request = $this->getListRequest($listId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getList' + * + * @param int $listId Id of the list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getListRequest($listId) + { + // verify the required parameter 'listId' is set + if ($listId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $listId when calling getList' + ); + } + + $resourcePath = '/contacts/lists/{listId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($listId !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($listId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLists + * + * Get all the lists + * + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetLists + */ + public function getLists($limit = '10', $offset = '0') + { + list($response) = $this->getListsWithHttpInfo($limit, $offset); + return $response; + } + + /** + * Operation getListsWithHttpInfo + * + * Get all the lists + * + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetLists, HTTP status code, HTTP response headers (array of strings) + */ + public function getListsWithHttpInfo($limit = '10', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetLists'; + $request = $this->getListsRequest($limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetLists', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getListsAsync + * + * Get all the lists + * + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getListsAsync($limit = '10', $offset = '0') + { + return $this->getListsAsyncWithHttpInfo($limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getListsAsyncWithHttpInfo + * + * Get all the lists + * + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getListsAsyncWithHttpInfo($limit = '10', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetLists'; + $request = $this->getListsRequest($limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLists' + * + * @param int $limit Number of documents per page (optional, default to 10) + * @param int $offset Index of the first document of the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getListsRequest($limit = '10', $offset = '0') + { + if ($limit !== null && $limit > 50) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ListsApi.getLists, must be smaller than or equal to 50.'); + } + + + $resourcePath = '/contacts/lists'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation removeContactFromList + * + * Remove existing contacts from a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\RemoveContactFromList $contactEmails Emails adresses of the contact (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\PostContactInfo + */ + public function removeContactFromList($listId, $contactEmails) + { + list($response) = $this->removeContactFromListWithHttpInfo($listId, $contactEmails); + return $response; + } + + /** + * Operation removeContactFromListWithHttpInfo + * + * Remove existing contacts from a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\RemoveContactFromList $contactEmails Emails adresses of the contact (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\PostContactInfo, HTTP status code, HTTP response headers (array of strings) + */ + public function removeContactFromListWithHttpInfo($listId, $contactEmails) + { + $returnType = '\SendinBlue\Client\Model\PostContactInfo'; + $request = $this->removeContactFromListRequest($listId, $contactEmails); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\PostContactInfo', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation removeContactFromListAsync + * + * Remove existing contacts from a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\RemoveContactFromList $contactEmails Emails adresses of the contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeContactFromListAsync($listId, $contactEmails) + { + return $this->removeContactFromListAsyncWithHttpInfo($listId, $contactEmails) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation removeContactFromListAsyncWithHttpInfo + * + * Remove existing contacts from a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\RemoveContactFromList $contactEmails Emails adresses of the contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeContactFromListAsyncWithHttpInfo($listId, $contactEmails) + { + $returnType = '\SendinBlue\Client\Model\PostContactInfo'; + $request = $this->removeContactFromListRequest($listId, $contactEmails); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'removeContactFromList' + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\RemoveContactFromList $contactEmails Emails adresses of the contact (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function removeContactFromListRequest($listId, $contactEmails) + { + // verify the required parameter 'listId' is set + if ($listId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $listId when calling removeContactFromList' + ); + } + // verify the required parameter 'contactEmails' is set + if ($contactEmails === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $contactEmails when calling removeContactFromList' + ); + } + + $resourcePath = '/contacts/lists/{listId}/contacts/remove'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($listId !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($listId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($contactEmails)) { + $_tempBody = $contactEmails; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateList + * + * Update a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\UpdateList $updateList Values to update a list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateList($listId, $updateList) + { + $this->updateListWithHttpInfo($listId, $updateList); + } + + /** + * Operation updateListWithHttpInfo + * + * Update a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\UpdateList $updateList Values to update a list (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateListWithHttpInfo($listId, $updateList) + { + $returnType = ''; + $request = $this->updateListRequest($listId, $updateList); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateListAsync + * + * Update a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\UpdateList $updateList Values to update a list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateListAsync($listId, $updateList) + { + return $this->updateListAsyncWithHttpInfo($listId, $updateList) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateListAsyncWithHttpInfo + * + * Update a list + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\UpdateList $updateList Values to update a list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateListAsyncWithHttpInfo($listId, $updateList) + { + $returnType = ''; + $request = $this->updateListRequest($listId, $updateList); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateList' + * + * @param int $listId Id of the list (required) + * @param \SendinBlue\Client\Model\UpdateList $updateList Values to update a list (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateListRequest($listId, $updateList) + { + // verify the required parameter 'listId' is set + if ($listId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $listId when calling updateList' + ); + } + // verify the required parameter 'updateList' is set + if ($updateList === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $updateList when calling updateList' + ); + } + + $resourcePath = '/contacts/lists/{listId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($listId !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($listId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($updateList)) { + $_tempBody = $updateList; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/ProcessApi.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/ProcessApi.php new file mode 100644 index 0000000..a8f1cd8 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/ProcessApi.php @@ -0,0 +1,674 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getProcess + * + * Return the informations for a process + * + * @param int $processId Id of the process (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetProcess + */ + public function getProcess($processId) + { + list($response) = $this->getProcessWithHttpInfo($processId); + return $response; + } + + /** + * Operation getProcessWithHttpInfo + * + * Return the informations for a process + * + * @param int $processId Id of the process (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetProcess, HTTP status code, HTTP response headers (array of strings) + */ + public function getProcessWithHttpInfo($processId) + { + $returnType = '\SendinBlue\Client\Model\GetProcess'; + $request = $this->getProcessRequest($processId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetProcess', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProcessAsync + * + * Return the informations for a process + * + * @param int $processId Id of the process (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProcessAsync($processId) + { + return $this->getProcessAsyncWithHttpInfo($processId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProcessAsyncWithHttpInfo + * + * Return the informations for a process + * + * @param int $processId Id of the process (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProcessAsyncWithHttpInfo($processId) + { + $returnType = '\SendinBlue\Client\Model\GetProcess'; + $request = $this->getProcessRequest($processId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProcess' + * + * @param int $processId Id of the process (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getProcessRequest($processId) + { + // verify the required parameter 'processId' is set + if ($processId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $processId when calling getProcess' + ); + } + + $resourcePath = '/processes/{processId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($processId !== null) { + $resourcePath = str_replace( + '{' . 'processId' . '}', + ObjectSerializer::toPathValue($processId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getProcesses + * + * Return all the processes for your account + * + * @param int $limit Number limitation for the result returned (optional, default to 10) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetProcesses + */ + public function getProcesses($limit = '10', $offset = '0') + { + list($response) = $this->getProcessesWithHttpInfo($limit, $offset); + return $response; + } + + /** + * Operation getProcessesWithHttpInfo + * + * Return all the processes for your account + * + * @param int $limit Number limitation for the result returned (optional, default to 10) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetProcesses, HTTP status code, HTTP response headers (array of strings) + */ + public function getProcessesWithHttpInfo($limit = '10', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetProcesses'; + $request = $this->getProcessesRequest($limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetProcesses', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProcessesAsync + * + * Return all the processes for your account + * + * @param int $limit Number limitation for the result returned (optional, default to 10) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProcessesAsync($limit = '10', $offset = '0') + { + return $this->getProcessesAsyncWithHttpInfo($limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProcessesAsyncWithHttpInfo + * + * Return all the processes for your account + * + * @param int $limit Number limitation for the result returned (optional, default to 10) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProcessesAsyncWithHttpInfo($limit = '10', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetProcesses'; + $request = $this->getProcessesRequest($limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProcesses' + * + * @param int $limit Number limitation for the result returned (optional, default to 10) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getProcessesRequest($limit = '10', $offset = '0') + { + if ($limit !== null && $limit > 50) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ProcessApi.getProcesses, must be smaller than or equal to 50.'); + } + + + $resourcePath = '/processes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/ResellerApi.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/ResellerApi.php new file mode 100644 index 0000000..cf7cf83 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/ResellerApi.php @@ -0,0 +1,4327 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation addCredits + * + * Add Email and/or SMS credits to a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\AddCredits $addCredits Values to post to add credit to a specific child account (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\RemainingCreditModel + */ + public function addCredits($childAuthKey, $addCredits) + { + list($response) = $this->addCreditsWithHttpInfo($childAuthKey, $addCredits); + return $response; + } + + /** + * Operation addCreditsWithHttpInfo + * + * Add Email and/or SMS credits to a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\AddCredits $addCredits Values to post to add credit to a specific child account (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\RemainingCreditModel, HTTP status code, HTTP response headers (array of strings) + */ + public function addCreditsWithHttpInfo($childAuthKey, $addCredits) + { + $returnType = '\SendinBlue\Client\Model\RemainingCreditModel'; + $request = $this->addCreditsRequest($childAuthKey, $addCredits); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\RemainingCreditModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addCreditsAsync + * + * Add Email and/or SMS credits to a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\AddCredits $addCredits Values to post to add credit to a specific child account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function addCreditsAsync($childAuthKey, $addCredits) + { + return $this->addCreditsAsyncWithHttpInfo($childAuthKey, $addCredits) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addCreditsAsyncWithHttpInfo + * + * Add Email and/or SMS credits to a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\AddCredits $addCredits Values to post to add credit to a specific child account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function addCreditsAsyncWithHttpInfo($childAuthKey, $addCredits) + { + $returnType = '\SendinBlue\Client\Model\RemainingCreditModel'; + $request = $this->addCreditsRequest($childAuthKey, $addCredits); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addCredits' + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\AddCredits $addCredits Values to post to add credit to a specific child account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function addCreditsRequest($childAuthKey, $addCredits) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling addCredits' + ); + } + // verify the required parameter 'addCredits' is set + if ($addCredits === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $addCredits when calling addCredits' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/credits/add'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($addCredits)) { + $_tempBody = $addCredits; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation associateIpToChild + * + * Associate a dedicated IP to the child + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to associate (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function associateIpToChild($childAuthKey, $ip) + { + $this->associateIpToChildWithHttpInfo($childAuthKey, $ip); + } + + /** + * Operation associateIpToChildWithHttpInfo + * + * Associate a dedicated IP to the child + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to associate (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function associateIpToChildWithHttpInfo($childAuthKey, $ip) + { + $returnType = ''; + $request = $this->associateIpToChildRequest($childAuthKey, $ip); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation associateIpToChildAsync + * + * Associate a dedicated IP to the child + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to associate (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function associateIpToChildAsync($childAuthKey, $ip) + { + return $this->associateIpToChildAsyncWithHttpInfo($childAuthKey, $ip) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation associateIpToChildAsyncWithHttpInfo + * + * Associate a dedicated IP to the child + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to associate (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function associateIpToChildAsyncWithHttpInfo($childAuthKey, $ip) + { + $returnType = ''; + $request = $this->associateIpToChildRequest($childAuthKey, $ip); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'associateIpToChild' + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to associate (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function associateIpToChildRequest($childAuthKey, $ip) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling associateIpToChild' + ); + } + // verify the required parameter 'ip' is set + if ($ip === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ip when calling associateIpToChild' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/ips/associate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($ip)) { + $_tempBody = $ip; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createChildDomain + * + * Creates a domain for a child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function createChildDomain($childAuthKey, $addChildDomain) + { + $this->createChildDomainWithHttpInfo($childAuthKey, $addChildDomain); + } + + /** + * Operation createChildDomainWithHttpInfo + * + * Creates a domain for a child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function createChildDomainWithHttpInfo($childAuthKey, $addChildDomain) + { + $returnType = ''; + $request = $this->createChildDomainRequest($childAuthKey, $addChildDomain); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createChildDomainAsync + * + * Creates a domain for a child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createChildDomainAsync($childAuthKey, $addChildDomain) + { + return $this->createChildDomainAsyncWithHttpInfo($childAuthKey, $addChildDomain) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createChildDomainAsyncWithHttpInfo + * + * Creates a domain for a child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createChildDomainAsyncWithHttpInfo($childAuthKey, $addChildDomain) + { + $returnType = ''; + $request = $this->createChildDomainRequest($childAuthKey, $addChildDomain); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createChildDomain' + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createChildDomainRequest($childAuthKey, $addChildDomain) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling createChildDomain' + ); + } + // verify the required parameter 'addChildDomain' is set + if ($addChildDomain === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $addChildDomain when calling createChildDomain' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/domains'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($addChildDomain)) { + $_tempBody = $addChildDomain; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createResellerChild + * + * Creates a reseller child + * + * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreateReseller + */ + public function createResellerChild($resellerChild = null) + { + list($response) = $this->createResellerChildWithHttpInfo($resellerChild); + return $response; + } + + /** + * Operation createResellerChildWithHttpInfo + * + * Creates a reseller child + * + * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreateReseller, HTTP status code, HTTP response headers (array of strings) + */ + public function createResellerChildWithHttpInfo($resellerChild = null) + { + $returnType = '\SendinBlue\Client\Model\CreateReseller'; + $request = $this->createResellerChildRequest($resellerChild); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreateReseller', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createResellerChildAsync + * + * Creates a reseller child + * + * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createResellerChildAsync($resellerChild = null) + { + return $this->createResellerChildAsyncWithHttpInfo($resellerChild) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createResellerChildAsyncWithHttpInfo + * + * Creates a reseller child + * + * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createResellerChildAsyncWithHttpInfo($resellerChild = null) + { + $returnType = '\SendinBlue\Client\Model\CreateReseller'; + $request = $this->createResellerChildRequest($resellerChild); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createResellerChild' + * + * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createResellerChildRequest($resellerChild = null) + { + + $resourcePath = '/reseller/children'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($resellerChild)) { + $_tempBody = $resellerChild; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteChildDomain + * + * Deletes the sender domain of the reseller child based on the childAuthKey and domainName passed + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be deleted (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteChildDomain($childAuthKey, $domainName) + { + $this->deleteChildDomainWithHttpInfo($childAuthKey, $domainName); + } + + /** + * Operation deleteChildDomainWithHttpInfo + * + * Deletes the sender domain of the reseller child based on the childAuthKey and domainName passed + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be deleted (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteChildDomainWithHttpInfo($childAuthKey, $domainName) + { + $returnType = ''; + $request = $this->deleteChildDomainRequest($childAuthKey, $domainName); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteChildDomainAsync + * + * Deletes the sender domain of the reseller child based on the childAuthKey and domainName passed + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be deleted (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteChildDomainAsync($childAuthKey, $domainName) + { + return $this->deleteChildDomainAsyncWithHttpInfo($childAuthKey, $domainName) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteChildDomainAsyncWithHttpInfo + * + * Deletes the sender domain of the reseller child based on the childAuthKey and domainName passed + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be deleted (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteChildDomainAsyncWithHttpInfo($childAuthKey, $domainName) + { + $returnType = ''; + $request = $this->deleteChildDomainRequest($childAuthKey, $domainName); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteChildDomain' + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be deleted (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteChildDomainRequest($childAuthKey, $domainName) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling deleteChildDomain' + ); + } + // verify the required parameter 'domainName' is set + if ($domainName === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $domainName when calling deleteChildDomain' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/domains/{domainName}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + // path params + if ($domainName !== null) { + $resourcePath = str_replace( + '{' . 'domainName' . '}', + ObjectSerializer::toPathValue($domainName), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteResellerChild + * + * Deletes a single reseller child based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteResellerChild($childAuthKey) + { + $this->deleteResellerChildWithHttpInfo($childAuthKey); + } + + /** + * Operation deleteResellerChildWithHttpInfo + * + * Deletes a single reseller child based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteResellerChildWithHttpInfo($childAuthKey) + { + $returnType = ''; + $request = $this->deleteResellerChildRequest($childAuthKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteResellerChildAsync + * + * Deletes a single reseller child based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteResellerChildAsync($childAuthKey) + { + return $this->deleteResellerChildAsyncWithHttpInfo($childAuthKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteResellerChildAsyncWithHttpInfo + * + * Deletes a single reseller child based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteResellerChildAsyncWithHttpInfo($childAuthKey) + { + $returnType = ''; + $request = $this->deleteResellerChildRequest($childAuthKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteResellerChild' + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteResellerChildRequest($childAuthKey) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling deleteResellerChild' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation dissociateIpFromChild + * + * Dissociate a dedicated IP to the child + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function dissociateIpFromChild($childAuthKey, $ip) + { + $this->dissociateIpFromChildWithHttpInfo($childAuthKey, $ip); + } + + /** + * Operation dissociateIpFromChildWithHttpInfo + * + * Dissociate a dedicated IP to the child + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function dissociateIpFromChildWithHttpInfo($childAuthKey, $ip) + { + $returnType = ''; + $request = $this->dissociateIpFromChildRequest($childAuthKey, $ip); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation dissociateIpFromChildAsync + * + * Dissociate a dedicated IP to the child + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function dissociateIpFromChildAsync($childAuthKey, $ip) + { + return $this->dissociateIpFromChildAsyncWithHttpInfo($childAuthKey, $ip) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation dissociateIpFromChildAsyncWithHttpInfo + * + * Dissociate a dedicated IP to the child + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function dissociateIpFromChildAsyncWithHttpInfo($childAuthKey, $ip) + { + $returnType = ''; + $request = $this->dissociateIpFromChildRequest($childAuthKey, $ip); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'dissociateIpFromChild' + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function dissociateIpFromChildRequest($childAuthKey, $ip) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling dissociateIpFromChild' + ); + } + // verify the required parameter 'ip' is set + if ($ip === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ip when calling dissociateIpFromChild' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/ips/dissociate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($ip)) { + $_tempBody = $ip; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getChildDomains + * + * Gets all the sender domains of a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetChildDomains + */ + public function getChildDomains($childAuthKey) + { + list($response) = $this->getChildDomainsWithHttpInfo($childAuthKey); + return $response; + } + + /** + * Operation getChildDomainsWithHttpInfo + * + * Gets all the sender domains of a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetChildDomains, HTTP status code, HTTP response headers (array of strings) + */ + public function getChildDomainsWithHttpInfo($childAuthKey) + { + $returnType = '\SendinBlue\Client\Model\GetChildDomains'; + $request = $this->getChildDomainsRequest($childAuthKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetChildDomains', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getChildDomainsAsync + * + * Gets all the sender domains of a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChildDomainsAsync($childAuthKey) + { + return $this->getChildDomainsAsyncWithHttpInfo($childAuthKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getChildDomainsAsyncWithHttpInfo + * + * Gets all the sender domains of a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChildDomainsAsyncWithHttpInfo($childAuthKey) + { + $returnType = '\SendinBlue\Client\Model\GetChildDomains'; + $request = $this->getChildDomainsRequest($childAuthKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getChildDomains' + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getChildDomainsRequest($childAuthKey) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling getChildDomains' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/domains'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getChildInfo + * + * Gets the info about a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetChildInfo + */ + public function getChildInfo($childAuthKey) + { + list($response) = $this->getChildInfoWithHttpInfo($childAuthKey); + return $response; + } + + /** + * Operation getChildInfoWithHttpInfo + * + * Gets the info about a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetChildInfo, HTTP status code, HTTP response headers (array of strings) + */ + public function getChildInfoWithHttpInfo($childAuthKey) + { + $returnType = '\SendinBlue\Client\Model\GetChildInfo'; + $request = $this->getChildInfoRequest($childAuthKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetChildInfo', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getChildInfoAsync + * + * Gets the info about a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChildInfoAsync($childAuthKey) + { + return $this->getChildInfoAsyncWithHttpInfo($childAuthKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getChildInfoAsyncWithHttpInfo + * + * Gets the info about a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChildInfoAsyncWithHttpInfo($childAuthKey) + { + $returnType = '\SendinBlue\Client\Model\GetChildInfo'; + $request = $this->getChildInfoRequest($childAuthKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getChildInfo' + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getChildInfoRequest($childAuthKey) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling getChildInfo' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getResellerChilds + * + * Gets the list of all reseller's children accounts + * + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetChildrenList + */ + public function getResellerChilds() + { + list($response) = $this->getResellerChildsWithHttpInfo(); + return $response; + } + + /** + * Operation getResellerChildsWithHttpInfo + * + * Gets the list of all reseller's children accounts + * + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetChildrenList, HTTP status code, HTTP response headers (array of strings) + */ + public function getResellerChildsWithHttpInfo() + { + $returnType = '\SendinBlue\Client\Model\GetChildrenList'; + $request = $this->getResellerChildsRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetChildrenList', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getResellerChildsAsync + * + * Gets the list of all reseller's children accounts + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getResellerChildsAsync() + { + return $this->getResellerChildsAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getResellerChildsAsyncWithHttpInfo + * + * Gets the list of all reseller's children accounts + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getResellerChildsAsyncWithHttpInfo() + { + $returnType = '\SendinBlue\Client\Model\GetChildrenList'; + $request = $this->getResellerChildsRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getResellerChilds' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getResellerChildsRequest() + { + + $resourcePath = '/reseller/children'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSsoToken + * + * Get session token to access Sendinblue (SSO) + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetSsoToken + */ + public function getSsoToken($childAuthKey) + { + list($response) = $this->getSsoTokenWithHttpInfo($childAuthKey); + return $response; + } + + /** + * Operation getSsoTokenWithHttpInfo + * + * Get session token to access Sendinblue (SSO) + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetSsoToken, HTTP status code, HTTP response headers (array of strings) + */ + public function getSsoTokenWithHttpInfo($childAuthKey) + { + $returnType = '\SendinBlue\Client\Model\GetSsoToken'; + $request = $this->getSsoTokenRequest($childAuthKey); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetSsoToken', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSsoTokenAsync + * + * Get session token to access Sendinblue (SSO) + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSsoTokenAsync($childAuthKey) + { + return $this->getSsoTokenAsyncWithHttpInfo($childAuthKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSsoTokenAsyncWithHttpInfo + * + * Get session token to access Sendinblue (SSO) + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSsoTokenAsyncWithHttpInfo($childAuthKey) + { + $returnType = '\SendinBlue\Client\Model\GetSsoToken'; + $request = $this->getSsoTokenRequest($childAuthKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSsoToken' + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getSsoTokenRequest($childAuthKey) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling getSsoToken' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/auth'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation removeCredits + * + * Remove Email and/or SMS credits from a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\RemainingCreditModel + */ + public function removeCredits($childAuthKey, $removeCredits) + { + list($response) = $this->removeCreditsWithHttpInfo($childAuthKey, $removeCredits); + return $response; + } + + /** + * Operation removeCreditsWithHttpInfo + * + * Remove Email and/or SMS credits from a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\RemainingCreditModel, HTTP status code, HTTP response headers (array of strings) + */ + public function removeCreditsWithHttpInfo($childAuthKey, $removeCredits) + { + $returnType = '\SendinBlue\Client\Model\RemainingCreditModel'; + $request = $this->removeCreditsRequest($childAuthKey, $removeCredits); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\RemainingCreditModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation removeCreditsAsync + * + * Remove Email and/or SMS credits from a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeCreditsAsync($childAuthKey, $removeCredits) + { + return $this->removeCreditsAsyncWithHttpInfo($childAuthKey, $removeCredits) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation removeCreditsAsyncWithHttpInfo + * + * Remove Email and/or SMS credits from a specific child account + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeCreditsAsyncWithHttpInfo($childAuthKey, $removeCredits) + { + $returnType = '\SendinBlue\Client\Model\RemainingCreditModel'; + $request = $this->removeCreditsRequest($childAuthKey, $removeCredits); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'removeCredits' + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function removeCreditsRequest($childAuthKey, $removeCredits) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling removeCredits' + ); + } + // verify the required parameter 'removeCredits' is set + if ($removeCredits === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $removeCredits when calling removeCredits' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/credits/remove'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($removeCredits)) { + $_tempBody = $removeCredits; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateChildAccountStatus + * + * Updates infos of reseller's child account status based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateChildAccountStatus($childAuthKey, $updateChildAccountStatus) + { + $this->updateChildAccountStatusWithHttpInfo($childAuthKey, $updateChildAccountStatus); + } + + /** + * Operation updateChildAccountStatusWithHttpInfo + * + * Updates infos of reseller's child account status based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateChildAccountStatusWithHttpInfo($childAuthKey, $updateChildAccountStatus) + { + $returnType = ''; + $request = $this->updateChildAccountStatusRequest($childAuthKey, $updateChildAccountStatus); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateChildAccountStatusAsync + * + * Updates infos of reseller's child account status based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateChildAccountStatusAsync($childAuthKey, $updateChildAccountStatus) + { + return $this->updateChildAccountStatusAsyncWithHttpInfo($childAuthKey, $updateChildAccountStatus) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateChildAccountStatusAsyncWithHttpInfo + * + * Updates infos of reseller's child account status based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateChildAccountStatusAsyncWithHttpInfo($childAuthKey, $updateChildAccountStatus) + { + $returnType = ''; + $request = $this->updateChildAccountStatusRequest($childAuthKey, $updateChildAccountStatus); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateChildAccountStatus' + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateChildAccountStatusRequest($childAuthKey, $updateChildAccountStatus) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling updateChildAccountStatus' + ); + } + // verify the required parameter 'updateChildAccountStatus' is set + if ($updateChildAccountStatus === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $updateChildAccountStatus when calling updateChildAccountStatus' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/accountStatus'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($updateChildAccountStatus)) { + $_tempBody = $updateChildAccountStatus; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateChildDomain + * + * Updates the sender domain of reseller's child based on the childAuthKey and domainName passed + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be updated (required) + * @param \SendinBlue\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateChildDomain($childAuthKey, $domainName, $updateChildDomain) + { + $this->updateChildDomainWithHttpInfo($childAuthKey, $domainName, $updateChildDomain); + } + + /** + * Operation updateChildDomainWithHttpInfo + * + * Updates the sender domain of reseller's child based on the childAuthKey and domainName passed + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be updated (required) + * @param \SendinBlue\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateChildDomainWithHttpInfo($childAuthKey, $domainName, $updateChildDomain) + { + $returnType = ''; + $request = $this->updateChildDomainRequest($childAuthKey, $domainName, $updateChildDomain); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateChildDomainAsync + * + * Updates the sender domain of reseller's child based on the childAuthKey and domainName passed + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be updated (required) + * @param \SendinBlue\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateChildDomainAsync($childAuthKey, $domainName, $updateChildDomain) + { + return $this->updateChildDomainAsyncWithHttpInfo($childAuthKey, $domainName, $updateChildDomain) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateChildDomainAsyncWithHttpInfo + * + * Updates the sender domain of reseller's child based on the childAuthKey and domainName passed + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be updated (required) + * @param \SendinBlue\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateChildDomainAsyncWithHttpInfo($childAuthKey, $domainName, $updateChildDomain) + { + $returnType = ''; + $request = $this->updateChildDomainRequest($childAuthKey, $domainName, $updateChildDomain); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateChildDomain' + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be updated (required) + * @param \SendinBlue\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateChildDomainRequest($childAuthKey, $domainName, $updateChildDomain) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling updateChildDomain' + ); + } + // verify the required parameter 'domainName' is set + if ($domainName === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $domainName when calling updateChildDomain' + ); + } + // verify the required parameter 'updateChildDomain' is set + if ($updateChildDomain === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $updateChildDomain when calling updateChildDomain' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/domains/{domainName}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + // path params + if ($domainName !== null) { + $resourcePath = str_replace( + '{' . 'domainName' . '}', + ObjectSerializer::toPathValue($domainName), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($updateChildDomain)) { + $_tempBody = $updateChildDomain; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateResellerChild + * + * Updates infos of reseller's child based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChild $resellerChild values to update in child profile (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateResellerChild($childAuthKey, $resellerChild) + { + $this->updateResellerChildWithHttpInfo($childAuthKey, $resellerChild); + } + + /** + * Operation updateResellerChildWithHttpInfo + * + * Updates infos of reseller's child based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChild $resellerChild values to update in child profile (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateResellerChildWithHttpInfo($childAuthKey, $resellerChild) + { + $returnType = ''; + $request = $this->updateResellerChildRequest($childAuthKey, $resellerChild); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateResellerChildAsync + * + * Updates infos of reseller's child based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChild $resellerChild values to update in child profile (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateResellerChildAsync($childAuthKey, $resellerChild) + { + return $this->updateResellerChildAsyncWithHttpInfo($childAuthKey, $resellerChild) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateResellerChildAsyncWithHttpInfo + * + * Updates infos of reseller's child based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChild $resellerChild values to update in child profile (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateResellerChildAsyncWithHttpInfo($childAuthKey, $resellerChild) + { + $returnType = ''; + $request = $this->updateResellerChildRequest($childAuthKey, $resellerChild); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateResellerChild' + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChild $resellerChild values to update in child profile (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateResellerChildRequest($childAuthKey, $resellerChild) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling updateResellerChild' + ); + } + // verify the required parameter 'resellerChild' is set + if ($resellerChild === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $resellerChild when calling updateResellerChild' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($resellerChild)) { + $_tempBody = $resellerChild; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/SMSCampaignsApi.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/SMSCampaignsApi.php new file mode 100644 index 0000000..31345a8 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/SMSCampaignsApi.php @@ -0,0 +1,2842 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createSmsCampaign + * + * Creates an SMS campaign + * + * @param \SendinBlue\Client\Model\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreateModel + */ + public function createSmsCampaign($createSmsCampaign) + { + list($response) = $this->createSmsCampaignWithHttpInfo($createSmsCampaign); + return $response; + } + + /** + * Operation createSmsCampaignWithHttpInfo + * + * Creates an SMS campaign + * + * @param \SendinBlue\Client\Model\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings) + */ + public function createSmsCampaignWithHttpInfo($createSmsCampaign) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createSmsCampaignRequest($createSmsCampaign); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreateModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createSmsCampaignAsync + * + * Creates an SMS campaign + * + * @param \SendinBlue\Client\Model\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSmsCampaignAsync($createSmsCampaign) + { + return $this->createSmsCampaignAsyncWithHttpInfo($createSmsCampaign) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createSmsCampaignAsyncWithHttpInfo + * + * Creates an SMS campaign + * + * @param \SendinBlue\Client\Model\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSmsCampaignAsyncWithHttpInfo($createSmsCampaign) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createSmsCampaignRequest($createSmsCampaign); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createSmsCampaign' + * + * @param \SendinBlue\Client\Model\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createSmsCampaignRequest($createSmsCampaign) + { + // verify the required parameter 'createSmsCampaign' is set + if ($createSmsCampaign === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $createSmsCampaign when calling createSmsCampaign' + ); + } + + $resourcePath = '/smsCampaigns'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($createSmsCampaign)) { + $_tempBody = $createSmsCampaign; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteSmsCampaign + * + * Delete the SMS campaign + * + * @param int $campaignId id of the SMS campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteSmsCampaign($campaignId) + { + $this->deleteSmsCampaignWithHttpInfo($campaignId); + } + + /** + * Operation deleteSmsCampaignWithHttpInfo + * + * Delete the SMS campaign + * + * @param int $campaignId id of the SMS campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteSmsCampaignWithHttpInfo($campaignId) + { + $returnType = ''; + $request = $this->deleteSmsCampaignRequest($campaignId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteSmsCampaignAsync + * + * Delete the SMS campaign + * + * @param int $campaignId id of the SMS campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSmsCampaignAsync($campaignId) + { + return $this->deleteSmsCampaignAsyncWithHttpInfo($campaignId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteSmsCampaignAsyncWithHttpInfo + * + * Delete the SMS campaign + * + * @param int $campaignId id of the SMS campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSmsCampaignAsyncWithHttpInfo($campaignId) + { + $returnType = ''; + $request = $this->deleteSmsCampaignRequest($campaignId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteSmsCampaign' + * + * @param int $campaignId id of the SMS campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteSmsCampaignRequest($campaignId) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling deleteSmsCampaign' + ); + } + + $resourcePath = '/smsCampaigns/{campaignId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSmsCampaign + * + * Get an SMS campaign + * + * @param int $campaignId id of the SMS campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetSmsCampaign + */ + public function getSmsCampaign($campaignId) + { + list($response) = $this->getSmsCampaignWithHttpInfo($campaignId); + return $response; + } + + /** + * Operation getSmsCampaignWithHttpInfo + * + * Get an SMS campaign + * + * @param int $campaignId id of the SMS campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetSmsCampaign, HTTP status code, HTTP response headers (array of strings) + */ + public function getSmsCampaignWithHttpInfo($campaignId) + { + $returnType = '\SendinBlue\Client\Model\GetSmsCampaign'; + $request = $this->getSmsCampaignRequest($campaignId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetSmsCampaign', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSmsCampaignAsync + * + * Get an SMS campaign + * + * @param int $campaignId id of the SMS campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSmsCampaignAsync($campaignId) + { + return $this->getSmsCampaignAsyncWithHttpInfo($campaignId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSmsCampaignAsyncWithHttpInfo + * + * Get an SMS campaign + * + * @param int $campaignId id of the SMS campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSmsCampaignAsyncWithHttpInfo($campaignId) + { + $returnType = '\SendinBlue\Client\Model\GetSmsCampaign'; + $request = $this->getSmsCampaignRequest($campaignId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSmsCampaign' + * + * @param int $campaignId id of the SMS campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getSmsCampaignRequest($campaignId) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling getSmsCampaign' + ); + } + + $resourcePath = '/smsCampaigns/{campaignId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSmsCampaigns + * + * Returns the informations for all your created SMS campaigns + * + * @param string $status Status of campaign. (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number limitation for the result returned (optional, default to 500) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetSmsCampaigns + */ + public function getSmsCampaigns($status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + { + list($response) = $this->getSmsCampaignsWithHttpInfo($status, $startDate, $endDate, $limit, $offset); + return $response; + } + + /** + * Operation getSmsCampaignsWithHttpInfo + * + * Returns the informations for all your created SMS campaigns + * + * @param string $status Status of campaign. (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number limitation for the result returned (optional, default to 500) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetSmsCampaigns, HTTP status code, HTTP response headers (array of strings) + */ + public function getSmsCampaignsWithHttpInfo($status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetSmsCampaigns'; + $request = $this->getSmsCampaignsRequest($status, $startDate, $endDate, $limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetSmsCampaigns', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSmsCampaignsAsync + * + * Returns the informations for all your created SMS campaigns + * + * @param string $status Status of campaign. (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number limitation for the result returned (optional, default to 500) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSmsCampaignsAsync($status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + { + return $this->getSmsCampaignsAsyncWithHttpInfo($status, $startDate, $endDate, $limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSmsCampaignsAsyncWithHttpInfo + * + * Returns the informations for all your created SMS campaigns + * + * @param string $status Status of campaign. (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number limitation for the result returned (optional, default to 500) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSmsCampaignsAsyncWithHttpInfo($status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetSmsCampaigns'; + $request = $this->getSmsCampaignsRequest($status, $startDate, $endDate, $limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSmsCampaigns' + * + * @param string $status Status of campaign. (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number limitation for the result returned (optional, default to 500) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getSmsCampaignsRequest($status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + { + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling SMSCampaignsApi.getSmsCampaigns, must be smaller than or equal to 1000.'); + } + + + $resourcePath = '/smsCampaigns'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($status !== null) { + $queryParams['status'] = ObjectSerializer::toQueryValue($status); + } + // query params + if ($startDate !== null) { + $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate); + } + // query params + if ($endDate !== null) { + $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate); + } + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation requestSmsRecipientExport + * + * Exports the recipients of the specified campaign. + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\RequestSmsRecipientExport $recipientExport Values to send for a recipient export request (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreatedProcessId + */ + public function requestSmsRecipientExport($campaignId, $recipientExport = null) + { + list($response) = $this->requestSmsRecipientExportWithHttpInfo($campaignId, $recipientExport); + return $response; + } + + /** + * Operation requestSmsRecipientExportWithHttpInfo + * + * Exports the recipients of the specified campaign. + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\RequestSmsRecipientExport $recipientExport Values to send for a recipient export request (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreatedProcessId, HTTP status code, HTTP response headers (array of strings) + */ + public function requestSmsRecipientExportWithHttpInfo($campaignId, $recipientExport = null) + { + $returnType = '\SendinBlue\Client\Model\CreatedProcessId'; + $request = $this->requestSmsRecipientExportRequest($campaignId, $recipientExport); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreatedProcessId', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation requestSmsRecipientExportAsync + * + * Exports the recipients of the specified campaign. + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\RequestSmsRecipientExport $recipientExport Values to send for a recipient export request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function requestSmsRecipientExportAsync($campaignId, $recipientExport = null) + { + return $this->requestSmsRecipientExportAsyncWithHttpInfo($campaignId, $recipientExport) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation requestSmsRecipientExportAsyncWithHttpInfo + * + * Exports the recipients of the specified campaign. + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\RequestSmsRecipientExport $recipientExport Values to send for a recipient export request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function requestSmsRecipientExportAsyncWithHttpInfo($campaignId, $recipientExport = null) + { + $returnType = '\SendinBlue\Client\Model\CreatedProcessId'; + $request = $this->requestSmsRecipientExportRequest($campaignId, $recipientExport); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'requestSmsRecipientExport' + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\RequestSmsRecipientExport $recipientExport Values to send for a recipient export request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function requestSmsRecipientExportRequest($campaignId, $recipientExport = null) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling requestSmsRecipientExport' + ); + } + + $resourcePath = '/smsCampaigns/{campaignId}/exportRecipients'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($recipientExport)) { + $_tempBody = $recipientExport; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendSmsCampaignNow + * + * Send your SMS campaign immediately + * + * @param int $campaignId id of the campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function sendSmsCampaignNow($campaignId) + { + $this->sendSmsCampaignNowWithHttpInfo($campaignId); + } + + /** + * Operation sendSmsCampaignNowWithHttpInfo + * + * Send your SMS campaign immediately + * + * @param int $campaignId id of the campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function sendSmsCampaignNowWithHttpInfo($campaignId) + { + $returnType = ''; + $request = $this->sendSmsCampaignNowRequest($campaignId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendSmsCampaignNowAsync + * + * Send your SMS campaign immediately + * + * @param int $campaignId id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendSmsCampaignNowAsync($campaignId) + { + return $this->sendSmsCampaignNowAsyncWithHttpInfo($campaignId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendSmsCampaignNowAsyncWithHttpInfo + * + * Send your SMS campaign immediately + * + * @param int $campaignId id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendSmsCampaignNowAsyncWithHttpInfo($campaignId) + { + $returnType = ''; + $request = $this->sendSmsCampaignNowRequest($campaignId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sendSmsCampaignNow' + * + * @param int $campaignId id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sendSmsCampaignNowRequest($campaignId) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling sendSmsCampaignNow' + ); + } + + $resourcePath = '/smsCampaigns/{campaignId}/sendNow'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendSmsReport + * + * Send report of SMS campaigns + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\SendReport $sendReport Values for send a report (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function sendSmsReport($campaignId, $sendReport) + { + $this->sendSmsReportWithHttpInfo($campaignId, $sendReport); + } + + /** + * Operation sendSmsReportWithHttpInfo + * + * Send report of SMS campaigns + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\SendReport $sendReport Values for send a report (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function sendSmsReportWithHttpInfo($campaignId, $sendReport) + { + $returnType = ''; + $request = $this->sendSmsReportRequest($campaignId, $sendReport); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendSmsReportAsync + * + * Send report of SMS campaigns + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\SendReport $sendReport Values for send a report (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendSmsReportAsync($campaignId, $sendReport) + { + return $this->sendSmsReportAsyncWithHttpInfo($campaignId, $sendReport) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendSmsReportAsyncWithHttpInfo + * + * Send report of SMS campaigns + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\SendReport $sendReport Values for send a report (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendSmsReportAsyncWithHttpInfo($campaignId, $sendReport) + { + $returnType = ''; + $request = $this->sendSmsReportRequest($campaignId, $sendReport); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sendSmsReport' + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\SendReport $sendReport Values for send a report (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sendSmsReportRequest($campaignId, $sendReport) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling sendSmsReport' + ); + } + // verify the required parameter 'sendReport' is set + if ($sendReport === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sendReport when calling sendSmsReport' + ); + } + + $resourcePath = '/smsCampaigns/{campaignId}/sendReport'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($sendReport)) { + $_tempBody = $sendReport; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendTestSms + * + * Send an SMS + * + * @param int $campaignId Id of the SMS campaign (required) + * @param \SendinBlue\Client\Model\SendTestSms $phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function sendTestSms($campaignId, $phoneNumber) + { + $this->sendTestSmsWithHttpInfo($campaignId, $phoneNumber); + } + + /** + * Operation sendTestSmsWithHttpInfo + * + * Send an SMS + * + * @param int $campaignId Id of the SMS campaign (required) + * @param \SendinBlue\Client\Model\SendTestSms $phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function sendTestSmsWithHttpInfo($campaignId, $phoneNumber) + { + $returnType = ''; + $request = $this->sendTestSmsRequest($campaignId, $phoneNumber); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\PostSendSmsTestFailed', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendTestSmsAsync + * + * Send an SMS + * + * @param int $campaignId Id of the SMS campaign (required) + * @param \SendinBlue\Client\Model\SendTestSms $phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTestSmsAsync($campaignId, $phoneNumber) + { + return $this->sendTestSmsAsyncWithHttpInfo($campaignId, $phoneNumber) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendTestSmsAsyncWithHttpInfo + * + * Send an SMS + * + * @param int $campaignId Id of the SMS campaign (required) + * @param \SendinBlue\Client\Model\SendTestSms $phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTestSmsAsyncWithHttpInfo($campaignId, $phoneNumber) + { + $returnType = ''; + $request = $this->sendTestSmsRequest($campaignId, $phoneNumber); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sendTestSms' + * + * @param int $campaignId Id of the SMS campaign (required) + * @param \SendinBlue\Client\Model\SendTestSms $phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sendTestSmsRequest($campaignId, $phoneNumber) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling sendTestSms' + ); + } + // verify the required parameter 'phoneNumber' is set + if ($phoneNumber === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $phoneNumber when calling sendTestSms' + ); + } + + $resourcePath = '/smsCampaigns/{campaignId}/sendTest'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($phoneNumber)) { + $_tempBody = $phoneNumber; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateSmsCampaign + * + * Updates an SMS campaign + * + * @param int $campaignId id of the SMS campaign (required) + * @param \SendinBlue\Client\Model\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateSmsCampaign($campaignId, $updateSmsCampaign) + { + $this->updateSmsCampaignWithHttpInfo($campaignId, $updateSmsCampaign); + } + + /** + * Operation updateSmsCampaignWithHttpInfo + * + * Updates an SMS campaign + * + * @param int $campaignId id of the SMS campaign (required) + * @param \SendinBlue\Client\Model\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateSmsCampaignWithHttpInfo($campaignId, $updateSmsCampaign) + { + $returnType = ''; + $request = $this->updateSmsCampaignRequest($campaignId, $updateSmsCampaign); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateSmsCampaignAsync + * + * Updates an SMS campaign + * + * @param int $campaignId id of the SMS campaign (required) + * @param \SendinBlue\Client\Model\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSmsCampaignAsync($campaignId, $updateSmsCampaign) + { + return $this->updateSmsCampaignAsyncWithHttpInfo($campaignId, $updateSmsCampaign) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateSmsCampaignAsyncWithHttpInfo + * + * Updates an SMS campaign + * + * @param int $campaignId id of the SMS campaign (required) + * @param \SendinBlue\Client\Model\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSmsCampaignAsyncWithHttpInfo($campaignId, $updateSmsCampaign) + { + $returnType = ''; + $request = $this->updateSmsCampaignRequest($campaignId, $updateSmsCampaign); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateSmsCampaign' + * + * @param int $campaignId id of the SMS campaign (required) + * @param \SendinBlue\Client\Model\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateSmsCampaignRequest($campaignId, $updateSmsCampaign) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling updateSmsCampaign' + ); + } + // verify the required parameter 'updateSmsCampaign' is set + if ($updateSmsCampaign === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $updateSmsCampaign when calling updateSmsCampaign' + ); + } + + $resourcePath = '/smsCampaigns/{campaignId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($updateSmsCampaign)) { + $_tempBody = $updateSmsCampaign; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateSmsCampaignStatus + * + * Update the campaign status + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateCampaignStatus $status Status of the campaign. (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateSmsCampaignStatus($campaignId, $status) + { + $this->updateSmsCampaignStatusWithHttpInfo($campaignId, $status); + } + + /** + * Operation updateSmsCampaignStatusWithHttpInfo + * + * Update the campaign status + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateCampaignStatus $status Status of the campaign. (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateSmsCampaignStatusWithHttpInfo($campaignId, $status) + { + $returnType = ''; + $request = $this->updateSmsCampaignStatusRequest($campaignId, $status); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateSmsCampaignStatusAsync + * + * Update the campaign status + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateCampaignStatus $status Status of the campaign. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSmsCampaignStatusAsync($campaignId, $status) + { + return $this->updateSmsCampaignStatusAsyncWithHttpInfo($campaignId, $status) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateSmsCampaignStatusAsyncWithHttpInfo + * + * Update the campaign status + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateCampaignStatus $status Status of the campaign. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSmsCampaignStatusAsyncWithHttpInfo($campaignId, $status) + { + $returnType = ''; + $request = $this->updateSmsCampaignStatusRequest($campaignId, $status); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateSmsCampaignStatus' + * + * @param int $campaignId id of the campaign (required) + * @param \SendinBlue\Client\Model\UpdateCampaignStatus $status Status of the campaign. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateSmsCampaignStatusRequest($campaignId, $status) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling updateSmsCampaignStatus' + ); + } + // verify the required parameter 'status' is set + if ($status === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $status when calling updateSmsCampaignStatus' + ); + } + + $resourcePath = '/smsCampaigns/{campaignId}/status'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($status)) { + $_tempBody = $status; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/SMTPApi.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/SMTPApi.php new file mode 100644 index 0000000..6789ffb --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/SMTPApi.php @@ -0,0 +1,3519 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createSmtpTemplate + * + * Create an smtp template + * + * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreateModel + */ + public function createSmtpTemplate($smtpTemplate) + { + list($response) = $this->createSmtpTemplateWithHttpInfo($smtpTemplate); + return $response; + } + + /** + * Operation createSmtpTemplateWithHttpInfo + * + * Create an smtp template + * + * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings) + */ + public function createSmtpTemplateWithHttpInfo($smtpTemplate) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createSmtpTemplateRequest($smtpTemplate); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreateModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createSmtpTemplateAsync + * + * Create an smtp template + * + * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSmtpTemplateAsync($smtpTemplate) + { + return $this->createSmtpTemplateAsyncWithHttpInfo($smtpTemplate) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createSmtpTemplateAsyncWithHttpInfo + * + * Create an smtp template + * + * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSmtpTemplateAsyncWithHttpInfo($smtpTemplate) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createSmtpTemplateRequest($smtpTemplate); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createSmtpTemplate' + * + * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createSmtpTemplateRequest($smtpTemplate) + { + // verify the required parameter 'smtpTemplate' is set + if ($smtpTemplate === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $smtpTemplate when calling createSmtpTemplate' + ); + } + + $resourcePath = '/smtp/templates'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($smtpTemplate)) { + $_tempBody = $smtpTemplate; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteHardbounces + * + * Delete hardbounces + * + * @param \SendinBlue\Client\Model\DeleteHardbounces $deleteHardbounces values to delete hardbounces (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteHardbounces($deleteHardbounces = null) + { + $this->deleteHardbouncesWithHttpInfo($deleteHardbounces); + } + + /** + * Operation deleteHardbouncesWithHttpInfo + * + * Delete hardbounces + * + * @param \SendinBlue\Client\Model\DeleteHardbounces $deleteHardbounces values to delete hardbounces (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteHardbouncesWithHttpInfo($deleteHardbounces = null) + { + $returnType = ''; + $request = $this->deleteHardbouncesRequest($deleteHardbounces); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteHardbouncesAsync + * + * Delete hardbounces + * + * @param \SendinBlue\Client\Model\DeleteHardbounces $deleteHardbounces values to delete hardbounces (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteHardbouncesAsync($deleteHardbounces = null) + { + return $this->deleteHardbouncesAsyncWithHttpInfo($deleteHardbounces) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteHardbouncesAsyncWithHttpInfo + * + * Delete hardbounces + * + * @param \SendinBlue\Client\Model\DeleteHardbounces $deleteHardbounces values to delete hardbounces (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteHardbouncesAsyncWithHttpInfo($deleteHardbounces = null) + { + $returnType = ''; + $request = $this->deleteHardbouncesRequest($deleteHardbounces); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteHardbounces' + * + * @param \SendinBlue\Client\Model\DeleteHardbounces $deleteHardbounces values to delete hardbounces (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteHardbouncesRequest($deleteHardbounces = null) + { + + $resourcePath = '/smtp/deleteHardbounces'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($deleteHardbounces)) { + $_tempBody = $deleteHardbounces; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteSmtpTemplate + * + * Delete an inactive smtp template + * + * @param int $templateId id of the template (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteSmtpTemplate($templateId) + { + $this->deleteSmtpTemplateWithHttpInfo($templateId); + } + + /** + * Operation deleteSmtpTemplateWithHttpInfo + * + * Delete an inactive smtp template + * + * @param int $templateId id of the template (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteSmtpTemplateWithHttpInfo($templateId) + { + $returnType = ''; + $request = $this->deleteSmtpTemplateRequest($templateId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteSmtpTemplateAsync + * + * Delete an inactive smtp template + * + * @param int $templateId id of the template (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSmtpTemplateAsync($templateId) + { + return $this->deleteSmtpTemplateAsyncWithHttpInfo($templateId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteSmtpTemplateAsyncWithHttpInfo + * + * Delete an inactive smtp template + * + * @param int $templateId id of the template (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSmtpTemplateAsyncWithHttpInfo($templateId) + { + $returnType = ''; + $request = $this->deleteSmtpTemplateRequest($templateId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteSmtpTemplate' + * + * @param int $templateId id of the template (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteSmtpTemplateRequest($templateId) + { + // verify the required parameter 'templateId' is set + if ($templateId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $templateId when calling deleteSmtpTemplate' + ); + } + + $resourcePath = '/smtp/templates/{templateId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($templateId !== null) { + $resourcePath = str_replace( + '{' . 'templateId' . '}', + ObjectSerializer::toPathValue($templateId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAggregatedSmtpReport + * + * Get your SMTP activity aggregated over a period of time + * + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Tag of the emails (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetAggregatedReport + */ + public function getAggregatedSmtpReport($startDate = null, $endDate = null, $days = null, $tag = null) + { + list($response) = $this->getAggregatedSmtpReportWithHttpInfo($startDate, $endDate, $days, $tag); + return $response; + } + + /** + * Operation getAggregatedSmtpReportWithHttpInfo + * + * Get your SMTP activity aggregated over a period of time + * + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Tag of the emails (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetAggregatedReport, HTTP status code, HTTP response headers (array of strings) + */ + public function getAggregatedSmtpReportWithHttpInfo($startDate = null, $endDate = null, $days = null, $tag = null) + { + $returnType = '\SendinBlue\Client\Model\GetAggregatedReport'; + $request = $this->getAggregatedSmtpReportRequest($startDate, $endDate, $days, $tag); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetAggregatedReport', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAggregatedSmtpReportAsync + * + * Get your SMTP activity aggregated over a period of time + * + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Tag of the emails (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAggregatedSmtpReportAsync($startDate = null, $endDate = null, $days = null, $tag = null) + { + return $this->getAggregatedSmtpReportAsyncWithHttpInfo($startDate, $endDate, $days, $tag) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAggregatedSmtpReportAsyncWithHttpInfo + * + * Get your SMTP activity aggregated over a period of time + * + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Tag of the emails (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAggregatedSmtpReportAsyncWithHttpInfo($startDate = null, $endDate = null, $days = null, $tag = null) + { + $returnType = '\SendinBlue\Client\Model\GetAggregatedReport'; + $request = $this->getAggregatedSmtpReportRequest($startDate, $endDate, $days, $tag); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAggregatedSmtpReport' + * + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Tag of the emails (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getAggregatedSmtpReportRequest($startDate = null, $endDate = null, $days = null, $tag = null) + { + + $resourcePath = '/smtp/statistics/aggregatedReport'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($startDate !== null) { + $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate); + } + // query params + if ($endDate !== null) { + $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate); + } + // query params + if ($days !== null) { + $queryParams['days'] = ObjectSerializer::toQueryValue($days); + } + // query params + if ($tag !== null) { + $queryParams['tag'] = ObjectSerializer::toQueryValue($tag); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEmailEventReport + * + * Get all your SMTP activity (unaggregated events) + * + * @param int $limit Number limitation for the result returned (optional, default to 50) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $email Filter the report for a specific email addresses (optional) + * @param string $event Filter the report for a specific event type (optional) + * @param string $tags Filter the report for tags (serialized and urlencoded array) (optional) + * @param string $messageId Filter on a specific message id (optional) + * @param int $templateId Filter on a specific template id (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetEmailEventReport + */ + public function getEmailEventReport($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $email = null, $event = null, $tags = null, $messageId = null, $templateId = null) + { + list($response) = $this->getEmailEventReportWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId); + return $response; + } + + /** + * Operation getEmailEventReportWithHttpInfo + * + * Get all your SMTP activity (unaggregated events) + * + * @param int $limit Number limitation for the result returned (optional, default to 50) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $email Filter the report for a specific email addresses (optional) + * @param string $event Filter the report for a specific event type (optional) + * @param string $tags Filter the report for tags (serialized and urlencoded array) (optional) + * @param string $messageId Filter on a specific message id (optional) + * @param int $templateId Filter on a specific template id (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetEmailEventReport, HTTP status code, HTTP response headers (array of strings) + */ + public function getEmailEventReportWithHttpInfo($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $email = null, $event = null, $tags = null, $messageId = null, $templateId = null) + { + $returnType = '\SendinBlue\Client\Model\GetEmailEventReport'; + $request = $this->getEmailEventReportRequest($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetEmailEventReport', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmailEventReportAsync + * + * Get all your SMTP activity (unaggregated events) + * + * @param int $limit Number limitation for the result returned (optional, default to 50) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $email Filter the report for a specific email addresses (optional) + * @param string $event Filter the report for a specific event type (optional) + * @param string $tags Filter the report for tags (serialized and urlencoded array) (optional) + * @param string $messageId Filter on a specific message id (optional) + * @param int $templateId Filter on a specific template id (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getEmailEventReportAsync($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $email = null, $event = null, $tags = null, $messageId = null, $templateId = null) + { + return $this->getEmailEventReportAsyncWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmailEventReportAsyncWithHttpInfo + * + * Get all your SMTP activity (unaggregated events) + * + * @param int $limit Number limitation for the result returned (optional, default to 50) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $email Filter the report for a specific email addresses (optional) + * @param string $event Filter the report for a specific event type (optional) + * @param string $tags Filter the report for tags (serialized and urlencoded array) (optional) + * @param string $messageId Filter on a specific message id (optional) + * @param int $templateId Filter on a specific template id (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getEmailEventReportAsyncWithHttpInfo($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $email = null, $event = null, $tags = null, $messageId = null, $templateId = null) + { + $returnType = '\SendinBlue\Client\Model\GetEmailEventReport'; + $request = $this->getEmailEventReportRequest($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEmailEventReport' + * + * @param int $limit Number limitation for the result returned (optional, default to 50) + * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $email Filter the report for a specific email addresses (optional) + * @param string $event Filter the report for a specific event type (optional) + * @param string $tags Filter the report for tags (serialized and urlencoded array) (optional) + * @param string $messageId Filter on a specific message id (optional) + * @param int $templateId Filter on a specific template id (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getEmailEventReportRequest($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $email = null, $event = null, $tags = null, $messageId = null, $templateId = null) + { + if ($limit !== null && $limit > 100) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling SMTPApi.getEmailEventReport, must be smaller than or equal to 100.'); + } + + + $resourcePath = '/smtp/statistics/events'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + // query params + if ($startDate !== null) { + $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate); + } + // query params + if ($endDate !== null) { + $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate); + } + // query params + if ($days !== null) { + $queryParams['days'] = ObjectSerializer::toQueryValue($days); + } + // query params + if ($email !== null) { + $queryParams['email'] = ObjectSerializer::toQueryValue($email); + } + // query params + if ($event !== null) { + $queryParams['event'] = ObjectSerializer::toQueryValue($event); + } + // query params + if ($tags !== null) { + $queryParams['tags'] = ObjectSerializer::toQueryValue($tags); + } + // query params + if ($messageId !== null) { + $queryParams['messageId'] = ObjectSerializer::toQueryValue($messageId); + } + // query params + if ($templateId !== null) { + $queryParams['templateId'] = ObjectSerializer::toQueryValue($templateId); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSmtpReport + * + * Get your SMTP activity aggregated per day + * + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document on the page (optional, default to 0) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Tag of the emails (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetReports + */ + public function getSmtpReport($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) + { + list($response) = $this->getSmtpReportWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $tag); + return $response; + } + + /** + * Operation getSmtpReportWithHttpInfo + * + * Get your SMTP activity aggregated per day + * + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document on the page (optional, default to 0) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Tag of the emails (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetReports, HTTP status code, HTTP response headers (array of strings) + */ + public function getSmtpReportWithHttpInfo($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) + { + $returnType = '\SendinBlue\Client\Model\GetReports'; + $request = $this->getSmtpReportRequest($limit, $offset, $startDate, $endDate, $days, $tag); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetReports', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSmtpReportAsync + * + * Get your SMTP activity aggregated per day + * + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document on the page (optional, default to 0) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Tag of the emails (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSmtpReportAsync($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) + { + return $this->getSmtpReportAsyncWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $tag) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSmtpReportAsyncWithHttpInfo + * + * Get your SMTP activity aggregated per day + * + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document on the page (optional, default to 0) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Tag of the emails (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSmtpReportAsyncWithHttpInfo($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) + { + $returnType = '\SendinBlue\Client\Model\GetReports'; + $request = $this->getSmtpReportRequest($limit, $offset, $startDate, $endDate, $days, $tag); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSmtpReport' + * + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document on the page (optional, default to 0) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Tag of the emails (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getSmtpReportRequest($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) + { + if ($limit !== null && $limit > 100) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling SMTPApi.getSmtpReport, must be smaller than or equal to 100.'); + } + + + $resourcePath = '/smtp/statistics/reports'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + // query params + if ($startDate !== null) { + $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate); + } + // query params + if ($endDate !== null) { + $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate); + } + // query params + if ($days !== null) { + $queryParams['days'] = ObjectSerializer::toQueryValue($days); + } + // query params + if ($tag !== null) { + $queryParams['tag'] = ObjectSerializer::toQueryValue($tag); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSmtpTemplate + * + * Returns the template informations + * + * @param int $templateId id of the template (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetSmtpTemplateOverview + */ + public function getSmtpTemplate($templateId) + { + list($response) = $this->getSmtpTemplateWithHttpInfo($templateId); + return $response; + } + + /** + * Operation getSmtpTemplateWithHttpInfo + * + * Returns the template informations + * + * @param int $templateId id of the template (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetSmtpTemplateOverview, HTTP status code, HTTP response headers (array of strings) + */ + public function getSmtpTemplateWithHttpInfo($templateId) + { + $returnType = '\SendinBlue\Client\Model\GetSmtpTemplateOverview'; + $request = $this->getSmtpTemplateRequest($templateId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetSmtpTemplateOverview', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSmtpTemplateAsync + * + * Returns the template informations + * + * @param int $templateId id of the template (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSmtpTemplateAsync($templateId) + { + return $this->getSmtpTemplateAsyncWithHttpInfo($templateId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSmtpTemplateAsyncWithHttpInfo + * + * Returns the template informations + * + * @param int $templateId id of the template (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSmtpTemplateAsyncWithHttpInfo($templateId) + { + $returnType = '\SendinBlue\Client\Model\GetSmtpTemplateOverview'; + $request = $this->getSmtpTemplateRequest($templateId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSmtpTemplate' + * + * @param int $templateId id of the template (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getSmtpTemplateRequest($templateId) + { + // verify the required parameter 'templateId' is set + if ($templateId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $templateId when calling getSmtpTemplate' + ); + } + + $resourcePath = '/smtp/templates/{templateId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($templateId !== null) { + $resourcePath = str_replace( + '{' . 'templateId' . '}', + ObjectSerializer::toPathValue($templateId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSmtpTemplates + * + * Get the list of SMTP templates + * + * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional) + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document in the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetSmtpTemplates + */ + public function getSmtpTemplates($templateStatus = null, $limit = '50', $offset = '0') + { + list($response) = $this->getSmtpTemplatesWithHttpInfo($templateStatus, $limit, $offset); + return $response; + } + + /** + * Operation getSmtpTemplatesWithHttpInfo + * + * Get the list of SMTP templates + * + * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional) + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document in the page (optional, default to 0) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetSmtpTemplates, HTTP status code, HTTP response headers (array of strings) + */ + public function getSmtpTemplatesWithHttpInfo($templateStatus = null, $limit = '50', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetSmtpTemplates'; + $request = $this->getSmtpTemplatesRequest($templateStatus, $limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetSmtpTemplates', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSmtpTemplatesAsync + * + * Get the list of SMTP templates + * + * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional) + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document in the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSmtpTemplatesAsync($templateStatus = null, $limit = '50', $offset = '0') + { + return $this->getSmtpTemplatesAsyncWithHttpInfo($templateStatus, $limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSmtpTemplatesAsyncWithHttpInfo + * + * Get the list of SMTP templates + * + * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional) + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document in the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSmtpTemplatesAsyncWithHttpInfo($templateStatus = null, $limit = '50', $offset = '0') + { + $returnType = '\SendinBlue\Client\Model\GetSmtpTemplates'; + $request = $this->getSmtpTemplatesRequest($templateStatus, $limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSmtpTemplates' + * + * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional) + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document in the page (optional, default to 0) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getSmtpTemplatesRequest($templateStatus = null, $limit = '50', $offset = '0') + { + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling SMTPApi.getSmtpTemplates, must be smaller than or equal to 1000.'); + } + + + $resourcePath = '/smtp/templates'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($templateStatus !== null) { + $queryParams['templateStatus'] = ObjectSerializer::toQueryValue($templateStatus); + } + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendTemplate + * + * Send a template + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendEmail $sendEmail sendEmail (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\SendTemplateEmail + */ + public function sendTemplate($templateId, $sendEmail) + { + list($response) = $this->sendTemplateWithHttpInfo($templateId, $sendEmail); + return $response; + } + + /** + * Operation sendTemplateWithHttpInfo + * + * Send a template + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendEmail $sendEmail (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\SendTemplateEmail, HTTP status code, HTTP response headers (array of strings) + */ + public function sendTemplateWithHttpInfo($templateId, $sendEmail) + { + $returnType = '\SendinBlue\Client\Model\SendTemplateEmail'; + $request = $this->sendTemplateRequest($templateId, $sendEmail); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\SendTemplateEmail', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\PostSendFailed', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendTemplateAsync + * + * Send a template + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendEmail $sendEmail (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTemplateAsync($templateId, $sendEmail) + { + return $this->sendTemplateAsyncWithHttpInfo($templateId, $sendEmail) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendTemplateAsyncWithHttpInfo + * + * Send a template + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendEmail $sendEmail (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTemplateAsyncWithHttpInfo($templateId, $sendEmail) + { + $returnType = '\SendinBlue\Client\Model\SendTemplateEmail'; + $request = $this->sendTemplateRequest($templateId, $sendEmail); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sendTemplate' + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendEmail $sendEmail (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sendTemplateRequest($templateId, $sendEmail) + { + // verify the required parameter 'templateId' is set + if ($templateId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $templateId when calling sendTemplate' + ); + } + // verify the required parameter 'sendEmail' is set + if ($sendEmail === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sendEmail when calling sendTemplate' + ); + } + + $resourcePath = '/smtp/templates/{templateId}/send'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($templateId !== null) { + $resourcePath = str_replace( + '{' . 'templateId' . '}', + ObjectSerializer::toPathValue($templateId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($sendEmail)) { + $_tempBody = $sendEmail; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendTestTemplate + * + * Send a template to your test list + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail sendTestEmail (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function sendTestTemplate($templateId, $sendTestEmail) + { + $this->sendTestTemplateWithHttpInfo($templateId, $sendTestEmail); + } + + /** + * Operation sendTestTemplateWithHttpInfo + * + * Send a template to your test list + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function sendTestTemplateWithHttpInfo($templateId, $sendTestEmail) + { + $returnType = ''; + $request = $this->sendTestTemplateRequest($templateId, $sendTestEmail); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\PostSendFailed', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendTestTemplateAsync + * + * Send a template to your test list + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTestTemplateAsync($templateId, $sendTestEmail) + { + return $this->sendTestTemplateAsyncWithHttpInfo($templateId, $sendTestEmail) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendTestTemplateAsyncWithHttpInfo + * + * Send a template to your test list + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTestTemplateAsyncWithHttpInfo($templateId, $sendTestEmail) + { + $returnType = ''; + $request = $this->sendTestTemplateRequest($templateId, $sendTestEmail); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sendTestTemplate' + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sendTestTemplateRequest($templateId, $sendTestEmail) + { + // verify the required parameter 'templateId' is set + if ($templateId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $templateId when calling sendTestTemplate' + ); + } + // verify the required parameter 'sendTestEmail' is set + if ($sendTestEmail === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sendTestEmail when calling sendTestTemplate' + ); + } + + $resourcePath = '/smtp/templates/{templateId}/sendTest'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($templateId !== null) { + $resourcePath = str_replace( + '{' . 'templateId' . '}', + ObjectSerializer::toPathValue($templateId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($sendTestEmail)) { + $_tempBody = $sendTestEmail; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendTransacEmail + * + * Send a transactional email + * + * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreateSmtpEmail + */ + public function sendTransacEmail($sendSmtpEmail) + { + list($response) = $this->sendTransacEmailWithHttpInfo($sendSmtpEmail); + return $response; + } + + /** + * Operation sendTransacEmailWithHttpInfo + * + * Send a transactional email + * + * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreateSmtpEmail, HTTP status code, HTTP response headers (array of strings) + */ + public function sendTransacEmailWithHttpInfo($sendSmtpEmail) + { + $returnType = '\SendinBlue\Client\Model\CreateSmtpEmail'; + $request = $this->sendTransacEmailRequest($sendSmtpEmail); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreateSmtpEmail', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendTransacEmailAsync + * + * Send a transactional email + * + * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTransacEmailAsync($sendSmtpEmail) + { + return $this->sendTransacEmailAsyncWithHttpInfo($sendSmtpEmail) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendTransacEmailAsyncWithHttpInfo + * + * Send a transactional email + * + * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTransacEmailAsyncWithHttpInfo($sendSmtpEmail) + { + $returnType = '\SendinBlue\Client\Model\CreateSmtpEmail'; + $request = $this->sendTransacEmailRequest($sendSmtpEmail); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sendTransacEmail' + * + * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sendTransacEmailRequest($sendSmtpEmail) + { + // verify the required parameter 'sendSmtpEmail' is set + if ($sendSmtpEmail === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sendSmtpEmail when calling sendTransacEmail' + ); + } + + $resourcePath = '/smtp/email'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($sendSmtpEmail)) { + $_tempBody = $sendSmtpEmail; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateSmtpTemplate + * + * Updates an smtp templates + * + * @param int $templateId id of the template (required) + * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateSmtpTemplate($templateId, $smtpTemplate) + { + $this->updateSmtpTemplateWithHttpInfo($templateId, $smtpTemplate); + } + + /** + * Operation updateSmtpTemplateWithHttpInfo + * + * Updates an smtp templates + * + * @param int $templateId id of the template (required) + * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateSmtpTemplateWithHttpInfo($templateId, $smtpTemplate) + { + $returnType = ''; + $request = $this->updateSmtpTemplateRequest($templateId, $smtpTemplate); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateSmtpTemplateAsync + * + * Updates an smtp templates + * + * @param int $templateId id of the template (required) + * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSmtpTemplateAsync($templateId, $smtpTemplate) + { + return $this->updateSmtpTemplateAsyncWithHttpInfo($templateId, $smtpTemplate) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateSmtpTemplateAsyncWithHttpInfo + * + * Updates an smtp templates + * + * @param int $templateId id of the template (required) + * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSmtpTemplateAsyncWithHttpInfo($templateId, $smtpTemplate) + { + $returnType = ''; + $request = $this->updateSmtpTemplateRequest($templateId, $smtpTemplate); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateSmtpTemplate' + * + * @param int $templateId id of the template (required) + * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateSmtpTemplateRequest($templateId, $smtpTemplate) + { + // verify the required parameter 'templateId' is set + if ($templateId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $templateId when calling updateSmtpTemplate' + ); + } + // verify the required parameter 'smtpTemplate' is set + if ($smtpTemplate === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $smtpTemplate when calling updateSmtpTemplate' + ); + } + + $resourcePath = '/smtp/templates/{templateId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($templateId !== null) { + $resourcePath = str_replace( + '{' . 'templateId' . '}', + ObjectSerializer::toPathValue($templateId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($smtpTemplate)) { + $_tempBody = $smtpTemplate; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/SendersApi.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/SendersApi.php new file mode 100644 index 0000000..fade455 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/SendersApi.php @@ -0,0 +1,1702 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createSender + * + * Create a new sender + * + * @param \SendinBlue\Client\Model\CreateSender $sender sender's name (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreateSenderModel + */ + public function createSender($sender = null) + { + list($response) = $this->createSenderWithHttpInfo($sender); + return $response; + } + + /** + * Operation createSenderWithHttpInfo + * + * Create a new sender + * + * @param \SendinBlue\Client\Model\CreateSender $sender sender's name (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreateSenderModel, HTTP status code, HTTP response headers (array of strings) + */ + public function createSenderWithHttpInfo($sender = null) + { + $returnType = '\SendinBlue\Client\Model\CreateSenderModel'; + $request = $this->createSenderRequest($sender); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreateSenderModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createSenderAsync + * + * Create a new sender + * + * @param \SendinBlue\Client\Model\CreateSender $sender sender's name (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSenderAsync($sender = null) + { + return $this->createSenderAsyncWithHttpInfo($sender) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createSenderAsyncWithHttpInfo + * + * Create a new sender + * + * @param \SendinBlue\Client\Model\CreateSender $sender sender's name (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSenderAsyncWithHttpInfo($sender = null) + { + $returnType = '\SendinBlue\Client\Model\CreateSenderModel'; + $request = $this->createSenderRequest($sender); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createSender' + * + * @param \SendinBlue\Client\Model\CreateSender $sender sender's name (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createSenderRequest($sender = null) + { + + $resourcePath = '/senders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($sender)) { + $_tempBody = $sender; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteSender + * + * Delete a sender + * + * @param int $senderId Id of the sender (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteSender($senderId) + { + $this->deleteSenderWithHttpInfo($senderId); + } + + /** + * Operation deleteSenderWithHttpInfo + * + * Delete a sender + * + * @param int $senderId Id of the sender (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteSenderWithHttpInfo($senderId) + { + $returnType = ''; + $request = $this->deleteSenderRequest($senderId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteSenderAsync + * + * Delete a sender + * + * @param int $senderId Id of the sender (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSenderAsync($senderId) + { + return $this->deleteSenderAsyncWithHttpInfo($senderId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteSenderAsyncWithHttpInfo + * + * Delete a sender + * + * @param int $senderId Id of the sender (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSenderAsyncWithHttpInfo($senderId) + { + $returnType = ''; + $request = $this->deleteSenderRequest($senderId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteSender' + * + * @param int $senderId Id of the sender (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteSenderRequest($senderId) + { + // verify the required parameter 'senderId' is set + if ($senderId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $senderId when calling deleteSender' + ); + } + + $resourcePath = '/senders/{senderId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($senderId !== null) { + $resourcePath = str_replace( + '{' . 'senderId' . '}', + ObjectSerializer::toPathValue($senderId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getIps + * + * Return all the dedicated IPs for your account + * + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetIps + */ + public function getIps() + { + list($response) = $this->getIpsWithHttpInfo(); + return $response; + } + + /** + * Operation getIpsWithHttpInfo + * + * Return all the dedicated IPs for your account + * + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetIps, HTTP status code, HTTP response headers (array of strings) + */ + public function getIpsWithHttpInfo() + { + $returnType = '\SendinBlue\Client\Model\GetIps'; + $request = $this->getIpsRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetIps', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getIpsAsync + * + * Return all the dedicated IPs for your account + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getIpsAsync() + { + return $this->getIpsAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getIpsAsyncWithHttpInfo + * + * Return all the dedicated IPs for your account + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getIpsAsyncWithHttpInfo() + { + $returnType = '\SendinBlue\Client\Model\GetIps'; + $request = $this->getIpsRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getIps' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getIpsRequest() + { + + $resourcePath = '/senders/ips'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getIpsFromSender + * + * Return all the dedicated IPs for a sender + * + * @param int $senderId Id of the sender (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetIpsFromSender + */ + public function getIpsFromSender($senderId) + { + list($response) = $this->getIpsFromSenderWithHttpInfo($senderId); + return $response; + } + + /** + * Operation getIpsFromSenderWithHttpInfo + * + * Return all the dedicated IPs for a sender + * + * @param int $senderId Id of the sender (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetIpsFromSender, HTTP status code, HTTP response headers (array of strings) + */ + public function getIpsFromSenderWithHttpInfo($senderId) + { + $returnType = '\SendinBlue\Client\Model\GetIpsFromSender'; + $request = $this->getIpsFromSenderRequest($senderId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetIpsFromSender', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getIpsFromSenderAsync + * + * Return all the dedicated IPs for a sender + * + * @param int $senderId Id of the sender (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getIpsFromSenderAsync($senderId) + { + return $this->getIpsFromSenderAsyncWithHttpInfo($senderId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getIpsFromSenderAsyncWithHttpInfo + * + * Return all the dedicated IPs for a sender + * + * @param int $senderId Id of the sender (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getIpsFromSenderAsyncWithHttpInfo($senderId) + { + $returnType = '\SendinBlue\Client\Model\GetIpsFromSender'; + $request = $this->getIpsFromSenderRequest($senderId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getIpsFromSender' + * + * @param int $senderId Id of the sender (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getIpsFromSenderRequest($senderId) + { + // verify the required parameter 'senderId' is set + if ($senderId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $senderId when calling getIpsFromSender' + ); + } + + $resourcePath = '/senders/{senderId}/ips'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($senderId !== null) { + $resourcePath = str_replace( + '{' . 'senderId' . '}', + ObjectSerializer::toPathValue($senderId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSenders + * + * Get the list of all your senders + * + * @param string $ip Filter your senders for a specific ip (available for dedicated IP usage only) (optional) + * @param string $domain Filter your senders for a specific domain (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetSendersList + */ + public function getSenders($ip = null, $domain = null) + { + list($response) = $this->getSendersWithHttpInfo($ip, $domain); + return $response; + } + + /** + * Operation getSendersWithHttpInfo + * + * Get the list of all your senders + * + * @param string $ip Filter your senders for a specific ip (available for dedicated IP usage only) (optional) + * @param string $domain Filter your senders for a specific domain (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetSendersList, HTTP status code, HTTP response headers (array of strings) + */ + public function getSendersWithHttpInfo($ip = null, $domain = null) + { + $returnType = '\SendinBlue\Client\Model\GetSendersList'; + $request = $this->getSendersRequest($ip, $domain); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetSendersList', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSendersAsync + * + * Get the list of all your senders + * + * @param string $ip Filter your senders for a specific ip (available for dedicated IP usage only) (optional) + * @param string $domain Filter your senders for a specific domain (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSendersAsync($ip = null, $domain = null) + { + return $this->getSendersAsyncWithHttpInfo($ip, $domain) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSendersAsyncWithHttpInfo + * + * Get the list of all your senders + * + * @param string $ip Filter your senders for a specific ip (available for dedicated IP usage only) (optional) + * @param string $domain Filter your senders for a specific domain (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSendersAsyncWithHttpInfo($ip = null, $domain = null) + { + $returnType = '\SendinBlue\Client\Model\GetSendersList'; + $request = $this->getSendersRequest($ip, $domain); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSenders' + * + * @param string $ip Filter your senders for a specific ip (available for dedicated IP usage only) (optional) + * @param string $domain Filter your senders for a specific domain (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getSendersRequest($ip = null, $domain = null) + { + + $resourcePath = '/senders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($ip !== null) { + $queryParams['ip'] = ObjectSerializer::toQueryValue($ip); + } + // query params + if ($domain !== null) { + $queryParams['domain'] = ObjectSerializer::toQueryValue($domain); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateSender + * + * Update a sender + * + * @param int $senderId Id of the sender (required) + * @param \SendinBlue\Client\Model\UpdateSender $sender sender's name (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateSender($senderId, $sender = null) + { + $this->updateSenderWithHttpInfo($senderId, $sender); + } + + /** + * Operation updateSenderWithHttpInfo + * + * Update a sender + * + * @param int $senderId Id of the sender (required) + * @param \SendinBlue\Client\Model\UpdateSender $sender sender's name (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateSenderWithHttpInfo($senderId, $sender = null) + { + $returnType = ''; + $request = $this->updateSenderRequest($senderId, $sender); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateSenderAsync + * + * Update a sender + * + * @param int $senderId Id of the sender (required) + * @param \SendinBlue\Client\Model\UpdateSender $sender sender's name (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSenderAsync($senderId, $sender = null) + { + return $this->updateSenderAsyncWithHttpInfo($senderId, $sender) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateSenderAsyncWithHttpInfo + * + * Update a sender + * + * @param int $senderId Id of the sender (required) + * @param \SendinBlue\Client\Model\UpdateSender $sender sender's name (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSenderAsyncWithHttpInfo($senderId, $sender = null) + { + $returnType = ''; + $request = $this->updateSenderRequest($senderId, $sender); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateSender' + * + * @param int $senderId Id of the sender (required) + * @param \SendinBlue\Client\Model\UpdateSender $sender sender's name (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateSenderRequest($senderId, $sender = null) + { + // verify the required parameter 'senderId' is set + if ($senderId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $senderId when calling updateSender' + ); + } + + $resourcePath = '/senders/{senderId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($senderId !== null) { + $resourcePath = str_replace( + '{' . 'senderId' . '}', + ObjectSerializer::toPathValue($senderId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($sender)) { + $_tempBody = $sender; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/TransactionalSMSApi.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/TransactionalSMSApi.php new file mode 100644 index 0000000..3391fdf --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/TransactionalSMSApi.php @@ -0,0 +1,1317 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getSmsEvents + * + * Get all the SMS activity (unaggregated events) + * + * @param int $limit Number of documents per page (optional, default to 50) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $offset Index of the first document of the page (optional, default to 0) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $phoneNumber Filter the report for a specific phone number (optional) + * @param string $event Filter the report for specific events (optional) + * @param string $tags Filter the report for specific tags passed as a serialized urlencoded array (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetSmsEventReport + */ + public function getSmsEvents($limit = '50', $startDate = null, $endDate = null, $offset = '0', $days = null, $phoneNumber = null, $event = null, $tags = null) + { + list($response) = $this->getSmsEventsWithHttpInfo($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags); + return $response; + } + + /** + * Operation getSmsEventsWithHttpInfo + * + * Get all the SMS activity (unaggregated events) + * + * @param int $limit Number of documents per page (optional, default to 50) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $offset Index of the first document of the page (optional, default to 0) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $phoneNumber Filter the report for a specific phone number (optional) + * @param string $event Filter the report for specific events (optional) + * @param string $tags Filter the report for specific tags passed as a serialized urlencoded array (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetSmsEventReport, HTTP status code, HTTP response headers (array of strings) + */ + public function getSmsEventsWithHttpInfo($limit = '50', $startDate = null, $endDate = null, $offset = '0', $days = null, $phoneNumber = null, $event = null, $tags = null) + { + $returnType = '\SendinBlue\Client\Model\GetSmsEventReport'; + $request = $this->getSmsEventsRequest($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetSmsEventReport', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSmsEventsAsync + * + * Get all the SMS activity (unaggregated events) + * + * @param int $limit Number of documents per page (optional, default to 50) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $offset Index of the first document of the page (optional, default to 0) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $phoneNumber Filter the report for a specific phone number (optional) + * @param string $event Filter the report for specific events (optional) + * @param string $tags Filter the report for specific tags passed as a serialized urlencoded array (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSmsEventsAsync($limit = '50', $startDate = null, $endDate = null, $offset = '0', $days = null, $phoneNumber = null, $event = null, $tags = null) + { + return $this->getSmsEventsAsyncWithHttpInfo($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSmsEventsAsyncWithHttpInfo + * + * Get all the SMS activity (unaggregated events) + * + * @param int $limit Number of documents per page (optional, default to 50) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $offset Index of the first document of the page (optional, default to 0) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $phoneNumber Filter the report for a specific phone number (optional) + * @param string $event Filter the report for specific events (optional) + * @param string $tags Filter the report for specific tags passed as a serialized urlencoded array (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSmsEventsAsyncWithHttpInfo($limit = '50', $startDate = null, $endDate = null, $offset = '0', $days = null, $phoneNumber = null, $event = null, $tags = null) + { + $returnType = '\SendinBlue\Client\Model\GetSmsEventReport'; + $request = $this->getSmsEventsRequest($limit, $startDate, $endDate, $offset, $days, $phoneNumber, $event, $tags); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSmsEvents' + * + * @param int $limit Number of documents per page (optional, default to 50) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $offset Index of the first document of the page (optional, default to 0) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $phoneNumber Filter the report for a specific phone number (optional) + * @param string $event Filter the report for specific events (optional) + * @param string $tags Filter the report for specific tags passed as a serialized urlencoded array (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getSmsEventsRequest($limit = '50', $startDate = null, $endDate = null, $offset = '0', $days = null, $phoneNumber = null, $event = null, $tags = null) + { + if ($limit !== null && $limit > 100) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling TransactionalSMSApi.getSmsEvents, must be smaller than or equal to 100.'); + } + + + $resourcePath = '/transactionalSMS/statistics/events'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($startDate !== null) { + $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate); + } + // query params + if ($endDate !== null) { + $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + // query params + if ($days !== null) { + $queryParams['days'] = ObjectSerializer::toQueryValue($days); + } + // query params + if ($phoneNumber !== null) { + $queryParams['phoneNumber'] = ObjectSerializer::toQueryValue($phoneNumber); + } + // query params + if ($event !== null) { + $queryParams['event'] = ObjectSerializer::toQueryValue($event); + } + // query params + if ($tags !== null) { + $queryParams['tags'] = ObjectSerializer::toQueryValue($tags); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTransacAggregatedSmsReport + * + * Get your SMS activity aggregated over a period of time + * + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) + * @param string $tag Filter on a tag (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetTransacAggregatedSmsReport + */ + public function getTransacAggregatedSmsReport($startDate = null, $endDate = null, $days = null, $tag = null) + { + list($response) = $this->getTransacAggregatedSmsReportWithHttpInfo($startDate, $endDate, $days, $tag); + return $response; + } + + /** + * Operation getTransacAggregatedSmsReportWithHttpInfo + * + * Get your SMS activity aggregated over a period of time + * + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) + * @param string $tag Filter on a tag (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetTransacAggregatedSmsReport, HTTP status code, HTTP response headers (array of strings) + */ + public function getTransacAggregatedSmsReportWithHttpInfo($startDate = null, $endDate = null, $days = null, $tag = null) + { + $returnType = '\SendinBlue\Client\Model\GetTransacAggregatedSmsReport'; + $request = $this->getTransacAggregatedSmsReportRequest($startDate, $endDate, $days, $tag); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetTransacAggregatedSmsReport', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTransacAggregatedSmsReportAsync + * + * Get your SMS activity aggregated over a period of time + * + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) + * @param string $tag Filter on a tag (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTransacAggregatedSmsReportAsync($startDate = null, $endDate = null, $days = null, $tag = null) + { + return $this->getTransacAggregatedSmsReportAsyncWithHttpInfo($startDate, $endDate, $days, $tag) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTransacAggregatedSmsReportAsyncWithHttpInfo + * + * Get your SMS activity aggregated over a period of time + * + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) + * @param string $tag Filter on a tag (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTransacAggregatedSmsReportAsyncWithHttpInfo($startDate = null, $endDate = null, $days = null, $tag = null) + { + $returnType = '\SendinBlue\Client\Model\GetTransacAggregatedSmsReport'; + $request = $this->getTransacAggregatedSmsReportRequest($startDate, $endDate, $days, $tag); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTransacAggregatedSmsReport' + * + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) + * @param string $tag Filter on a tag (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getTransacAggregatedSmsReportRequest($startDate = null, $endDate = null, $days = null, $tag = null) + { + + $resourcePath = '/transactionalSMS/statistics/aggregatedReport'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($startDate !== null) { + $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate); + } + // query params + if ($endDate !== null) { + $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate); + } + // query params + if ($days !== null) { + $queryParams['days'] = ObjectSerializer::toQueryValue($days); + } + // query params + if ($tag !== null) { + $queryParams['tag'] = ObjectSerializer::toQueryValue($tag); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTransacSmsReport + * + * Get your SMS activity aggregated per day + * + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Filter on a tag (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetTransacSmsReport + */ + public function getTransacSmsReport($startDate = null, $endDate = null, $days = null, $tag = null) + { + list($response) = $this->getTransacSmsReportWithHttpInfo($startDate, $endDate, $days, $tag); + return $response; + } + + /** + * Operation getTransacSmsReportWithHttpInfo + * + * Get your SMS activity aggregated per day + * + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Filter on a tag (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetTransacSmsReport, HTTP status code, HTTP response headers (array of strings) + */ + public function getTransacSmsReportWithHttpInfo($startDate = null, $endDate = null, $days = null, $tag = null) + { + $returnType = '\SendinBlue\Client\Model\GetTransacSmsReport'; + $request = $this->getTransacSmsReportRequest($startDate, $endDate, $days, $tag); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetTransacSmsReport', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTransacSmsReportAsync + * + * Get your SMS activity aggregated per day + * + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Filter on a tag (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTransacSmsReportAsync($startDate = null, $endDate = null, $days = null, $tag = null) + { + return $this->getTransacSmsReportAsyncWithHttpInfo($startDate, $endDate, $days, $tag) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTransacSmsReportAsyncWithHttpInfo + * + * Get your SMS activity aggregated per day + * + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Filter on a tag (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getTransacSmsReportAsyncWithHttpInfo($startDate = null, $endDate = null, $days = null, $tag = null) + { + $returnType = '\SendinBlue\Client\Model\GetTransacSmsReport'; + $request = $this->getTransacSmsReportRequest($startDate, $endDate, $days, $tag); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTransacSmsReport' + * + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) + * @param string $tag Filter on a tag (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getTransacSmsReportRequest($startDate = null, $endDate = null, $days = null, $tag = null) + { + + $resourcePath = '/transactionalSMS/statistics/reports'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($startDate !== null) { + $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate); + } + // query params + if ($endDate !== null) { + $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate); + } + // query params + if ($days !== null) { + $queryParams['days'] = ObjectSerializer::toQueryValue($days); + } + // query params + if ($tag !== null) { + $queryParams['tag'] = ObjectSerializer::toQueryValue($tag); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendTransacSms + * + * Send the SMS campaign to the specified mobile number + * + * @param \SendinBlue\Client\Model\SendTransacSms $sendTransacSms Values to send a transactional SMS (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\SendSms + */ + public function sendTransacSms($sendTransacSms) + { + list($response) = $this->sendTransacSmsWithHttpInfo($sendTransacSms); + return $response; + } + + /** + * Operation sendTransacSmsWithHttpInfo + * + * Send the SMS campaign to the specified mobile number + * + * @param \SendinBlue\Client\Model\SendTransacSms $sendTransacSms Values to send a transactional SMS (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\SendSms, HTTP status code, HTTP response headers (array of strings) + */ + public function sendTransacSmsWithHttpInfo($sendTransacSms) + { + $returnType = '\SendinBlue\Client\Model\SendSms'; + $request = $this->sendTransacSmsRequest($sendTransacSms); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\SendSms', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendTransacSmsAsync + * + * Send the SMS campaign to the specified mobile number + * + * @param \SendinBlue\Client\Model\SendTransacSms $sendTransacSms Values to send a transactional SMS (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTransacSmsAsync($sendTransacSms) + { + return $this->sendTransacSmsAsyncWithHttpInfo($sendTransacSms) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendTransacSmsAsyncWithHttpInfo + * + * Send the SMS campaign to the specified mobile number + * + * @param \SendinBlue\Client\Model\SendTransacSms $sendTransacSms Values to send a transactional SMS (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTransacSmsAsyncWithHttpInfo($sendTransacSms) + { + $returnType = '\SendinBlue\Client\Model\SendSms'; + $request = $this->sendTransacSmsRequest($sendTransacSms); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sendTransacSms' + * + * @param \SendinBlue\Client\Model\SendTransacSms $sendTransacSms Values to send a transactional SMS (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sendTransacSmsRequest($sendTransacSms) + { + // verify the required parameter 'sendTransacSms' is set + if ($sendTransacSms === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sendTransacSms when calling sendTransacSms' + ); + } + + $resourcePath = '/transactionalSMS/sms'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($sendTransacSms)) { + $_tempBody = $sendTransacSms; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/WebhooksApi.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/WebhooksApi.php new file mode 100644 index 0000000..38c7116 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Api/WebhooksApi.php @@ -0,0 +1,1452 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createWebhook + * + * Create a webhook + * + * @param \SendinBlue\Client\Model\CreateWebhook $createWebhook Values to create a webhook (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreateModel + */ + public function createWebhook($createWebhook) + { + list($response) = $this->createWebhookWithHttpInfo($createWebhook); + return $response; + } + + /** + * Operation createWebhookWithHttpInfo + * + * Create a webhook + * + * @param \SendinBlue\Client\Model\CreateWebhook $createWebhook Values to create a webhook (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings) + */ + public function createWebhookWithHttpInfo($createWebhook) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createWebhookRequest($createWebhook); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreateModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createWebhookAsync + * + * Create a webhook + * + * @param \SendinBlue\Client\Model\CreateWebhook $createWebhook Values to create a webhook (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createWebhookAsync($createWebhook) + { + return $this->createWebhookAsyncWithHttpInfo($createWebhook) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createWebhookAsyncWithHttpInfo + * + * Create a webhook + * + * @param \SendinBlue\Client\Model\CreateWebhook $createWebhook Values to create a webhook (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createWebhookAsyncWithHttpInfo($createWebhook) + { + $returnType = '\SendinBlue\Client\Model\CreateModel'; + $request = $this->createWebhookRequest($createWebhook); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createWebhook' + * + * @param \SendinBlue\Client\Model\CreateWebhook $createWebhook Values to create a webhook (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createWebhookRequest($createWebhook) + { + // verify the required parameter 'createWebhook' is set + if ($createWebhook === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $createWebhook when calling createWebhook' + ); + } + + $resourcePath = '/webhooks'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($createWebhook)) { + $_tempBody = $createWebhook; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteWebhook + * + * Delete a webhook + * + * @param int $webhookId Id of the webhook (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteWebhook($webhookId) + { + $this->deleteWebhookWithHttpInfo($webhookId); + } + + /** + * Operation deleteWebhookWithHttpInfo + * + * Delete a webhook + * + * @param int $webhookId Id of the webhook (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteWebhookWithHttpInfo($webhookId) + { + $returnType = ''; + $request = $this->deleteWebhookRequest($webhookId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteWebhookAsync + * + * Delete a webhook + * + * @param int $webhookId Id of the webhook (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteWebhookAsync($webhookId) + { + return $this->deleteWebhookAsyncWithHttpInfo($webhookId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteWebhookAsyncWithHttpInfo + * + * Delete a webhook + * + * @param int $webhookId Id of the webhook (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteWebhookAsyncWithHttpInfo($webhookId) + { + $returnType = ''; + $request = $this->deleteWebhookRequest($webhookId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteWebhook' + * + * @param int $webhookId Id of the webhook (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteWebhookRequest($webhookId) + { + // verify the required parameter 'webhookId' is set + if ($webhookId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $webhookId when calling deleteWebhook' + ); + } + + $resourcePath = '/webhooks/{webhookId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($webhookId !== null) { + $resourcePath = str_replace( + '{' . 'webhookId' . '}', + ObjectSerializer::toPathValue($webhookId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getWebhook + * + * Get a webhook details + * + * @param int $webhookId Id of the webhook (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetWebhook + */ + public function getWebhook($webhookId) + { + list($response) = $this->getWebhookWithHttpInfo($webhookId); + return $response; + } + + /** + * Operation getWebhookWithHttpInfo + * + * Get a webhook details + * + * @param int $webhookId Id of the webhook (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetWebhook, HTTP status code, HTTP response headers (array of strings) + */ + public function getWebhookWithHttpInfo($webhookId) + { + $returnType = '\SendinBlue\Client\Model\GetWebhook'; + $request = $this->getWebhookRequest($webhookId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetWebhook', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getWebhookAsync + * + * Get a webhook details + * + * @param int $webhookId Id of the webhook (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getWebhookAsync($webhookId) + { + return $this->getWebhookAsyncWithHttpInfo($webhookId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWebhookAsyncWithHttpInfo + * + * Get a webhook details + * + * @param int $webhookId Id of the webhook (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getWebhookAsyncWithHttpInfo($webhookId) + { + $returnType = '\SendinBlue\Client\Model\GetWebhook'; + $request = $this->getWebhookRequest($webhookId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getWebhook' + * + * @param int $webhookId Id of the webhook (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getWebhookRequest($webhookId) + { + // verify the required parameter 'webhookId' is set + if ($webhookId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $webhookId when calling getWebhook' + ); + } + + $resourcePath = '/webhooks/{webhookId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($webhookId !== null) { + $resourcePath = str_replace( + '{' . 'webhookId' . '}', + ObjectSerializer::toPathValue($webhookId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getWebhooks + * + * Get all webhooks + * + * @param string $type Filter on webhook type (optional, default to transactional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetWebhooks + */ + public function getWebhooks($type = 'transactional') + { + list($response) = $this->getWebhooksWithHttpInfo($type); + return $response; + } + + /** + * Operation getWebhooksWithHttpInfo + * + * Get all webhooks + * + * @param string $type Filter on webhook type (optional, default to transactional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetWebhooks, HTTP status code, HTTP response headers (array of strings) + */ + public function getWebhooksWithHttpInfo($type = 'transactional') + { + $returnType = '\SendinBlue\Client\Model\GetWebhooks'; + $request = $this->getWebhooksRequest($type); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetWebhooks', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getWebhooksAsync + * + * Get all webhooks + * + * @param string $type Filter on webhook type (optional, default to transactional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getWebhooksAsync($type = 'transactional') + { + return $this->getWebhooksAsyncWithHttpInfo($type) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWebhooksAsyncWithHttpInfo + * + * Get all webhooks + * + * @param string $type Filter on webhook type (optional, default to transactional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getWebhooksAsyncWithHttpInfo($type = 'transactional') + { + $returnType = '\SendinBlue\Client\Model\GetWebhooks'; + $request = $this->getWebhooksRequest($type); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getWebhooks' + * + * @param string $type Filter on webhook type (optional, default to transactional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getWebhooksRequest($type = 'transactional') + { + + $resourcePath = '/webhooks'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($type !== null) { + $queryParams['type'] = ObjectSerializer::toQueryValue($type); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateWebhook + * + * Update a webhook + * + * @param int $webhookId Id of the webhook (required) + * @param \SendinBlue\Client\Model\UpdateWebhook $updateWebhook Values to update a webhook (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateWebhook($webhookId, $updateWebhook) + { + $this->updateWebhookWithHttpInfo($webhookId, $updateWebhook); + } + + /** + * Operation updateWebhookWithHttpInfo + * + * Update a webhook + * + * @param int $webhookId Id of the webhook (required) + * @param \SendinBlue\Client\Model\UpdateWebhook $updateWebhook Values to update a webhook (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function updateWebhookWithHttpInfo($webhookId, $updateWebhook) + { + $returnType = ''; + $request = $this->updateWebhookRequest($webhookId, $updateWebhook); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateWebhookAsync + * + * Update a webhook + * + * @param int $webhookId Id of the webhook (required) + * @param \SendinBlue\Client\Model\UpdateWebhook $updateWebhook Values to update a webhook (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateWebhookAsync($webhookId, $updateWebhook) + { + return $this->updateWebhookAsyncWithHttpInfo($webhookId, $updateWebhook) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateWebhookAsyncWithHttpInfo + * + * Update a webhook + * + * @param int $webhookId Id of the webhook (required) + * @param \SendinBlue\Client\Model\UpdateWebhook $updateWebhook Values to update a webhook (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateWebhookAsyncWithHttpInfo($webhookId, $updateWebhook) + { + $returnType = ''; + $request = $this->updateWebhookRequest($webhookId, $updateWebhook); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateWebhook' + * + * @param int $webhookId Id of the webhook (required) + * @param \SendinBlue\Client\Model\UpdateWebhook $updateWebhook Values to update a webhook (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateWebhookRequest($webhookId, $updateWebhook) + { + // verify the required parameter 'webhookId' is set + if ($webhookId === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $webhookId when calling updateWebhook' + ); + } + // verify the required parameter 'updateWebhook' is set + if ($updateWebhook === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $updateWebhook when calling updateWebhook' + ); + } + + $resourcePath = '/webhooks/{webhookId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($webhookId !== null) { + $resourcePath = str_replace( + '{' . 'webhookId' . '}', + ObjectSerializer::toPathValue($webhookId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($updateWebhook)) { + $_tempBody = $updateWebhook; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api-key'); + if ($apiKey !== null) { + $headers['api-key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('partner-key'); + if ($apiKey !== null) { + $headers['partner-key'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/ApiException.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/ApiException.php new file mode 100644 index 0000000..ff45e00 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/ApiException.php @@ -0,0 +1,121 @@ +responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return string[]|null HTTP response header + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return mixed HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Sets the deseralized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deseralized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Configuration.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Configuration.php new file mode 100644 index 0000000..06d6bb5 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Configuration.php @@ -0,0 +1,429 @@ +tempFolderPath = sys_get_temp_dir(); + } + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Gets the username for HTTP basic authentication + * + * @return string Username for HTTP basic authentication + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug($debug) + { + $this->debug = $debug; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile($debugFile) + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile() + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration() + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the detault configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config) + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport() + { + $report = 'PHP SDK (SendinBlue\Client) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' OpenAPI Spec Version: 3.0.0' . PHP_EOL; + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } +} diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/HeaderSelector.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/HeaderSelector.php new file mode 100644 index 0000000..214dff6 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/HeaderSelector.php @@ -0,0 +1,110 @@ +selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); + return $headers; + } + + /** + * @param string[] $accept + * @return array + */ + public function selectHeadersForMultipart($accept) + { + $headers = $this->selectHeaders($accept, []); + + unset($headers['Content-Type']); + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided + * + * @param string[] $accept Array of header + * + * @return string Accept (e.g. application/json) + */ + private function selectAcceptHeader($accept) + { + if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + return null; + } elseif (preg_grep("/application\/json/i", $accept)) { + return 'application/json'; + } else { + return implode(',', $accept); + } + } + + /** + * Return the content type based on an array of content-type provided + * + * @param string[] $contentType Array fo content-type + * + * @return string Content-Type (e.g. application/json) + */ + private function selectContentTypeHeader($contentType) + { + if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { + return 'application/json'; + } elseif (preg_grep("/application\/json/i", $contentType)) { + return 'application/json'; + } else { + return implode(',', $contentType); + } + } +} + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/AddChildDomain.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/AddChildDomain.php new file mode 100644 index 0000000..3c24c86 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/AddChildDomain.php @@ -0,0 +1,302 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'domain' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'domain' => 'domain' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'domain' => 'setDomain' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'domain' => 'getDomain' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets domain + * + * @return string + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string $domain Sender domain to add for a specific child account + * + * @return $this + */ + public function setDomain($domain) + { + $this->container['domain'] = $domain; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/AddContactToList.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/AddContactToList.php new file mode 100644 index 0000000..673e1ed --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/AddContactToList.php @@ -0,0 +1,302 @@ + 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'emails' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'emails' => 'emails' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'emails' => 'setEmails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'emails' => 'getEmails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['emails'] = isset($data['emails']) ? $data['emails'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets emails + * + * @return string[] + */ + public function getEmails() + { + return $this->container['emails']; + } + + /** + * Sets emails + * + * @param string[] $emails Emails to add to a list + * + * @return $this + */ + public function setEmails($emails) + { + $this->container['emails'] = $emails; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/AddCredits.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/AddCredits.php new file mode 100644 index 0000000..1714ad1 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/AddCredits.php @@ -0,0 +1,332 @@ + 'int', + 'email' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'sms' => 'int64', + 'email' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sms' => 'sms', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sms' => 'setSms', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sms' => 'getSms', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['sms'] = isset($data['sms']) ? $data['sms'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets sms + * + * @return int + */ + public function getSms() + { + return $this->container['sms']; + } + + /** + * Sets sms + * + * @param int $sms Required if email credits are empty. SMS credits to be added to the child account + * + * @return $this + */ + public function setSms($sms) + { + $this->container['sms'] = $sms; + + return $this; + } + + /** + * Gets email + * + * @return int + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param int $email Required if sms credits are empty. Email credits to be added to the child account + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateAttribute.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateAttribute.php new file mode 100644 index 0000000..86a338a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateAttribute.php @@ -0,0 +1,406 @@ + 'string', + 'enumeration' => '\SendinBlue\Client\Model\CreateAttributeEnumeration[]', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'value' => null, + 'enumeration' => null, + 'type' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'enumeration' => 'enumeration', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'enumeration' => 'setEnumeration', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'enumeration' => 'getEnumeration', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const TYPE_TEXT = 'text'; + const TYPE_DATE = 'date'; + const TYPE_FLOAT = 'float'; + const TYPE_BOOLEAN = 'boolean'; + const TYPE_ID = 'id'; + const TYPE_CATEGORY = 'category'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_TEXT, + self::TYPE_DATE, + self::TYPE_FLOAT, + self::TYPE_BOOLEAN, + self::TYPE_ID, + self::TYPE_CATEGORY, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = isset($data['value']) ? $data['value'] : null; + $this->container['enumeration'] = isset($data['enumeration']) ? $data['enumeration'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + return false; + } + return true; + } + + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value Value of the attribute. Use only if the attribute's category is 'calculated' or 'global' + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets enumeration + * + * @return \SendinBlue\Client\Model\CreateAttributeEnumeration[] + */ + public function getEnumeration() + { + return $this->container['enumeration']; + } + + /** + * Sets enumeration + * + * @param \SendinBlue\Client\Model\CreateAttributeEnumeration[] $enumeration List of values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, `[{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}]` + * + * @return $this + */ + public function setEnumeration($enumeration) + { + $this->container['enumeration'] = $enumeration; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute ) + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array($type, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateAttributeEnumeration.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateAttributeEnumeration.php new file mode 100644 index 0000000..fad0af8 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateAttributeEnumeration.php @@ -0,0 +1,344 @@ + 'int', + 'label' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'value' => null, + 'label' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'label' => 'label' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'label' => 'setLabel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'label' => 'getLabel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = isset($data['value']) ? $data['value'] : null; + $this->container['label'] = isset($data['label']) ? $data['label'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['value'] === null) { + return false; + } + if ($this->container['label'] === null) { + return false; + } + return true; + } + + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value Id of the value + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets label + * + * @return string + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string $label Label of the value + * + * @return $this + */ + public function setLabel($label) + { + $this->container['label'] = $label; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateChild.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateChild.php new file mode 100644 index 0000000..5e5c980 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateChild.php @@ -0,0 +1,452 @@ + 'string', + 'firstName' => 'string', + 'lastName' => 'string', + 'companyName' => 'string', + 'password' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'firstName' => null, + 'lastName' => null, + 'companyName' => null, + 'password' => 'password' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'firstName' => 'firstName', + 'lastName' => 'lastName', + 'companyName' => 'companyName', + 'password' => 'password' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName', + 'companyName' => 'setCompanyName', + 'password' => 'setPassword' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName', + 'companyName' => 'getCompanyName', + 'password' => 'getPassword' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['firstName'] = isset($data['firstName']) ? $data['firstName'] : null; + $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null; + $this->container['companyName'] = isset($data['companyName']) ? $data['companyName'] : null; + $this->container['password'] = isset($data['password']) ? $data['password'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['firstName'] === null) { + $invalidProperties[] = "'firstName' can't be null"; + } + if ($this->container['lastName'] === null) { + $invalidProperties[] = "'lastName' can't be null"; + } + if ($this->container['companyName'] === null) { + $invalidProperties[] = "'companyName' can't be null"; + } + if ($this->container['password'] === null) { + $invalidProperties[] = "'password' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + if ($this->container['firstName'] === null) { + return false; + } + if ($this->container['lastName'] === null) { + return false; + } + if ($this->container['companyName'] === null) { + return false; + } + if ($this->container['password'] === null) { + return false; + } + return true; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email address to create the child account + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets firstName + * + * @return string + */ + public function getFirstName() + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string $firstName First name to use to create the child account + * + * @return $this + */ + public function setFirstName($firstName) + { + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string + */ + public function getLastName() + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string $lastName Last name to use to create the child account + * + * @return $this + */ + public function setLastName($lastName) + { + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets companyName + * + * @return string + */ + public function getCompanyName() + { + return $this->container['companyName']; + } + + /** + * Sets companyName + * + * @param string $companyName Company name to use to create the child account + * + * @return $this + */ + public function setCompanyName($companyName) + { + $this->container['companyName'] = $companyName; + + return $this; + } + + /** + * Gets password + * + * @return string + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string $password Password for the child account to login + * + * @return $this + */ + public function setPassword($password) + { + $this->container['password'] = $password; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateContact.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateContact.php new file mode 100644 index 0000000..c362203 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateContact.php @@ -0,0 +1,482 @@ + 'string', + 'attributes' => 'object', + 'emailBlacklisted' => 'bool', + 'smsBlacklisted' => 'bool', + 'listIds' => 'int[]', + 'updateEnabled' => 'bool', + 'smtpBlacklistSender' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'attributes' => null, + 'emailBlacklisted' => null, + 'smsBlacklisted' => null, + 'listIds' => 'int64', + 'updateEnabled' => null, + 'smtpBlacklistSender' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'attributes' => 'attributes', + 'emailBlacklisted' => 'emailBlacklisted', + 'smsBlacklisted' => 'smsBlacklisted', + 'listIds' => 'listIds', + 'updateEnabled' => 'updateEnabled', + 'smtpBlacklistSender' => 'smtpBlacklistSender' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'attributes' => 'setAttributes', + 'emailBlacklisted' => 'setEmailBlacklisted', + 'smsBlacklisted' => 'setSmsBlacklisted', + 'listIds' => 'setListIds', + 'updateEnabled' => 'setUpdateEnabled', + 'smtpBlacklistSender' => 'setSmtpBlacklistSender' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'attributes' => 'getAttributes', + 'emailBlacklisted' => 'getEmailBlacklisted', + 'smsBlacklisted' => 'getSmsBlacklisted', + 'listIds' => 'getListIds', + 'updateEnabled' => 'getUpdateEnabled', + 'smtpBlacklistSender' => 'getSmtpBlacklistSender' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + $this->container['emailBlacklisted'] = isset($data['emailBlacklisted']) ? $data['emailBlacklisted'] : null; + $this->container['smsBlacklisted'] = isset($data['smsBlacklisted']) ? $data['smsBlacklisted'] : null; + $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null; + $this->container['updateEnabled'] = isset($data['updateEnabled']) ? $data['updateEnabled'] : false; + $this->container['smtpBlacklistSender'] = isset($data['smtpBlacklistSender']) ? $data['smtpBlacklistSender'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email address of the user. Mandatory if \"sms\" field is not passed in \"attributes\" parameter' + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets attributes + * + * @return object + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param object $attributes Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For example, `{\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"}` + * + * @return $this + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + return $this; + } + + /** + * Gets emailBlacklisted + * + * @return bool + */ + public function getEmailBlacklisted() + { + return $this->container['emailBlacklisted']; + } + + /** + * Sets emailBlacklisted + * + * @param bool $emailBlacklisted Set this field to blacklist the contact for emails (emailBlacklisted = true) + * + * @return $this + */ + public function setEmailBlacklisted($emailBlacklisted) + { + $this->container['emailBlacklisted'] = $emailBlacklisted; + + return $this; + } + + /** + * Gets smsBlacklisted + * + * @return bool + */ + public function getSmsBlacklisted() + { + return $this->container['smsBlacklisted']; + } + + /** + * Sets smsBlacklisted + * + * @param bool $smsBlacklisted Set this field to blacklist the contact for SMS (smsBlacklisted = true) + * + * @return $this + */ + public function setSmsBlacklisted($smsBlacklisted) + { + $this->container['smsBlacklisted'] = $smsBlacklisted; + + return $this; + } + + /** + * Gets listIds + * + * @return int[] + */ + public function getListIds() + { + return $this->container['listIds']; + } + + /** + * Sets listIds + * + * @param int[] $listIds Ids of the lists to add the contact to + * + * @return $this + */ + public function setListIds($listIds) + { + $this->container['listIds'] = $listIds; + + return $this; + } + + /** + * Gets updateEnabled + * + * @return bool + */ + public function getUpdateEnabled() + { + return $this->container['updateEnabled']; + } + + /** + * Sets updateEnabled + * + * @param bool $updateEnabled Facilitate to update the existing contact in the same request (updateEnabled = true) + * + * @return $this + */ + public function setUpdateEnabled($updateEnabled) + { + $this->container['updateEnabled'] = $updateEnabled; + + return $this; + } + + /** + * Gets smtpBlacklistSender + * + * @return string[] + */ + public function getSmtpBlacklistSender() + { + return $this->container['smtpBlacklistSender']; + } + + /** + * Sets smtpBlacklistSender + * + * @param string[] $smtpBlacklistSender SMTP forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true ) + * + * @return $this + */ + public function setSmtpBlacklistSender($smtpBlacklistSender) + { + $this->container['smtpBlacklistSender'] = $smtpBlacklistSender; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateEmailCampaign.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateEmailCampaign.php new file mode 100644 index 0000000..572ab1b --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateEmailCampaign.php @@ -0,0 +1,1114 @@ + 'string', + 'sender' => '\SendinBlue\Client\Model\CreateEmailCampaignSender', + 'name' => 'string', + 'htmlContent' => 'string', + 'htmlUrl' => 'string', + 'templateId' => 'int', + 'scheduledAt' => '\DateTime', + 'subject' => 'string', + 'replyTo' => 'string', + 'toField' => 'string', + 'recipients' => '\SendinBlue\Client\Model\CreateEmailCampaignRecipients', + 'attachmentUrl' => 'string', + 'inlineImageActivation' => 'bool', + 'mirrorActive' => 'bool', + 'footer' => 'string', + 'header' => 'string', + 'utmCampaign' => 'string', + 'params' => 'object', + 'sendAtBestTime' => 'bool', + 'abTesting' => 'bool', + 'subjectA' => 'string', + 'subjectB' => 'string', + 'splitRule' => 'int', + 'winnerCriteria' => 'string', + 'winnerDelay' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'tag' => null, + 'sender' => null, + 'name' => null, + 'htmlContent' => null, + 'htmlUrl' => 'url', + 'templateId' => 'int64', + 'scheduledAt' => 'date-time', + 'subject' => null, + 'replyTo' => 'email', + 'toField' => null, + 'recipients' => null, + 'attachmentUrl' => 'url', + 'inlineImageActivation' => null, + 'mirrorActive' => null, + 'footer' => null, + 'header' => null, + 'utmCampaign' => null, + 'params' => null, + 'sendAtBestTime' => null, + 'abTesting' => null, + 'subjectA' => null, + 'subjectB' => null, + 'splitRule' => 'int64', + 'winnerCriteria' => null, + 'winnerDelay' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tag' => 'tag', + 'sender' => 'sender', + 'name' => 'name', + 'htmlContent' => 'htmlContent', + 'htmlUrl' => 'htmlUrl', + 'templateId' => 'templateId', + 'scheduledAt' => 'scheduledAt', + 'subject' => 'subject', + 'replyTo' => 'replyTo', + 'toField' => 'toField', + 'recipients' => 'recipients', + 'attachmentUrl' => 'attachmentUrl', + 'inlineImageActivation' => 'inlineImageActivation', + 'mirrorActive' => 'mirrorActive', + 'footer' => 'footer', + 'header' => 'header', + 'utmCampaign' => 'utmCampaign', + 'params' => 'params', + 'sendAtBestTime' => 'sendAtBestTime', + 'abTesting' => 'abTesting', + 'subjectA' => 'subjectA', + 'subjectB' => 'subjectB', + 'splitRule' => 'splitRule', + 'winnerCriteria' => 'winnerCriteria', + 'winnerDelay' => 'winnerDelay' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tag' => 'setTag', + 'sender' => 'setSender', + 'name' => 'setName', + 'htmlContent' => 'setHtmlContent', + 'htmlUrl' => 'setHtmlUrl', + 'templateId' => 'setTemplateId', + 'scheduledAt' => 'setScheduledAt', + 'subject' => 'setSubject', + 'replyTo' => 'setReplyTo', + 'toField' => 'setToField', + 'recipients' => 'setRecipients', + 'attachmentUrl' => 'setAttachmentUrl', + 'inlineImageActivation' => 'setInlineImageActivation', + 'mirrorActive' => 'setMirrorActive', + 'footer' => 'setFooter', + 'header' => 'setHeader', + 'utmCampaign' => 'setUtmCampaign', + 'params' => 'setParams', + 'sendAtBestTime' => 'setSendAtBestTime', + 'abTesting' => 'setAbTesting', + 'subjectA' => 'setSubjectA', + 'subjectB' => 'setSubjectB', + 'splitRule' => 'setSplitRule', + 'winnerCriteria' => 'setWinnerCriteria', + 'winnerDelay' => 'setWinnerDelay' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tag' => 'getTag', + 'sender' => 'getSender', + 'name' => 'getName', + 'htmlContent' => 'getHtmlContent', + 'htmlUrl' => 'getHtmlUrl', + 'templateId' => 'getTemplateId', + 'scheduledAt' => 'getScheduledAt', + 'subject' => 'getSubject', + 'replyTo' => 'getReplyTo', + 'toField' => 'getToField', + 'recipients' => 'getRecipients', + 'attachmentUrl' => 'getAttachmentUrl', + 'inlineImageActivation' => 'getInlineImageActivation', + 'mirrorActive' => 'getMirrorActive', + 'footer' => 'getFooter', + 'header' => 'getHeader', + 'utmCampaign' => 'getUtmCampaign', + 'params' => 'getParams', + 'sendAtBestTime' => 'getSendAtBestTime', + 'abTesting' => 'getAbTesting', + 'subjectA' => 'getSubjectA', + 'subjectB' => 'getSubjectB', + 'splitRule' => 'getSplitRule', + 'winnerCriteria' => 'getWinnerCriteria', + 'winnerDelay' => 'getWinnerDelay' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const WINNER_CRITERIA_OPEN = 'open'; + const WINNER_CRITERIA_CLICK = 'click'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getWinnerCriteriaAllowableValues() + { + return [ + self::WINNER_CRITERIA_OPEN, + self::WINNER_CRITERIA_CLICK, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null; + $this->container['htmlUrl'] = isset($data['htmlUrl']) ? $data['htmlUrl'] : null; + $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null; + $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null; + $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null; + $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null; + $this->container['attachmentUrl'] = isset($data['attachmentUrl']) ? $data['attachmentUrl'] : null; + $this->container['inlineImageActivation'] = isset($data['inlineImageActivation']) ? $data['inlineImageActivation'] : false; + $this->container['mirrorActive'] = isset($data['mirrorActive']) ? $data['mirrorActive'] : null; + $this->container['footer'] = isset($data['footer']) ? $data['footer'] : null; + $this->container['header'] = isset($data['header']) ? $data['header'] : null; + $this->container['utmCampaign'] = isset($data['utmCampaign']) ? $data['utmCampaign'] : null; + $this->container['params'] = isset($data['params']) ? $data['params'] : null; + $this->container['sendAtBestTime'] = isset($data['sendAtBestTime']) ? $data['sendAtBestTime'] : false; + $this->container['abTesting'] = isset($data['abTesting']) ? $data['abTesting'] : false; + $this->container['subjectA'] = isset($data['subjectA']) ? $data['subjectA'] : null; + $this->container['subjectB'] = isset($data['subjectB']) ? $data['subjectB'] : null; + $this->container['splitRule'] = isset($data['splitRule']) ? $data['splitRule'] : null; + $this->container['winnerCriteria'] = isset($data['winnerCriteria']) ? $data['winnerCriteria'] : null; + $this->container['winnerDelay'] = isset($data['winnerDelay']) ? $data['winnerDelay'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['sender'] === null) { + $invalidProperties[] = "'sender' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if (!is_null($this->container['splitRule']) && ($this->container['splitRule'] > 50)) { + $invalidProperties[] = "invalid value for 'splitRule', must be smaller than or equal to 50."; + } + + if (!is_null($this->container['splitRule']) && ($this->container['splitRule'] < 1)) { + $invalidProperties[] = "invalid value for 'splitRule', must be bigger than or equal to 1."; + } + + $allowedValues = $this->getWinnerCriteriaAllowableValues(); + if (!in_array($this->container['winnerCriteria'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'winnerCriteria', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['winnerDelay']) && ($this->container['winnerDelay'] > 168)) { + $invalidProperties[] = "invalid value for 'winnerDelay', must be smaller than or equal to 168."; + } + + if (!is_null($this->container['winnerDelay']) && ($this->container['winnerDelay'] < 1)) { + $invalidProperties[] = "invalid value for 'winnerDelay', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['sender'] === null) { + return false; + } + if ($this->container['name'] === null) { + return false; + } + if ($this->container['splitRule'] > 50) { + return false; + } + if ($this->container['splitRule'] < 1) { + return false; + } + $allowedValues = $this->getWinnerCriteriaAllowableValues(); + if (!in_array($this->container['winnerCriteria'], $allowedValues)) { + return false; + } + if ($this->container['winnerDelay'] > 168) { + return false; + } + if ($this->container['winnerDelay'] < 1) { + return false; + } + return true; + } + + + /** + * Gets tag + * + * @return string + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string $tag Tag of the campaign + * + * @return $this + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets sender + * + * @return \SendinBlue\Client\Model\CreateEmailCampaignSender + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param \SendinBlue\Client\Model\CreateEmailCampaignSender $sender sender + * + * @return $this + */ + public function setSender($sender) + { + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the campaign + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets htmlContent + * + * @return string + */ + public function getHtmlContent() + { + return $this->container['htmlContent']; + } + + /** + * Sets htmlContent + * + * @param string $htmlContent Mandatory if htmlUrl and templateId are empty. Body of the message (HTML) + * + * @return $this + */ + public function setHtmlContent($htmlContent) + { + $this->container['htmlContent'] = $htmlContent; + + return $this; + } + + /** + * Gets htmlUrl + * + * @return string + */ + public function getHtmlUrl() + { + return $this->container['htmlUrl']; + } + + /** + * Sets htmlUrl + * + * @param string $htmlUrl Mandatory if htmlContent and templateId are empty. Url to the message (HTML) + * + * @return $this + */ + public function setHtmlUrl($htmlUrl) + { + $this->container['htmlUrl'] = $htmlUrl; + + return $this; + } + + /** + * Gets templateId + * + * @return int + */ + public function getTemplateId() + { + return $this->container['templateId']; + } + + /** + * Sets templateId + * + * @param int $templateId Mandatory if htmlContent and htmlUrl are empty. Id of the SMTP template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. + * + * @return $this + */ + public function setTemplateId($templateId) + { + $this->container['templateId'] = $templateId; + + return $this; + } + + /** + * Gets scheduledAt + * + * @return \DateTime + */ + public function getScheduledAt() + { + return $this->container['scheduledAt']; + } + + /** + * Sets scheduledAt + * + * @param \DateTime $scheduledAt Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). + * + * @return $this + */ + public function setScheduledAt($scheduledAt) + { + $this->container['scheduledAt'] = $scheduledAt; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Subject of the campaign. Mandatory if abTesting is false. Ignored if abTesting is true. + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets replyTo + * + * @return string + */ + public function getReplyTo() + { + return $this->container['replyTo']; + } + + /** + * Sets replyTo + * + * @param string $replyTo Email on which the campaign recipients will be able to reply to + * + * @return $this + */ + public function setReplyTo($replyTo) + { + $this->container['replyTo'] = $replyTo; + + return $this; + } + + /** + * Gets toField + * + * @return string + */ + public function getToField() + { + return $this->container['toField']; + } + + /** + * Sets toField + * + * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add `{FNAME} {LNAME}`. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use `{{contact.FNAME}} {{contact.LNAME}}` for personalization + * + * @return $this + */ + public function setToField($toField) + { + $this->container['toField'] = $toField; + + return $this; + } + + /** + * Gets recipients + * + * @return \SendinBlue\Client\Model\CreateEmailCampaignRecipients + */ + public function getRecipients() + { + return $this->container['recipients']; + } + + /** + * Sets recipients + * + * @param \SendinBlue\Client\Model\CreateEmailCampaignRecipients $recipients recipients + * + * @return $this + */ + public function setRecipients($recipients) + { + $this->container['recipients'] = $recipients; + + return $this; + } + + /** + * Gets attachmentUrl + * + * @return string + */ + public function getAttachmentUrl() + { + return $this->container['attachmentUrl']; + } + + /** + * Sets attachmentUrl + * + * @param string $attachmentUrl Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps + * + * @return $this + */ + public function setAttachmentUrl($attachmentUrl) + { + $this->container['attachmentUrl'] = $attachmentUrl; + + return $this; + } + + /** + * Gets inlineImageActivation + * + * @return bool + */ + public function getInlineImageActivation() + { + return $this->container['inlineImageActivation']; + } + + /** + * Sets inlineImageActivation + * + * @param bool $inlineImageActivation Use true to embedded the images in your email. Final size of the email should be less than 4MB. Campaigns with embedded images can not be sent to more than 5000 contacts + * + * @return $this + */ + public function setInlineImageActivation($inlineImageActivation) + { + $this->container['inlineImageActivation'] = $inlineImageActivation; + + return $this; + } + + /** + * Gets mirrorActive + * + * @return bool + */ + public function getMirrorActive() + { + return $this->container['mirrorActive']; + } + + /** + * Sets mirrorActive + * + * @param bool $mirrorActive Use true to enable the mirror link + * + * @return $this + */ + public function setMirrorActive($mirrorActive) + { + $this->container['mirrorActive'] = $mirrorActive; + + return $this; + } + + /** + * Gets footer + * + * @return string + */ + public function getFooter() + { + return $this->container['footer']; + } + + /** + * Sets footer + * + * @param string $footer Footer of the email campaign + * + * @return $this + */ + public function setFooter($footer) + { + $this->container['footer'] = $footer; + + return $this; + } + + /** + * Gets header + * + * @return string + */ + public function getHeader() + { + return $this->container['header']; + } + + /** + * Sets header + * + * @param string $header Header of the email campaign + * + * @return $this + */ + public function setHeader($header) + { + $this->container['header'] = $header; + + return $this; + } + + /** + * Gets utmCampaign + * + * @return string + */ + public function getUtmCampaign() + { + return $this->container['utmCampaign']; + } + + /** + * Sets utmCampaign + * + * @param string $utmCampaign Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed + * + * @return $this + */ + public function setUtmCampaign($utmCampaign) + { + $this->container['utmCampaign'] = $utmCampaign; + + return $this; + } + + /** + * Gets params + * + * @return object + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param object $params Pass the set of attributes to customize the type classic campaign. For example, `{\"FNAME\":\"Joe\", \"LNAME:\"Doe\"}`. Only available if 'type' is 'classic'. It's considered only if campaign is in New Template Language format. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' + * + * @return $this + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets sendAtBestTime + * + * @return bool + */ + public function getSendAtBestTime() + { + return $this->container['sendAtBestTime']; + } + + /** + * Sets sendAtBestTime + * + * @param bool $sendAtBestTime Set this to true if you want to send your campaign at best time. + * + * @return $this + */ + public function setSendAtBestTime($sendAtBestTime) + { + $this->container['sendAtBestTime'] = $sendAtBestTime; + + return $this; + } + + /** + * Gets abTesting + * + * @return bool + */ + public function getAbTesting() + { + return $this->container['abTesting']; + } + + /** + * Sets abTesting + * + * @param bool $abTesting Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. 'subjectA', 'subjectB', 'splitRule', 'winnerCriteria' & 'winnerDelay' will be considered when abTesting is set to true. 'subjectA' & 'subjectB' are mandatory together & 'subject' if passed is ignored. Can be set to true only if 'sendAtBestTime' is 'false'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B + * + * @return $this + */ + public function setAbTesting($abTesting) + { + $this->container['abTesting'] = $abTesting; + + return $this; + } + + /** + * Gets subjectA + * + * @return string + */ + public function getSubjectA() + { + return $this->container['subjectA']; + } + + /** + * Sets subjectA + * + * @param string $subjectA Subject A of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value + * + * @return $this + */ + public function setSubjectA($subjectA) + { + $this->container['subjectA'] = $subjectA; + + return $this; + } + + /** + * Gets subjectB + * + * @return string + */ + public function getSubjectB() + { + return $this->container['subjectB']; + } + + /** + * Sets subjectB + * + * @param string $subjectB Subject B of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value + * + * @return $this + */ + public function setSubjectB($subjectB) + { + $this->container['subjectB'] = $subjectB; + + return $this; + } + + /** + * Gets splitRule + * + * @return int + */ + public function getSplitRule() + { + return $this->container['splitRule']; + } + + /** + * Sets splitRule + * + * @param int $splitRule Add the size of your test groups. Mandatory if abTesting = true & 'recipients' is passed. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else + * + * @return $this + */ + public function setSplitRule($splitRule) + { + + if (!is_null($splitRule) && ($splitRule > 50)) { + throw new \InvalidArgumentException('invalid value for $splitRule when calling CreateEmailCampaign., must be smaller than or equal to 50.'); + } + if (!is_null($splitRule) && ($splitRule < 1)) { + throw new \InvalidArgumentException('invalid value for $splitRule when calling CreateEmailCampaign., must be bigger than or equal to 1.'); + } + + $this->container['splitRule'] = $splitRule; + + return $this; + } + + /** + * Gets winnerCriteria + * + * @return string + */ + public function getWinnerCriteria() + { + return $this->container['winnerCriteria']; + } + + /** + * Sets winnerCriteria + * + * @param string $winnerCriteria Choose the metrics that will determinate the winning version. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed + * + * @return $this + */ + public function setWinnerCriteria($winnerCriteria) + { + $allowedValues = $this->getWinnerCriteriaAllowableValues(); + if (!is_null($winnerCriteria) && !in_array($winnerCriteria, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'winnerCriteria', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['winnerCriteria'] = $winnerCriteria; + + return $this; + } + + /** + * Gets winnerDelay + * + * @return int + */ + public function getWinnerDelay() + { + return $this->container['winnerDelay']; + } + + /** + * Sets winnerDelay + * + * @param int $winnerDelay Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed + * + * @return $this + */ + public function setWinnerDelay($winnerDelay) + { + + if (!is_null($winnerDelay) && ($winnerDelay > 168)) { + throw new \InvalidArgumentException('invalid value for $winnerDelay when calling CreateEmailCampaign., must be smaller than or equal to 168.'); + } + if (!is_null($winnerDelay) && ($winnerDelay < 1)) { + throw new \InvalidArgumentException('invalid value for $winnerDelay when calling CreateEmailCampaign., must be bigger than or equal to 1.'); + } + + $this->container['winnerDelay'] = $winnerDelay; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateEmailCampaignRecipients.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateEmailCampaignRecipients.php new file mode 100644 index 0000000..eb83145 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateEmailCampaignRecipients.php @@ -0,0 +1,333 @@ + 'int[]', + 'listIds' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'exclusionListIds' => 'int64', + 'listIds' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'exclusionListIds' => 'exclusionListIds', + 'listIds' => 'listIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'exclusionListIds' => 'setExclusionListIds', + 'listIds' => 'setListIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'exclusionListIds' => 'getExclusionListIds', + 'listIds' => 'getListIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['exclusionListIds'] = isset($data['exclusionListIds']) ? $data['exclusionListIds'] : null; + $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets exclusionListIds + * + * @return int[] + */ + public function getExclusionListIds() + { + return $this->container['exclusionListIds']; + } + + /** + * Sets exclusionListIds + * + * @param int[] $exclusionListIds List ids to exclude from the campaign + * + * @return $this + */ + public function setExclusionListIds($exclusionListIds) + { + $this->container['exclusionListIds'] = $exclusionListIds; + + return $this; + } + + /** + * Gets listIds + * + * @return int[] + */ + public function getListIds() + { + return $this->container['listIds']; + } + + /** + * Sets listIds + * + * @param int[] $listIds Mandatory if scheduledAt is not empty. List Ids to send the campaign to + * + * @return $this + */ + public function setListIds($listIds) + { + $this->container['listIds'] = $listIds; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateEmailCampaignSender.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateEmailCampaignSender.php new file mode 100644 index 0000000..71fe1a3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateEmailCampaignSender.php @@ -0,0 +1,339 @@ + 'string', + 'email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'email' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Sender Name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Sender email + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateList.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateList.php new file mode 100644 index 0000000..f3698d9 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateList.php @@ -0,0 +1,344 @@ + 'string', + 'folderId' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'folderId' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'folderId' => 'folderId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'folderId' => 'setFolderId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'folderId' => 'getFolderId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['folderId'] = isset($data['folderId']) ? $data['folderId'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['folderId'] === null) { + $invalidProperties[] = "'folderId' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['name'] === null) { + return false; + } + if ($this->container['folderId'] === null) { + return false; + } + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the list + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets folderId + * + * @return int + */ + public function getFolderId() + { + return $this->container['folderId']; + } + + /** + * Sets folderId + * + * @param int $folderId Id of the parent folder in which this list is to be created + * + * @return $this + */ + public function setFolderId($folderId) + { + $this->container['folderId'] = $folderId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateModel.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateModel.php new file mode 100644 index 0000000..15a1cf4 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateModel.php @@ -0,0 +1,308 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the object created + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateReseller.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateReseller.php new file mode 100644 index 0000000..b384daa --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateReseller.php @@ -0,0 +1,308 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'authKey' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authKey' => 'authKey' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authKey' => 'setAuthKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authKey' => 'getAuthKey' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['authKey'] = isset($data['authKey']) ? $data['authKey'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['authKey'] === null) { + $invalidProperties[] = "'authKey' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['authKey'] === null) { + return false; + } + return true; + } + + + /** + * Gets authKey + * + * @return string + */ + public function getAuthKey() + { + return $this->container['authKey']; + } + + /** + * Sets authKey + * + * @param string $authKey AuthKey of Reseller child created + * + * @return $this + */ + public function setAuthKey($authKey) + { + $this->container['authKey'] = $authKey; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSender.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSender.php new file mode 100644 index 0000000..87cb01e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSender.php @@ -0,0 +1,374 @@ + 'string', + 'email' => 'string', + 'ips' => '\SendinBlue\Client\Model\CreateSenderIps[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'email' => 'email', + 'ips' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'email' => 'email', + 'ips' => 'ips' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'email' => 'setEmail', + 'ips' => 'setIps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'email' => 'getEmail', + 'ips' => 'getIps' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['ips'] = isset($data['ips']) ? $data['ips'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['name'] === null) { + return false; + } + if ($this->container['email'] === null) { + return false; + } + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name From Name to use for the sender + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email From Email to use for the sender + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets ips + * + * @return \SendinBlue\Client\Model\CreateSenderIps[] + */ + public function getIps() + { + return $this->container['ips']; + } + + /** + * Sets ips + * + * @param \SendinBlue\Client\Model\CreateSenderIps[] $ips Mandatory in case of dedicated IP, IPs to associate to the sender + * + * @return $this + */ + public function setIps($ips) + { + $this->container['ips'] = $ips; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSenderIps.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSenderIps.php new file mode 100644 index 0000000..82b885b --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSenderIps.php @@ -0,0 +1,396 @@ + 'string', + 'domain' => 'string', + 'weight' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'ip' => null, + 'domain' => null, + 'weight' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ip' => 'ip', + 'domain' => 'domain', + 'weight' => 'weight' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ip' => 'setIp', + 'domain' => 'setDomain', + 'weight' => 'setWeight' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ip' => 'getIp', + 'domain' => 'getDomain', + 'weight' => 'getWeight' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null; + $this->container['weight'] = isset($data['weight']) ? $data['weight'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ip'] === null) { + $invalidProperties[] = "'ip' can't be null"; + } + if ($this->container['domain'] === null) { + $invalidProperties[] = "'domain' can't be null"; + } + if (!is_null($this->container['weight']) && ($this->container['weight'] > 100)) { + $invalidProperties[] = "invalid value for 'weight', must be smaller than or equal to 100."; + } + + if (!is_null($this->container['weight']) && ($this->container['weight'] < 1)) { + $invalidProperties[] = "invalid value for 'weight', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['ip'] === null) { + return false; + } + if ($this->container['domain'] === null) { + return false; + } + if ($this->container['weight'] > 100) { + return false; + } + if ($this->container['weight'] < 1) { + return false; + } + return true; + } + + + /** + * Gets ip + * + * @return string + */ + public function getIp() + { + return $this->container['ip']; + } + + /** + * Sets ip + * + * @param string $ip Dedicated IP available in your account + * + * @return $this + */ + public function setIp($ip) + { + $this->container['ip'] = $ip; + + return $this; + } + + /** + * Gets domain + * + * @return string + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string $domain Domain of the IP + * + * @return $this + */ + public function setDomain($domain) + { + $this->container['domain'] = $domain; + + return $this; + } + + /** + * Gets weight + * + * @return int + */ + public function getWeight() + { + return $this->container['weight']; + } + + /** + * Sets weight + * + * @param int $weight Weight to apply to the IP. Sum of all IP weights must be 100. Should be passed for either ALL or NONE of the IPs. If it's not passed, the sending will be equally balanced on all IPs. + * + * @return $this + */ + public function setWeight($weight) + { + + if (!is_null($weight) && ($weight > 100)) { + throw new \InvalidArgumentException('invalid value for $weight when calling CreateSenderIps., must be smaller than or equal to 100.'); + } + if (!is_null($weight) && ($weight < 1)) { + throw new \InvalidArgumentException('invalid value for $weight when calling CreateSenderIps., must be bigger than or equal to 1.'); + } + + $this->container['weight'] = $weight; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSenderModel.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSenderModel.php new file mode 100644 index 0000000..597078b --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSenderModel.php @@ -0,0 +1,368 @@ + 'int', + 'spfError' => 'bool', + 'dkimError' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'spfError' => null, + 'dkimError' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'spfError' => 'spfError', + 'dkimError' => 'dkimError' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'spfError' => 'setSpfError', + 'dkimError' => 'setDkimError' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'spfError' => 'getSpfError', + 'dkimError' => 'getDkimError' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['spfError'] = isset($data['spfError']) ? $data['spfError'] : null; + $this->container['dkimError'] = isset($data['dkimError']) ? $data['dkimError'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the Sender created + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets spfError + * + * @return bool + */ + public function getSpfError() + { + return $this->container['spfError']; + } + + /** + * Sets spfError + * + * @param bool $spfError Status of SPF configuration for the sender (true = SPF not well configured, false = SPF well configured) + * + * @return $this + */ + public function setSpfError($spfError) + { + $this->container['spfError'] = $spfError; + + return $this; + } + + /** + * Gets dkimError + * + * @return bool + */ + public function getDkimError() + { + return $this->container['dkimError']; + } + + /** + * Sets dkimError + * + * @param bool $dkimError Status of DKIM configuration for the sender (true = DKIM not well configured, false = DKIM well configured) + * + * @return $this + */ + public function setDkimError($dkimError) + { + $this->container['dkimError'] = $dkimError; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmsCampaign.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmsCampaign.php new file mode 100644 index 0000000..09502e6 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmsCampaign.php @@ -0,0 +1,451 @@ + 'string', + 'sender' => 'string', + 'content' => 'string', + 'recipients' => '\SendinBlue\Client\Model\CreateSmsCampaignRecipients', + 'scheduledAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'sender' => null, + 'content' => null, + 'recipients' => null, + 'scheduledAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'sender' => 'sender', + 'content' => 'content', + 'recipients' => 'recipients', + 'scheduledAt' => 'scheduledAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'sender' => 'setSender', + 'content' => 'setContent', + 'recipients' => 'setRecipients', + 'scheduledAt' => 'setScheduledAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'sender' => 'getSender', + 'content' => 'getContent', + 'recipients' => 'getRecipients', + 'scheduledAt' => 'getScheduledAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['content'] = isset($data['content']) ? $data['content'] : null; + $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null; + $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['sender'] === null) { + $invalidProperties[] = "'sender' can't be null"; + } + if ((strlen($this->container['sender']) > 11)) { + $invalidProperties[] = "invalid value for 'sender', the character length must be smaller than or equal to 11."; + } + + if ($this->container['content'] === null) { + $invalidProperties[] = "'content' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['name'] === null) { + return false; + } + if ($this->container['sender'] === null) { + return false; + } + if (strlen($this->container['sender']) > 11) { + return false; + } + if ($this->container['content'] === null) { + return false; + } + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the campaign + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets sender + * + * @return string + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param string $sender Name of the sender. The number of characters is limited to 11 + * + * @return $this + */ + public function setSender($sender) + { + if ((strlen($sender) > 11)) { + throw new \InvalidArgumentException('invalid length for $sender when calling CreateSmsCampaign., must be smaller than or equal to 11.'); + } + + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets recipients + * + * @return \SendinBlue\Client\Model\CreateSmsCampaignRecipients + */ + public function getRecipients() + { + return $this->container['recipients']; + } + + /** + * Sets recipients + * + * @param \SendinBlue\Client\Model\CreateSmsCampaignRecipients $recipients recipients + * + * @return $this + */ + public function setRecipients($recipients) + { + $this->container['recipients'] = $recipients; + + return $this; + } + + /** + * Gets scheduledAt + * + * @return \DateTime + */ + public function getScheduledAt() + { + return $this->container['scheduledAt']; + } + + /** + * Sets scheduledAt + * + * @param \DateTime $scheduledAt UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. + * + * @return $this + */ + public function setScheduledAt($scheduledAt) + { + $this->container['scheduledAt'] = $scheduledAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmsCampaignRecipients.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmsCampaignRecipients.php new file mode 100644 index 0000000..90b817d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmsCampaignRecipients.php @@ -0,0 +1,338 @@ + 'int[]', + 'exclusionListIds' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'listIds' => 'int64', + 'exclusionListIds' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'listIds' => 'listIds', + 'exclusionListIds' => 'exclusionListIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'listIds' => 'setListIds', + 'exclusionListIds' => 'setExclusionListIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'listIds' => 'getListIds', + 'exclusionListIds' => 'getExclusionListIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null; + $this->container['exclusionListIds'] = isset($data['exclusionListIds']) ? $data['exclusionListIds'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['listIds'] === null) { + $invalidProperties[] = "'listIds' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['listIds'] === null) { + return false; + } + return true; + } + + + /** + * Gets listIds + * + * @return int[] + */ + public function getListIds() + { + return $this->container['listIds']; + } + + /** + * Sets listIds + * + * @param int[] $listIds Lists Ids to send the campaign to. REQUIRED if scheduledAt is not empty + * + * @return $this + */ + public function setListIds($listIds) + { + $this->container['listIds'] = $listIds; + + return $this; + } + + /** + * Gets exclusionListIds + * + * @return int[] + */ + public function getExclusionListIds() + { + return $this->container['exclusionListIds']; + } + + /** + * Sets exclusionListIds + * + * @param int[] $exclusionListIds List ids which have to be excluded from a campaign + * + * @return $this + */ + public function setExclusionListIds($exclusionListIds) + { + $this->container['exclusionListIds'] = $exclusionListIds; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmtpEmail.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmtpEmail.php new file mode 100644 index 0000000..63a4d01 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmtpEmail.php @@ -0,0 +1,308 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'messageId' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'messageId' => 'messageId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'messageId' => 'setMessageId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'messageId' => 'getMessageId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['messageId'] === null) { + $invalidProperties[] = "'messageId' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['messageId'] === null) { + return false; + } + return true; + } + + + /** + * Gets messageId + * + * @return string + */ + public function getMessageId() + { + return $this->container['messageId']; + } + + /** + * Sets messageId + * + * @param string $messageId Message ID of the SMTP Email sent + * + * @return $this + */ + public function setMessageId($messageId) + { + $this->container['messageId'] = $messageId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmtpTemplate.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmtpTemplate.php new file mode 100644 index 0000000..bea4d64 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmtpTemplate.php @@ -0,0 +1,590 @@ + 'string', + 'sender' => '\SendinBlue\Client\Model\CreateSmtpTemplateSender', + 'templateName' => 'string', + 'htmlContent' => 'string', + 'htmlUrl' => 'string', + 'subject' => 'string', + 'replyTo' => 'string', + 'toField' => 'string', + 'attachmentUrl' => 'string', + 'isActive' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'tag' => null, + 'sender' => null, + 'templateName' => null, + 'htmlContent' => null, + 'htmlUrl' => 'url', + 'subject' => null, + 'replyTo' => 'email', + 'toField' => null, + 'attachmentUrl' => 'url', + 'isActive' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tag' => 'tag', + 'sender' => 'sender', + 'templateName' => 'templateName', + 'htmlContent' => 'htmlContent', + 'htmlUrl' => 'htmlUrl', + 'subject' => 'subject', + 'replyTo' => 'replyTo', + 'toField' => 'toField', + 'attachmentUrl' => 'attachmentUrl', + 'isActive' => 'isActive' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tag' => 'setTag', + 'sender' => 'setSender', + 'templateName' => 'setTemplateName', + 'htmlContent' => 'setHtmlContent', + 'htmlUrl' => 'setHtmlUrl', + 'subject' => 'setSubject', + 'replyTo' => 'setReplyTo', + 'toField' => 'setToField', + 'attachmentUrl' => 'setAttachmentUrl', + 'isActive' => 'setIsActive' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tag' => 'getTag', + 'sender' => 'getSender', + 'templateName' => 'getTemplateName', + 'htmlContent' => 'getHtmlContent', + 'htmlUrl' => 'getHtmlUrl', + 'subject' => 'getSubject', + 'replyTo' => 'getReplyTo', + 'toField' => 'getToField', + 'attachmentUrl' => 'getAttachmentUrl', + 'isActive' => 'getIsActive' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['templateName'] = isset($data['templateName']) ? $data['templateName'] : null; + $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null; + $this->container['htmlUrl'] = isset($data['htmlUrl']) ? $data['htmlUrl'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null; + $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null; + $this->container['attachmentUrl'] = isset($data['attachmentUrl']) ? $data['attachmentUrl'] : null; + $this->container['isActive'] = isset($data['isActive']) ? $data['isActive'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['sender'] === null) { + $invalidProperties[] = "'sender' can't be null"; + } + if ($this->container['templateName'] === null) { + $invalidProperties[] = "'templateName' can't be null"; + } + if ($this->container['subject'] === null) { + $invalidProperties[] = "'subject' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['sender'] === null) { + return false; + } + if ($this->container['templateName'] === null) { + return false; + } + if ($this->container['subject'] === null) { + return false; + } + return true; + } + + + /** + * Gets tag + * + * @return string + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string $tag Tag of the template + * + * @return $this + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets sender + * + * @return \SendinBlue\Client\Model\CreateSmtpTemplateSender + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param \SendinBlue\Client\Model\CreateSmtpTemplateSender $sender sender + * + * @return $this + */ + public function setSender($sender) + { + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets templateName + * + * @return string + */ + public function getTemplateName() + { + return $this->container['templateName']; + } + + /** + * Sets templateName + * + * @param string $templateName Name of the template + * + * @return $this + */ + public function setTemplateName($templateName) + { + $this->container['templateName'] = $templateName; + + return $this; + } + + /** + * Gets htmlContent + * + * @return string + */ + public function getHtmlContent() + { + return $this->container['htmlContent']; + } + + /** + * Sets htmlContent + * + * @param string $htmlContent Body of the message (HTML version). The field must have more than 10 characters. REQUIRED if htmlUrl is empty + * + * @return $this + */ + public function setHtmlContent($htmlContent) + { + $this->container['htmlContent'] = $htmlContent; + + return $this; + } + + /** + * Gets htmlUrl + * + * @return string + */ + public function getHtmlUrl() + { + return $this->container['htmlUrl']; + } + + /** + * Sets htmlUrl + * + * @param string $htmlUrl Url which contents the body of the email message. REQUIRED if htmlContent is empty + * + * @return $this + */ + public function setHtmlUrl($htmlUrl) + { + $this->container['htmlUrl'] = $htmlUrl; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Subject of the template + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets replyTo + * + * @return string + */ + public function getReplyTo() + { + return $this->container['replyTo']; + } + + /** + * Sets replyTo + * + * @param string $replyTo Email on which campaign recipients will be able to reply to + * + * @return $this + */ + public function setReplyTo($replyTo) + { + $this->container['replyTo'] = $replyTo; + + return $this; + } + + /** + * Gets toField + * + * @return string + */ + public function getToField() + { + return $this->container['toField']; + } + + /** + * Sets toField + * + * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add `{FNAME} {LNAME}`. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use `{{contact.FNAME}} {{contact.LNAME}}` for personalization + * + * @return $this + */ + public function setToField($toField) + { + $this->container['toField'] = $toField; + + return $this; + } + + /** + * Gets attachmentUrl + * + * @return string + */ + public function getAttachmentUrl() + { + return $this->container['attachmentUrl']; + } + + /** + * Sets attachmentUrl + * + * @param string $attachmentUrl Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps + * + * @return $this + */ + public function setAttachmentUrl($attachmentUrl) + { + $this->container['attachmentUrl'] = $attachmentUrl; + + return $this; + } + + /** + * Gets isActive + * + * @return bool + */ + public function getIsActive() + { + return $this->container['isActive']; + } + + /** + * Sets isActive + * + * @param bool $isActive Status of template. isActive = true means template is active and isActive = false means template is inactive + * + * @return $this + */ + public function setIsActive($isActive) + { + $this->container['isActive'] = $isActive; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmtpTemplateSender.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmtpTemplateSender.php new file mode 100644 index 0000000..f4f048f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateSmtpTemplateSender.php @@ -0,0 +1,339 @@ + 'string', + 'email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'email' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the sender. If not passed, will be set to default + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email of the sender + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateUpdateContactModel.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateUpdateContactModel.php new file mode 100644 index 0000000..9198065 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateUpdateContactModel.php @@ -0,0 +1,302 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the contact when a new contact is created + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateUpdateFolder.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateUpdateFolder.php new file mode 100644 index 0000000..e51e62a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateUpdateFolder.php @@ -0,0 +1,302 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the folder + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateWebhook.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateWebhook.php new file mode 100644 index 0000000..21524b0 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreateWebhook.php @@ -0,0 +1,486 @@ + 'string', + 'description' => 'string', + 'events' => 'string[]', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'url' => 'url', + 'description' => null, + 'events' => null, + 'type' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'url' => 'url', + 'description' => 'description', + 'events' => 'events', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'url' => 'setUrl', + 'description' => 'setDescription', + 'events' => 'setEvents', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'url' => 'getUrl', + 'description' => 'getDescription', + 'events' => 'getEvents', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const EVENTS_HARD_BOUNCE = 'hardBounce'; + const EVENTS_SOFT_BOUNCE = 'softBounce'; + const EVENTS_BLOCKED = 'blocked'; + const EVENTS_SPAM = 'spam'; + const EVENTS_DELIVERED = 'delivered'; + const EVENTS_REQUEST = 'request'; + const EVENTS_CLICK = 'click'; + const EVENTS_INVALID = 'invalid'; + const EVENTS_DEFERRED = 'deferred'; + const EVENTS_OPENED = 'opened'; + const EVENTS_UNIQUE_OPENED = 'uniqueOpened'; + const EVENTS_UNSUBSCRIBED = 'unsubscribed'; + const EVENTS_LIST_ADDITION = 'listAddition'; + const TYPE_TRANSACTIONAL = 'transactional'; + const TYPE_MARKETING = 'marketing'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEventsAllowableValues() + { + return [ + self::EVENTS_HARD_BOUNCE, + self::EVENTS_SOFT_BOUNCE, + self::EVENTS_BLOCKED, + self::EVENTS_SPAM, + self::EVENTS_DELIVERED, + self::EVENTS_REQUEST, + self::EVENTS_CLICK, + self::EVENTS_INVALID, + self::EVENTS_DEFERRED, + self::EVENTS_OPENED, + self::EVENTS_UNIQUE_OPENED, + self::EVENTS_UNSUBSCRIBED, + self::EVENTS_LIST_ADDITION, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_TRANSACTIONAL, + self::TYPE_MARKETING, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['events'] = isset($data['events']) ? $data['events'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : 'transactional'; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + if ($this->container['events'] === null) { + $invalidProperties[] = "'events' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['url'] === null) { + return false; + } + if ($this->container['events'] === null) { + return false; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + return false; + } + return true; + } + + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url URL of the webhook + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description Description of the webhook + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets events + * + * @return string[] + */ + public function getEvents() + { + return $this->container['events']; + } + + /** + * Sets events + * + * @param string[] $events Events triggering the webhook. Possible values for Transactional type webhook – request, delivered, hardBounce, softBounce, blocked, spam, invalid, deferred, click, opened, uniqueOpened and unsubscribed and possible values for Marketing type webhook – spam, opened, click, hardBounce, softBounce, unsubscribed, listAddition & delivered + * + * @return $this + */ + public function setEvents($events) + { + $allowedValues = $this->getEventsAllowableValues(); + if (array_diff($events, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'events', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['events'] = $events; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of the webhook + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array($type, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreatedProcessId.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreatedProcessId.php new file mode 100644 index 0000000..dcf6ecf --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/CreatedProcessId.php @@ -0,0 +1,308 @@ + 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'processId' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'processId' => 'processId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'processId' => 'setProcessId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'processId' => 'getProcessId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['processId'] = isset($data['processId']) ? $data['processId'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['processId'] === null) { + $invalidProperties[] = "'processId' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['processId'] === null) { + return false; + } + return true; + } + + + /** + * Gets processId + * + * @return int + */ + public function getProcessId() + { + return $this->container['processId']; + } + + /** + * Sets processId + * + * @param int $processId Id of the process created + * + * @return $this + */ + public function setProcessId($processId) + { + $this->container['processId'] = $processId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/DeleteHardbounces.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/DeleteHardbounces.php new file mode 100644 index 0000000..5b87d5e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/DeleteHardbounces.php @@ -0,0 +1,362 @@ + 'string', + 'endDate' => 'string', + 'contactEmail' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'startDate' => null, + 'endDate' => null, + 'contactEmail' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'contactEmail' => 'contactEmail' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'contactEmail' => 'setContactEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'contactEmail' => 'getContactEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['startDate'] = isset($data['startDate']) ? $data['startDate'] : null; + $this->container['endDate'] = isset($data['endDate']) ? $data['endDate'] : null; + $this->container['contactEmail'] = isset($data['contactEmail']) ? $data['contactEmail'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets startDate + * + * @return string + */ + public function getStartDate() + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param string $startDate Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate + * + * @return $this + */ + public function setStartDate($startDate) + { + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return string + */ + public function getEndDate() + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param string $endDate Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate + * + * @return $this + */ + public function setEndDate($endDate) + { + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets contactEmail + * + * @return string + */ + public function getContactEmail() + { + return $this->container['contactEmail']; + } + + /** + * Sets contactEmail + * + * @param string $contactEmail Target a specific email address + * + * @return $this + */ + public function setContactEmail($contactEmail) + { + $this->container['contactEmail'] = $contactEmail; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/EmailExportRecipients.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/EmailExportRecipients.php new file mode 100644 index 0000000..f092a17 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/EmailExportRecipients.php @@ -0,0 +1,386 @@ + 'string', + 'recipientsType' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'notifyURL' => 'url', + 'recipientsType' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'notifyURL' => 'notifyURL', + 'recipientsType' => 'recipientsType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'notifyURL' => 'setNotifyURL', + 'recipientsType' => 'setRecipientsType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'notifyURL' => 'getNotifyURL', + 'recipientsType' => 'getRecipientsType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const RECIPIENTS_TYPE_ALL = 'all'; + const RECIPIENTS_TYPE_NON_CLICKERS = 'nonClickers'; + const RECIPIENTS_TYPE_NON_OPENERS = 'nonOpeners'; + const RECIPIENTS_TYPE_CLICKERS = 'clickers'; + const RECIPIENTS_TYPE_OPENERS = 'openers'; + const RECIPIENTS_TYPE_SOFT_BOUNCES = 'softBounces'; + const RECIPIENTS_TYPE_HARD_BOUNCES = 'hardBounces'; + const RECIPIENTS_TYPE_UNSUBSCRIBED = 'unsubscribed'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecipientsTypeAllowableValues() + { + return [ + self::RECIPIENTS_TYPE_ALL, + self::RECIPIENTS_TYPE_NON_CLICKERS, + self::RECIPIENTS_TYPE_NON_OPENERS, + self::RECIPIENTS_TYPE_CLICKERS, + self::RECIPIENTS_TYPE_OPENERS, + self::RECIPIENTS_TYPE_SOFT_BOUNCES, + self::RECIPIENTS_TYPE_HARD_BOUNCES, + self::RECIPIENTS_TYPE_UNSUBSCRIBED, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['notifyURL'] = isset($data['notifyURL']) ? $data['notifyURL'] : null; + $this->container['recipientsType'] = isset($data['recipientsType']) ? $data['recipientsType'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['recipientsType'] === null) { + $invalidProperties[] = "'recipientsType' can't be null"; + } + $allowedValues = $this->getRecipientsTypeAllowableValues(); + if (!in_array($this->container['recipientsType'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'recipientsType', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['recipientsType'] === null) { + return false; + } + $allowedValues = $this->getRecipientsTypeAllowableValues(); + if (!in_array($this->container['recipientsType'], $allowedValues)) { + return false; + } + return true; + } + + + /** + * Gets notifyURL + * + * @return string + */ + public function getNotifyURL() + { + return $this->container['notifyURL']; + } + + /** + * Sets notifyURL + * + * @param string $notifyURL Webhook called once the export process is finished + * + * @return $this + */ + public function setNotifyURL($notifyURL) + { + $this->container['notifyURL'] = $notifyURL; + + return $this; + } + + /** + * Gets recipientsType + * + * @return string + */ + public function getRecipientsType() + { + return $this->container['recipientsType']; + } + + /** + * Sets recipientsType + * + * @param string $recipientsType Type of recipients to export for a campaign + * + * @return $this + */ + public function setRecipientsType($recipientsType) + { + $allowedValues = $this->getRecipientsTypeAllowableValues(); + if (!in_array($recipientsType, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'recipientsType', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['recipientsType'] = $recipientsType; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/ErrorModel.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/ErrorModel.php new file mode 100644 index 0000000..4c98fb5 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/ErrorModel.php @@ -0,0 +1,406 @@ + 'string', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'code' => null, + 'message' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const CODE_INVALID_PARAMETER = 'invalid_parameter'; + const CODE_MISSING_PARAMETER = 'missing_parameter'; + const CODE_OUT_OF_RANGE = 'out_of_range'; + const CODE_CAMPAIGN_PROCESSING = 'campaign_processing'; + const CODE_CAMPAIGN_SENT = 'campaign_sent'; + const CODE_DOCUMENT_NOT_FOUND = 'document_not_found'; + const CODE_RESELLER_PERMISSION_DENIED = 'reseller_permission_denied'; + const CODE_NOT_ENOUGH_CREDITS = 'not_enough_credits'; + const CODE_PERMISSION_DENIED = 'permission_denied'; + const CODE_DUPLICATE_PARAMETER = 'duplicate_parameter'; + const CODE_DUPLICATE_REQUEST = 'duplicate_request'; + const CODE_METHOD_NOT_ALLOWED = 'method_not_allowed'; + const CODE_UNAUTHORIZED = 'unauthorized'; + const CODE_ACCOUNT_UNDER_VALIDATION = 'account_under_validation'; + const CODE_NOT_ACCEPTABLE = 'not_acceptable'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCodeAllowableValues() + { + return [ + self::CODE_INVALID_PARAMETER, + self::CODE_MISSING_PARAMETER, + self::CODE_OUT_OF_RANGE, + self::CODE_CAMPAIGN_PROCESSING, + self::CODE_CAMPAIGN_SENT, + self::CODE_DOCUMENT_NOT_FOUND, + self::CODE_RESELLER_PERMISSION_DENIED, + self::CODE_NOT_ENOUGH_CREDITS, + self::CODE_PERMISSION_DENIED, + self::CODE_DUPLICATE_PARAMETER, + self::CODE_DUPLICATE_REQUEST, + self::CODE_METHOD_NOT_ALLOWED, + self::CODE_UNAUTHORIZED, + self::CODE_ACCOUNT_UNDER_VALIDATION, + self::CODE_NOT_ACCEPTABLE, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($this->container['code'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['code'] === null) { + return false; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($this->container['code'], $allowedValues)) { + return false; + } + if ($this->container['message'] === null) { + return false; + } + return true; + } + + + /** + * Gets code + * + * @return string + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code Error code displayed in case of a failure + * + * @return $this + */ + public function setCode($code) + { + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($code, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message Readable message associated to the failure + * + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccount.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccount.php new file mode 100644 index 0000000..cb9dd7a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccount.php @@ -0,0 +1,554 @@ + 'string', + 'firstName' => 'string', + 'lastName' => 'string', + 'companyName' => 'string', + 'address' => '\SendinBlue\Client\Model\GetExtendedClientAddress', + 'plan' => '\SendinBlue\Client\Model\GetAccountPlan[]', + 'relay' => '\SendinBlue\Client\Model\GetAccountRelay', + 'marketingAutomation' => '\SendinBlue\Client\Model\GetAccountMarketingAutomation' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'firstName' => null, + 'lastName' => null, + 'companyName' => null, + 'address' => null, + 'plan' => null, + 'relay' => null, + 'marketingAutomation' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'firstName' => 'firstName', + 'lastName' => 'lastName', + 'companyName' => 'companyName', + 'address' => 'address', + 'plan' => 'plan', + 'relay' => 'relay', + 'marketingAutomation' => 'marketingAutomation' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName', + 'companyName' => 'setCompanyName', + 'address' => 'setAddress', + 'plan' => 'setPlan', + 'relay' => 'setRelay', + 'marketingAutomation' => 'setMarketingAutomation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName', + 'companyName' => 'getCompanyName', + 'address' => 'getAddress', + 'plan' => 'getPlan', + 'relay' => 'getRelay', + 'marketingAutomation' => 'getMarketingAutomation' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['firstName'] = isset($data['firstName']) ? $data['firstName'] : null; + $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null; + $this->container['companyName'] = isset($data['companyName']) ? $data['companyName'] : null; + $this->container['address'] = isset($data['address']) ? $data['address'] : null; + $this->container['plan'] = isset($data['plan']) ? $data['plan'] : null; + $this->container['relay'] = isset($data['relay']) ? $data['relay'] : null; + $this->container['marketingAutomation'] = isset($data['marketingAutomation']) ? $data['marketingAutomation'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['firstName'] === null) { + $invalidProperties[] = "'firstName' can't be null"; + } + if ($this->container['lastName'] === null) { + $invalidProperties[] = "'lastName' can't be null"; + } + if ($this->container['companyName'] === null) { + $invalidProperties[] = "'companyName' can't be null"; + } + if ($this->container['address'] === null) { + $invalidProperties[] = "'address' can't be null"; + } + if ($this->container['plan'] === null) { + $invalidProperties[] = "'plan' can't be null"; + } + if ($this->container['relay'] === null) { + $invalidProperties[] = "'relay' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + if ($this->container['firstName'] === null) { + return false; + } + if ($this->container['lastName'] === null) { + return false; + } + if ($this->container['companyName'] === null) { + return false; + } + if ($this->container['address'] === null) { + return false; + } + if ($this->container['plan'] === null) { + return false; + } + if ($this->container['relay'] === null) { + return false; + } + return true; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Login Email + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets firstName + * + * @return string + */ + public function getFirstName() + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string $firstName First Name + * + * @return $this + */ + public function setFirstName($firstName) + { + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string + */ + public function getLastName() + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string $lastName Last Name + * + * @return $this + */ + public function setLastName($lastName) + { + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets companyName + * + * @return string + */ + public function getCompanyName() + { + return $this->container['companyName']; + } + + /** + * Sets companyName + * + * @param string $companyName Name of the company + * + * @return $this + */ + public function setCompanyName($companyName) + { + $this->container['companyName'] = $companyName; + + return $this; + } + + /** + * Gets address + * + * @return \SendinBlue\Client\Model\GetExtendedClientAddress + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \SendinBlue\Client\Model\GetExtendedClientAddress $address address + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets plan + * + * @return \SendinBlue\Client\Model\GetAccountPlan[] + */ + public function getPlan() + { + return $this->container['plan']; + } + + /** + * Sets plan + * + * @param \SendinBlue\Client\Model\GetAccountPlan[] $plan Information about your plans and credits + * + * @return $this + */ + public function setPlan($plan) + { + $this->container['plan'] = $plan; + + return $this; + } + + /** + * Gets relay + * + * @return \SendinBlue\Client\Model\GetAccountRelay + */ + public function getRelay() + { + return $this->container['relay']; + } + + /** + * Sets relay + * + * @param \SendinBlue\Client\Model\GetAccountRelay $relay relay + * + * @return $this + */ + public function setRelay($relay) + { + $this->container['relay'] = $relay; + + return $this; + } + + /** + * Gets marketingAutomation + * + * @return \SendinBlue\Client\Model\GetAccountMarketingAutomation + */ + public function getMarketingAutomation() + { + return $this->container['marketingAutomation']; + } + + /** + * Sets marketingAutomation + * + * @param \SendinBlue\Client\Model\GetAccountMarketingAutomation $marketingAutomation marketingAutomation + * + * @return $this + */ + public function setMarketingAutomation($marketingAutomation) + { + $this->container['marketingAutomation'] = $marketingAutomation; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccountMarketingAutomation.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccountMarketingAutomation.php new file mode 100644 index 0000000..a5721b2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccountMarketingAutomation.php @@ -0,0 +1,338 @@ + 'string', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'key' => null, + 'enabled' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'key' => 'key', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'key' => 'setKey', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'key' => 'getKey', + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['key'] = isset($data['key']) ? $data['key'] : null; + $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['enabled'] === null) { + $invalidProperties[] = "'enabled' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['enabled'] === null) { + return false; + } + return true; + } + + + /** + * Gets key + * + * @return string + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string $key Marketing Automation Tracker ID + * + * @return $this + */ + public function setKey($key) + { + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets enabled + * + * @return bool + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool $enabled Status of Marketing Automation Plateform activation for your account (true=enabled, false=disabled) + * + * @return $this + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccountPlan.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccountPlan.php new file mode 100644 index 0000000..df25b78 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccountPlan.php @@ -0,0 +1,546 @@ + 'string', + 'creditsType' => 'string', + 'credits' => 'float', + 'startDate' => '\DateTime', + 'endDate' => '\DateTime', + 'userLimit' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'type' => null, + 'creditsType' => null, + 'credits' => 'float', + 'startDate' => 'date', + 'endDate' => 'date', + 'userLimit' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'creditsType' => 'creditsType', + 'credits' => 'credits', + 'startDate' => 'startDate', + 'endDate' => 'endDate', + 'userLimit' => 'userLimit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'creditsType' => 'setCreditsType', + 'credits' => 'setCredits', + 'startDate' => 'setStartDate', + 'endDate' => 'setEndDate', + 'userLimit' => 'setUserLimit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'creditsType' => 'getCreditsType', + 'credits' => 'getCredits', + 'startDate' => 'getStartDate', + 'endDate' => 'getEndDate', + 'userLimit' => 'getUserLimit' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const TYPE_PAY_AS_YOU_GO = 'payAsYouGo'; + const TYPE_FREE = 'free'; + const TYPE_SUBSCRIPTION = 'subscription'; + const TYPE_SMS = 'sms'; + const TYPE_RESELLER = 'reseller'; + const CREDITS_TYPE_SEND_LIMIT = 'sendLimit'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PAY_AS_YOU_GO, + self::TYPE_FREE, + self::TYPE_SUBSCRIPTION, + self::TYPE_SMS, + self::TYPE_RESELLER, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCreditsTypeAllowableValues() + { + return [ + self::CREDITS_TYPE_SEND_LIMIT, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['creditsType'] = isset($data['creditsType']) ? $data['creditsType'] : null; + $this->container['credits'] = isset($data['credits']) ? $data['credits'] : null; + $this->container['startDate'] = isset($data['startDate']) ? $data['startDate'] : null; + $this->container['endDate'] = isset($data['endDate']) ? $data['endDate'] : null; + $this->container['userLimit'] = isset($data['userLimit']) ? $data['userLimit'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['creditsType'] === null) { + $invalidProperties[] = "'creditsType' can't be null"; + } + $allowedValues = $this->getCreditsTypeAllowableValues(); + if (!in_array($this->container['creditsType'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'creditsType', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['credits'] === null) { + $invalidProperties[] = "'credits' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['type'] === null) { + return false; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + return false; + } + if ($this->container['creditsType'] === null) { + return false; + } + $allowedValues = $this->getCreditsTypeAllowableValues(); + if (!in_array($this->container['creditsType'], $allowedValues)) { + return false; + } + if ($this->container['credits'] === null) { + return false; + } + return true; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Displays the plan type of the user + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets creditsType + * + * @return string + */ + public function getCreditsType() + { + return $this->container['creditsType']; + } + + /** + * Sets creditsType + * + * @param string $creditsType This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account. + * + * @return $this + */ + public function setCreditsType($creditsType) + { + $allowedValues = $this->getCreditsTypeAllowableValues(); + if (!in_array($creditsType, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'creditsType', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['creditsType'] = $creditsType; + + return $this; + } + + /** + * Gets credits + * + * @return float + */ + public function getCredits() + { + return $this->container['credits']; + } + + /** + * Sets credits + * + * @param float $credits Remaining credits of the user + * + * @return $this + */ + public function setCredits($credits) + { + $this->container['credits'] = $credits; + + return $this; + } + + /** + * Gets startDate + * + * @return \DateTime + */ + public function getStartDate() + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param \DateTime $startDate Date of the period from which the plan will start (only available for \"subscription\" and \"reseller\" plan type) + * + * @return $this + */ + public function setStartDate($startDate) + { + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return \DateTime + */ + public function getEndDate() + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param \DateTime $endDate Date of the period from which the plan will end (only available for \"subscription\" and \"reseller\" plan type) + * + * @return $this + */ + public function setEndDate($endDate) + { + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets userLimit + * + * @return int + */ + public function getUserLimit() + { + return $this->container['userLimit']; + } + + /** + * Sets userLimit + * + * @param int $userLimit Only in case of reseller account. It implies the total number of child accounts you can add to your account. + * + * @return $this + */ + public function setUserLimit($userLimit) + { + $this->container['userLimit'] = $userLimit; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccountRelay.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccountRelay.php new file mode 100644 index 0000000..61ae084 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccountRelay.php @@ -0,0 +1,345 @@ + 'bool', + 'data' => '\SendinBlue\Client\Model\GetAccountRelayData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'enabled' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['enabled'] === null) { + $invalidProperties[] = "'enabled' can't be null"; + } + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['enabled'] === null) { + return false; + } + if ($this->container['data'] === null) { + return false; + } + return true; + } + + + /** + * Gets enabled + * + * @return bool + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool $enabled Status of your SMTP Account (true=Enabled, false=Disabled) + * + * @return $this + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets data + * + * @return \SendinBlue\Client\Model\GetAccountRelayData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \SendinBlue\Client\Model\GetAccountRelayData $data data + * + * @return $this + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccountRelayData.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccountRelayData.php new file mode 100644 index 0000000..07beaf0 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAccountRelayData.php @@ -0,0 +1,381 @@ + 'string', + 'relay' => 'string', + 'port' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'userName' => 'email', + 'relay' => null, + 'port' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'userName' => 'userName', + 'relay' => 'relay', + 'port' => 'port' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userName' => 'setUserName', + 'relay' => 'setRelay', + 'port' => 'setPort' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userName' => 'getUserName', + 'relay' => 'getRelay', + 'port' => 'getPort' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['userName'] = isset($data['userName']) ? $data['userName'] : null; + $this->container['relay'] = isset($data['relay']) ? $data['relay'] : null; + $this->container['port'] = isset($data['port']) ? $data['port'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['userName'] === null) { + $invalidProperties[] = "'userName' can't be null"; + } + if ($this->container['relay'] === null) { + $invalidProperties[] = "'relay' can't be null"; + } + if ($this->container['port'] === null) { + $invalidProperties[] = "'port' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['userName'] === null) { + return false; + } + if ($this->container['relay'] === null) { + return false; + } + if ($this->container['port'] === null) { + return false; + } + return true; + } + + + /** + * Gets userName + * + * @return string + */ + public function getUserName() + { + return $this->container['userName']; + } + + /** + * Sets userName + * + * @param string $userName Email to use as login on SMTP + * + * @return $this + */ + public function setUserName($userName) + { + $this->container['userName'] = $userName; + + return $this; + } + + /** + * Gets relay + * + * @return string + */ + public function getRelay() + { + return $this->container['relay']; + } + + /** + * Sets relay + * + * @param string $relay URL of the SMTP Relay + * + * @return $this + */ + public function setRelay($relay) + { + $this->container['relay'] = $relay; + + return $this; + } + + /** + * Gets port + * + * @return int + */ + public function getPort() + { + return $this->container['port']; + } + + /** + * Sets port + * + * @param int $port Port used for SMTP Relay + * + * @return $this + */ + public function setPort($port) + { + $this->container['port'] = $port; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAggregatedReport.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAggregatedReport.php new file mode 100644 index 0000000..7bae834 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAggregatedReport.php @@ -0,0 +1,740 @@ + 'string', + 'requests' => 'int', + 'delivered' => 'int', + 'hardBounces' => 'int', + 'softBounces' => 'int', + 'clicks' => 'int', + 'uniqueClicks' => 'int', + 'opens' => 'int', + 'uniqueOpens' => 'int', + 'spamReports' => 'int', + 'blocked' => 'int', + 'invalid' => 'int', + 'unsubscribed' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'range' => null, + 'requests' => 'int64', + 'delivered' => 'int64', + 'hardBounces' => 'int64', + 'softBounces' => 'int64', + 'clicks' => 'int64', + 'uniqueClicks' => 'int64', + 'opens' => 'int64', + 'uniqueOpens' => 'int64', + 'spamReports' => 'int64', + 'blocked' => 'int64', + 'invalid' => 'int64', + 'unsubscribed' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'range' => 'range', + 'requests' => 'requests', + 'delivered' => 'delivered', + 'hardBounces' => 'hardBounces', + 'softBounces' => 'softBounces', + 'clicks' => 'clicks', + 'uniqueClicks' => 'uniqueClicks', + 'opens' => 'opens', + 'uniqueOpens' => 'uniqueOpens', + 'spamReports' => 'spamReports', + 'blocked' => 'blocked', + 'invalid' => 'invalid', + 'unsubscribed' => 'unsubscribed' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'range' => 'setRange', + 'requests' => 'setRequests', + 'delivered' => 'setDelivered', + 'hardBounces' => 'setHardBounces', + 'softBounces' => 'setSoftBounces', + 'clicks' => 'setClicks', + 'uniqueClicks' => 'setUniqueClicks', + 'opens' => 'setOpens', + 'uniqueOpens' => 'setUniqueOpens', + 'spamReports' => 'setSpamReports', + 'blocked' => 'setBlocked', + 'invalid' => 'setInvalid', + 'unsubscribed' => 'setUnsubscribed' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'range' => 'getRange', + 'requests' => 'getRequests', + 'delivered' => 'getDelivered', + 'hardBounces' => 'getHardBounces', + 'softBounces' => 'getSoftBounces', + 'clicks' => 'getClicks', + 'uniqueClicks' => 'getUniqueClicks', + 'opens' => 'getOpens', + 'uniqueOpens' => 'getUniqueOpens', + 'spamReports' => 'getSpamReports', + 'blocked' => 'getBlocked', + 'invalid' => 'getInvalid', + 'unsubscribed' => 'getUnsubscribed' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['range'] = isset($data['range']) ? $data['range'] : null; + $this->container['requests'] = isset($data['requests']) ? $data['requests'] : null; + $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null; + $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null; + $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null; + $this->container['clicks'] = isset($data['clicks']) ? $data['clicks'] : null; + $this->container['uniqueClicks'] = isset($data['uniqueClicks']) ? $data['uniqueClicks'] : null; + $this->container['opens'] = isset($data['opens']) ? $data['opens'] : null; + $this->container['uniqueOpens'] = isset($data['uniqueOpens']) ? $data['uniqueOpens'] : null; + $this->container['spamReports'] = isset($data['spamReports']) ? $data['spamReports'] : null; + $this->container['blocked'] = isset($data['blocked']) ? $data['blocked'] : null; + $this->container['invalid'] = isset($data['invalid']) ? $data['invalid'] : null; + $this->container['unsubscribed'] = isset($data['unsubscribed']) ? $data['unsubscribed'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['range'] === null) { + $invalidProperties[] = "'range' can't be null"; + } + if ($this->container['requests'] === null) { + $invalidProperties[] = "'requests' can't be null"; + } + if ($this->container['delivered'] === null) { + $invalidProperties[] = "'delivered' can't be null"; + } + if ($this->container['hardBounces'] === null) { + $invalidProperties[] = "'hardBounces' can't be null"; + } + if ($this->container['softBounces'] === null) { + $invalidProperties[] = "'softBounces' can't be null"; + } + if ($this->container['clicks'] === null) { + $invalidProperties[] = "'clicks' can't be null"; + } + if ($this->container['uniqueClicks'] === null) { + $invalidProperties[] = "'uniqueClicks' can't be null"; + } + if ($this->container['opens'] === null) { + $invalidProperties[] = "'opens' can't be null"; + } + if ($this->container['uniqueOpens'] === null) { + $invalidProperties[] = "'uniqueOpens' can't be null"; + } + if ($this->container['spamReports'] === null) { + $invalidProperties[] = "'spamReports' can't be null"; + } + if ($this->container['blocked'] === null) { + $invalidProperties[] = "'blocked' can't be null"; + } + if ($this->container['invalid'] === null) { + $invalidProperties[] = "'invalid' can't be null"; + } + if ($this->container['unsubscribed'] === null) { + $invalidProperties[] = "'unsubscribed' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['range'] === null) { + return false; + } + if ($this->container['requests'] === null) { + return false; + } + if ($this->container['delivered'] === null) { + return false; + } + if ($this->container['hardBounces'] === null) { + return false; + } + if ($this->container['softBounces'] === null) { + return false; + } + if ($this->container['clicks'] === null) { + return false; + } + if ($this->container['uniqueClicks'] === null) { + return false; + } + if ($this->container['opens'] === null) { + return false; + } + if ($this->container['uniqueOpens'] === null) { + return false; + } + if ($this->container['spamReports'] === null) { + return false; + } + if ($this->container['blocked'] === null) { + return false; + } + if ($this->container['invalid'] === null) { + return false; + } + if ($this->container['unsubscribed'] === null) { + return false; + } + return true; + } + + + /** + * Gets range + * + * @return string + */ + public function getRange() + { + return $this->container['range']; + } + + /** + * Sets range + * + * @param string $range Time frame of the report + * + * @return $this + */ + public function setRange($range) + { + $this->container['range'] = $range; + + return $this; + } + + /** + * Gets requests + * + * @return int + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param int $requests Number of requests for the timeframe + * + * @return $this + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + + /** + * Gets delivered + * + * @return int + */ + public function getDelivered() + { + return $this->container['delivered']; + } + + /** + * Sets delivered + * + * @param int $delivered Number of delivered emails for the timeframe + * + * @return $this + */ + public function setDelivered($delivered) + { + $this->container['delivered'] = $delivered; + + return $this; + } + + /** + * Gets hardBounces + * + * @return int + */ + public function getHardBounces() + { + return $this->container['hardBounces']; + } + + /** + * Sets hardBounces + * + * @param int $hardBounces Number of hardbounces for the timeframe + * + * @return $this + */ + public function setHardBounces($hardBounces) + { + $this->container['hardBounces'] = $hardBounces; + + return $this; + } + + /** + * Gets softBounces + * + * @return int + */ + public function getSoftBounces() + { + return $this->container['softBounces']; + } + + /** + * Sets softBounces + * + * @param int $softBounces Number of softbounces for the timeframe + * + * @return $this + */ + public function setSoftBounces($softBounces) + { + $this->container['softBounces'] = $softBounces; + + return $this; + } + + /** + * Gets clicks + * + * @return int + */ + public function getClicks() + { + return $this->container['clicks']; + } + + /** + * Sets clicks + * + * @param int $clicks Number of clicks for the timeframe + * + * @return $this + */ + public function setClicks($clicks) + { + $this->container['clicks'] = $clicks; + + return $this; + } + + /** + * Gets uniqueClicks + * + * @return int + */ + public function getUniqueClicks() + { + return $this->container['uniqueClicks']; + } + + /** + * Sets uniqueClicks + * + * @param int $uniqueClicks Number of unique clicks for the timeframe + * + * @return $this + */ + public function setUniqueClicks($uniqueClicks) + { + $this->container['uniqueClicks'] = $uniqueClicks; + + return $this; + } + + /** + * Gets opens + * + * @return int + */ + public function getOpens() + { + return $this->container['opens']; + } + + /** + * Sets opens + * + * @param int $opens Number of openings for the timeframe + * + * @return $this + */ + public function setOpens($opens) + { + $this->container['opens'] = $opens; + + return $this; + } + + /** + * Gets uniqueOpens + * + * @return int + */ + public function getUniqueOpens() + { + return $this->container['uniqueOpens']; + } + + /** + * Sets uniqueOpens + * + * @param int $uniqueOpens Number of unique openings for the timeframe + * + * @return $this + */ + public function setUniqueOpens($uniqueOpens) + { + $this->container['uniqueOpens'] = $uniqueOpens; + + return $this; + } + + /** + * Gets spamReports + * + * @return int + */ + public function getSpamReports() + { + return $this->container['spamReports']; + } + + /** + * Sets spamReports + * + * @param int $spamReports Number of complaint (spam report) for the timeframe + * + * @return $this + */ + public function setSpamReports($spamReports) + { + $this->container['spamReports'] = $spamReports; + + return $this; + } + + /** + * Gets blocked + * + * @return int + */ + public function getBlocked() + { + return $this->container['blocked']; + } + + /** + * Sets blocked + * + * @param int $blocked Number of blocked contact emails for the timeframe + * + * @return $this + */ + public function setBlocked($blocked) + { + $this->container['blocked'] = $blocked; + + return $this; + } + + /** + * Gets invalid + * + * @return int + */ + public function getInvalid() + { + return $this->container['invalid']; + } + + /** + * Sets invalid + * + * @param int $invalid Number of invalid emails for the timeframe + * + * @return $this + */ + public function setInvalid($invalid) + { + $this->container['invalid'] = $invalid; + + return $this; + } + + /** + * Gets unsubscribed + * + * @return int + */ + public function getUnsubscribed() + { + return $this->container['unsubscribed']; + } + + /** + * Sets unsubscribed + * + * @param int $unsubscribed Number of unsubscribed emails for the timeframe + * + * @return $this + */ + public function setUnsubscribed($unsubscribed) + { + $this->container['unsubscribed'] = $unsubscribed; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAttributes.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAttributes.php new file mode 100644 index 0000000..1cfc845 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAttributes.php @@ -0,0 +1,308 @@ + '\SendinBlue\Client\Model\GetAttributesAttributes[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'attributes' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'attributes' => 'attributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'attributes' => 'setAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'attributes' => 'getAttributes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['attributes'] === null) { + $invalidProperties[] = "'attributes' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['attributes'] === null) { + return false; + } + return true; + } + + + /** + * Gets attributes + * + * @return \SendinBlue\Client\Model\GetAttributesAttributes[] + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param \SendinBlue\Client\Model\GetAttributesAttributes[] $attributes Listing of available contact attributes in your account + * + * @return $this + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAttributesAttributes.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAttributesAttributes.php new file mode 100644 index 0000000..7cdea1c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAttributesAttributes.php @@ -0,0 +1,518 @@ + 'string', + 'category' => 'string', + 'type' => 'string', + 'enumeration' => '\SendinBlue\Client\Model\GetAttributesEnumeration[]', + 'calculatedValue' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'category' => null, + 'type' => null, + 'enumeration' => null, + 'calculatedValue' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'category' => 'category', + 'type' => 'type', + 'enumeration' => 'enumeration', + 'calculatedValue' => 'calculatedValue' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'category' => 'setCategory', + 'type' => 'setType', + 'enumeration' => 'setEnumeration', + 'calculatedValue' => 'setCalculatedValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'category' => 'getCategory', + 'type' => 'getType', + 'enumeration' => 'getEnumeration', + 'calculatedValue' => 'getCalculatedValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const CATEGORY_NORMAL = 'normal'; + const CATEGORY_TRANSACTIONAL = 'transactional'; + const CATEGORY_CATEGORY = 'category'; + const CATEGORY_CALCULATED = 'calculated'; + const CATEGORY__GLOBAL = 'global'; + const TYPE_TEXT = 'text'; + const TYPE_DATE = 'date'; + const TYPE_FLOAT = 'float'; + const TYPE_ID = 'id'; + const TYPE_BOOLEAN = 'boolean'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCategoryAllowableValues() + { + return [ + self::CATEGORY_NORMAL, + self::CATEGORY_TRANSACTIONAL, + self::CATEGORY_CATEGORY, + self::CATEGORY_CALCULATED, + self::CATEGORY__GLOBAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_TEXT, + self::TYPE_DATE, + self::TYPE_FLOAT, + self::TYPE_ID, + self::TYPE_BOOLEAN, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['category'] = isset($data['category']) ? $data['category'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['enumeration'] = isset($data['enumeration']) ? $data['enumeration'] : null; + $this->container['calculatedValue'] = isset($data['calculatedValue']) ? $data['calculatedValue'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } + $allowedValues = $this->getCategoryAllowableValues(); + if (!in_array($this->container['category'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'category', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['name'] === null) { + return false; + } + if ($this->container['category'] === null) { + return false; + } + $allowedValues = $this->getCategoryAllowableValues(); + if (!in_array($this->container['category'], $allowedValues)) { + return false; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + return false; + } + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the attribute + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets category + * + * @return string + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string $category Category of the attribute + * + * @return $this + */ + public function setCategory($category) + { + $allowedValues = $this->getCategoryAllowableValues(); + if (!in_array($category, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'category', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of the attribute + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array($type, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets enumeration + * + * @return \SendinBlue\Client\Model\GetAttributesEnumeration[] + */ + public function getEnumeration() + { + return $this->container['enumeration']; + } + + /** + * Sets enumeration + * + * @param \SendinBlue\Client\Model\GetAttributesEnumeration[] $enumeration Parameter only available for \"category\" type attributes. + * + * @return $this + */ + public function setEnumeration($enumeration) + { + $this->container['enumeration'] = $enumeration; + + return $this; + } + + /** + * Gets calculatedValue + * + * @return string + */ + public function getCalculatedValue() + { + return $this->container['calculatedValue']; + } + + /** + * Sets calculatedValue + * + * @param string $calculatedValue Calculated value formula + * + * @return $this + */ + public function setCalculatedValue($calculatedValue) + { + $this->container['calculatedValue'] = $calculatedValue; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAttributesEnumeration.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAttributesEnumeration.php new file mode 100644 index 0000000..d6bcb40 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetAttributesEnumeration.php @@ -0,0 +1,344 @@ + 'int', + 'label' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'value' => 'int64', + 'label' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'label' => 'label' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'label' => 'setLabel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'label' => 'getLabel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = isset($data['value']) ? $data['value'] : null; + $this->container['label'] = isset($data['label']) ? $data['label'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['value'] === null) { + return false; + } + if ($this->container['label'] === null) { + return false; + } + return true; + } + + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value ID of Value of the \"category\" type attribute + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets label + * + * @return string + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string $label Label of the \"category\" type attribute + * + * @return $this + */ + public function setLabel($label) + { + $this->container['label'] = $label; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetCampaignOverview.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetCampaignOverview.php new file mode 100644 index 0000000..4fb098c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetCampaignOverview.php @@ -0,0 +1,766 @@ + 'int', + 'name' => 'string', + 'subject' => 'string', + 'type' => 'string', + 'status' => 'string', + 'scheduledAt' => '\DateTime', + 'abTesting' => 'bool', + 'subjectA' => 'string', + 'subjectB' => 'string', + 'splitRule' => 'int', + 'winnerCriteria' => 'string', + 'winnerDelay' => 'int', + 'sendAtBestTime' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'subject' => null, + 'type' => null, + 'status' => null, + 'scheduledAt' => 'date-time', + 'abTesting' => null, + 'subjectA' => null, + 'subjectB' => null, + 'splitRule' => null, + 'winnerCriteria' => null, + 'winnerDelay' => null, + 'sendAtBestTime' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'subject' => 'subject', + 'type' => 'type', + 'status' => 'status', + 'scheduledAt' => 'scheduledAt', + 'abTesting' => 'abTesting', + 'subjectA' => 'subjectA', + 'subjectB' => 'subjectB', + 'splitRule' => 'splitRule', + 'winnerCriteria' => 'winnerCriteria', + 'winnerDelay' => 'winnerDelay', + 'sendAtBestTime' => 'sendAtBestTime' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'subject' => 'setSubject', + 'type' => 'setType', + 'status' => 'setStatus', + 'scheduledAt' => 'setScheduledAt', + 'abTesting' => 'setAbTesting', + 'subjectA' => 'setSubjectA', + 'subjectB' => 'setSubjectB', + 'splitRule' => 'setSplitRule', + 'winnerCriteria' => 'setWinnerCriteria', + 'winnerDelay' => 'setWinnerDelay', + 'sendAtBestTime' => 'setSendAtBestTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'subject' => 'getSubject', + 'type' => 'getType', + 'status' => 'getStatus', + 'scheduledAt' => 'getScheduledAt', + 'abTesting' => 'getAbTesting', + 'subjectA' => 'getSubjectA', + 'subjectB' => 'getSubjectB', + 'splitRule' => 'getSplitRule', + 'winnerCriteria' => 'getWinnerCriteria', + 'winnerDelay' => 'getWinnerDelay', + 'sendAtBestTime' => 'getSendAtBestTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const TYPE_CLASSIC = 'classic'; + const TYPE_TRIGGER = 'trigger'; + const STATUS_DRAFT = 'draft'; + const STATUS_SENT = 'sent'; + const STATUS_ARCHIVE = 'archive'; + const STATUS_QUEUED = 'queued'; + const STATUS_SUSPENDED = 'suspended'; + const STATUS_IN_PROCESS = 'in_process'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CLASSIC, + self::TYPE_TRIGGER, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_DRAFT, + self::STATUS_SENT, + self::STATUS_ARCHIVE, + self::STATUS_QUEUED, + self::STATUS_SUSPENDED, + self::STATUS_IN_PROCESS, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null; + $this->container['abTesting'] = isset($data['abTesting']) ? $data['abTesting'] : null; + $this->container['subjectA'] = isset($data['subjectA']) ? $data['subjectA'] : null; + $this->container['subjectB'] = isset($data['subjectB']) ? $data['subjectB'] : null; + $this->container['splitRule'] = isset($data['splitRule']) ? $data['splitRule'] : null; + $this->container['winnerCriteria'] = isset($data['winnerCriteria']) ? $data['winnerCriteria'] : null; + $this->container['winnerDelay'] = isset($data['winnerDelay']) ? $data['winnerDelay'] : null; + $this->container['sendAtBestTime'] = isset($data['sendAtBestTime']) ? $data['sendAtBestTime'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + if ($this->container['name'] === null) { + return false; + } + if ($this->container['type'] === null) { + return false; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + return false; + } + if ($this->container['status'] === null) { + return false; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the campaign + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the campaign + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of campaign + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Status of the campaign + * + * @return $this + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets scheduledAt + * + * @return \DateTime + */ + public function getScheduledAt() + { + return $this->container['scheduledAt']; + } + + /** + * Sets scheduledAt + * + * @param \DateTime $scheduledAt UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setScheduledAt($scheduledAt) + { + $this->container['scheduledAt'] = $scheduledAt; + + return $this; + } + + /** + * Gets abTesting + * + * @return bool + */ + public function getAbTesting() + { + return $this->container['abTesting']; + } + + /** + * Sets abTesting + * + * @param bool $abTesting Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. + * + * @return $this + */ + public function setAbTesting($abTesting) + { + $this->container['abTesting'] = $abTesting; + + return $this; + } + + /** + * Gets subjectA + * + * @return string + */ + public function getSubjectA() + { + return $this->container['subjectA']; + } + + /** + * Sets subjectA + * + * @param string $subjectA Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSubjectA($subjectA) + { + $this->container['subjectA'] = $subjectA; + + return $this; + } + + /** + * Gets subjectB + * + * @return string + */ + public function getSubjectB() + { + return $this->container['subjectB']; + } + + /** + * Sets subjectB + * + * @param string $subjectB Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSubjectB($subjectB) + { + $this->container['subjectB'] = $subjectB; + + return $this; + } + + /** + * Gets splitRule + * + * @return int + */ + public function getSplitRule() + { + return $this->container['splitRule']; + } + + /** + * Sets splitRule + * + * @param int $splitRule The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSplitRule($splitRule) + { + $this->container['splitRule'] = $splitRule; + + return $this; + } + + /** + * Gets winnerCriteria + * + * @return string + */ + public function getWinnerCriteria() + { + return $this->container['winnerCriteria']; + } + + /** + * Sets winnerCriteria + * + * @param string $winnerCriteria Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setWinnerCriteria($winnerCriteria) + { + $this->container['winnerCriteria'] = $winnerCriteria; + + return $this; + } + + /** + * Gets winnerDelay + * + * @return int + */ + public function getWinnerDelay() + { + return $this->container['winnerDelay']; + } + + /** + * Sets winnerDelay + * + * @param int $winnerDelay The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setWinnerDelay($winnerDelay) + { + $this->container['winnerDelay'] = $winnerDelay; + + return $this; + } + + /** + * Gets sendAtBestTime + * + * @return bool + */ + public function getSendAtBestTime() + { + return $this->container['sendAtBestTime']; + } + + /** + * Sets sendAtBestTime + * + * @param bool $sendAtBestTime It is true if you have chosen to send your campaign at best time, otherwise it is false + * + * @return $this + */ + public function setSendAtBestTime($sendAtBestTime) + { + $this->container['sendAtBestTime'] = $sendAtBestTime; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetCampaignRecipients.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetCampaignRecipients.php new file mode 100644 index 0000000..7197818 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetCampaignRecipients.php @@ -0,0 +1,344 @@ + 'int[]', + 'exclusionLists' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'lists' => 'int64', + 'exclusionLists' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'lists' => 'lists', + 'exclusionLists' => 'exclusionLists' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'lists' => 'setLists', + 'exclusionLists' => 'setExclusionLists' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'lists' => 'getLists', + 'exclusionLists' => 'getExclusionLists' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['lists'] = isset($data['lists']) ? $data['lists'] : null; + $this->container['exclusionLists'] = isset($data['exclusionLists']) ? $data['exclusionLists'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['lists'] === null) { + $invalidProperties[] = "'lists' can't be null"; + } + if ($this->container['exclusionLists'] === null) { + $invalidProperties[] = "'exclusionLists' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['lists'] === null) { + return false; + } + if ($this->container['exclusionLists'] === null) { + return false; + } + return true; + } + + + /** + * Gets lists + * + * @return int[] + */ + public function getLists() + { + return $this->container['lists']; + } + + /** + * Sets lists + * + * @param int[] $lists lists + * + * @return $this + */ + public function setLists($lists) + { + $this->container['lists'] = $lists; + + return $this; + } + + /** + * Gets exclusionLists + * + * @return int[] + */ + public function getExclusionLists() + { + return $this->container['exclusionLists']; + } + + /** + * Sets exclusionLists + * + * @param int[] $exclusionLists exclusionLists + * + * @return $this + */ + public function setExclusionLists($exclusionLists) + { + $this->container['exclusionLists'] = $exclusionLists; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetCampaignStats.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetCampaignStats.php new file mode 100644 index 0000000..91b23dc --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetCampaignStats.php @@ -0,0 +1,692 @@ + 'int', + 'uniqueClicks' => 'int', + 'clickers' => 'int', + 'complaints' => 'int', + 'delivered' => 'int', + 'sent' => 'int', + 'softBounces' => 'int', + 'hardBounces' => 'int', + 'uniqueViews' => 'int', + 'unsubscriptions' => 'int', + 'viewed' => 'int', + 'deferred' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'listId' => 'int64', + 'uniqueClicks' => 'int64', + 'clickers' => 'int64', + 'complaints' => 'int64', + 'delivered' => 'int64', + 'sent' => 'int64', + 'softBounces' => 'int64', + 'hardBounces' => 'int64', + 'uniqueViews' => 'int64', + 'unsubscriptions' => 'int64', + 'viewed' => 'int64', + 'deferred' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'listId' => 'listId', + 'uniqueClicks' => 'uniqueClicks', + 'clickers' => 'clickers', + 'complaints' => 'complaints', + 'delivered' => 'delivered', + 'sent' => 'sent', + 'softBounces' => 'softBounces', + 'hardBounces' => 'hardBounces', + 'uniqueViews' => 'uniqueViews', + 'unsubscriptions' => 'unsubscriptions', + 'viewed' => 'viewed', + 'deferred' => 'deferred' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'listId' => 'setListId', + 'uniqueClicks' => 'setUniqueClicks', + 'clickers' => 'setClickers', + 'complaints' => 'setComplaints', + 'delivered' => 'setDelivered', + 'sent' => 'setSent', + 'softBounces' => 'setSoftBounces', + 'hardBounces' => 'setHardBounces', + 'uniqueViews' => 'setUniqueViews', + 'unsubscriptions' => 'setUnsubscriptions', + 'viewed' => 'setViewed', + 'deferred' => 'setDeferred' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'listId' => 'getListId', + 'uniqueClicks' => 'getUniqueClicks', + 'clickers' => 'getClickers', + 'complaints' => 'getComplaints', + 'delivered' => 'getDelivered', + 'sent' => 'getSent', + 'softBounces' => 'getSoftBounces', + 'hardBounces' => 'getHardBounces', + 'uniqueViews' => 'getUniqueViews', + 'unsubscriptions' => 'getUnsubscriptions', + 'viewed' => 'getViewed', + 'deferred' => 'getDeferred' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['listId'] = isset($data['listId']) ? $data['listId'] : null; + $this->container['uniqueClicks'] = isset($data['uniqueClicks']) ? $data['uniqueClicks'] : null; + $this->container['clickers'] = isset($data['clickers']) ? $data['clickers'] : null; + $this->container['complaints'] = isset($data['complaints']) ? $data['complaints'] : null; + $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null; + $this->container['sent'] = isset($data['sent']) ? $data['sent'] : null; + $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null; + $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null; + $this->container['uniqueViews'] = isset($data['uniqueViews']) ? $data['uniqueViews'] : null; + $this->container['unsubscriptions'] = isset($data['unsubscriptions']) ? $data['unsubscriptions'] : null; + $this->container['viewed'] = isset($data['viewed']) ? $data['viewed'] : null; + $this->container['deferred'] = isset($data['deferred']) ? $data['deferred'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['uniqueClicks'] === null) { + $invalidProperties[] = "'uniqueClicks' can't be null"; + } + if ($this->container['clickers'] === null) { + $invalidProperties[] = "'clickers' can't be null"; + } + if ($this->container['complaints'] === null) { + $invalidProperties[] = "'complaints' can't be null"; + } + if ($this->container['delivered'] === null) { + $invalidProperties[] = "'delivered' can't be null"; + } + if ($this->container['sent'] === null) { + $invalidProperties[] = "'sent' can't be null"; + } + if ($this->container['softBounces'] === null) { + $invalidProperties[] = "'softBounces' can't be null"; + } + if ($this->container['hardBounces'] === null) { + $invalidProperties[] = "'hardBounces' can't be null"; + } + if ($this->container['uniqueViews'] === null) { + $invalidProperties[] = "'uniqueViews' can't be null"; + } + if ($this->container['unsubscriptions'] === null) { + $invalidProperties[] = "'unsubscriptions' can't be null"; + } + if ($this->container['viewed'] === null) { + $invalidProperties[] = "'viewed' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['uniqueClicks'] === null) { + return false; + } + if ($this->container['clickers'] === null) { + return false; + } + if ($this->container['complaints'] === null) { + return false; + } + if ($this->container['delivered'] === null) { + return false; + } + if ($this->container['sent'] === null) { + return false; + } + if ($this->container['softBounces'] === null) { + return false; + } + if ($this->container['hardBounces'] === null) { + return false; + } + if ($this->container['uniqueViews'] === null) { + return false; + } + if ($this->container['unsubscriptions'] === null) { + return false; + } + if ($this->container['viewed'] === null) { + return false; + } + return true; + } + + + /** + * Gets listId + * + * @return int + */ + public function getListId() + { + return $this->container['listId']; + } + + /** + * Sets listId + * + * @param int $listId List Id of email campaign (only in case of get email campaign(s)(not for global stats)) + * + * @return $this + */ + public function setListId($listId) + { + $this->container['listId'] = $listId; + + return $this; + } + + /** + * Gets uniqueClicks + * + * @return int + */ + public function getUniqueClicks() + { + return $this->container['uniqueClicks']; + } + + /** + * Sets uniqueClicks + * + * @param int $uniqueClicks Number of unique clicks for the campaign + * + * @return $this + */ + public function setUniqueClicks($uniqueClicks) + { + $this->container['uniqueClicks'] = $uniqueClicks; + + return $this; + } + + /** + * Gets clickers + * + * @return int + */ + public function getClickers() + { + return $this->container['clickers']; + } + + /** + * Sets clickers + * + * @param int $clickers Number of total clicks for the campaign + * + * @return $this + */ + public function setClickers($clickers) + { + $this->container['clickers'] = $clickers; + + return $this; + } + + /** + * Gets complaints + * + * @return int + */ + public function getComplaints() + { + return $this->container['complaints']; + } + + /** + * Sets complaints + * + * @param int $complaints Number of complaints (Spam reports) for the campaign + * + * @return $this + */ + public function setComplaints($complaints) + { + $this->container['complaints'] = $complaints; + + return $this; + } + + /** + * Gets delivered + * + * @return int + */ + public function getDelivered() + { + return $this->container['delivered']; + } + + /** + * Sets delivered + * + * @param int $delivered Number of delivered emails for the campaign + * + * @return $this + */ + public function setDelivered($delivered) + { + $this->container['delivered'] = $delivered; + + return $this; + } + + /** + * Gets sent + * + * @return int + */ + public function getSent() + { + return $this->container['sent']; + } + + /** + * Sets sent + * + * @param int $sent Number of sent emails for the campaign + * + * @return $this + */ + public function setSent($sent) + { + $this->container['sent'] = $sent; + + return $this; + } + + /** + * Gets softBounces + * + * @return int + */ + public function getSoftBounces() + { + return $this->container['softBounces']; + } + + /** + * Sets softBounces + * + * @param int $softBounces Number of softbounce for the campaign + * + * @return $this + */ + public function setSoftBounces($softBounces) + { + $this->container['softBounces'] = $softBounces; + + return $this; + } + + /** + * Gets hardBounces + * + * @return int + */ + public function getHardBounces() + { + return $this->container['hardBounces']; + } + + /** + * Sets hardBounces + * + * @param int $hardBounces Number of harbounce for the campaign + * + * @return $this + */ + public function setHardBounces($hardBounces) + { + $this->container['hardBounces'] = $hardBounces; + + return $this; + } + + /** + * Gets uniqueViews + * + * @return int + */ + public function getUniqueViews() + { + return $this->container['uniqueViews']; + } + + /** + * Sets uniqueViews + * + * @param int $uniqueViews Number of unique openings for the campaign + * + * @return $this + */ + public function setUniqueViews($uniqueViews) + { + $this->container['uniqueViews'] = $uniqueViews; + + return $this; + } + + /** + * Gets unsubscriptions + * + * @return int + */ + public function getUnsubscriptions() + { + return $this->container['unsubscriptions']; + } + + /** + * Sets unsubscriptions + * + * @param int $unsubscriptions Number of unsubscription for the campaign + * + * @return $this + */ + public function setUnsubscriptions($unsubscriptions) + { + $this->container['unsubscriptions'] = $unsubscriptions; + + return $this; + } + + /** + * Gets viewed + * + * @return int + */ + public function getViewed() + { + return $this->container['viewed']; + } + + /** + * Sets viewed + * + * @param int $viewed Number of openings for the campaign + * + * @return $this + */ + public function setViewed($viewed) + { + $this->container['viewed'] = $viewed; + + return $this; + } + + /** + * Gets deferred + * + * @return int + */ + public function getDeferred() + { + return $this->container['deferred']; + } + + /** + * Sets deferred + * + * @param int $deferred Number of deferred emails for the campaign + * + * @return $this + */ + public function setDeferred($deferred) + { + $this->container['deferred'] = $deferred; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildDomain.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildDomain.php new file mode 100644 index 0000000..5b7db91 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildDomain.php @@ -0,0 +1,344 @@ + 'string', + 'active' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'domain' => null, + 'active' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'domain' => 'domain', + 'active' => 'active' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'domain' => 'setDomain', + 'active' => 'setActive' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'domain' => 'getDomain', + 'active' => 'getActive' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null; + $this->container['active'] = isset($data['active']) ? $data['active'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['domain'] === null) { + $invalidProperties[] = "'domain' can't be null"; + } + if ($this->container['active'] === null) { + $invalidProperties[] = "'active' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['domain'] === null) { + return false; + } + if ($this->container['active'] === null) { + return false; + } + return true; + } + + + /** + * Gets domain + * + * @return string + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string $domain Sender domain + * + * @return $this + */ + public function setDomain($domain) + { + $this->container['domain'] = $domain; + + return $this; + } + + /** + * Gets active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active indicates whether a domain is verified or not + * + * @return $this + */ + public function setActive($active) + { + $this->container['active'] = $active; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildDomains.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildDomains.php new file mode 100644 index 0000000..dc0a126 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildDomains.php @@ -0,0 +1,280 @@ +container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfo.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfo.php new file mode 100644 index 0000000..6991820 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfo.php @@ -0,0 +1,572 @@ + 'string', + 'firstName' => 'string', + 'lastName' => 'string', + 'companyName' => 'string', + 'credits' => '\SendinBlue\Client\Model\GetChildInfoCredits', + 'statistics' => '\SendinBlue\Client\Model\GetChildInfoStatistics', + 'password' => 'string', + 'ips' => 'string[]', + 'apiKeys' => '\SendinBlue\Client\Model\GetChildInfoApiKeys' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'firstName' => null, + 'lastName' => null, + 'companyName' => null, + 'credits' => null, + 'statistics' => null, + 'password' => 'password', + 'ips' => null, + 'apiKeys' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'firstName' => 'firstName', + 'lastName' => 'lastName', + 'companyName' => 'companyName', + 'credits' => 'credits', + 'statistics' => 'statistics', + 'password' => 'password', + 'ips' => 'ips', + 'apiKeys' => 'apiKeys' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName', + 'companyName' => 'setCompanyName', + 'credits' => 'setCredits', + 'statistics' => 'setStatistics', + 'password' => 'setPassword', + 'ips' => 'setIps', + 'apiKeys' => 'setApiKeys' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName', + 'companyName' => 'getCompanyName', + 'credits' => 'getCredits', + 'statistics' => 'getStatistics', + 'password' => 'getPassword', + 'ips' => 'getIps', + 'apiKeys' => 'getApiKeys' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['firstName'] = isset($data['firstName']) ? $data['firstName'] : null; + $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null; + $this->container['companyName'] = isset($data['companyName']) ? $data['companyName'] : null; + $this->container['credits'] = isset($data['credits']) ? $data['credits'] : null; + $this->container['statistics'] = isset($data['statistics']) ? $data['statistics'] : null; + $this->container['password'] = isset($data['password']) ? $data['password'] : null; + $this->container['ips'] = isset($data['ips']) ? $data['ips'] : null; + $this->container['apiKeys'] = isset($data['apiKeys']) ? $data['apiKeys'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['firstName'] === null) { + $invalidProperties[] = "'firstName' can't be null"; + } + if ($this->container['lastName'] === null) { + $invalidProperties[] = "'lastName' can't be null"; + } + if ($this->container['companyName'] === null) { + $invalidProperties[] = "'companyName' can't be null"; + } + if ($this->container['password'] === null) { + $invalidProperties[] = "'password' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + if ($this->container['firstName'] === null) { + return false; + } + if ($this->container['lastName'] === null) { + return false; + } + if ($this->container['companyName'] === null) { + return false; + } + if ($this->container['password'] === null) { + return false; + } + return true; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Login Email + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets firstName + * + * @return string + */ + public function getFirstName() + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string $firstName First Name + * + * @return $this + */ + public function setFirstName($firstName) + { + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string + */ + public function getLastName() + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string $lastName Last Name + * + * @return $this + */ + public function setLastName($lastName) + { + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets companyName + * + * @return string + */ + public function getCompanyName() + { + return $this->container['companyName']; + } + + /** + * Sets companyName + * + * @param string $companyName Name of the company + * + * @return $this + */ + public function setCompanyName($companyName) + { + $this->container['companyName'] = $companyName; + + return $this; + } + + /** + * Gets credits + * + * @return \SendinBlue\Client\Model\GetChildInfoCredits + */ + public function getCredits() + { + return $this->container['credits']; + } + + /** + * Sets credits + * + * @param \SendinBlue\Client\Model\GetChildInfoCredits $credits credits + * + * @return $this + */ + public function setCredits($credits) + { + $this->container['credits'] = $credits; + + return $this; + } + + /** + * Gets statistics + * + * @return \SendinBlue\Client\Model\GetChildInfoStatistics + */ + public function getStatistics() + { + return $this->container['statistics']; + } + + /** + * Sets statistics + * + * @param \SendinBlue\Client\Model\GetChildInfoStatistics $statistics statistics + * + * @return $this + */ + public function setStatistics($statistics) + { + $this->container['statistics'] = $statistics; + + return $this; + } + + /** + * Gets password + * + * @return string + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string $password The encrypted password of child account + * + * @return $this + */ + public function setPassword($password) + { + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets ips + * + * @return string[] + */ + public function getIps() + { + return $this->container['ips']; + } + + /** + * Sets ips + * + * @param string[] $ips IP(s) associated to a child account user + * + * @return $this + */ + public function setIps($ips) + { + $this->container['ips'] = $ips; + + return $this; + } + + /** + * Gets apiKeys + * + * @return \SendinBlue\Client\Model\GetChildInfoApiKeys + */ + public function getApiKeys() + { + return $this->container['apiKeys']; + } + + /** + * Sets apiKeys + * + * @param \SendinBlue\Client\Model\GetChildInfoApiKeys $apiKeys apiKeys + * + * @return $this + */ + public function setApiKeys($apiKeys) + { + $this->container['apiKeys'] = $apiKeys; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoApiKeys.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoApiKeys.php new file mode 100644 index 0000000..cf42dde --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoApiKeys.php @@ -0,0 +1,339 @@ + '\SendinBlue\Client\Model\GetChildInfoApiKeysV2[]', + 'v3' => '\SendinBlue\Client\Model\GetChildInfoApiKeysV3[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'v2' => null, + 'v3' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'v2' => 'v2', + 'v3' => 'v3' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'v2' => 'setV2', + 'v3' => 'setV3' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'v2' => 'getV2', + 'v3' => 'getV3' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['v2'] = isset($data['v2']) ? $data['v2'] : null; + $this->container['v3'] = isset($data['v3']) ? $data['v3'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['v2'] === null) { + $invalidProperties[] = "'v2' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['v2'] === null) { + return false; + } + return true; + } + + + /** + * Gets v2 + * + * @return \SendinBlue\Client\Model\GetChildInfoApiKeysV2[] + */ + public function getV2() + { + return $this->container['v2']; + } + + /** + * Sets v2 + * + * @param \SendinBlue\Client\Model\GetChildInfoApiKeysV2[] $v2 v2 + * + * @return $this + */ + public function setV2($v2) + { + $this->container['v2'] = $v2; + + return $this; + } + + /** + * Gets v3 + * + * @return \SendinBlue\Client\Model\GetChildInfoApiKeysV3[] + */ + public function getV3() + { + return $this->container['v3']; + } + + /** + * Sets v3 + * + * @param \SendinBlue\Client\Model\GetChildInfoApiKeysV3[] $v3 v3 + * + * @return $this + */ + public function setV3($v3) + { + $this->container['v3'] = $v3; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoApiKeysV2.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoApiKeysV2.php new file mode 100644 index 0000000..f4d2369 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoApiKeysV2.php @@ -0,0 +1,344 @@ + 'string', + 'key' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'key' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'key' => 'key' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'key' => 'setKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'key' => 'getKey' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['key'] = isset($data['key']) ? $data['key'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['key'] === null) { + $invalidProperties[] = "'key' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['name'] === null) { + return false; + } + if ($this->container['key'] === null) { + return false; + } + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the key for version 2 + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string $key API Key for version 2 + * + * @return $this + */ + public function setKey($key) + { + $this->container['key'] = $key; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoApiKeysV3.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoApiKeysV3.php new file mode 100644 index 0000000..b9d7c9d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoApiKeysV3.php @@ -0,0 +1,344 @@ + 'string', + 'key' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'key' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'key' => 'key' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'key' => 'setKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'key' => 'getKey' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['key'] = isset($data['key']) ? $data['key'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['key'] === null) { + $invalidProperties[] = "'key' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['name'] === null) { + return false; + } + if ($this->container['key'] === null) { + return false; + } + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the key for version 3 + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string $key API Key for version 3 + * + * @return $this + */ + public function setKey($key) + { + $this->container['key'] = $key; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoCredits.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoCredits.php new file mode 100644 index 0000000..3c043c0 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoCredits.php @@ -0,0 +1,333 @@ + 'int', + 'smsCredits' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'emailCredits' => 'int64', + 'smsCredits' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'emailCredits' => 'emailCredits', + 'smsCredits' => 'smsCredits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'emailCredits' => 'setEmailCredits', + 'smsCredits' => 'setSmsCredits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'emailCredits' => 'getEmailCredits', + 'smsCredits' => 'getSmsCredits' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['emailCredits'] = isset($data['emailCredits']) ? $data['emailCredits'] : null; + $this->container['smsCredits'] = isset($data['smsCredits']) ? $data['smsCredits'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets emailCredits + * + * @return int + */ + public function getEmailCredits() + { + return $this->container['emailCredits']; + } + + /** + * Sets emailCredits + * + * @param int $emailCredits Email credits available for your child + * + * @return $this + */ + public function setEmailCredits($emailCredits) + { + $this->container['emailCredits'] = $emailCredits; + + return $this; + } + + /** + * Gets smsCredits + * + * @return int + */ + public function getSmsCredits() + { + return $this->container['smsCredits']; + } + + /** + * Sets smsCredits + * + * @param int $smsCredits SMS credits available for your child + * + * @return $this + */ + public function setSmsCredits($smsCredits) + { + $this->container['smsCredits'] = $smsCredits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoStatistics.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoStatistics.php new file mode 100644 index 0000000..0b5dafe --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildInfoStatistics.php @@ -0,0 +1,363 @@ + 'int', + 'currentMonthTotalSent' => 'int', + 'totalSent' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'previousMonthTotalSent' => 'int64', + 'currentMonthTotalSent' => 'int64', + 'totalSent' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'previousMonthTotalSent' => 'previousMonthTotalSent', + 'currentMonthTotalSent' => 'currentMonthTotalSent', + 'totalSent' => 'totalSent' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'previousMonthTotalSent' => 'setPreviousMonthTotalSent', + 'currentMonthTotalSent' => 'setCurrentMonthTotalSent', + 'totalSent' => 'setTotalSent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'previousMonthTotalSent' => 'getPreviousMonthTotalSent', + 'currentMonthTotalSent' => 'getCurrentMonthTotalSent', + 'totalSent' => 'getTotalSent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['previousMonthTotalSent'] = isset($data['previousMonthTotalSent']) ? $data['previousMonthTotalSent'] : null; + $this->container['currentMonthTotalSent'] = isset($data['currentMonthTotalSent']) ? $data['currentMonthTotalSent'] : null; + $this->container['totalSent'] = isset($data['totalSent']) ? $data['totalSent'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets previousMonthTotalSent + * + * @return int + */ + public function getPreviousMonthTotalSent() + { + return $this->container['previousMonthTotalSent']; + } + + /** + * Sets previousMonthTotalSent + * + * @param int $previousMonthTotalSent Overall emails sent for the previous month + * + * @return $this + */ + public function setPreviousMonthTotalSent($previousMonthTotalSent) + { + $this->container['previousMonthTotalSent'] = $previousMonthTotalSent; + + return $this; + } + + /** + * Gets currentMonthTotalSent + * + * @return int + */ + public function getCurrentMonthTotalSent() + { + return $this->container['currentMonthTotalSent']; + } + + /** + * Sets currentMonthTotalSent + * + * @param int $currentMonthTotalSent Overall emails sent for current month + * + * @return $this + */ + public function setCurrentMonthTotalSent($currentMonthTotalSent) + { + $this->container['currentMonthTotalSent'] = $currentMonthTotalSent; + + return $this; + } + + /** + * Gets totalSent + * + * @return int + */ + public function getTotalSent() + { + return $this->container['totalSent']; + } + + /** + * Sets totalSent + * + * @param int $totalSent Overall emails sent for since the account exists + * + * @return $this + */ + public function setTotalSent($totalSent) + { + $this->container['totalSent'] = $totalSent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildrenList.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildrenList.php new file mode 100644 index 0000000..7a2fed2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetChildrenList.php @@ -0,0 +1,302 @@ + 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'children' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'children' => 'children' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'children' => 'setChildren' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'children' => 'getChildren' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['children'] = isset($data['children']) ? $data['children'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets children + * + * @return object[] + */ + public function getChildren() + { + return $this->container['children']; + } + + /** + * Sets children + * + * @param object[] $children Your children's account information + * + * @return $this + */ + public function setChildren($children) + { + $this->container['children'] = $children; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetClient.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetClient.php new file mode 100644 index 0000000..a908c1a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetClient.php @@ -0,0 +1,416 @@ + 'string', + 'firstName' => 'string', + 'lastName' => 'string', + 'companyName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'firstName' => null, + 'lastName' => null, + 'companyName' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'firstName' => 'firstName', + 'lastName' => 'lastName', + 'companyName' => 'companyName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName', + 'companyName' => 'setCompanyName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName', + 'companyName' => 'getCompanyName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['firstName'] = isset($data['firstName']) ? $data['firstName'] : null; + $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null; + $this->container['companyName'] = isset($data['companyName']) ? $data['companyName'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['firstName'] === null) { + $invalidProperties[] = "'firstName' can't be null"; + } + if ($this->container['lastName'] === null) { + $invalidProperties[] = "'lastName' can't be null"; + } + if ($this->container['companyName'] === null) { + $invalidProperties[] = "'companyName' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + if ($this->container['firstName'] === null) { + return false; + } + if ($this->container['lastName'] === null) { + return false; + } + if ($this->container['companyName'] === null) { + return false; + } + return true; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Login Email + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets firstName + * + * @return string + */ + public function getFirstName() + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string $firstName First Name + * + * @return $this + */ + public function setFirstName($firstName) + { + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string + */ + public function getLastName() + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string $lastName Last Name + * + * @return $this + */ + public function setLastName($lastName) + { + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets companyName + * + * @return string + */ + public function getCompanyName() + { + return $this->container['companyName']; + } + + /** + * Sets companyName + * + * @param string $companyName Name of the company + * + * @return $this + */ + public function setCompanyName($companyName) + { + $this->container['companyName'] = $companyName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStats.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStats.php new file mode 100644 index 0000000..e917e7e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStats.php @@ -0,0 +1,513 @@ + '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]', + 'hardBounces' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]', + 'softBounces' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]', + 'complaints' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]', + 'unsubscriptions' => '\SendinBlue\Client\Model\GetContactCampaignStatsUnsubscriptions', + 'opened' => '\SendinBlue\Client\Model\GetContactCampaignStatsOpened[]', + 'clicked' => '\SendinBlue\Client\Model\GetContactCampaignStatsClicked[]', + 'transacAttributes' => '\SendinBlue\Client\Model\GetContactCampaignStatsTransacAttributes[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'messagesSent' => null, + 'hardBounces' => null, + 'softBounces' => null, + 'complaints' => null, + 'unsubscriptions' => null, + 'opened' => null, + 'clicked' => null, + 'transacAttributes' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'messagesSent' => 'messagesSent', + 'hardBounces' => 'hardBounces', + 'softBounces' => 'softBounces', + 'complaints' => 'complaints', + 'unsubscriptions' => 'unsubscriptions', + 'opened' => 'opened', + 'clicked' => 'clicked', + 'transacAttributes' => 'transacAttributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'messagesSent' => 'setMessagesSent', + 'hardBounces' => 'setHardBounces', + 'softBounces' => 'setSoftBounces', + 'complaints' => 'setComplaints', + 'unsubscriptions' => 'setUnsubscriptions', + 'opened' => 'setOpened', + 'clicked' => 'setClicked', + 'transacAttributes' => 'setTransacAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'messagesSent' => 'getMessagesSent', + 'hardBounces' => 'getHardBounces', + 'softBounces' => 'getSoftBounces', + 'complaints' => 'getComplaints', + 'unsubscriptions' => 'getUnsubscriptions', + 'opened' => 'getOpened', + 'clicked' => 'getClicked', + 'transacAttributes' => 'getTransacAttributes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['messagesSent'] = isset($data['messagesSent']) ? $data['messagesSent'] : null; + $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null; + $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null; + $this->container['complaints'] = isset($data['complaints']) ? $data['complaints'] : null; + $this->container['unsubscriptions'] = isset($data['unsubscriptions']) ? $data['unsubscriptions'] : null; + $this->container['opened'] = isset($data['opened']) ? $data['opened'] : null; + $this->container['clicked'] = isset($data['clicked']) ? $data['clicked'] : null; + $this->container['transacAttributes'] = isset($data['transacAttributes']) ? $data['transacAttributes'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets messagesSent + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] + */ + public function getMessagesSent() + { + return $this->container['messagesSent']; + } + + /** + * Sets messagesSent + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $messagesSent messagesSent + * + * @return $this + */ + public function setMessagesSent($messagesSent) + { + $this->container['messagesSent'] = $messagesSent; + + return $this; + } + + /** + * Gets hardBounces + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] + */ + public function getHardBounces() + { + return $this->container['hardBounces']; + } + + /** + * Sets hardBounces + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $hardBounces hardBounces + * + * @return $this + */ + public function setHardBounces($hardBounces) + { + $this->container['hardBounces'] = $hardBounces; + + return $this; + } + + /** + * Gets softBounces + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] + */ + public function getSoftBounces() + { + return $this->container['softBounces']; + } + + /** + * Sets softBounces + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $softBounces softBounces + * + * @return $this + */ + public function setSoftBounces($softBounces) + { + $this->container['softBounces'] = $softBounces; + + return $this; + } + + /** + * Gets complaints + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] + */ + public function getComplaints() + { + return $this->container['complaints']; + } + + /** + * Sets complaints + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $complaints complaints + * + * @return $this + */ + public function setComplaints($complaints) + { + $this->container['complaints'] = $complaints; + + return $this; + } + + /** + * Gets unsubscriptions + * + * @return \SendinBlue\Client\Model\GetContactCampaignStatsUnsubscriptions + */ + public function getUnsubscriptions() + { + return $this->container['unsubscriptions']; + } + + /** + * Sets unsubscriptions + * + * @param \SendinBlue\Client\Model\GetContactCampaignStatsUnsubscriptions $unsubscriptions unsubscriptions + * + * @return $this + */ + public function setUnsubscriptions($unsubscriptions) + { + $this->container['unsubscriptions'] = $unsubscriptions; + + return $this; + } + + /** + * Gets opened + * + * @return \SendinBlue\Client\Model\GetContactCampaignStatsOpened[] + */ + public function getOpened() + { + return $this->container['opened']; + } + + /** + * Sets opened + * + * @param \SendinBlue\Client\Model\GetContactCampaignStatsOpened[] $opened opened + * + * @return $this + */ + public function setOpened($opened) + { + $this->container['opened'] = $opened; + + return $this; + } + + /** + * Gets clicked + * + * @return \SendinBlue\Client\Model\GetContactCampaignStatsClicked[] + */ + public function getClicked() + { + return $this->container['clicked']; + } + + /** + * Sets clicked + * + * @param \SendinBlue\Client\Model\GetContactCampaignStatsClicked[] $clicked clicked + * + * @return $this + */ + public function setClicked($clicked) + { + $this->container['clicked'] = $clicked; + + return $this; + } + + /** + * Gets transacAttributes + * + * @return \SendinBlue\Client\Model\GetContactCampaignStatsTransacAttributes[] + */ + public function getTransacAttributes() + { + return $this->container['transacAttributes']; + } + + /** + * Sets transacAttributes + * + * @param \SendinBlue\Client\Model\GetContactCampaignStatsTransacAttributes[] $transacAttributes transacAttributes + * + * @return $this + */ + public function setTransacAttributes($transacAttributes) + { + $this->container['transacAttributes'] = $transacAttributes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStatsClicked.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStatsClicked.php new file mode 100644 index 0000000..296e2a9 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStatsClicked.php @@ -0,0 +1,344 @@ + 'int', + 'links' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsLinks[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'campaignId' => 'int64', + 'links' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaignId' => 'campaignId', + 'links' => 'links' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaignId' => 'setCampaignId', + 'links' => 'setLinks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaignId' => 'getCampaignId', + 'links' => 'getLinks' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; + $this->container['links'] = isset($data['links']) ? $data['links'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['campaignId'] === null) { + $invalidProperties[] = "'campaignId' can't be null"; + } + if ($this->container['links'] === null) { + $invalidProperties[] = "'links' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['campaignId'] === null) { + return false; + } + if ($this->container['links'] === null) { + return false; + } + return true; + } + + + /** + * Gets campaignId + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaignId']; + } + + /** + * Sets campaignId + * + * @param int $campaignId ID of the campaign which generated the event + * + * @return $this + */ + public function setCampaignId($campaignId) + { + $this->container['campaignId'] = $campaignId; + + return $this; + } + + /** + * Gets links + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsLinks[] + */ + public function getLinks() + { + return $this->container['links']; + } + + /** + * Sets links + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsLinks[] $links links + * + * @return $this + */ + public function setLinks($links) + { + $this->container['links'] = $links; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStatsOpened.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStatsOpened.php new file mode 100644 index 0000000..53cd654 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStatsOpened.php @@ -0,0 +1,416 @@ + 'int', + 'count' => 'int', + 'eventTime' => '\DateTime', + 'ip' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'campaignId' => 'int64', + 'count' => 'int64', + 'eventTime' => 'date-time', + 'ip' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaignId' => 'campaignId', + 'count' => 'count', + 'eventTime' => 'eventTime', + 'ip' => 'ip' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaignId' => 'setCampaignId', + 'count' => 'setCount', + 'eventTime' => 'setEventTime', + 'ip' => 'setIp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaignId' => 'getCampaignId', + 'count' => 'getCount', + 'eventTime' => 'getEventTime', + 'ip' => 'getIp' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + $this->container['eventTime'] = isset($data['eventTime']) ? $data['eventTime'] : null; + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['campaignId'] === null) { + $invalidProperties[] = "'campaignId' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['eventTime'] === null) { + $invalidProperties[] = "'eventTime' can't be null"; + } + if ($this->container['ip'] === null) { + $invalidProperties[] = "'ip' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['campaignId'] === null) { + return false; + } + if ($this->container['count'] === null) { + return false; + } + if ($this->container['eventTime'] === null) { + return false; + } + if ($this->container['ip'] === null) { + return false; + } + return true; + } + + + /** + * Gets campaignId + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaignId']; + } + + /** + * Sets campaignId + * + * @param int $campaignId ID of the campaign which generated the event + * + * @return $this + */ + public function setCampaignId($campaignId) + { + $this->container['campaignId'] = $campaignId; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Number of openings of the campaign + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets eventTime + * + * @return \DateTime + */ + public function getEventTime() + { + return $this->container['eventTime']; + } + + /** + * Sets eventTime + * + * @param \DateTime $eventTime UTC date-time of the event + * + * @return $this + */ + public function setEventTime($eventTime) + { + $this->container['eventTime'] = $eventTime; + + return $this; + } + + /** + * Gets ip + * + * @return string + */ + public function getIp() + { + return $this->container['ip']; + } + + /** + * Sets ip + * + * @param string $ip IP from which the user has opened the campaign + * + * @return $this + */ + public function setIp($ip) + { + $this->container['ip'] = $ip; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStatsTransacAttributes.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStatsTransacAttributes.php new file mode 100644 index 0000000..9d8d736 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStatsTransacAttributes.php @@ -0,0 +1,380 @@ + '\DateTime', + 'orderPrice' => 'float', + 'orderId' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'orderDate' => 'date', + 'orderPrice' => 'float', + 'orderId' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'orderDate' => 'orderDate', + 'orderPrice' => 'orderPrice', + 'orderId' => 'orderId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'orderDate' => 'setOrderDate', + 'orderPrice' => 'setOrderPrice', + 'orderId' => 'setOrderId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'orderDate' => 'getOrderDate', + 'orderPrice' => 'getOrderPrice', + 'orderId' => 'getOrderId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['orderDate'] = isset($data['orderDate']) ? $data['orderDate'] : null; + $this->container['orderPrice'] = isset($data['orderPrice']) ? $data['orderPrice'] : null; + $this->container['orderId'] = isset($data['orderId']) ? $data['orderId'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['orderDate'] === null) { + $invalidProperties[] = "'orderDate' can't be null"; + } + if ($this->container['orderPrice'] === null) { + $invalidProperties[] = "'orderPrice' can't be null"; + } + if ($this->container['orderId'] === null) { + $invalidProperties[] = "'orderId' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['orderDate'] === null) { + return false; + } + if ($this->container['orderPrice'] === null) { + return false; + } + if ($this->container['orderId'] === null) { + return false; + } + return true; + } + + + /** + * Gets orderDate + * + * @return \DateTime + */ + public function getOrderDate() + { + return $this->container['orderDate']; + } + + /** + * Sets orderDate + * + * @param \DateTime $orderDate Date of the order + * + * @return $this + */ + public function setOrderDate($orderDate) + { + $this->container['orderDate'] = $orderDate; + + return $this; + } + + /** + * Gets orderPrice + * + * @return float + */ + public function getOrderPrice() + { + return $this->container['orderPrice']; + } + + /** + * Sets orderPrice + * + * @param float $orderPrice Price of the order + * + * @return $this + */ + public function setOrderPrice($orderPrice) + { + $this->container['orderPrice'] = $orderPrice; + + return $this; + } + + /** + * Gets orderId + * + * @return int + */ + public function getOrderId() + { + return $this->container['orderId']; + } + + /** + * Sets orderId + * + * @param int $orderId ID of the order + * + * @return $this + */ + public function setOrderId($orderId) + { + $this->container['orderId'] = $orderId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStatsUnsubscriptions.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStatsUnsubscriptions.php new file mode 100644 index 0000000..87aef87 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactCampaignStatsUnsubscriptions.php @@ -0,0 +1,344 @@ + '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription[]', + 'adminUnsubscription' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'userUnsubscription' => null, + 'adminUnsubscription' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'userUnsubscription' => 'userUnsubscription', + 'adminUnsubscription' => 'adminUnsubscription' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userUnsubscription' => 'setUserUnsubscription', + 'adminUnsubscription' => 'setAdminUnsubscription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userUnsubscription' => 'getUserUnsubscription', + 'adminUnsubscription' => 'getAdminUnsubscription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['userUnsubscription'] = isset($data['userUnsubscription']) ? $data['userUnsubscription'] : null; + $this->container['adminUnsubscription'] = isset($data['adminUnsubscription']) ? $data['adminUnsubscription'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['userUnsubscription'] === null) { + $invalidProperties[] = "'userUnsubscription' can't be null"; + } + if ($this->container['adminUnsubscription'] === null) { + $invalidProperties[] = "'adminUnsubscription' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['userUnsubscription'] === null) { + return false; + } + if ($this->container['adminUnsubscription'] === null) { + return false; + } + return true; + } + + + /** + * Gets userUnsubscription + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription[] + */ + public function getUserUnsubscription() + { + return $this->container['userUnsubscription']; + } + + /** + * Sets userUnsubscription + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription[] $userUnsubscription Contact has unsubscribed via the unsubscription link in the email + * + * @return $this + */ + public function setUserUnsubscription($userUnsubscription) + { + $this->container['userUnsubscription'] = $userUnsubscription; + + return $this; + } + + /** + * Gets adminUnsubscription + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription[] + */ + public function getAdminUnsubscription() + { + return $this->container['adminUnsubscription']; + } + + /** + * Sets adminUnsubscription + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription[] $adminUnsubscription Contact has been unsubscribed from the administrator + * + * @return $this + */ + public function setAdminUnsubscription($adminUnsubscription) + { + $this->container['adminUnsubscription'] = $adminUnsubscription; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactDetails.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactDetails.php new file mode 100644 index 0000000..318fe79 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContactDetails.php @@ -0,0 +1,590 @@ + 'string', + 'id' => 'int', + 'emailBlacklisted' => 'bool', + 'smsBlacklisted' => 'bool', + 'createdAt' => '\DateTime', + 'modifiedAt' => '\DateTime', + 'listIds' => 'int[]', + 'listUnsubscribed' => 'int[]', + 'attributes' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'id' => 'int64', + 'emailBlacklisted' => null, + 'smsBlacklisted' => null, + 'createdAt' => 'date-time', + 'modifiedAt' => 'date-time', + 'listIds' => 'int64', + 'listUnsubscribed' => 'int64', + 'attributes' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'id' => 'id', + 'emailBlacklisted' => 'emailBlacklisted', + 'smsBlacklisted' => 'smsBlacklisted', + 'createdAt' => 'createdAt', + 'modifiedAt' => 'modifiedAt', + 'listIds' => 'listIds', + 'listUnsubscribed' => 'listUnsubscribed', + 'attributes' => 'attributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'id' => 'setId', + 'emailBlacklisted' => 'setEmailBlacklisted', + 'smsBlacklisted' => 'setSmsBlacklisted', + 'createdAt' => 'setCreatedAt', + 'modifiedAt' => 'setModifiedAt', + 'listIds' => 'setListIds', + 'listUnsubscribed' => 'setListUnsubscribed', + 'attributes' => 'setAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'id' => 'getId', + 'emailBlacklisted' => 'getEmailBlacklisted', + 'smsBlacklisted' => 'getSmsBlacklisted', + 'createdAt' => 'getCreatedAt', + 'modifiedAt' => 'getModifiedAt', + 'listIds' => 'getListIds', + 'listUnsubscribed' => 'getListUnsubscribed', + 'attributes' => 'getAttributes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['emailBlacklisted'] = isset($data['emailBlacklisted']) ? $data['emailBlacklisted'] : null; + $this->container['smsBlacklisted'] = isset($data['smsBlacklisted']) ? $data['smsBlacklisted'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; + $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null; + $this->container['listUnsubscribed'] = isset($data['listUnsubscribed']) ? $data['listUnsubscribed'] : null; + $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['emailBlacklisted'] === null) { + $invalidProperties[] = "'emailBlacklisted' can't be null"; + } + if ($this->container['smsBlacklisted'] === null) { + $invalidProperties[] = "'smsBlacklisted' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['modifiedAt'] === null) { + $invalidProperties[] = "'modifiedAt' can't be null"; + } + if ($this->container['listIds'] === null) { + $invalidProperties[] = "'listIds' can't be null"; + } + if ($this->container['attributes'] === null) { + $invalidProperties[] = "'attributes' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + if ($this->container['id'] === null) { + return false; + } + if ($this->container['emailBlacklisted'] === null) { + return false; + } + if ($this->container['smsBlacklisted'] === null) { + return false; + } + if ($this->container['createdAt'] === null) { + return false; + } + if ($this->container['modifiedAt'] === null) { + return false; + } + if ($this->container['listIds'] === null) { + return false; + } + if ($this->container['attributes'] === null) { + return false; + } + return true; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email address of the contact for which you requested the details + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the contact for which you requested the details + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets emailBlacklisted + * + * @return bool + */ + public function getEmailBlacklisted() + { + return $this->container['emailBlacklisted']; + } + + /** + * Sets emailBlacklisted + * + * @param bool $emailBlacklisted Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) + * + * @return $this + */ + public function setEmailBlacklisted($emailBlacklisted) + { + $this->container['emailBlacklisted'] = $emailBlacklisted; + + return $this; + } + + /** + * Gets smsBlacklisted + * + * @return bool + */ + public function getSmsBlacklisted() + { + return $this->container['smsBlacklisted']; + } + + /** + * Sets smsBlacklisted + * + * @param bool $smsBlacklisted Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) + * + * @return $this + */ + public function setSmsBlacklisted($smsBlacklisted) + { + $this->container['smsBlacklisted'] = $smsBlacklisted; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets modifiedAt + * + * @return \DateTime + */ + public function getModifiedAt() + { + return $this->container['modifiedAt']; + } + + /** + * Sets modifiedAt + * + * @param \DateTime $modifiedAt Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setModifiedAt($modifiedAt) + { + $this->container['modifiedAt'] = $modifiedAt; + + return $this; + } + + /** + * Gets listIds + * + * @return int[] + */ + public function getListIds() + { + return $this->container['listIds']; + } + + /** + * Sets listIds + * + * @param int[] $listIds listIds + * + * @return $this + */ + public function setListIds($listIds) + { + $this->container['listIds'] = $listIds; + + return $this; + } + + /** + * Gets listUnsubscribed + * + * @return int[] + */ + public function getListUnsubscribed() + { + return $this->container['listUnsubscribed']; + } + + /** + * Sets listUnsubscribed + * + * @param int[] $listUnsubscribed listUnsubscribed + * + * @return $this + */ + public function setListUnsubscribed($listUnsubscribed) + { + $this->container['listUnsubscribed'] = $listUnsubscribed; + + return $this; + } + + /** + * Gets attributes + * + * @return object + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param object $attributes Set of attributes of the contact + * + * @return $this + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContacts.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContacts.php new file mode 100644 index 0000000..3c6c4e9 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetContacts.php @@ -0,0 +1,344 @@ + 'object[]', + 'count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'contacts' => null, + 'count' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'contacts' => 'contacts', + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'contacts' => 'setContacts', + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'contacts' => 'getContacts', + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['contacts'] = isset($data['contacts']) ? $data['contacts'] : null; + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['contacts'] === null) { + $invalidProperties[] = "'contacts' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['contacts'] === null) { + return false; + } + if ($this->container['count'] === null) { + return false; + } + return true; + } + + + /** + * Gets contacts + * + * @return object[] + */ + public function getContacts() + { + return $this->container['contacts']; + } + + /** + * Sets contacts + * + * @param object[] $contacts contacts + * + * @return $this + */ + public function setContacts($contacts) + { + $this->container['contacts'] = $contacts; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Number of contacts + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetEmailCampaign.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetEmailCampaign.php new file mode 100644 index 0000000..8d2434f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetEmailCampaign.php @@ -0,0 +1,1348 @@ + 'int', + 'name' => 'string', + 'subject' => 'string', + 'type' => 'string', + 'status' => 'string', + 'scheduledAt' => '\DateTime', + 'abTesting' => 'bool', + 'subjectA' => 'string', + 'subjectB' => 'string', + 'splitRule' => 'int', + 'winnerCriteria' => 'string', + 'winnerDelay' => 'int', + 'sendAtBestTime' => 'bool', + 'testSent' => 'bool', + 'header' => 'string', + 'footer' => 'string', + 'sender' => '\SendinBlue\Client\Model\GetExtendedCampaignOverviewSender', + 'replyTo' => 'string', + 'toField' => 'string', + 'htmlContent' => 'string', + 'shareLink' => 'string', + 'tag' => 'string', + 'createdAt' => '\DateTime', + 'modifiedAt' => '\DateTime', + 'inlineImageActivation' => 'bool', + 'mirrorActive' => 'bool', + 'recurring' => 'bool', + 'sentDate' => '\DateTime', + 'recipients' => 'object', + 'statistics' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'subject' => null, + 'type' => null, + 'status' => null, + 'scheduledAt' => 'date-time', + 'abTesting' => null, + 'subjectA' => null, + 'subjectB' => null, + 'splitRule' => null, + 'winnerCriteria' => null, + 'winnerDelay' => null, + 'sendAtBestTime' => null, + 'testSent' => null, + 'header' => null, + 'footer' => null, + 'sender' => null, + 'replyTo' => 'email', + 'toField' => null, + 'htmlContent' => null, + 'shareLink' => 'url', + 'tag' => null, + 'createdAt' => 'date-time', + 'modifiedAt' => 'date-time', + 'inlineImageActivation' => null, + 'mirrorActive' => null, + 'recurring' => null, + 'sentDate' => 'date-time', + 'recipients' => null, + 'statistics' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'subject' => 'subject', + 'type' => 'type', + 'status' => 'status', + 'scheduledAt' => 'scheduledAt', + 'abTesting' => 'abTesting', + 'subjectA' => 'subjectA', + 'subjectB' => 'subjectB', + 'splitRule' => 'splitRule', + 'winnerCriteria' => 'winnerCriteria', + 'winnerDelay' => 'winnerDelay', + 'sendAtBestTime' => 'sendAtBestTime', + 'testSent' => 'testSent', + 'header' => 'header', + 'footer' => 'footer', + 'sender' => 'sender', + 'replyTo' => 'replyTo', + 'toField' => 'toField', + 'htmlContent' => 'htmlContent', + 'shareLink' => 'shareLink', + 'tag' => 'tag', + 'createdAt' => 'createdAt', + 'modifiedAt' => 'modifiedAt', + 'inlineImageActivation' => 'inlineImageActivation', + 'mirrorActive' => 'mirrorActive', + 'recurring' => 'recurring', + 'sentDate' => 'sentDate', + 'recipients' => 'recipients', + 'statistics' => 'statistics' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'subject' => 'setSubject', + 'type' => 'setType', + 'status' => 'setStatus', + 'scheduledAt' => 'setScheduledAt', + 'abTesting' => 'setAbTesting', + 'subjectA' => 'setSubjectA', + 'subjectB' => 'setSubjectB', + 'splitRule' => 'setSplitRule', + 'winnerCriteria' => 'setWinnerCriteria', + 'winnerDelay' => 'setWinnerDelay', + 'sendAtBestTime' => 'setSendAtBestTime', + 'testSent' => 'setTestSent', + 'header' => 'setHeader', + 'footer' => 'setFooter', + 'sender' => 'setSender', + 'replyTo' => 'setReplyTo', + 'toField' => 'setToField', + 'htmlContent' => 'setHtmlContent', + 'shareLink' => 'setShareLink', + 'tag' => 'setTag', + 'createdAt' => 'setCreatedAt', + 'modifiedAt' => 'setModifiedAt', + 'inlineImageActivation' => 'setInlineImageActivation', + 'mirrorActive' => 'setMirrorActive', + 'recurring' => 'setRecurring', + 'sentDate' => 'setSentDate', + 'recipients' => 'setRecipients', + 'statistics' => 'setStatistics' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'subject' => 'getSubject', + 'type' => 'getType', + 'status' => 'getStatus', + 'scheduledAt' => 'getScheduledAt', + 'abTesting' => 'getAbTesting', + 'subjectA' => 'getSubjectA', + 'subjectB' => 'getSubjectB', + 'splitRule' => 'getSplitRule', + 'winnerCriteria' => 'getWinnerCriteria', + 'winnerDelay' => 'getWinnerDelay', + 'sendAtBestTime' => 'getSendAtBestTime', + 'testSent' => 'getTestSent', + 'header' => 'getHeader', + 'footer' => 'getFooter', + 'sender' => 'getSender', + 'replyTo' => 'getReplyTo', + 'toField' => 'getToField', + 'htmlContent' => 'getHtmlContent', + 'shareLink' => 'getShareLink', + 'tag' => 'getTag', + 'createdAt' => 'getCreatedAt', + 'modifiedAt' => 'getModifiedAt', + 'inlineImageActivation' => 'getInlineImageActivation', + 'mirrorActive' => 'getMirrorActive', + 'recurring' => 'getRecurring', + 'sentDate' => 'getSentDate', + 'recipients' => 'getRecipients', + 'statistics' => 'getStatistics' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const TYPE_CLASSIC = 'classic'; + const TYPE_TRIGGER = 'trigger'; + const STATUS_DRAFT = 'draft'; + const STATUS_SENT = 'sent'; + const STATUS_ARCHIVE = 'archive'; + const STATUS_QUEUED = 'queued'; + const STATUS_SUSPENDED = 'suspended'; + const STATUS_IN_PROCESS = 'in_process'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CLASSIC, + self::TYPE_TRIGGER, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_DRAFT, + self::STATUS_SENT, + self::STATUS_ARCHIVE, + self::STATUS_QUEUED, + self::STATUS_SUSPENDED, + self::STATUS_IN_PROCESS, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null; + $this->container['abTesting'] = isset($data['abTesting']) ? $data['abTesting'] : null; + $this->container['subjectA'] = isset($data['subjectA']) ? $data['subjectA'] : null; + $this->container['subjectB'] = isset($data['subjectB']) ? $data['subjectB'] : null; + $this->container['splitRule'] = isset($data['splitRule']) ? $data['splitRule'] : null; + $this->container['winnerCriteria'] = isset($data['winnerCriteria']) ? $data['winnerCriteria'] : null; + $this->container['winnerDelay'] = isset($data['winnerDelay']) ? $data['winnerDelay'] : null; + $this->container['sendAtBestTime'] = isset($data['sendAtBestTime']) ? $data['sendAtBestTime'] : null; + $this->container['testSent'] = isset($data['testSent']) ? $data['testSent'] : null; + $this->container['header'] = isset($data['header']) ? $data['header'] : null; + $this->container['footer'] = isset($data['footer']) ? $data['footer'] : null; + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null; + $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null; + $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null; + $this->container['shareLink'] = isset($data['shareLink']) ? $data['shareLink'] : null; + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; + $this->container['inlineImageActivation'] = isset($data['inlineImageActivation']) ? $data['inlineImageActivation'] : null; + $this->container['mirrorActive'] = isset($data['mirrorActive']) ? $data['mirrorActive'] : null; + $this->container['recurring'] = isset($data['recurring']) ? $data['recurring'] : null; + $this->container['sentDate'] = isset($data['sentDate']) ? $data['sentDate'] : null; + $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null; + $this->container['statistics'] = isset($data['statistics']) ? $data['statistics'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['testSent'] === null) { + $invalidProperties[] = "'testSent' can't be null"; + } + if ($this->container['header'] === null) { + $invalidProperties[] = "'header' can't be null"; + } + if ($this->container['footer'] === null) { + $invalidProperties[] = "'footer' can't be null"; + } + if ($this->container['sender'] === null) { + $invalidProperties[] = "'sender' can't be null"; + } + if ($this->container['replyTo'] === null) { + $invalidProperties[] = "'replyTo' can't be null"; + } + if ($this->container['toField'] === null) { + $invalidProperties[] = "'toField' can't be null"; + } + if ($this->container['htmlContent'] === null) { + $invalidProperties[] = "'htmlContent' can't be null"; + } + if ($this->container['tag'] === null) { + $invalidProperties[] = "'tag' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['modifiedAt'] === null) { + $invalidProperties[] = "'modifiedAt' can't be null"; + } + if ($this->container['recipients'] === null) { + $invalidProperties[] = "'recipients' can't be null"; + } + if ($this->container['statistics'] === null) { + $invalidProperties[] = "'statistics' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + if ($this->container['name'] === null) { + return false; + } + if ($this->container['type'] === null) { + return false; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + return false; + } + if ($this->container['status'] === null) { + return false; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + return false; + } + if ($this->container['testSent'] === null) { + return false; + } + if ($this->container['header'] === null) { + return false; + } + if ($this->container['footer'] === null) { + return false; + } + if ($this->container['sender'] === null) { + return false; + } + if ($this->container['replyTo'] === null) { + return false; + } + if ($this->container['toField'] === null) { + return false; + } + if ($this->container['htmlContent'] === null) { + return false; + } + if ($this->container['tag'] === null) { + return false; + } + if ($this->container['createdAt'] === null) { + return false; + } + if ($this->container['modifiedAt'] === null) { + return false; + } + if ($this->container['recipients'] === null) { + return false; + } + if ($this->container['statistics'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the campaign + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the campaign + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of campaign + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Status of the campaign + * + * @return $this + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets scheduledAt + * + * @return \DateTime + */ + public function getScheduledAt() + { + return $this->container['scheduledAt']; + } + + /** + * Sets scheduledAt + * + * @param \DateTime $scheduledAt UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setScheduledAt($scheduledAt) + { + $this->container['scheduledAt'] = $scheduledAt; + + return $this; + } + + /** + * Gets abTesting + * + * @return bool + */ + public function getAbTesting() + { + return $this->container['abTesting']; + } + + /** + * Sets abTesting + * + * @param bool $abTesting Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. + * + * @return $this + */ + public function setAbTesting($abTesting) + { + $this->container['abTesting'] = $abTesting; + + return $this; + } + + /** + * Gets subjectA + * + * @return string + */ + public function getSubjectA() + { + return $this->container['subjectA']; + } + + /** + * Sets subjectA + * + * @param string $subjectA Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSubjectA($subjectA) + { + $this->container['subjectA'] = $subjectA; + + return $this; + } + + /** + * Gets subjectB + * + * @return string + */ + public function getSubjectB() + { + return $this->container['subjectB']; + } + + /** + * Sets subjectB + * + * @param string $subjectB Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSubjectB($subjectB) + { + $this->container['subjectB'] = $subjectB; + + return $this; + } + + /** + * Gets splitRule + * + * @return int + */ + public function getSplitRule() + { + return $this->container['splitRule']; + } + + /** + * Sets splitRule + * + * @param int $splitRule The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSplitRule($splitRule) + { + $this->container['splitRule'] = $splitRule; + + return $this; + } + + /** + * Gets winnerCriteria + * + * @return string + */ + public function getWinnerCriteria() + { + return $this->container['winnerCriteria']; + } + + /** + * Sets winnerCriteria + * + * @param string $winnerCriteria Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setWinnerCriteria($winnerCriteria) + { + $this->container['winnerCriteria'] = $winnerCriteria; + + return $this; + } + + /** + * Gets winnerDelay + * + * @return int + */ + public function getWinnerDelay() + { + return $this->container['winnerDelay']; + } + + /** + * Sets winnerDelay + * + * @param int $winnerDelay The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setWinnerDelay($winnerDelay) + { + $this->container['winnerDelay'] = $winnerDelay; + + return $this; + } + + /** + * Gets sendAtBestTime + * + * @return bool + */ + public function getSendAtBestTime() + { + return $this->container['sendAtBestTime']; + } + + /** + * Sets sendAtBestTime + * + * @param bool $sendAtBestTime It is true if you have chosen to send your campaign at best time, otherwise it is false + * + * @return $this + */ + public function setSendAtBestTime($sendAtBestTime) + { + $this->container['sendAtBestTime'] = $sendAtBestTime; + + return $this; + } + + /** + * Gets testSent + * + * @return bool + */ + public function getTestSent() + { + return $this->container['testSent']; + } + + /** + * Sets testSent + * + * @param bool $testSent Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) + * + * @return $this + */ + public function setTestSent($testSent) + { + $this->container['testSent'] = $testSent; + + return $this; + } + + /** + * Gets header + * + * @return string + */ + public function getHeader() + { + return $this->container['header']; + } + + /** + * Sets header + * + * @param string $header Header of the campaign + * + * @return $this + */ + public function setHeader($header) + { + $this->container['header'] = $header; + + return $this; + } + + /** + * Gets footer + * + * @return string + */ + public function getFooter() + { + return $this->container['footer']; + } + + /** + * Sets footer + * + * @param string $footer Footer of the campaign + * + * @return $this + */ + public function setFooter($footer) + { + $this->container['footer'] = $footer; + + return $this; + } + + /** + * Gets sender + * + * @return \SendinBlue\Client\Model\GetExtendedCampaignOverviewSender + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param \SendinBlue\Client\Model\GetExtendedCampaignOverviewSender $sender sender + * + * @return $this + */ + public function setSender($sender) + { + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets replyTo + * + * @return string + */ + public function getReplyTo() + { + return $this->container['replyTo']; + } + + /** + * Sets replyTo + * + * @param string $replyTo Email defined as the \"Reply to\" of the campaign + * + * @return $this + */ + public function setReplyTo($replyTo) + { + $this->container['replyTo'] = $replyTo; + + return $this; + } + + /** + * Gets toField + * + * @return string + */ + public function getToField() + { + return $this->container['toField']; + } + + /** + * Sets toField + * + * @param string $toField Customisation of the \"to\" field of the campaign + * + * @return $this + */ + public function setToField($toField) + { + $this->container['toField'] = $toField; + + return $this; + } + + /** + * Gets htmlContent + * + * @return string + */ + public function getHtmlContent() + { + return $this->container['htmlContent']; + } + + /** + * Sets htmlContent + * + * @param string $htmlContent HTML content of the campaign + * + * @return $this + */ + public function setHtmlContent($htmlContent) + { + $this->container['htmlContent'] = $htmlContent; + + return $this; + } + + /** + * Gets shareLink + * + * @return string + */ + public function getShareLink() + { + return $this->container['shareLink']; + } + + /** + * Sets shareLink + * + * @param string $shareLink Link to share the campaign on social medias + * + * @return $this + */ + public function setShareLink($shareLink) + { + $this->container['shareLink'] = $shareLink; + + return $this; + } + + /** + * Gets tag + * + * @return string + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string $tag Tag of the campaign + * + * @return $this + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets modifiedAt + * + * @return \DateTime + */ + public function getModifiedAt() + { + return $this->container['modifiedAt']; + } + + /** + * Sets modifiedAt + * + * @param \DateTime $modifiedAt UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setModifiedAt($modifiedAt) + { + $this->container['modifiedAt'] = $modifiedAt; + + return $this; + } + + /** + * Gets inlineImageActivation + * + * @return bool + */ + public function getInlineImageActivation() + { + return $this->container['inlineImageActivation']; + } + + /** + * Sets inlineImageActivation + * + * @param bool $inlineImageActivation Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. + * + * @return $this + */ + public function setInlineImageActivation($inlineImageActivation) + { + $this->container['inlineImageActivation'] = $inlineImageActivation; + + return $this; + } + + /** + * Gets mirrorActive + * + * @return bool + */ + public function getMirrorActive() + { + return $this->container['mirrorActive']; + } + + /** + * Sets mirrorActive + * + * @param bool $mirrorActive Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign + * + * @return $this + */ + public function setMirrorActive($mirrorActive) + { + $this->container['mirrorActive'] = $mirrorActive; + + return $this; + } + + /** + * Gets recurring + * + * @return bool + */ + public function getRecurring() + { + return $this->container['recurring']; + } + + /** + * Sets recurring + * + * @param bool $recurring FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times + * + * @return $this + */ + public function setRecurring($recurring) + { + $this->container['recurring'] = $recurring; + + return $this; + } + + /** + * Gets sentDate + * + * @return \DateTime + */ + public function getSentDate() + { + return $this->container['sentDate']; + } + + /** + * Sets sentDate + * + * @param \DateTime $sentDate Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' + * + * @return $this + */ + public function setSentDate($sentDate) + { + $this->container['sentDate'] = $sentDate; + + return $this; + } + + /** + * Gets recipients + * + * @return object + */ + public function getRecipients() + { + return $this->container['recipients']; + } + + /** + * Sets recipients + * + * @param object $recipients recipients + * + * @return $this + */ + public function setRecipients($recipients) + { + $this->container['recipients'] = $recipients; + + return $this; + } + + /** + * Gets statistics + * + * @return object + */ + public function getStatistics() + { + return $this->container['statistics']; + } + + /** + * Sets statistics + * + * @param object $statistics statistics + * + * @return $this + */ + public function setStatistics($statistics) + { + $this->container['statistics'] = $statistics; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetEmailCampaigns.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetEmailCampaigns.php new file mode 100644 index 0000000..ba26222 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetEmailCampaigns.php @@ -0,0 +1,338 @@ + 'object[]', + 'count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'campaigns' => null, + 'count' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaigns' => 'campaigns', + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaigns' => 'setCampaigns', + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaigns' => 'getCampaigns', + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['campaigns'] = isset($data['campaigns']) ? $data['campaigns'] : null; + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['count'] === null) { + return false; + } + return true; + } + + + /** + * Gets campaigns + * + * @return object[] + */ + public function getCampaigns() + { + return $this->container['campaigns']; + } + + /** + * Sets campaigns + * + * @param object[] $campaigns campaigns + * + * @return $this + */ + public function setCampaigns($campaigns) + { + $this->container['campaigns'] = $campaigns; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Number of Email campaigns retrieved + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetEmailEventReport.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetEmailEventReport.php new file mode 100644 index 0000000..4c2c169 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetEmailEventReport.php @@ -0,0 +1,302 @@ + '\SendinBlue\Client\Model\GetEmailEventReportEvents[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'events' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'events' => 'events' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'events' => 'setEvents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'events' => 'getEvents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['events'] = isset($data['events']) ? $data['events'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets events + * + * @return \SendinBlue\Client\Model\GetEmailEventReportEvents[] + */ + public function getEvents() + { + return $this->container['events']; + } + + /** + * Sets events + * + * @param \SendinBlue\Client\Model\GetEmailEventReportEvents[] $events events + * + * @return $this + */ + public function setEvents($events) + { + $this->container['events'] = $events; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetEmailEventReportEvents.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetEmailEventReportEvents.php new file mode 100644 index 0000000..bebc48a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetEmailEventReportEvents.php @@ -0,0 +1,652 @@ + 'string', + 'date' => '\DateTime', + 'subject' => 'string', + 'messageId' => 'string', + 'event' => 'string', + 'reason' => 'string', + 'tag' => 'string', + 'ip' => 'string', + 'link' => 'string', + 'from' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'date' => 'date-time', + 'subject' => null, + 'messageId' => null, + 'event' => null, + 'reason' => null, + 'tag' => null, + 'ip' => null, + 'link' => null, + 'from' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'date' => 'date', + 'subject' => 'subject', + 'messageId' => 'messageId', + 'event' => 'event', + 'reason' => 'reason', + 'tag' => 'tag', + 'ip' => 'ip', + 'link' => 'link', + 'from' => 'from' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'date' => 'setDate', + 'subject' => 'setSubject', + 'messageId' => 'setMessageId', + 'event' => 'setEvent', + 'reason' => 'setReason', + 'tag' => 'setTag', + 'ip' => 'setIp', + 'link' => 'setLink', + 'from' => 'setFrom' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'date' => 'getDate', + 'subject' => 'getSubject', + 'messageId' => 'getMessageId', + 'event' => 'getEvent', + 'reason' => 'getReason', + 'tag' => 'getTag', + 'ip' => 'getIp', + 'link' => 'getLink', + 'from' => 'getFrom' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const EVENT_BOUNCES = 'bounces'; + const EVENT_HARD_BOUNCES = 'hardBounces'; + const EVENT_SOFT_BOUNCES = 'softBounces'; + const EVENT_DELIVERED = 'delivered'; + const EVENT_SPAM = 'spam'; + const EVENT_REQUESTS = 'requests'; + const EVENT_OPENED = 'opened'; + const EVENT_CLICKS = 'clicks'; + const EVENT_INVALID = 'invalid'; + const EVENT_DEFERRED = 'deferred'; + const EVENT_BLOCKED = 'blocked'; + const EVENT_UNSUBSCRIBED = 'unsubscribed'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEventAllowableValues() + { + return [ + self::EVENT_BOUNCES, + self::EVENT_HARD_BOUNCES, + self::EVENT_SOFT_BOUNCES, + self::EVENT_DELIVERED, + self::EVENT_SPAM, + self::EVENT_REQUESTS, + self::EVENT_OPENED, + self::EVENT_CLICKS, + self::EVENT_INVALID, + self::EVENT_DEFERRED, + self::EVENT_BLOCKED, + self::EVENT_UNSUBSCRIBED, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['date'] = isset($data['date']) ? $data['date'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null; + $this->container['event'] = isset($data['event']) ? $data['event'] : null; + $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + $this->container['link'] = isset($data['link']) ? $data['link'] : null; + $this->container['from'] = isset($data['from']) ? $data['from'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if ($this->container['messageId'] === null) { + $invalidProperties[] = "'messageId' can't be null"; + } + if ($this->container['event'] === null) { + $invalidProperties[] = "'event' can't be null"; + } + $allowedValues = $this->getEventAllowableValues(); + if (!in_array($this->container['event'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'event', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + if ($this->container['date'] === null) { + return false; + } + if ($this->container['messageId'] === null) { + return false; + } + if ($this->container['event'] === null) { + return false; + } + $allowedValues = $this->getEventAllowableValues(); + if (!in_array($this->container['event'], $allowedValues)) { + return false; + } + return true; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email address which generates the event + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime $date UTC date-time on which the event has been generated + * + * @return $this + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Subject of the event + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets messageId + * + * @return string + */ + public function getMessageId() + { + return $this->container['messageId']; + } + + /** + * Sets messageId + * + * @param string $messageId Message ID which generated the event + * + * @return $this + */ + public function setMessageId($messageId) + { + $this->container['messageId'] = $messageId; + + return $this; + } + + /** + * Gets event + * + * @return string + */ + public function getEvent() + { + return $this->container['event']; + } + + /** + * Sets event + * + * @param string $event Event which occurred + * + * @return $this + */ + public function setEvent($event) + { + $allowedValues = $this->getEventAllowableValues(); + if (!in_array($event, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'event', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['event'] = $event; + + return $this; + } + + /** + * Gets reason + * + * @return string + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string $reason Reason of bounce (only available if the event is hardbounce or softbounce) + * + * @return $this + */ + public function setReason($reason) + { + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets tag + * + * @return string + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string $tag Tag of the email which generated the event + * + * @return $this + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets ip + * + * @return string + */ + public function getIp() + { + return $this->container['ip']; + } + + /** + * Sets ip + * + * @param string $ip IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks) + * + * @return $this + */ + public function setIp($ip) + { + $this->container['ip'] = $ip; + + return $this; + } + + /** + * Gets link + * + * @return string + */ + public function getLink() + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param string $link The link which is sent to the user (only available if the event is requests or opened or clicks) + * + * @return $this + */ + public function setLink($link) + { + $this->container['link'] = $link; + + return $this; + } + + /** + * Gets from + * + * @return string + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param string $from Sender email from which the emails are sent + * + * @return $this + */ + public function setFrom($from) + { + $this->container['from'] = $from; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedCampaignOverview.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedCampaignOverview.php new file mode 100644 index 0000000..54ccb0c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedCampaignOverview.php @@ -0,0 +1,1276 @@ + 'int', + 'name' => 'string', + 'subject' => 'string', + 'type' => 'string', + 'status' => 'string', + 'scheduledAt' => '\DateTime', + 'abTesting' => 'bool', + 'subjectA' => 'string', + 'subjectB' => 'string', + 'splitRule' => 'int', + 'winnerCriteria' => 'string', + 'winnerDelay' => 'int', + 'sendAtBestTime' => 'bool', + 'testSent' => 'bool', + 'header' => 'string', + 'footer' => 'string', + 'sender' => '\SendinBlue\Client\Model\GetExtendedCampaignOverviewSender', + 'replyTo' => 'string', + 'toField' => 'string', + 'htmlContent' => 'string', + 'shareLink' => 'string', + 'tag' => 'string', + 'createdAt' => '\DateTime', + 'modifiedAt' => '\DateTime', + 'inlineImageActivation' => 'bool', + 'mirrorActive' => 'bool', + 'recurring' => 'bool', + 'sentDate' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'subject' => null, + 'type' => null, + 'status' => null, + 'scheduledAt' => 'date-time', + 'abTesting' => null, + 'subjectA' => null, + 'subjectB' => null, + 'splitRule' => null, + 'winnerCriteria' => null, + 'winnerDelay' => null, + 'sendAtBestTime' => null, + 'testSent' => null, + 'header' => null, + 'footer' => null, + 'sender' => null, + 'replyTo' => 'email', + 'toField' => null, + 'htmlContent' => null, + 'shareLink' => 'url', + 'tag' => null, + 'createdAt' => 'date-time', + 'modifiedAt' => 'date-time', + 'inlineImageActivation' => null, + 'mirrorActive' => null, + 'recurring' => null, + 'sentDate' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'subject' => 'subject', + 'type' => 'type', + 'status' => 'status', + 'scheduledAt' => 'scheduledAt', + 'abTesting' => 'abTesting', + 'subjectA' => 'subjectA', + 'subjectB' => 'subjectB', + 'splitRule' => 'splitRule', + 'winnerCriteria' => 'winnerCriteria', + 'winnerDelay' => 'winnerDelay', + 'sendAtBestTime' => 'sendAtBestTime', + 'testSent' => 'testSent', + 'header' => 'header', + 'footer' => 'footer', + 'sender' => 'sender', + 'replyTo' => 'replyTo', + 'toField' => 'toField', + 'htmlContent' => 'htmlContent', + 'shareLink' => 'shareLink', + 'tag' => 'tag', + 'createdAt' => 'createdAt', + 'modifiedAt' => 'modifiedAt', + 'inlineImageActivation' => 'inlineImageActivation', + 'mirrorActive' => 'mirrorActive', + 'recurring' => 'recurring', + 'sentDate' => 'sentDate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'subject' => 'setSubject', + 'type' => 'setType', + 'status' => 'setStatus', + 'scheduledAt' => 'setScheduledAt', + 'abTesting' => 'setAbTesting', + 'subjectA' => 'setSubjectA', + 'subjectB' => 'setSubjectB', + 'splitRule' => 'setSplitRule', + 'winnerCriteria' => 'setWinnerCriteria', + 'winnerDelay' => 'setWinnerDelay', + 'sendAtBestTime' => 'setSendAtBestTime', + 'testSent' => 'setTestSent', + 'header' => 'setHeader', + 'footer' => 'setFooter', + 'sender' => 'setSender', + 'replyTo' => 'setReplyTo', + 'toField' => 'setToField', + 'htmlContent' => 'setHtmlContent', + 'shareLink' => 'setShareLink', + 'tag' => 'setTag', + 'createdAt' => 'setCreatedAt', + 'modifiedAt' => 'setModifiedAt', + 'inlineImageActivation' => 'setInlineImageActivation', + 'mirrorActive' => 'setMirrorActive', + 'recurring' => 'setRecurring', + 'sentDate' => 'setSentDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'subject' => 'getSubject', + 'type' => 'getType', + 'status' => 'getStatus', + 'scheduledAt' => 'getScheduledAt', + 'abTesting' => 'getAbTesting', + 'subjectA' => 'getSubjectA', + 'subjectB' => 'getSubjectB', + 'splitRule' => 'getSplitRule', + 'winnerCriteria' => 'getWinnerCriteria', + 'winnerDelay' => 'getWinnerDelay', + 'sendAtBestTime' => 'getSendAtBestTime', + 'testSent' => 'getTestSent', + 'header' => 'getHeader', + 'footer' => 'getFooter', + 'sender' => 'getSender', + 'replyTo' => 'getReplyTo', + 'toField' => 'getToField', + 'htmlContent' => 'getHtmlContent', + 'shareLink' => 'getShareLink', + 'tag' => 'getTag', + 'createdAt' => 'getCreatedAt', + 'modifiedAt' => 'getModifiedAt', + 'inlineImageActivation' => 'getInlineImageActivation', + 'mirrorActive' => 'getMirrorActive', + 'recurring' => 'getRecurring', + 'sentDate' => 'getSentDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const TYPE_CLASSIC = 'classic'; + const TYPE_TRIGGER = 'trigger'; + const STATUS_DRAFT = 'draft'; + const STATUS_SENT = 'sent'; + const STATUS_ARCHIVE = 'archive'; + const STATUS_QUEUED = 'queued'; + const STATUS_SUSPENDED = 'suspended'; + const STATUS_IN_PROCESS = 'in_process'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CLASSIC, + self::TYPE_TRIGGER, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_DRAFT, + self::STATUS_SENT, + self::STATUS_ARCHIVE, + self::STATUS_QUEUED, + self::STATUS_SUSPENDED, + self::STATUS_IN_PROCESS, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null; + $this->container['abTesting'] = isset($data['abTesting']) ? $data['abTesting'] : null; + $this->container['subjectA'] = isset($data['subjectA']) ? $data['subjectA'] : null; + $this->container['subjectB'] = isset($data['subjectB']) ? $data['subjectB'] : null; + $this->container['splitRule'] = isset($data['splitRule']) ? $data['splitRule'] : null; + $this->container['winnerCriteria'] = isset($data['winnerCriteria']) ? $data['winnerCriteria'] : null; + $this->container['winnerDelay'] = isset($data['winnerDelay']) ? $data['winnerDelay'] : null; + $this->container['sendAtBestTime'] = isset($data['sendAtBestTime']) ? $data['sendAtBestTime'] : null; + $this->container['testSent'] = isset($data['testSent']) ? $data['testSent'] : null; + $this->container['header'] = isset($data['header']) ? $data['header'] : null; + $this->container['footer'] = isset($data['footer']) ? $data['footer'] : null; + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null; + $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null; + $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null; + $this->container['shareLink'] = isset($data['shareLink']) ? $data['shareLink'] : null; + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; + $this->container['inlineImageActivation'] = isset($data['inlineImageActivation']) ? $data['inlineImageActivation'] : null; + $this->container['mirrorActive'] = isset($data['mirrorActive']) ? $data['mirrorActive'] : null; + $this->container['recurring'] = isset($data['recurring']) ? $data['recurring'] : null; + $this->container['sentDate'] = isset($data['sentDate']) ? $data['sentDate'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['testSent'] === null) { + $invalidProperties[] = "'testSent' can't be null"; + } + if ($this->container['header'] === null) { + $invalidProperties[] = "'header' can't be null"; + } + if ($this->container['footer'] === null) { + $invalidProperties[] = "'footer' can't be null"; + } + if ($this->container['sender'] === null) { + $invalidProperties[] = "'sender' can't be null"; + } + if ($this->container['replyTo'] === null) { + $invalidProperties[] = "'replyTo' can't be null"; + } + if ($this->container['toField'] === null) { + $invalidProperties[] = "'toField' can't be null"; + } + if ($this->container['htmlContent'] === null) { + $invalidProperties[] = "'htmlContent' can't be null"; + } + if ($this->container['tag'] === null) { + $invalidProperties[] = "'tag' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['modifiedAt'] === null) { + $invalidProperties[] = "'modifiedAt' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + if ($this->container['name'] === null) { + return false; + } + if ($this->container['type'] === null) { + return false; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + return false; + } + if ($this->container['status'] === null) { + return false; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + return false; + } + if ($this->container['testSent'] === null) { + return false; + } + if ($this->container['header'] === null) { + return false; + } + if ($this->container['footer'] === null) { + return false; + } + if ($this->container['sender'] === null) { + return false; + } + if ($this->container['replyTo'] === null) { + return false; + } + if ($this->container['toField'] === null) { + return false; + } + if ($this->container['htmlContent'] === null) { + return false; + } + if ($this->container['tag'] === null) { + return false; + } + if ($this->container['createdAt'] === null) { + return false; + } + if ($this->container['modifiedAt'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the campaign + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the campaign + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of campaign + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Status of the campaign + * + * @return $this + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets scheduledAt + * + * @return \DateTime + */ + public function getScheduledAt() + { + return $this->container['scheduledAt']; + } + + /** + * Sets scheduledAt + * + * @param \DateTime $scheduledAt UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setScheduledAt($scheduledAt) + { + $this->container['scheduledAt'] = $scheduledAt; + + return $this; + } + + /** + * Gets abTesting + * + * @return bool + */ + public function getAbTesting() + { + return $this->container['abTesting']; + } + + /** + * Sets abTesting + * + * @param bool $abTesting Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. + * + * @return $this + */ + public function setAbTesting($abTesting) + { + $this->container['abTesting'] = $abTesting; + + return $this; + } + + /** + * Gets subjectA + * + * @return string + */ + public function getSubjectA() + { + return $this->container['subjectA']; + } + + /** + * Sets subjectA + * + * @param string $subjectA Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSubjectA($subjectA) + { + $this->container['subjectA'] = $subjectA; + + return $this; + } + + /** + * Gets subjectB + * + * @return string + */ + public function getSubjectB() + { + return $this->container['subjectB']; + } + + /** + * Sets subjectB + * + * @param string $subjectB Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSubjectB($subjectB) + { + $this->container['subjectB'] = $subjectB; + + return $this; + } + + /** + * Gets splitRule + * + * @return int + */ + public function getSplitRule() + { + return $this->container['splitRule']; + } + + /** + * Sets splitRule + * + * @param int $splitRule The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSplitRule($splitRule) + { + $this->container['splitRule'] = $splitRule; + + return $this; + } + + /** + * Gets winnerCriteria + * + * @return string + */ + public function getWinnerCriteria() + { + return $this->container['winnerCriteria']; + } + + /** + * Sets winnerCriteria + * + * @param string $winnerCriteria Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setWinnerCriteria($winnerCriteria) + { + $this->container['winnerCriteria'] = $winnerCriteria; + + return $this; + } + + /** + * Gets winnerDelay + * + * @return int + */ + public function getWinnerDelay() + { + return $this->container['winnerDelay']; + } + + /** + * Sets winnerDelay + * + * @param int $winnerDelay The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setWinnerDelay($winnerDelay) + { + $this->container['winnerDelay'] = $winnerDelay; + + return $this; + } + + /** + * Gets sendAtBestTime + * + * @return bool + */ + public function getSendAtBestTime() + { + return $this->container['sendAtBestTime']; + } + + /** + * Sets sendAtBestTime + * + * @param bool $sendAtBestTime It is true if you have chosen to send your campaign at best time, otherwise it is false + * + * @return $this + */ + public function setSendAtBestTime($sendAtBestTime) + { + $this->container['sendAtBestTime'] = $sendAtBestTime; + + return $this; + } + + /** + * Gets testSent + * + * @return bool + */ + public function getTestSent() + { + return $this->container['testSent']; + } + + /** + * Sets testSent + * + * @param bool $testSent Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) + * + * @return $this + */ + public function setTestSent($testSent) + { + $this->container['testSent'] = $testSent; + + return $this; + } + + /** + * Gets header + * + * @return string + */ + public function getHeader() + { + return $this->container['header']; + } + + /** + * Sets header + * + * @param string $header Header of the campaign + * + * @return $this + */ + public function setHeader($header) + { + $this->container['header'] = $header; + + return $this; + } + + /** + * Gets footer + * + * @return string + */ + public function getFooter() + { + return $this->container['footer']; + } + + /** + * Sets footer + * + * @param string $footer Footer of the campaign + * + * @return $this + */ + public function setFooter($footer) + { + $this->container['footer'] = $footer; + + return $this; + } + + /** + * Gets sender + * + * @return \SendinBlue\Client\Model\GetExtendedCampaignOverviewSender + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param \SendinBlue\Client\Model\GetExtendedCampaignOverviewSender $sender sender + * + * @return $this + */ + public function setSender($sender) + { + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets replyTo + * + * @return string + */ + public function getReplyTo() + { + return $this->container['replyTo']; + } + + /** + * Sets replyTo + * + * @param string $replyTo Email defined as the \"Reply to\" of the campaign + * + * @return $this + */ + public function setReplyTo($replyTo) + { + $this->container['replyTo'] = $replyTo; + + return $this; + } + + /** + * Gets toField + * + * @return string + */ + public function getToField() + { + return $this->container['toField']; + } + + /** + * Sets toField + * + * @param string $toField Customisation of the \"to\" field of the campaign + * + * @return $this + */ + public function setToField($toField) + { + $this->container['toField'] = $toField; + + return $this; + } + + /** + * Gets htmlContent + * + * @return string + */ + public function getHtmlContent() + { + return $this->container['htmlContent']; + } + + /** + * Sets htmlContent + * + * @param string $htmlContent HTML content of the campaign + * + * @return $this + */ + public function setHtmlContent($htmlContent) + { + $this->container['htmlContent'] = $htmlContent; + + return $this; + } + + /** + * Gets shareLink + * + * @return string + */ + public function getShareLink() + { + return $this->container['shareLink']; + } + + /** + * Sets shareLink + * + * @param string $shareLink Link to share the campaign on social medias + * + * @return $this + */ + public function setShareLink($shareLink) + { + $this->container['shareLink'] = $shareLink; + + return $this; + } + + /** + * Gets tag + * + * @return string + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string $tag Tag of the campaign + * + * @return $this + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets modifiedAt + * + * @return \DateTime + */ + public function getModifiedAt() + { + return $this->container['modifiedAt']; + } + + /** + * Sets modifiedAt + * + * @param \DateTime $modifiedAt UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setModifiedAt($modifiedAt) + { + $this->container['modifiedAt'] = $modifiedAt; + + return $this; + } + + /** + * Gets inlineImageActivation + * + * @return bool + */ + public function getInlineImageActivation() + { + return $this->container['inlineImageActivation']; + } + + /** + * Sets inlineImageActivation + * + * @param bool $inlineImageActivation Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. + * + * @return $this + */ + public function setInlineImageActivation($inlineImageActivation) + { + $this->container['inlineImageActivation'] = $inlineImageActivation; + + return $this; + } + + /** + * Gets mirrorActive + * + * @return bool + */ + public function getMirrorActive() + { + return $this->container['mirrorActive']; + } + + /** + * Sets mirrorActive + * + * @param bool $mirrorActive Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign + * + * @return $this + */ + public function setMirrorActive($mirrorActive) + { + $this->container['mirrorActive'] = $mirrorActive; + + return $this; + } + + /** + * Gets recurring + * + * @return bool + */ + public function getRecurring() + { + return $this->container['recurring']; + } + + /** + * Sets recurring + * + * @param bool $recurring FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times + * + * @return $this + */ + public function setRecurring($recurring) + { + $this->container['recurring'] = $recurring; + + return $this; + } + + /** + * Gets sentDate + * + * @return \DateTime + */ + public function getSentDate() + { + return $this->container['sentDate']; + } + + /** + * Sets sentDate + * + * @param \DateTime $sentDate Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' + * + * @return $this + */ + public function setSentDate($sentDate) + { + $this->container['sentDate'] = $sentDate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedCampaignOverviewSender.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedCampaignOverviewSender.php new file mode 100644 index 0000000..e74743c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedCampaignOverviewSender.php @@ -0,0 +1,332 @@ + 'string', + 'email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'email' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Sender name of the campaign + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Sender email of the campaign + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedCampaignStats.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedCampaignStats.php new file mode 100644 index 0000000..8d1d649 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedCampaignStats.php @@ -0,0 +1,488 @@ + 'object', + 'campaignStats' => 'object[]', + 'mirrorClick' => 'int', + 'remaining' => 'int', + 'linksStats' => 'object', + 'statsByDomain' => '\SendinBlue\Client\Model\GetStatsByDomain' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'globalStats' => null, + 'campaignStats' => null, + 'mirrorClick' => 'int64', + 'remaining' => 'int64', + 'linksStats' => null, + 'statsByDomain' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'globalStats' => 'globalStats', + 'campaignStats' => 'campaignStats', + 'mirrorClick' => 'mirrorClick', + 'remaining' => 'remaining', + 'linksStats' => 'linksStats', + 'statsByDomain' => 'statsByDomain' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'globalStats' => 'setGlobalStats', + 'campaignStats' => 'setCampaignStats', + 'mirrorClick' => 'setMirrorClick', + 'remaining' => 'setRemaining', + 'linksStats' => 'setLinksStats', + 'statsByDomain' => 'setStatsByDomain' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'globalStats' => 'getGlobalStats', + 'campaignStats' => 'getCampaignStats', + 'mirrorClick' => 'getMirrorClick', + 'remaining' => 'getRemaining', + 'linksStats' => 'getLinksStats', + 'statsByDomain' => 'getStatsByDomain' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['globalStats'] = isset($data['globalStats']) ? $data['globalStats'] : null; + $this->container['campaignStats'] = isset($data['campaignStats']) ? $data['campaignStats'] : null; + $this->container['mirrorClick'] = isset($data['mirrorClick']) ? $data['mirrorClick'] : null; + $this->container['remaining'] = isset($data['remaining']) ? $data['remaining'] : null; + $this->container['linksStats'] = isset($data['linksStats']) ? $data['linksStats'] : null; + $this->container['statsByDomain'] = isset($data['statsByDomain']) ? $data['statsByDomain'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['globalStats'] === null) { + $invalidProperties[] = "'globalStats' can't be null"; + } + if ($this->container['campaignStats'] === null) { + $invalidProperties[] = "'campaignStats' can't be null"; + } + if ($this->container['mirrorClick'] === null) { + $invalidProperties[] = "'mirrorClick' can't be null"; + } + if ($this->container['remaining'] === null) { + $invalidProperties[] = "'remaining' can't be null"; + } + if ($this->container['linksStats'] === null) { + $invalidProperties[] = "'linksStats' can't be null"; + } + if ($this->container['statsByDomain'] === null) { + $invalidProperties[] = "'statsByDomain' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['globalStats'] === null) { + return false; + } + if ($this->container['campaignStats'] === null) { + return false; + } + if ($this->container['mirrorClick'] === null) { + return false; + } + if ($this->container['remaining'] === null) { + return false; + } + if ($this->container['linksStats'] === null) { + return false; + } + if ($this->container['statsByDomain'] === null) { + return false; + } + return true; + } + + + /** + * Gets globalStats + * + * @return object + */ + public function getGlobalStats() + { + return $this->container['globalStats']; + } + + /** + * Sets globalStats + * + * @param object $globalStats Overall statistics of the campaign + * + * @return $this + */ + public function setGlobalStats($globalStats) + { + $this->container['globalStats'] = $globalStats; + + return $this; + } + + /** + * Gets campaignStats + * + * @return object[] + */ + public function getCampaignStats() + { + return $this->container['campaignStats']; + } + + /** + * Sets campaignStats + * + * @param object[] $campaignStats List-wise statistics of the campaign. + * + * @return $this + */ + public function setCampaignStats($campaignStats) + { + $this->container['campaignStats'] = $campaignStats; + + return $this; + } + + /** + * Gets mirrorClick + * + * @return int + */ + public function getMirrorClick() + { + return $this->container['mirrorClick']; + } + + /** + * Sets mirrorClick + * + * @param int $mirrorClick Number of clicks on mirror link + * + * @return $this + */ + public function setMirrorClick($mirrorClick) + { + $this->container['mirrorClick'] = $mirrorClick; + + return $this; + } + + /** + * Gets remaining + * + * @return int + */ + public function getRemaining() + { + return $this->container['remaining']; + } + + /** + * Sets remaining + * + * @param int $remaining Number of remaning emails to send + * + * @return $this + */ + public function setRemaining($remaining) + { + $this->container['remaining'] = $remaining; + + return $this; + } + + /** + * Gets linksStats + * + * @return object + */ + public function getLinksStats() + { + return $this->container['linksStats']; + } + + /** + * Sets linksStats + * + * @param object $linksStats Statistics about the number of clicks for the links + * + * @return $this + */ + public function setLinksStats($linksStats) + { + $this->container['linksStats'] = $linksStats; + + return $this; + } + + /** + * Gets statsByDomain + * + * @return \SendinBlue\Client\Model\GetStatsByDomain + */ + public function getStatsByDomain() + { + return $this->container['statsByDomain']; + } + + /** + * Sets statsByDomain + * + * @param \SendinBlue\Client\Model\GetStatsByDomain $statsByDomain statsByDomain + * + * @return $this + */ + public function setStatsByDomain($statsByDomain) + { + $this->container['statsByDomain'] = $statsByDomain; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedClient.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedClient.php new file mode 100644 index 0000000..bb41125 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedClient.php @@ -0,0 +1,452 @@ + 'string', + 'firstName' => 'string', + 'lastName' => 'string', + 'companyName' => 'string', + 'address' => '\SendinBlue\Client\Model\GetExtendedClientAddress' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'firstName' => null, + 'lastName' => null, + 'companyName' => null, + 'address' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'firstName' => 'firstName', + 'lastName' => 'lastName', + 'companyName' => 'companyName', + 'address' => 'address' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName', + 'companyName' => 'setCompanyName', + 'address' => 'setAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName', + 'companyName' => 'getCompanyName', + 'address' => 'getAddress' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['firstName'] = isset($data['firstName']) ? $data['firstName'] : null; + $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null; + $this->container['companyName'] = isset($data['companyName']) ? $data['companyName'] : null; + $this->container['address'] = isset($data['address']) ? $data['address'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['firstName'] === null) { + $invalidProperties[] = "'firstName' can't be null"; + } + if ($this->container['lastName'] === null) { + $invalidProperties[] = "'lastName' can't be null"; + } + if ($this->container['companyName'] === null) { + $invalidProperties[] = "'companyName' can't be null"; + } + if ($this->container['address'] === null) { + $invalidProperties[] = "'address' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + if ($this->container['firstName'] === null) { + return false; + } + if ($this->container['lastName'] === null) { + return false; + } + if ($this->container['companyName'] === null) { + return false; + } + if ($this->container['address'] === null) { + return false; + } + return true; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Login Email + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets firstName + * + * @return string + */ + public function getFirstName() + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string $firstName First Name + * + * @return $this + */ + public function setFirstName($firstName) + { + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string + */ + public function getLastName() + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string $lastName Last Name + * + * @return $this + */ + public function setLastName($lastName) + { + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets companyName + * + * @return string + */ + public function getCompanyName() + { + return $this->container['companyName']; + } + + /** + * Sets companyName + * + * @param string $companyName Name of the company + * + * @return $this + */ + public function setCompanyName($companyName) + { + $this->container['companyName'] = $companyName; + + return $this; + } + + /** + * Gets address + * + * @return \SendinBlue\Client\Model\GetExtendedClientAddress + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \SendinBlue\Client\Model\GetExtendedClientAddress $address address + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedClientAddress.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedClientAddress.php new file mode 100644 index 0000000..be07159 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedClientAddress.php @@ -0,0 +1,417 @@ + 'string', + 'city' => 'string', + 'zipCode' => 'string', + 'country' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'street' => null, + 'city' => null, + 'zipCode' => null, + 'country' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'street' => 'street', + 'city' => 'city', + 'zipCode' => 'zipCode', + 'country' => 'country' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'street' => 'setStreet', + 'city' => 'setCity', + 'zipCode' => 'setZipCode', + 'country' => 'setCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'street' => 'getStreet', + 'city' => 'getCity', + 'zipCode' => 'getZipCode', + 'country' => 'getCountry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['street'] = isset($data['street']) ? $data['street'] : null; + $this->container['city'] = isset($data['city']) ? $data['city'] : null; + $this->container['zipCode'] = isset($data['zipCode']) ? $data['zipCode'] : null; + $this->container['country'] = isset($data['country']) ? $data['country'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['street'] === null) { + $invalidProperties[] = "'street' can't be null"; + } + if ($this->container['city'] === null) { + $invalidProperties[] = "'city' can't be null"; + } + if ($this->container['zipCode'] === null) { + $invalidProperties[] = "'zipCode' can't be null"; + } + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['street'] === null) { + return false; + } + if ($this->container['city'] === null) { + return false; + } + if ($this->container['zipCode'] === null) { + return false; + } + if ($this->container['country'] === null) { + return false; + } + return true; + } + + + /** + * Gets street + * + * @return string + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string $street Street information + * + * @return $this + */ + public function setStreet($street) + { + $this->container['street'] = $street; + + return $this; + } + + /** + * Gets city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city City information + * + * @return $this + */ + public function setCity($city) + { + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets zipCode + * + * @return string + */ + public function getZipCode() + { + return $this->container['zipCode']; + } + + /** + * Sets zipCode + * + * @param string $zipCode Zip Code information + * + * @return $this + */ + public function setZipCode($zipCode) + { + $this->container['zipCode'] = $zipCode; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country Country information + * + * @return $this + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetails.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetails.php new file mode 100644 index 0000000..797e2e6 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetails.php @@ -0,0 +1,626 @@ + 'string', + 'id' => 'int', + 'emailBlacklisted' => 'bool', + 'smsBlacklisted' => 'bool', + 'createdAt' => '\DateTime', + 'modifiedAt' => '\DateTime', + 'listIds' => 'int[]', + 'listUnsubscribed' => 'int[]', + 'attributes' => 'object', + 'statistics' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatistics' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'id' => 'int64', + 'emailBlacklisted' => null, + 'smsBlacklisted' => null, + 'createdAt' => 'date-time', + 'modifiedAt' => 'date-time', + 'listIds' => 'int64', + 'listUnsubscribed' => 'int64', + 'attributes' => null, + 'statistics' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'id' => 'id', + 'emailBlacklisted' => 'emailBlacklisted', + 'smsBlacklisted' => 'smsBlacklisted', + 'createdAt' => 'createdAt', + 'modifiedAt' => 'modifiedAt', + 'listIds' => 'listIds', + 'listUnsubscribed' => 'listUnsubscribed', + 'attributes' => 'attributes', + 'statistics' => 'statistics' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'id' => 'setId', + 'emailBlacklisted' => 'setEmailBlacklisted', + 'smsBlacklisted' => 'setSmsBlacklisted', + 'createdAt' => 'setCreatedAt', + 'modifiedAt' => 'setModifiedAt', + 'listIds' => 'setListIds', + 'listUnsubscribed' => 'setListUnsubscribed', + 'attributes' => 'setAttributes', + 'statistics' => 'setStatistics' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'id' => 'getId', + 'emailBlacklisted' => 'getEmailBlacklisted', + 'smsBlacklisted' => 'getSmsBlacklisted', + 'createdAt' => 'getCreatedAt', + 'modifiedAt' => 'getModifiedAt', + 'listIds' => 'getListIds', + 'listUnsubscribed' => 'getListUnsubscribed', + 'attributes' => 'getAttributes', + 'statistics' => 'getStatistics' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['emailBlacklisted'] = isset($data['emailBlacklisted']) ? $data['emailBlacklisted'] : null; + $this->container['smsBlacklisted'] = isset($data['smsBlacklisted']) ? $data['smsBlacklisted'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; + $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null; + $this->container['listUnsubscribed'] = isset($data['listUnsubscribed']) ? $data['listUnsubscribed'] : null; + $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + $this->container['statistics'] = isset($data['statistics']) ? $data['statistics'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['emailBlacklisted'] === null) { + $invalidProperties[] = "'emailBlacklisted' can't be null"; + } + if ($this->container['smsBlacklisted'] === null) { + $invalidProperties[] = "'smsBlacklisted' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['modifiedAt'] === null) { + $invalidProperties[] = "'modifiedAt' can't be null"; + } + if ($this->container['listIds'] === null) { + $invalidProperties[] = "'listIds' can't be null"; + } + if ($this->container['attributes'] === null) { + $invalidProperties[] = "'attributes' can't be null"; + } + if ($this->container['statistics'] === null) { + $invalidProperties[] = "'statistics' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + if ($this->container['id'] === null) { + return false; + } + if ($this->container['emailBlacklisted'] === null) { + return false; + } + if ($this->container['smsBlacklisted'] === null) { + return false; + } + if ($this->container['createdAt'] === null) { + return false; + } + if ($this->container['modifiedAt'] === null) { + return false; + } + if ($this->container['listIds'] === null) { + return false; + } + if ($this->container['attributes'] === null) { + return false; + } + if ($this->container['statistics'] === null) { + return false; + } + return true; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email address of the contact for which you requested the details + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the contact for which you requested the details + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets emailBlacklisted + * + * @return bool + */ + public function getEmailBlacklisted() + { + return $this->container['emailBlacklisted']; + } + + /** + * Sets emailBlacklisted + * + * @param bool $emailBlacklisted Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) + * + * @return $this + */ + public function setEmailBlacklisted($emailBlacklisted) + { + $this->container['emailBlacklisted'] = $emailBlacklisted; + + return $this; + } + + /** + * Gets smsBlacklisted + * + * @return bool + */ + public function getSmsBlacklisted() + { + return $this->container['smsBlacklisted']; + } + + /** + * Sets smsBlacklisted + * + * @param bool $smsBlacklisted Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) + * + * @return $this + */ + public function setSmsBlacklisted($smsBlacklisted) + { + $this->container['smsBlacklisted'] = $smsBlacklisted; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets modifiedAt + * + * @return \DateTime + */ + public function getModifiedAt() + { + return $this->container['modifiedAt']; + } + + /** + * Sets modifiedAt + * + * @param \DateTime $modifiedAt Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setModifiedAt($modifiedAt) + { + $this->container['modifiedAt'] = $modifiedAt; + + return $this; + } + + /** + * Gets listIds + * + * @return int[] + */ + public function getListIds() + { + return $this->container['listIds']; + } + + /** + * Sets listIds + * + * @param int[] $listIds listIds + * + * @return $this + */ + public function setListIds($listIds) + { + $this->container['listIds'] = $listIds; + + return $this; + } + + /** + * Gets listUnsubscribed + * + * @return int[] + */ + public function getListUnsubscribed() + { + return $this->container['listUnsubscribed']; + } + + /** + * Sets listUnsubscribed + * + * @param int[] $listUnsubscribed listUnsubscribed + * + * @return $this + */ + public function setListUnsubscribed($listUnsubscribed) + { + $this->container['listUnsubscribed'] = $listUnsubscribed; + + return $this; + } + + /** + * Gets attributes + * + * @return object + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param object $attributes Set of attributes of the contact + * + * @return $this + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + return $this; + } + + /** + * Gets statistics + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatistics + */ + public function getStatistics() + { + return $this->container['statistics']; + } + + /** + * Sets statistics + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatistics $statistics statistics + * + * @return $this + */ + public function setStatistics($statistics) + { + $this->container['statistics'] = $statistics; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatistics.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatistics.php new file mode 100644 index 0000000..19abe2c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatistics.php @@ -0,0 +1,513 @@ + '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]', + 'hardBounces' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]', + 'softBounces' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]', + 'complaints' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[]', + 'unsubscriptions' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptions', + 'opened' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsOpened[]', + 'clicked' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsClicked[]', + 'transacAttributes' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'messagesSent' => null, + 'hardBounces' => null, + 'softBounces' => null, + 'complaints' => null, + 'unsubscriptions' => null, + 'opened' => null, + 'clicked' => null, + 'transacAttributes' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'messagesSent' => 'messagesSent', + 'hardBounces' => 'hardBounces', + 'softBounces' => 'softBounces', + 'complaints' => 'complaints', + 'unsubscriptions' => 'unsubscriptions', + 'opened' => 'opened', + 'clicked' => 'clicked', + 'transacAttributes' => 'transacAttributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'messagesSent' => 'setMessagesSent', + 'hardBounces' => 'setHardBounces', + 'softBounces' => 'setSoftBounces', + 'complaints' => 'setComplaints', + 'unsubscriptions' => 'setUnsubscriptions', + 'opened' => 'setOpened', + 'clicked' => 'setClicked', + 'transacAttributes' => 'setTransacAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'messagesSent' => 'getMessagesSent', + 'hardBounces' => 'getHardBounces', + 'softBounces' => 'getSoftBounces', + 'complaints' => 'getComplaints', + 'unsubscriptions' => 'getUnsubscriptions', + 'opened' => 'getOpened', + 'clicked' => 'getClicked', + 'transacAttributes' => 'getTransacAttributes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['messagesSent'] = isset($data['messagesSent']) ? $data['messagesSent'] : null; + $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null; + $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null; + $this->container['complaints'] = isset($data['complaints']) ? $data['complaints'] : null; + $this->container['unsubscriptions'] = isset($data['unsubscriptions']) ? $data['unsubscriptions'] : null; + $this->container['opened'] = isset($data['opened']) ? $data['opened'] : null; + $this->container['clicked'] = isset($data['clicked']) ? $data['clicked'] : null; + $this->container['transacAttributes'] = isset($data['transacAttributes']) ? $data['transacAttributes'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets messagesSent + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] + */ + public function getMessagesSent() + { + return $this->container['messagesSent']; + } + + /** + * Sets messagesSent + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $messagesSent Listing of the sent campaign for the contact + * + * @return $this + */ + public function setMessagesSent($messagesSent) + { + $this->container['messagesSent'] = $messagesSent; + + return $this; + } + + /** + * Gets hardBounces + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] + */ + public function getHardBounces() + { + return $this->container['hardBounces']; + } + + /** + * Sets hardBounces + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $hardBounces Listing of the hardbounes generated by the contact + * + * @return $this + */ + public function setHardBounces($hardBounces) + { + $this->container['hardBounces'] = $hardBounces; + + return $this; + } + + /** + * Gets softBounces + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] + */ + public function getSoftBounces() + { + return $this->container['softBounces']; + } + + /** + * Sets softBounces + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $softBounces Listing of the softbounes generated by the contact + * + * @return $this + */ + public function setSoftBounces($softBounces) + { + $this->container['softBounces'] = $softBounces; + + return $this; + } + + /** + * Gets complaints + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] + */ + public function getComplaints() + { + return $this->container['complaints']; + } + + /** + * Sets complaints + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsMessagesSent[] $complaints Listing of the complaints generated by the contact + * + * @return $this + */ + public function setComplaints($complaints) + { + $this->container['complaints'] = $complaints; + + return $this; + } + + /** + * Gets unsubscriptions + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptions + */ + public function getUnsubscriptions() + { + return $this->container['unsubscriptions']; + } + + /** + * Sets unsubscriptions + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptions $unsubscriptions unsubscriptions + * + * @return $this + */ + public function setUnsubscriptions($unsubscriptions) + { + $this->container['unsubscriptions'] = $unsubscriptions; + + return $this; + } + + /** + * Gets opened + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsOpened[] + */ + public function getOpened() + { + return $this->container['opened']; + } + + /** + * Sets opened + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsOpened[] $opened Listing of the openings generated by the contact + * + * @return $this + */ + public function setOpened($opened) + { + $this->container['opened'] = $opened; + + return $this; + } + + /** + * Gets clicked + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsClicked[] + */ + public function getClicked() + { + return $this->container['clicked']; + } + + /** + * Sets clicked + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsClicked[] $clicked Listing of the clicks generated by the contact + * + * @return $this + */ + public function setClicked($clicked) + { + $this->container['clicked'] = $clicked; + + return $this; + } + + /** + * Gets transacAttributes + * + * @return object[] + */ + public function getTransacAttributes() + { + return $this->container['transacAttributes']; + } + + /** + * Sets transacAttributes + * + * @param object[] $transacAttributes Listing of the transactional attributes for the contact + * + * @return $this + */ + public function setTransacAttributes($transacAttributes) + { + $this->container['transacAttributes'] = $transacAttributes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsClicked.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsClicked.php new file mode 100644 index 0000000..e328d3f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsClicked.php @@ -0,0 +1,344 @@ + 'int', + 'links' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsLinks[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'campaignId' => 'int64', + 'links' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaignId' => 'campaignId', + 'links' => 'links' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaignId' => 'setCampaignId', + 'links' => 'setLinks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaignId' => 'getCampaignId', + 'links' => 'getLinks' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; + $this->container['links'] = isset($data['links']) ? $data['links'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['campaignId'] === null) { + $invalidProperties[] = "'campaignId' can't be null"; + } + if ($this->container['links'] === null) { + $invalidProperties[] = "'links' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['campaignId'] === null) { + return false; + } + if ($this->container['links'] === null) { + return false; + } + return true; + } + + + /** + * Gets campaignId + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaignId']; + } + + /** + * Sets campaignId + * + * @param int $campaignId ID of the campaign which generated the event + * + * @return $this + */ + public function setCampaignId($campaignId) + { + $this->container['campaignId'] = $campaignId; + + return $this; + } + + /** + * Gets links + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsLinks[] + */ + public function getLinks() + { + return $this->container['links']; + } + + /** + * Sets links + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsLinks[] $links Listing of the clicked links for the campaign + * + * @return $this + */ + public function setLinks($links) + { + $this->container['links'] = $links; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsLinks.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsLinks.php new file mode 100644 index 0000000..32fc9e2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsLinks.php @@ -0,0 +1,416 @@ + 'int', + 'eventTime' => '\DateTime', + 'ip' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'count' => 'int64', + 'eventTime' => 'date-time', + 'ip' => null, + 'url' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'eventTime' => 'eventTime', + 'ip' => 'ip', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'eventTime' => 'setEventTime', + 'ip' => 'setIp', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'eventTime' => 'getEventTime', + 'ip' => 'getIp', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + $this->container['eventTime'] = isset($data['eventTime']) ? $data['eventTime'] : null; + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['eventTime'] === null) { + $invalidProperties[] = "'eventTime' can't be null"; + } + if ($this->container['ip'] === null) { + $invalidProperties[] = "'ip' can't be null"; + } + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['count'] === null) { + return false; + } + if ($this->container['eventTime'] === null) { + return false; + } + if ($this->container['ip'] === null) { + return false; + } + if ($this->container['url'] === null) { + return false; + } + return true; + } + + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Number of clicks on this link for the campaign + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets eventTime + * + * @return \DateTime + */ + public function getEventTime() + { + return $this->container['eventTime']; + } + + /** + * Sets eventTime + * + * @param \DateTime $eventTime UTC date-time of the event + * + * @return $this + */ + public function setEventTime($eventTime) + { + $this->container['eventTime'] = $eventTime; + + return $this; + } + + /** + * Gets ip + * + * @return string + */ + public function getIp() + { + return $this->container['ip']; + } + + /** + * Sets ip + * + * @param string $ip IP from which the user has clicked on the link + * + * @return $this + */ + public function setIp($ip) + { + $this->container['ip'] = $ip; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url URL of the clicked link + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsMessagesSent.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsMessagesSent.php new file mode 100644 index 0000000..608fd98 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsMessagesSent.php @@ -0,0 +1,344 @@ + 'int', + 'eventTime' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'campaignId' => 'int64', + 'eventTime' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaignId' => 'campaignId', + 'eventTime' => 'eventTime' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaignId' => 'setCampaignId', + 'eventTime' => 'setEventTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaignId' => 'getCampaignId', + 'eventTime' => 'getEventTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; + $this->container['eventTime'] = isset($data['eventTime']) ? $data['eventTime'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['campaignId'] === null) { + $invalidProperties[] = "'campaignId' can't be null"; + } + if ($this->container['eventTime'] === null) { + $invalidProperties[] = "'eventTime' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['campaignId'] === null) { + return false; + } + if ($this->container['eventTime'] === null) { + return false; + } + return true; + } + + + /** + * Gets campaignId + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaignId']; + } + + /** + * Sets campaignId + * + * @param int $campaignId ID of the campaign which generated the event + * + * @return $this + */ + public function setCampaignId($campaignId) + { + $this->container['campaignId'] = $campaignId; + + return $this; + } + + /** + * Gets eventTime + * + * @return \DateTime + */ + public function getEventTime() + { + return $this->container['eventTime']; + } + + /** + * Sets eventTime + * + * @param \DateTime $eventTime UTC date-time of the event + * + * @return $this + */ + public function setEventTime($eventTime) + { + $this->container['eventTime'] = $eventTime; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsOpened.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsOpened.php new file mode 100644 index 0000000..eedb44d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsOpened.php @@ -0,0 +1,416 @@ + 'int', + 'count' => 'int', + 'eventTime' => '\DateTime', + 'ip' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'campaignId' => 'int64', + 'count' => 'int64', + 'eventTime' => 'date-time', + 'ip' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaignId' => 'campaignId', + 'count' => 'count', + 'eventTime' => 'eventTime', + 'ip' => 'ip' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaignId' => 'setCampaignId', + 'count' => 'setCount', + 'eventTime' => 'setEventTime', + 'ip' => 'setIp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaignId' => 'getCampaignId', + 'count' => 'getCount', + 'eventTime' => 'getEventTime', + 'ip' => 'getIp' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + $this->container['eventTime'] = isset($data['eventTime']) ? $data['eventTime'] : null; + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['campaignId'] === null) { + $invalidProperties[] = "'campaignId' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['eventTime'] === null) { + $invalidProperties[] = "'eventTime' can't be null"; + } + if ($this->container['ip'] === null) { + $invalidProperties[] = "'ip' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['campaignId'] === null) { + return false; + } + if ($this->container['count'] === null) { + return false; + } + if ($this->container['eventTime'] === null) { + return false; + } + if ($this->container['ip'] === null) { + return false; + } + return true; + } + + + /** + * Gets campaignId + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaignId']; + } + + /** + * Sets campaignId + * + * @param int $campaignId ID of the campaign which generated the event + * + * @return $this + */ + public function setCampaignId($campaignId) + { + $this->container['campaignId'] = $campaignId; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Number of openings for the campaign + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets eventTime + * + * @return \DateTime + */ + public function getEventTime() + { + return $this->container['eventTime']; + } + + /** + * Sets eventTime + * + * @param \DateTime $eventTime UTC date-time of the event + * + * @return $this + */ + public function setEventTime($eventTime) + { + $this->container['eventTime'] = $eventTime; + + return $this; + } + + /** + * Gets ip + * + * @return string + */ + public function getIp() + { + return $this->container['ip']; + } + + /** + * Sets ip + * + * @param string $ip IP from which the user has opened the email + * + * @return $this + */ + public function setIp($ip) + { + $this->container['ip'] = $ip; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptions.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptions.php new file mode 100644 index 0000000..7b4d171 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptions.php @@ -0,0 +1,345 @@ + '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription[]', + 'adminUnsubscription' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'userUnsubscription' => null, + 'adminUnsubscription' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'userUnsubscription' => 'userUnsubscription', + 'adminUnsubscription' => 'adminUnsubscription' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userUnsubscription' => 'setUserUnsubscription', + 'adminUnsubscription' => 'setAdminUnsubscription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userUnsubscription' => 'getUserUnsubscription', + 'adminUnsubscription' => 'getAdminUnsubscription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['userUnsubscription'] = isset($data['userUnsubscription']) ? $data['userUnsubscription'] : null; + $this->container['adminUnsubscription'] = isset($data['adminUnsubscription']) ? $data['adminUnsubscription'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['userUnsubscription'] === null) { + $invalidProperties[] = "'userUnsubscription' can't be null"; + } + if ($this->container['adminUnsubscription'] === null) { + $invalidProperties[] = "'adminUnsubscription' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['userUnsubscription'] === null) { + return false; + } + if ($this->container['adminUnsubscription'] === null) { + return false; + } + return true; + } + + + /** + * Gets userUnsubscription + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription[] + */ + public function getUserUnsubscription() + { + return $this->container['userUnsubscription']; + } + + /** + * Sets userUnsubscription + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription[] $userUnsubscription Contact unsubscribe via unsubscription link in a campaign + * + * @return $this + */ + public function setUserUnsubscription($userUnsubscription) + { + $this->container['userUnsubscription'] = $userUnsubscription; + + return $this; + } + + /** + * Gets adminUnsubscription + * + * @return \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription[] + */ + public function getAdminUnsubscription() + { + return $this->container['adminUnsubscription']; + } + + /** + * Sets adminUnsubscription + * + * @param \SendinBlue\Client\Model\GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription[] $adminUnsubscription Contact has been unsubscribed from the administrator + * + * @return $this + */ + public function setAdminUnsubscription($adminUnsubscription) + { + $this->container['adminUnsubscription'] = $adminUnsubscription; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.php new file mode 100644 index 0000000..604fdff --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.php @@ -0,0 +1,344 @@ + '\DateTime', + 'ip' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'eventTime' => 'date-time', + 'ip' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'eventTime' => 'eventTime', + 'ip' => 'ip' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'eventTime' => 'setEventTime', + 'ip' => 'setIp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'eventTime' => 'getEventTime', + 'ip' => 'getIp' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['eventTime'] = isset($data['eventTime']) ? $data['eventTime'] : null; + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['eventTime'] === null) { + $invalidProperties[] = "'eventTime' can't be null"; + } + if ($this->container['ip'] === null) { + $invalidProperties[] = "'ip' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['eventTime'] === null) { + return false; + } + if ($this->container['ip'] === null) { + return false; + } + return true; + } + + + /** + * Gets eventTime + * + * @return \DateTime + */ + public function getEventTime() + { + return $this->container['eventTime']; + } + + /** + * Sets eventTime + * + * @param \DateTime $eventTime UTC date-time of the event + * + * @return $this + */ + public function setEventTime($eventTime) + { + $this->container['eventTime'] = $eventTime; + + return $this; + } + + /** + * Gets ip + * + * @return string + */ + public function getIp() + { + return $this->container['ip']; + } + + /** + * Sets ip + * + * @param string $ip IP from which the user has been unsubscribed + * + * @return $this + */ + public function setIp($ip) + { + $this->container['ip'] = $ip; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.php new file mode 100644 index 0000000..5bb6af1 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.php @@ -0,0 +1,380 @@ + 'int', + 'eventTime' => '\DateTime', + 'ip' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'campaignId' => 'int64', + 'eventTime' => 'date-time', + 'ip' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaignId' => 'campaignId', + 'eventTime' => 'eventTime', + 'ip' => 'ip' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaignId' => 'setCampaignId', + 'eventTime' => 'setEventTime', + 'ip' => 'setIp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaignId' => 'getCampaignId', + 'eventTime' => 'getEventTime', + 'ip' => 'getIp' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; + $this->container['eventTime'] = isset($data['eventTime']) ? $data['eventTime'] : null; + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['campaignId'] === null) { + $invalidProperties[] = "'campaignId' can't be null"; + } + if ($this->container['eventTime'] === null) { + $invalidProperties[] = "'eventTime' can't be null"; + } + if ($this->container['ip'] === null) { + $invalidProperties[] = "'ip' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['campaignId'] === null) { + return false; + } + if ($this->container['eventTime'] === null) { + return false; + } + if ($this->container['ip'] === null) { + return false; + } + return true; + } + + + /** + * Gets campaignId + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaignId']; + } + + /** + * Sets campaignId + * + * @param int $campaignId ID of the campaign which generated the event + * + * @return $this + */ + public function setCampaignId($campaignId) + { + $this->container['campaignId'] = $campaignId; + + return $this; + } + + /** + * Gets eventTime + * + * @return \DateTime + */ + public function getEventTime() + { + return $this->container['eventTime']; + } + + /** + * Sets eventTime + * + * @param \DateTime $eventTime UTC date-time of the event + * + * @return $this + */ + public function setEventTime($eventTime) + { + $this->container['eventTime'] = $eventTime; + + return $this; + } + + /** + * Gets ip + * + * @return string + */ + public function getIp() + { + return $this->container['ip']; + } + + /** + * Sets ip + * + * @param string $ip IP from which the user has unsubscribed + * + * @return $this + */ + public function setIp($ip) + { + $this->container['ip'] = $ip; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedList.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedList.php new file mode 100644 index 0000000..75861cb --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedList.php @@ -0,0 +1,548 @@ + 'int', + 'name' => 'string', + 'totalBlacklisted' => 'int', + 'totalSubscribers' => 'int', + 'folderId' => 'int', + 'createdAt' => '\DateTime', + 'campaignStats' => '\SendinBlue\Client\Model\GetExtendedListCampaignStats[]', + 'dynamicList' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'totalBlacklisted' => 'int64', + 'totalSubscribers' => 'int64', + 'folderId' => 'int64', + 'createdAt' => 'date-time', + 'campaignStats' => null, + 'dynamicList' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'totalBlacklisted' => 'totalBlacklisted', + 'totalSubscribers' => 'totalSubscribers', + 'folderId' => 'folderId', + 'createdAt' => 'createdAt', + 'campaignStats' => 'campaignStats', + 'dynamicList' => 'dynamicList' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'totalBlacklisted' => 'setTotalBlacklisted', + 'totalSubscribers' => 'setTotalSubscribers', + 'folderId' => 'setFolderId', + 'createdAt' => 'setCreatedAt', + 'campaignStats' => 'setCampaignStats', + 'dynamicList' => 'setDynamicList' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'totalBlacklisted' => 'getTotalBlacklisted', + 'totalSubscribers' => 'getTotalSubscribers', + 'folderId' => 'getFolderId', + 'createdAt' => 'getCreatedAt', + 'campaignStats' => 'getCampaignStats', + 'dynamicList' => 'getDynamicList' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['totalBlacklisted'] = isset($data['totalBlacklisted']) ? $data['totalBlacklisted'] : null; + $this->container['totalSubscribers'] = isset($data['totalSubscribers']) ? $data['totalSubscribers'] : null; + $this->container['folderId'] = isset($data['folderId']) ? $data['folderId'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['campaignStats'] = isset($data['campaignStats']) ? $data['campaignStats'] : null; + $this->container['dynamicList'] = isset($data['dynamicList']) ? $data['dynamicList'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['totalBlacklisted'] === null) { + $invalidProperties[] = "'totalBlacklisted' can't be null"; + } + if ($this->container['totalSubscribers'] === null) { + $invalidProperties[] = "'totalSubscribers' can't be null"; + } + if ($this->container['folderId'] === null) { + $invalidProperties[] = "'folderId' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + if ($this->container['name'] === null) { + return false; + } + if ($this->container['totalBlacklisted'] === null) { + return false; + } + if ($this->container['totalSubscribers'] === null) { + return false; + } + if ($this->container['folderId'] === null) { + return false; + } + if ($this->container['createdAt'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the list + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the list + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets totalBlacklisted + * + * @return int + */ + public function getTotalBlacklisted() + { + return $this->container['totalBlacklisted']; + } + + /** + * Sets totalBlacklisted + * + * @param int $totalBlacklisted Number of blacklisted contacts in the list + * + * @return $this + */ + public function setTotalBlacklisted($totalBlacklisted) + { + $this->container['totalBlacklisted'] = $totalBlacklisted; + + return $this; + } + + /** + * Gets totalSubscribers + * + * @return int + */ + public function getTotalSubscribers() + { + return $this->container['totalSubscribers']; + } + + /** + * Sets totalSubscribers + * + * @param int $totalSubscribers Number of contacts in the list + * + * @return $this + */ + public function setTotalSubscribers($totalSubscribers) + { + $this->container['totalSubscribers'] = $totalSubscribers; + + return $this; + } + + /** + * Gets folderId + * + * @return int + */ + public function getFolderId() + { + return $this->container['folderId']; + } + + /** + * Sets folderId + * + * @param int $folderId ID of the folder + * + * @return $this + */ + public function setFolderId($folderId) + { + $this->container['folderId'] = $folderId; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets campaignStats + * + * @return \SendinBlue\Client\Model\GetExtendedListCampaignStats[] + */ + public function getCampaignStats() + { + return $this->container['campaignStats']; + } + + /** + * Sets campaignStats + * + * @param \SendinBlue\Client\Model\GetExtendedListCampaignStats[] $campaignStats campaignStats + * + * @return $this + */ + public function setCampaignStats($campaignStats) + { + $this->container['campaignStats'] = $campaignStats; + + return $this; + } + + /** + * Gets dynamicList + * + * @return bool + */ + public function getDynamicList() + { + return $this->container['dynamicList']; + } + + /** + * Sets dynamicList + * + * @param bool $dynamicList Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) + * + * @return $this + */ + public function setDynamicList($dynamicList) + { + $this->container['dynamicList'] = $dynamicList; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedListCampaignStats.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedListCampaignStats.php new file mode 100644 index 0000000..90143a2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetExtendedListCampaignStats.php @@ -0,0 +1,344 @@ + 'int', + 'stats' => '\SendinBlue\Client\Model\GetCampaignStats' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'campaignId' => 'int64', + 'stats' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaignId' => 'campaignId', + 'stats' => 'stats' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaignId' => 'setCampaignId', + 'stats' => 'setStats' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaignId' => 'getCampaignId', + 'stats' => 'getStats' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['campaignId'] = isset($data['campaignId']) ? $data['campaignId'] : null; + $this->container['stats'] = isset($data['stats']) ? $data['stats'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['campaignId'] === null) { + $invalidProperties[] = "'campaignId' can't be null"; + } + if ($this->container['stats'] === null) { + $invalidProperties[] = "'stats' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['campaignId'] === null) { + return false; + } + if ($this->container['stats'] === null) { + return false; + } + return true; + } + + + /** + * Gets campaignId + * + * @return int + */ + public function getCampaignId() + { + return $this->container['campaignId']; + } + + /** + * Sets campaignId + * + * @param int $campaignId ID of the campaign + * + * @return $this + */ + public function setCampaignId($campaignId) + { + $this->container['campaignId'] = $campaignId; + + return $this; + } + + /** + * Gets stats + * + * @return \SendinBlue\Client\Model\GetCampaignStats + */ + public function getStats() + { + return $this->container['stats']; + } + + /** + * Sets stats + * + * @param \SendinBlue\Client\Model\GetCampaignStats $stats stats + * + * @return $this + */ + public function setStats($stats) + { + $this->container['stats'] = $stats; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetFolder.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetFolder.php new file mode 100644 index 0000000..bf3d2a8 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetFolder.php @@ -0,0 +1,452 @@ + 'int', + 'name' => 'string', + 'totalBlacklisted' => 'int', + 'totalSubscribers' => 'int', + 'uniqueSubscribers' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'totalBlacklisted' => 'int64', + 'totalSubscribers' => 'int64', + 'uniqueSubscribers' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'totalBlacklisted' => 'totalBlacklisted', + 'totalSubscribers' => 'totalSubscribers', + 'uniqueSubscribers' => 'uniqueSubscribers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'totalBlacklisted' => 'setTotalBlacklisted', + 'totalSubscribers' => 'setTotalSubscribers', + 'uniqueSubscribers' => 'setUniqueSubscribers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'totalBlacklisted' => 'getTotalBlacklisted', + 'totalSubscribers' => 'getTotalSubscribers', + 'uniqueSubscribers' => 'getUniqueSubscribers' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['totalBlacklisted'] = isset($data['totalBlacklisted']) ? $data['totalBlacklisted'] : null; + $this->container['totalSubscribers'] = isset($data['totalSubscribers']) ? $data['totalSubscribers'] : null; + $this->container['uniqueSubscribers'] = isset($data['uniqueSubscribers']) ? $data['uniqueSubscribers'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['totalBlacklisted'] === null) { + $invalidProperties[] = "'totalBlacklisted' can't be null"; + } + if ($this->container['totalSubscribers'] === null) { + $invalidProperties[] = "'totalSubscribers' can't be null"; + } + if ($this->container['uniqueSubscribers'] === null) { + $invalidProperties[] = "'uniqueSubscribers' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + if ($this->container['name'] === null) { + return false; + } + if ($this->container['totalBlacklisted'] === null) { + return false; + } + if ($this->container['totalSubscribers'] === null) { + return false; + } + if ($this->container['uniqueSubscribers'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the folder + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the folder + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets totalBlacklisted + * + * @return int + */ + public function getTotalBlacklisted() + { + return $this->container['totalBlacklisted']; + } + + /** + * Sets totalBlacklisted + * + * @param int $totalBlacklisted Number of blacklisted contacts in the folder + * + * @return $this + */ + public function setTotalBlacklisted($totalBlacklisted) + { + $this->container['totalBlacklisted'] = $totalBlacklisted; + + return $this; + } + + /** + * Gets totalSubscribers + * + * @return int + */ + public function getTotalSubscribers() + { + return $this->container['totalSubscribers']; + } + + /** + * Sets totalSubscribers + * + * @param int $totalSubscribers Number of contacts in the folder + * + * @return $this + */ + public function setTotalSubscribers($totalSubscribers) + { + $this->container['totalSubscribers'] = $totalSubscribers; + + return $this; + } + + /** + * Gets uniqueSubscribers + * + * @return int + */ + public function getUniqueSubscribers() + { + return $this->container['uniqueSubscribers']; + } + + /** + * Sets uniqueSubscribers + * + * @param int $uniqueSubscribers Number of unique contacts in the folder + * + * @return $this + */ + public function setUniqueSubscribers($uniqueSubscribers) + { + $this->container['uniqueSubscribers'] = $uniqueSubscribers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetFolderLists.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetFolderLists.php new file mode 100644 index 0000000..b8b6da2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetFolderLists.php @@ -0,0 +1,344 @@ + 'object[]', + 'count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'lists' => null, + 'count' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'lists' => 'lists', + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'lists' => 'setLists', + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'lists' => 'getLists', + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['lists'] = isset($data['lists']) ? $data['lists'] : null; + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['lists'] === null) { + $invalidProperties[] = "'lists' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['lists'] === null) { + return false; + } + if ($this->container['count'] === null) { + return false; + } + return true; + } + + + /** + * Gets lists + * + * @return object[] + */ + public function getLists() + { + return $this->container['lists']; + } + + /** + * Sets lists + * + * @param object[] $lists lists + * + * @return $this + */ + public function setLists($lists) + { + $this->container['lists'] = $lists; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Number of lists in the folder + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetFolders.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetFolders.php new file mode 100644 index 0000000..095d19a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetFolders.php @@ -0,0 +1,332 @@ + 'object[]', + 'count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'folders' => null, + 'count' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'folders' => 'folders', + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'folders' => 'setFolders', + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'folders' => 'getFolders', + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['folders'] = isset($data['folders']) ? $data['folders'] : null; + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets folders + * + * @return object[] + */ + public function getFolders() + { + return $this->container['folders']; + } + + /** + * Sets folders + * + * @param object[] $folders folders + * + * @return $this + */ + public function setFolders($folders) + { + $this->container['folders'] = $folders; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Number of folders available in your account + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetIp.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetIp.php new file mode 100644 index 0000000..027a39e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetIp.php @@ -0,0 +1,416 @@ + 'int', + 'ip' => 'string', + 'active' => 'bool', + 'domain' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'ip' => null, + 'active' => null, + 'domain' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'ip' => 'ip', + 'active' => 'active', + 'domain' => 'domain' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'ip' => 'setIp', + 'active' => 'setActive', + 'domain' => 'setDomain' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'ip' => 'getIp', + 'active' => 'getActive', + 'domain' => 'getDomain' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + $this->container['active'] = isset($data['active']) ? $data['active'] : null; + $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['ip'] === null) { + $invalidProperties[] = "'ip' can't be null"; + } + if ($this->container['active'] === null) { + $invalidProperties[] = "'active' can't be null"; + } + if ($this->container['domain'] === null) { + $invalidProperties[] = "'domain' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + if ($this->container['ip'] === null) { + return false; + } + if ($this->container['active'] === null) { + return false; + } + if ($this->container['domain'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the dedicated IP + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets ip + * + * @return string + */ + public function getIp() + { + return $this->container['ip']; + } + + /** + * Sets ip + * + * @param string $ip Dedicated IP + * + * @return $this + */ + public function setIp($ip) + { + $this->container['ip'] = $ip; + + return $this; + } + + /** + * Gets active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active Status of the IP (true=active, false=inactive) + * + * @return $this + */ + public function setActive($active) + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets domain + * + * @return string + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string $domain Domain associated to the IP + * + * @return $this + */ + public function setDomain($domain) + { + $this->container['domain'] = $domain; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetIpFromSender.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetIpFromSender.php new file mode 100644 index 0000000..3c8e73c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetIpFromSender.php @@ -0,0 +1,416 @@ + 'int', + 'ip' => 'string', + 'domain' => 'string', + 'weight' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'ip' => null, + 'domain' => null, + 'weight' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'ip' => 'ip', + 'domain' => 'domain', + 'weight' => 'weight' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'ip' => 'setIp', + 'domain' => 'setDomain', + 'weight' => 'setWeight' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'ip' => 'getIp', + 'domain' => 'getDomain', + 'weight' => 'getWeight' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null; + $this->container['weight'] = isset($data['weight']) ? $data['weight'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['ip'] === null) { + $invalidProperties[] = "'ip' can't be null"; + } + if ($this->container['domain'] === null) { + $invalidProperties[] = "'domain' can't be null"; + } + if ($this->container['weight'] === null) { + $invalidProperties[] = "'weight' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + if ($this->container['ip'] === null) { + return false; + } + if ($this->container['domain'] === null) { + return false; + } + if ($this->container['weight'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the dedicated IP + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets ip + * + * @return string + */ + public function getIp() + { + return $this->container['ip']; + } + + /** + * Sets ip + * + * @param string $ip Dedicated IP + * + * @return $this + */ + public function setIp($ip) + { + $this->container['ip'] = $ip; + + return $this; + } + + /** + * Gets domain + * + * @return string + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string $domain Domain associated to the IP + * + * @return $this + */ + public function setDomain($domain) + { + $this->container['domain'] = $domain; + + return $this; + } + + /** + * Gets weight + * + * @return int + */ + public function getWeight() + { + return $this->container['weight']; + } + + /** + * Sets weight + * + * @param int $weight Weight of the IP + * + * @return $this + */ + public function setWeight($weight) + { + $this->container['weight'] = $weight; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetIps.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetIps.php new file mode 100644 index 0000000..eb660d2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetIps.php @@ -0,0 +1,308 @@ + '\SendinBlue\Client\Model\GetIp[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'ips' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ips' => 'ips' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ips' => 'setIps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ips' => 'getIps' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['ips'] = isset($data['ips']) ? $data['ips'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ips'] === null) { + $invalidProperties[] = "'ips' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['ips'] === null) { + return false; + } + return true; + } + + + /** + * Gets ips + * + * @return \SendinBlue\Client\Model\GetIp[] + */ + public function getIps() + { + return $this->container['ips']; + } + + /** + * Sets ips + * + * @param \SendinBlue\Client\Model\GetIp[] $ips Dedicated IP(s) available on your account + * + * @return $this + */ + public function setIps($ips) + { + $this->container['ips'] = $ips; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetIpsFromSender.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetIpsFromSender.php new file mode 100644 index 0000000..c3026ec --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetIpsFromSender.php @@ -0,0 +1,308 @@ + '\SendinBlue\Client\Model\GetIpFromSender[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'ips' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ips' => 'ips' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ips' => 'setIps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ips' => 'getIps' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['ips'] = isset($data['ips']) ? $data['ips'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ips'] === null) { + $invalidProperties[] = "'ips' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['ips'] === null) { + return false; + } + return true; + } + + + /** + * Gets ips + * + * @return \SendinBlue\Client\Model\GetIpFromSender[] + */ + public function getIps() + { + return $this->container['ips']; + } + + /** + * Sets ips + * + * @param \SendinBlue\Client\Model\GetIpFromSender[] $ips Dedicated IP(s) linked to a sender + * + * @return $this + */ + public function setIps($ips) + { + $this->container['ips'] = $ips; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetList.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetList.php new file mode 100644 index 0000000..74c5183 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetList.php @@ -0,0 +1,416 @@ + 'int', + 'name' => 'string', + 'totalBlacklisted' => 'int', + 'totalSubscribers' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'totalBlacklisted' => 'int64', + 'totalSubscribers' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'totalBlacklisted' => 'totalBlacklisted', + 'totalSubscribers' => 'totalSubscribers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'totalBlacklisted' => 'setTotalBlacklisted', + 'totalSubscribers' => 'setTotalSubscribers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'totalBlacklisted' => 'getTotalBlacklisted', + 'totalSubscribers' => 'getTotalSubscribers' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['totalBlacklisted'] = isset($data['totalBlacklisted']) ? $data['totalBlacklisted'] : null; + $this->container['totalSubscribers'] = isset($data['totalSubscribers']) ? $data['totalSubscribers'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['totalBlacklisted'] === null) { + $invalidProperties[] = "'totalBlacklisted' can't be null"; + } + if ($this->container['totalSubscribers'] === null) { + $invalidProperties[] = "'totalSubscribers' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + if ($this->container['name'] === null) { + return false; + } + if ($this->container['totalBlacklisted'] === null) { + return false; + } + if ($this->container['totalSubscribers'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the list + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the list + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets totalBlacklisted + * + * @return int + */ + public function getTotalBlacklisted() + { + return $this->container['totalBlacklisted']; + } + + /** + * Sets totalBlacklisted + * + * @param int $totalBlacklisted Number of blacklisted contacts in the list + * + * @return $this + */ + public function setTotalBlacklisted($totalBlacklisted) + { + $this->container['totalBlacklisted'] = $totalBlacklisted; + + return $this; + } + + /** + * Gets totalSubscribers + * + * @return int + */ + public function getTotalSubscribers() + { + return $this->container['totalSubscribers']; + } + + /** + * Sets totalSubscribers + * + * @param int $totalSubscribers Number of contacts in the list + * + * @return $this + */ + public function setTotalSubscribers($totalSubscribers) + { + $this->container['totalSubscribers'] = $totalSubscribers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetLists.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetLists.php new file mode 100644 index 0000000..b004193 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetLists.php @@ -0,0 +1,344 @@ + 'object[]', + 'count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'lists' => null, + 'count' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'lists' => 'lists', + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'lists' => 'setLists', + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'lists' => 'getLists', + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['lists'] = isset($data['lists']) ? $data['lists'] : null; + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['lists'] === null) { + $invalidProperties[] = "'lists' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['lists'] === null) { + return false; + } + if ($this->container['count'] === null) { + return false; + } + return true; + } + + + /** + * Gets lists + * + * @return object[] + */ + public function getLists() + { + return $this->container['lists']; + } + + /** + * Sets lists + * + * @param object[] $lists Listing of all the lists available in your account + * + * @return $this + */ + public function setLists($lists) + { + $this->container['lists'] = $lists; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Number of lists in your account + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetProcess.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetProcess.php new file mode 100644 index 0000000..4e90a36 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetProcess.php @@ -0,0 +1,448 @@ + 'int', + 'status' => 'string', + 'name' => 'string', + 'exportUrl' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'status' => null, + 'name' => null, + 'exportUrl' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'status' => 'status', + 'name' => 'name', + 'exportUrl' => 'export_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'status' => 'setStatus', + 'name' => 'setName', + 'exportUrl' => 'setExportUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'status' => 'getStatus', + 'name' => 'getName', + 'exportUrl' => 'getExportUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const STATUS_QUEUED = 'queued'; + const STATUS_IN_PROCESS = 'in_process'; + const STATUS_COMPLETED = 'completed'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_QUEUED, + self::STATUS_IN_PROCESS, + self::STATUS_COMPLETED, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['exportUrl'] = isset($data['exportUrl']) ? $data['exportUrl'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + if ($this->container['status'] === null) { + return false; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + return false; + } + if ($this->container['name'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Id of the process + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Status of the process + * + * @return $this + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Process name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets exportUrl + * + * @return string + */ + public function getExportUrl() + { + return $this->container['exportUrl']; + } + + /** + * Sets exportUrl + * + * @param string $exportUrl URL on which send export the of contacts once the process is completed + * + * @return $this + */ + public function setExportUrl($exportUrl) + { + $this->container['exportUrl'] = $exportUrl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetProcesses.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetProcesses.php new file mode 100644 index 0000000..7f53639 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetProcesses.php @@ -0,0 +1,338 @@ + '\SendinBlue\Client\Model\GetProcess[]', + 'count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'processes' => null, + 'count' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'processes' => 'processes', + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'processes' => 'setProcesses', + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'processes' => 'getProcesses', + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['processes'] = isset($data['processes']) ? $data['processes'] : null; + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['count'] === null) { + return false; + } + return true; + } + + + /** + * Gets processes + * + * @return \SendinBlue\Client\Model\GetProcess[] + */ + public function getProcesses() + { + return $this->container['processes']; + } + + /** + * Sets processes + * + * @param \SendinBlue\Client\Model\GetProcess[] $processes List of processes available on your account + * + * @return $this + */ + public function setProcesses($processes) + { + $this->container['processes'] = $processes; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Number of processes available on your account + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetReports.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetReports.php new file mode 100644 index 0000000..05a6eba --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetReports.php @@ -0,0 +1,302 @@ + '\SendinBlue\Client\Model\GetReportsReports[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'reports' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'reports' => 'reports' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'reports' => 'setReports' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'reports' => 'getReports' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['reports'] = isset($data['reports']) ? $data['reports'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets reports + * + * @return \SendinBlue\Client\Model\GetReportsReports[] + */ + public function getReports() + { + return $this->container['reports']; + } + + /** + * Sets reports + * + * @param \SendinBlue\Client\Model\GetReportsReports[] $reports reports + * + * @return $this + */ + public function setReports($reports) + { + $this->container['reports'] = $reports; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetReportsReports.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetReportsReports.php new file mode 100644 index 0000000..4663499 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetReportsReports.php @@ -0,0 +1,740 @@ + '\DateTime', + 'requests' => 'int', + 'delivered' => 'int', + 'hardBounces' => 'int', + 'softBounces' => 'int', + 'clicks' => 'int', + 'uniqueClicks' => 'int', + 'opens' => 'int', + 'uniqueOpens' => 'int', + 'spamReports' => 'int', + 'blocked' => 'int', + 'invalid' => 'int', + 'unsubscribed' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'date' => 'date', + 'requests' => 'int64', + 'delivered' => 'int64', + 'hardBounces' => 'int64', + 'softBounces' => 'int64', + 'clicks' => 'int64', + 'uniqueClicks' => 'int64', + 'opens' => 'int64', + 'uniqueOpens' => 'int64', + 'spamReports' => 'int64', + 'blocked' => 'int64', + 'invalid' => 'int64', + 'unsubscribed' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'date' => 'date', + 'requests' => 'requests', + 'delivered' => 'delivered', + 'hardBounces' => 'hardBounces', + 'softBounces' => 'softBounces', + 'clicks' => 'clicks', + 'uniqueClicks' => 'uniqueClicks', + 'opens' => 'opens', + 'uniqueOpens' => 'uniqueOpens', + 'spamReports' => 'spamReports', + 'blocked' => 'blocked', + 'invalid' => 'invalid', + 'unsubscribed' => 'unsubscribed' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date' => 'setDate', + 'requests' => 'setRequests', + 'delivered' => 'setDelivered', + 'hardBounces' => 'setHardBounces', + 'softBounces' => 'setSoftBounces', + 'clicks' => 'setClicks', + 'uniqueClicks' => 'setUniqueClicks', + 'opens' => 'setOpens', + 'uniqueOpens' => 'setUniqueOpens', + 'spamReports' => 'setSpamReports', + 'blocked' => 'setBlocked', + 'invalid' => 'setInvalid', + 'unsubscribed' => 'setUnsubscribed' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date' => 'getDate', + 'requests' => 'getRequests', + 'delivered' => 'getDelivered', + 'hardBounces' => 'getHardBounces', + 'softBounces' => 'getSoftBounces', + 'clicks' => 'getClicks', + 'uniqueClicks' => 'getUniqueClicks', + 'opens' => 'getOpens', + 'uniqueOpens' => 'getUniqueOpens', + 'spamReports' => 'getSpamReports', + 'blocked' => 'getBlocked', + 'invalid' => 'getInvalid', + 'unsubscribed' => 'getUnsubscribed' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['date'] = isset($data['date']) ? $data['date'] : null; + $this->container['requests'] = isset($data['requests']) ? $data['requests'] : null; + $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null; + $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null; + $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null; + $this->container['clicks'] = isset($data['clicks']) ? $data['clicks'] : null; + $this->container['uniqueClicks'] = isset($data['uniqueClicks']) ? $data['uniqueClicks'] : null; + $this->container['opens'] = isset($data['opens']) ? $data['opens'] : null; + $this->container['uniqueOpens'] = isset($data['uniqueOpens']) ? $data['uniqueOpens'] : null; + $this->container['spamReports'] = isset($data['spamReports']) ? $data['spamReports'] : null; + $this->container['blocked'] = isset($data['blocked']) ? $data['blocked'] : null; + $this->container['invalid'] = isset($data['invalid']) ? $data['invalid'] : null; + $this->container['unsubscribed'] = isset($data['unsubscribed']) ? $data['unsubscribed'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if ($this->container['requests'] === null) { + $invalidProperties[] = "'requests' can't be null"; + } + if ($this->container['delivered'] === null) { + $invalidProperties[] = "'delivered' can't be null"; + } + if ($this->container['hardBounces'] === null) { + $invalidProperties[] = "'hardBounces' can't be null"; + } + if ($this->container['softBounces'] === null) { + $invalidProperties[] = "'softBounces' can't be null"; + } + if ($this->container['clicks'] === null) { + $invalidProperties[] = "'clicks' can't be null"; + } + if ($this->container['uniqueClicks'] === null) { + $invalidProperties[] = "'uniqueClicks' can't be null"; + } + if ($this->container['opens'] === null) { + $invalidProperties[] = "'opens' can't be null"; + } + if ($this->container['uniqueOpens'] === null) { + $invalidProperties[] = "'uniqueOpens' can't be null"; + } + if ($this->container['spamReports'] === null) { + $invalidProperties[] = "'spamReports' can't be null"; + } + if ($this->container['blocked'] === null) { + $invalidProperties[] = "'blocked' can't be null"; + } + if ($this->container['invalid'] === null) { + $invalidProperties[] = "'invalid' can't be null"; + } + if ($this->container['unsubscribed'] === null) { + $invalidProperties[] = "'unsubscribed' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['date'] === null) { + return false; + } + if ($this->container['requests'] === null) { + return false; + } + if ($this->container['delivered'] === null) { + return false; + } + if ($this->container['hardBounces'] === null) { + return false; + } + if ($this->container['softBounces'] === null) { + return false; + } + if ($this->container['clicks'] === null) { + return false; + } + if ($this->container['uniqueClicks'] === null) { + return false; + } + if ($this->container['opens'] === null) { + return false; + } + if ($this->container['uniqueOpens'] === null) { + return false; + } + if ($this->container['spamReports'] === null) { + return false; + } + if ($this->container['blocked'] === null) { + return false; + } + if ($this->container['invalid'] === null) { + return false; + } + if ($this->container['unsubscribed'] === null) { + return false; + } + return true; + } + + + /** + * Gets date + * + * @return \DateTime + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime $date Date of the statistics + * + * @return $this + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets requests + * + * @return int + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param int $requests Number of requests for the date + * + * @return $this + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + + /** + * Gets delivered + * + * @return int + */ + public function getDelivered() + { + return $this->container['delivered']; + } + + /** + * Sets delivered + * + * @param int $delivered Number of delivered emails for the date + * + * @return $this + */ + public function setDelivered($delivered) + { + $this->container['delivered'] = $delivered; + + return $this; + } + + /** + * Gets hardBounces + * + * @return int + */ + public function getHardBounces() + { + return $this->container['hardBounces']; + } + + /** + * Sets hardBounces + * + * @param int $hardBounces Number of hardbounces for the date + * + * @return $this + */ + public function setHardBounces($hardBounces) + { + $this->container['hardBounces'] = $hardBounces; + + return $this; + } + + /** + * Gets softBounces + * + * @return int + */ + public function getSoftBounces() + { + return $this->container['softBounces']; + } + + /** + * Sets softBounces + * + * @param int $softBounces Number of softbounces for the date + * + * @return $this + */ + public function setSoftBounces($softBounces) + { + $this->container['softBounces'] = $softBounces; + + return $this; + } + + /** + * Gets clicks + * + * @return int + */ + public function getClicks() + { + return $this->container['clicks']; + } + + /** + * Sets clicks + * + * @param int $clicks Number of clicks for the date + * + * @return $this + */ + public function setClicks($clicks) + { + $this->container['clicks'] = $clicks; + + return $this; + } + + /** + * Gets uniqueClicks + * + * @return int + */ + public function getUniqueClicks() + { + return $this->container['uniqueClicks']; + } + + /** + * Sets uniqueClicks + * + * @param int $uniqueClicks Number of unique clicks for the date + * + * @return $this + */ + public function setUniqueClicks($uniqueClicks) + { + $this->container['uniqueClicks'] = $uniqueClicks; + + return $this; + } + + /** + * Gets opens + * + * @return int + */ + public function getOpens() + { + return $this->container['opens']; + } + + /** + * Sets opens + * + * @param int $opens Number of openings for the date + * + * @return $this + */ + public function setOpens($opens) + { + $this->container['opens'] = $opens; + + return $this; + } + + /** + * Gets uniqueOpens + * + * @return int + */ + public function getUniqueOpens() + { + return $this->container['uniqueOpens']; + } + + /** + * Sets uniqueOpens + * + * @param int $uniqueOpens Number of unique openings for the date + * + * @return $this + */ + public function setUniqueOpens($uniqueOpens) + { + $this->container['uniqueOpens'] = $uniqueOpens; + + return $this; + } + + /** + * Gets spamReports + * + * @return int + */ + public function getSpamReports() + { + return $this->container['spamReports']; + } + + /** + * Sets spamReports + * + * @param int $spamReports Number of complaints (spam reports) for the date + * + * @return $this + */ + public function setSpamReports($spamReports) + { + $this->container['spamReports'] = $spamReports; + + return $this; + } + + /** + * Gets blocked + * + * @return int + */ + public function getBlocked() + { + return $this->container['blocked']; + } + + /** + * Sets blocked + * + * @param int $blocked Number of blocked emails for the date + * + * @return $this + */ + public function setBlocked($blocked) + { + $this->container['blocked'] = $blocked; + + return $this; + } + + /** + * Gets invalid + * + * @return int + */ + public function getInvalid() + { + return $this->container['invalid']; + } + + /** + * Sets invalid + * + * @param int $invalid Number of invalid emails for the date + * + * @return $this + */ + public function setInvalid($invalid) + { + $this->container['invalid'] = $invalid; + + return $this; + } + + /** + * Gets unsubscribed + * + * @return int + */ + public function getUnsubscribed() + { + return $this->container['unsubscribed']; + } + + /** + * Sets unsubscribed + * + * @param int $unsubscribed Number of unsubscribed emails for the date + * + * @return $this + */ + public function setUnsubscribed($unsubscribed) + { + $this->container['unsubscribed'] = $unsubscribed; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSendersList.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSendersList.php new file mode 100644 index 0000000..7efcf13 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSendersList.php @@ -0,0 +1,302 @@ + '\SendinBlue\Client\Model\GetSendersListSenders[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'senders' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'senders' => 'senders' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'senders' => 'setSenders' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'senders' => 'getSenders' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['senders'] = isset($data['senders']) ? $data['senders'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets senders + * + * @return \SendinBlue\Client\Model\GetSendersListSenders[] + */ + public function getSenders() + { + return $this->container['senders']; + } + + /** + * Sets senders + * + * @param \SendinBlue\Client\Model\GetSendersListSenders[] $senders List of the senders available in your account + * + * @return $this + */ + public function setSenders($senders) + { + $this->container['senders'] = $senders; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSendersListIps.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSendersListIps.php new file mode 100644 index 0000000..89bdbd6 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSendersListIps.php @@ -0,0 +1,380 @@ + 'string', + 'domain' => 'string', + 'weight' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'ip' => null, + 'domain' => null, + 'weight' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ip' => 'ip', + 'domain' => 'domain', + 'weight' => 'weight' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ip' => 'setIp', + 'domain' => 'setDomain', + 'weight' => 'setWeight' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ip' => 'getIp', + 'domain' => 'getDomain', + 'weight' => 'getWeight' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null; + $this->container['weight'] = isset($data['weight']) ? $data['weight'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ip'] === null) { + $invalidProperties[] = "'ip' can't be null"; + } + if ($this->container['domain'] === null) { + $invalidProperties[] = "'domain' can't be null"; + } + if ($this->container['weight'] === null) { + $invalidProperties[] = "'weight' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['ip'] === null) { + return false; + } + if ($this->container['domain'] === null) { + return false; + } + if ($this->container['weight'] === null) { + return false; + } + return true; + } + + + /** + * Gets ip + * + * @return string + */ + public function getIp() + { + return $this->container['ip']; + } + + /** + * Sets ip + * + * @param string $ip Dedicated IP available in your account + * + * @return $this + */ + public function setIp($ip) + { + $this->container['ip'] = $ip; + + return $this; + } + + /** + * Gets domain + * + * @return string + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string $domain Domain of the IP + * + * @return $this + */ + public function setDomain($domain) + { + $this->container['domain'] = $domain; + + return $this; + } + + /** + * Gets weight + * + * @return int + */ + public function getWeight() + { + return $this->container['weight']; + } + + /** + * Sets weight + * + * @param int $weight Weight of the IP for this sender + * + * @return $this + */ + public function setWeight($weight) + { + $this->container['weight'] = $weight; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSendersListSenders.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSendersListSenders.php new file mode 100644 index 0000000..8fcd3a1 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSendersListSenders.php @@ -0,0 +1,446 @@ + 'int', + 'name' => 'string', + 'email' => 'string', + 'active' => 'bool', + 'ips' => '\SendinBlue\Client\Model\GetSendersListIps[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'email' => null, + 'active' => null, + 'ips' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'email' => 'email', + 'active' => 'active', + 'ips' => 'ips' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'email' => 'setEmail', + 'active' => 'setActive', + 'ips' => 'setIps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'email' => 'getEmail', + 'active' => 'getActive', + 'ips' => 'getIps' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['active'] = isset($data['active']) ? $data['active'] : null; + $this->container['ips'] = isset($data['ips']) ? $data['ips'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['active'] === null) { + $invalidProperties[] = "'active' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + if ($this->container['name'] === null) { + return false; + } + if ($this->container['email'] === null) { + return false; + } + if ($this->container['active'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Id of the sender + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name From Name associated to the sender + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email From Email associated to the sender + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active Status of sender (true=activated, false=deactivated) + * + * @return $this + */ + public function setActive($active) + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets ips + * + * @return \SendinBlue\Client\Model\GetSendersListIps[] + */ + public function getIps() + { + return $this->container['ips']; + } + + /** + * Sets ips + * + * @param \SendinBlue\Client\Model\GetSendersListIps[] $ips List of dedicated IP(s) available in the account. This data is displayed only for dedicated IPs + * + * @return $this + */ + public function setIps($ips) + { + $this->container['ips'] = $ips; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsCampaign.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsCampaign.php new file mode 100644 index 0000000..95c4001 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsCampaign.php @@ -0,0 +1,676 @@ + 'int', + 'name' => 'string', + 'status' => 'string', + 'content' => 'string', + 'scheduledAt' => '\DateTime', + 'sender' => 'string', + 'createdAt' => '\DateTime', + 'modifiedAt' => '\DateTime', + 'recipients' => 'object', + 'statistics' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'status' => null, + 'content' => null, + 'scheduledAt' => 'date-time', + 'sender' => null, + 'createdAt' => 'date-time', + 'modifiedAt' => 'date-time', + 'recipients' => null, + 'statistics' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'status' => 'status', + 'content' => 'content', + 'scheduledAt' => 'scheduledAt', + 'sender' => 'sender', + 'createdAt' => 'createdAt', + 'modifiedAt' => 'modifiedAt', + 'recipients' => 'recipients', + 'statistics' => 'statistics' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'status' => 'setStatus', + 'content' => 'setContent', + 'scheduledAt' => 'setScheduledAt', + 'sender' => 'setSender', + 'createdAt' => 'setCreatedAt', + 'modifiedAt' => 'setModifiedAt', + 'recipients' => 'setRecipients', + 'statistics' => 'setStatistics' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'status' => 'getStatus', + 'content' => 'getContent', + 'scheduledAt' => 'getScheduledAt', + 'sender' => 'getSender', + 'createdAt' => 'getCreatedAt', + 'modifiedAt' => 'getModifiedAt', + 'recipients' => 'getRecipients', + 'statistics' => 'getStatistics' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const STATUS_DRAFT = 'draft'; + const STATUS_SENT = 'sent'; + const STATUS_ARCHIVE = 'archive'; + const STATUS_QUEUED = 'queued'; + const STATUS_SUSPENDED = 'suspended'; + const STATUS_IN_PROCESS = 'inProcess'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_DRAFT, + self::STATUS_SENT, + self::STATUS_ARCHIVE, + self::STATUS_QUEUED, + self::STATUS_SUSPENDED, + self::STATUS_IN_PROCESS, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['content'] = isset($data['content']) ? $data['content'] : null; + $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null; + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; + $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null; + $this->container['statistics'] = isset($data['statistics']) ? $data['statistics'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['content'] === null) { + $invalidProperties[] = "'content' can't be null"; + } + if ($this->container['scheduledAt'] === null) { + $invalidProperties[] = "'scheduledAt' can't be null"; + } + if ($this->container['sender'] === null) { + $invalidProperties[] = "'sender' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['modifiedAt'] === null) { + $invalidProperties[] = "'modifiedAt' can't be null"; + } + if ($this->container['recipients'] === null) { + $invalidProperties[] = "'recipients' can't be null"; + } + if ($this->container['statistics'] === null) { + $invalidProperties[] = "'statistics' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + if ($this->container['name'] === null) { + return false; + } + if ($this->container['status'] === null) { + return false; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + return false; + } + if ($this->container['content'] === null) { + return false; + } + if ($this->container['scheduledAt'] === null) { + return false; + } + if ($this->container['sender'] === null) { + return false; + } + if ($this->container['createdAt'] === null) { + return false; + } + if ($this->container['modifiedAt'] === null) { + return false; + } + if ($this->container['recipients'] === null) { + return false; + } + if ($this->container['statistics'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the SMS Campaign + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the SMS Campaign + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Status of the SMS Campaign + * + * @return $this + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content Content of the SMS Campaign + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets scheduledAt + * + * @return \DateTime + */ + public function getScheduledAt() + { + return $this->container['scheduledAt']; + } + + /** + * Sets scheduledAt + * + * @param \DateTime $scheduledAt UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format + * + * @return $this + */ + public function setScheduledAt($scheduledAt) + { + $this->container['scheduledAt'] = $scheduledAt; + + return $this; + } + + /** + * Gets sender + * + * @return string + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param string $sender Sender of the SMS Campaign + * + * @return $this + */ + public function setSender($sender) + { + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets modifiedAt + * + * @return \DateTime + */ + public function getModifiedAt() + { + return $this->container['modifiedAt']; + } + + /** + * Sets modifiedAt + * + * @param \DateTime $modifiedAt UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setModifiedAt($modifiedAt) + { + $this->container['modifiedAt'] = $modifiedAt; + + return $this; + } + + /** + * Gets recipients + * + * @return object + */ + public function getRecipients() + { + return $this->container['recipients']; + } + + /** + * Sets recipients + * + * @param object $recipients recipients + * + * @return $this + */ + public function setRecipients($recipients) + { + $this->container['recipients'] = $recipients; + + return $this; + } + + /** + * Gets statistics + * + * @return object + */ + public function getStatistics() + { + return $this->container['statistics']; + } + + /** + * Sets statistics + * + * @param object $statistics statistics + * + * @return $this + */ + public function setStatistics($statistics) + { + $this->container['statistics'] = $statistics; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsCampaignOverview.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsCampaignOverview.php new file mode 100644 index 0000000..308bd53 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsCampaignOverview.php @@ -0,0 +1,604 @@ + 'int', + 'name' => 'string', + 'status' => 'string', + 'content' => 'string', + 'scheduledAt' => '\DateTime', + 'sender' => 'string', + 'createdAt' => '\DateTime', + 'modifiedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'status' => null, + 'content' => null, + 'scheduledAt' => 'date-time', + 'sender' => null, + 'createdAt' => 'date-time', + 'modifiedAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'status' => 'status', + 'content' => 'content', + 'scheduledAt' => 'scheduledAt', + 'sender' => 'sender', + 'createdAt' => 'createdAt', + 'modifiedAt' => 'modifiedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'status' => 'setStatus', + 'content' => 'setContent', + 'scheduledAt' => 'setScheduledAt', + 'sender' => 'setSender', + 'createdAt' => 'setCreatedAt', + 'modifiedAt' => 'setModifiedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'status' => 'getStatus', + 'content' => 'getContent', + 'scheduledAt' => 'getScheduledAt', + 'sender' => 'getSender', + 'createdAt' => 'getCreatedAt', + 'modifiedAt' => 'getModifiedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const STATUS_DRAFT = 'draft'; + const STATUS_SENT = 'sent'; + const STATUS_ARCHIVE = 'archive'; + const STATUS_QUEUED = 'queued'; + const STATUS_SUSPENDED = 'suspended'; + const STATUS_IN_PROCESS = 'inProcess'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_DRAFT, + self::STATUS_SENT, + self::STATUS_ARCHIVE, + self::STATUS_QUEUED, + self::STATUS_SUSPENDED, + self::STATUS_IN_PROCESS, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['content'] = isset($data['content']) ? $data['content'] : null; + $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null; + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['content'] === null) { + $invalidProperties[] = "'content' can't be null"; + } + if ($this->container['scheduledAt'] === null) { + $invalidProperties[] = "'scheduledAt' can't be null"; + } + if ($this->container['sender'] === null) { + $invalidProperties[] = "'sender' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['modifiedAt'] === null) { + $invalidProperties[] = "'modifiedAt' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + if ($this->container['name'] === null) { + return false; + } + if ($this->container['status'] === null) { + return false; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + return false; + } + if ($this->container['content'] === null) { + return false; + } + if ($this->container['scheduledAt'] === null) { + return false; + } + if ($this->container['sender'] === null) { + return false; + } + if ($this->container['createdAt'] === null) { + return false; + } + if ($this->container['modifiedAt'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the SMS Campaign + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the SMS Campaign + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Status of the SMS Campaign + * + * @return $this + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content Content of the SMS Campaign + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets scheduledAt + * + * @return \DateTime + */ + public function getScheduledAt() + { + return $this->container['scheduledAt']; + } + + /** + * Sets scheduledAt + * + * @param \DateTime $scheduledAt UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format + * + * @return $this + */ + public function setScheduledAt($scheduledAt) + { + $this->container['scheduledAt'] = $scheduledAt; + + return $this; + } + + /** + * Gets sender + * + * @return string + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param string $sender Sender of the SMS Campaign + * + * @return $this + */ + public function setSender($sender) + { + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets modifiedAt + * + * @return \DateTime + */ + public function getModifiedAt() + { + return $this->container['modifiedAt']; + } + + /** + * Sets modifiedAt + * + * @param \DateTime $modifiedAt UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setModifiedAt($modifiedAt) + { + $this->container['modifiedAt'] = $modifiedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsCampaignStats.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsCampaignStats.php new file mode 100644 index 0000000..3b8f81e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsCampaignStats.php @@ -0,0 +1,524 @@ + 'int', + 'sent' => 'int', + 'processing' => 'int', + 'softBounces' => 'int', + 'hardBounces' => 'int', + 'unsubscriptions' => 'int', + 'answered' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'delivered' => 'int64', + 'sent' => 'int64', + 'processing' => 'int64', + 'softBounces' => 'int64', + 'hardBounces' => 'int64', + 'unsubscriptions' => 'int64', + 'answered' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'delivered' => 'delivered', + 'sent' => 'sent', + 'processing' => 'processing', + 'softBounces' => 'softBounces', + 'hardBounces' => 'hardBounces', + 'unsubscriptions' => 'unsubscriptions', + 'answered' => 'answered' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'delivered' => 'setDelivered', + 'sent' => 'setSent', + 'processing' => 'setProcessing', + 'softBounces' => 'setSoftBounces', + 'hardBounces' => 'setHardBounces', + 'unsubscriptions' => 'setUnsubscriptions', + 'answered' => 'setAnswered' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'delivered' => 'getDelivered', + 'sent' => 'getSent', + 'processing' => 'getProcessing', + 'softBounces' => 'getSoftBounces', + 'hardBounces' => 'getHardBounces', + 'unsubscriptions' => 'getUnsubscriptions', + 'answered' => 'getAnswered' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null; + $this->container['sent'] = isset($data['sent']) ? $data['sent'] : null; + $this->container['processing'] = isset($data['processing']) ? $data['processing'] : null; + $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null; + $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null; + $this->container['unsubscriptions'] = isset($data['unsubscriptions']) ? $data['unsubscriptions'] : null; + $this->container['answered'] = isset($data['answered']) ? $data['answered'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['delivered'] === null) { + $invalidProperties[] = "'delivered' can't be null"; + } + if ($this->container['sent'] === null) { + $invalidProperties[] = "'sent' can't be null"; + } + if ($this->container['processing'] === null) { + $invalidProperties[] = "'processing' can't be null"; + } + if ($this->container['softBounces'] === null) { + $invalidProperties[] = "'softBounces' can't be null"; + } + if ($this->container['hardBounces'] === null) { + $invalidProperties[] = "'hardBounces' can't be null"; + } + if ($this->container['unsubscriptions'] === null) { + $invalidProperties[] = "'unsubscriptions' can't be null"; + } + if ($this->container['answered'] === null) { + $invalidProperties[] = "'answered' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['delivered'] === null) { + return false; + } + if ($this->container['sent'] === null) { + return false; + } + if ($this->container['processing'] === null) { + return false; + } + if ($this->container['softBounces'] === null) { + return false; + } + if ($this->container['hardBounces'] === null) { + return false; + } + if ($this->container['unsubscriptions'] === null) { + return false; + } + if ($this->container['answered'] === null) { + return false; + } + return true; + } + + + /** + * Gets delivered + * + * @return int + */ + public function getDelivered() + { + return $this->container['delivered']; + } + + /** + * Sets delivered + * + * @param int $delivered Number of delivered SMS + * + * @return $this + */ + public function setDelivered($delivered) + { + $this->container['delivered'] = $delivered; + + return $this; + } + + /** + * Gets sent + * + * @return int + */ + public function getSent() + { + return $this->container['sent']; + } + + /** + * Sets sent + * + * @param int $sent Number of sent SMS + * + * @return $this + */ + public function setSent($sent) + { + $this->container['sent'] = $sent; + + return $this; + } + + /** + * Gets processing + * + * @return int + */ + public function getProcessing() + { + return $this->container['processing']; + } + + /** + * Sets processing + * + * @param int $processing Number of processing SMS + * + * @return $this + */ + public function setProcessing($processing) + { + $this->container['processing'] = $processing; + + return $this; + } + + /** + * Gets softBounces + * + * @return int + */ + public function getSoftBounces() + { + return $this->container['softBounces']; + } + + /** + * Sets softBounces + * + * @param int $softBounces Number of softbounced SMS + * + * @return $this + */ + public function setSoftBounces($softBounces) + { + $this->container['softBounces'] = $softBounces; + + return $this; + } + + /** + * Gets hardBounces + * + * @return int + */ + public function getHardBounces() + { + return $this->container['hardBounces']; + } + + /** + * Sets hardBounces + * + * @param int $hardBounces Number of hardbounced SMS + * + * @return $this + */ + public function setHardBounces($hardBounces) + { + $this->container['hardBounces'] = $hardBounces; + + return $this; + } + + /** + * Gets unsubscriptions + * + * @return int + */ + public function getUnsubscriptions() + { + return $this->container['unsubscriptions']; + } + + /** + * Sets unsubscriptions + * + * @param int $unsubscriptions Number of unsubscription SMS + * + * @return $this + */ + public function setUnsubscriptions($unsubscriptions) + { + $this->container['unsubscriptions'] = $unsubscriptions; + + return $this; + } + + /** + * Gets answered + * + * @return int + */ + public function getAnswered() + { + return $this->container['answered']; + } + + /** + * Sets answered + * + * @param int $answered Number of replies to the SMS + * + * @return $this + */ + public function setAnswered($answered) + { + $this->container['answered'] = $answered; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsCampaigns.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsCampaigns.php new file mode 100644 index 0000000..8e1fb95 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsCampaigns.php @@ -0,0 +1,338 @@ + 'object[]', + 'count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'campaigns' => null, + 'count' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'campaigns' => 'campaigns', + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'campaigns' => 'setCampaigns', + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'campaigns' => 'getCampaigns', + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['campaigns'] = isset($data['campaigns']) ? $data['campaigns'] : null; + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['count'] === null) { + return false; + } + return true; + } + + + /** + * Gets campaigns + * + * @return object[] + */ + public function getCampaigns() + { + return $this->container['campaigns']; + } + + /** + * Sets campaigns + * + * @param object[] $campaigns campaigns + * + * @return $this + */ + public function setCampaigns($campaigns) + { + $this->container['campaigns'] = $campaigns; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Number of SMS campaigns retrieved + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsEventReport.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsEventReport.php new file mode 100644 index 0000000..4fc3fe4 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsEventReport.php @@ -0,0 +1,302 @@ + '\SendinBlue\Client\Model\GetSmsEventReportEvents[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'events' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'events' => 'events' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'events' => 'setEvents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'events' => 'getEvents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['events'] = isset($data['events']) ? $data['events'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets events + * + * @return \SendinBlue\Client\Model\GetSmsEventReportEvents[] + */ + public function getEvents() + { + return $this->container['events']; + } + + /** + * Sets events + * + * @param \SendinBlue\Client\Model\GetSmsEventReportEvents[] $events events + * + * @return $this + */ + public function setEvents($events) + { + $this->container['events'] = $events; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsEventReportEvents.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsEventReportEvents.php new file mode 100644 index 0000000..d939e56 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmsEventReportEvents.php @@ -0,0 +1,556 @@ + 'string', + 'date' => '\DateTime', + 'messageId' => 'string', + 'event' => 'string', + 'reason' => 'string', + 'reply' => 'string', + 'tag' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'phoneNumber' => null, + 'date' => 'date-time', + 'messageId' => null, + 'event' => null, + 'reason' => null, + 'reply' => null, + 'tag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'phoneNumber' => 'phoneNumber', + 'date' => 'date', + 'messageId' => 'messageId', + 'event' => 'event', + 'reason' => 'reason', + 'reply' => 'reply', + 'tag' => 'tag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'phoneNumber' => 'setPhoneNumber', + 'date' => 'setDate', + 'messageId' => 'setMessageId', + 'event' => 'setEvent', + 'reason' => 'setReason', + 'reply' => 'setReply', + 'tag' => 'setTag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'phoneNumber' => 'getPhoneNumber', + 'date' => 'getDate', + 'messageId' => 'getMessageId', + 'event' => 'getEvent', + 'reason' => 'getReason', + 'reply' => 'getReply', + 'tag' => 'getTag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const EVENT_BOUNCES = 'bounces'; + const EVENT_HARD_BOUNCES = 'hardBounces'; + const EVENT_SOFT_BOUNCES = 'softBounces'; + const EVENT_DELIVERED = 'delivered'; + const EVENT_SENT = 'sent'; + const EVENT_ACCEPTED = 'accepted'; + const EVENT_UNSUBSCRIPTION = 'unsubscription'; + const EVENT_REPLIES = 'replies'; + const EVENT_BLOCKED = 'blocked'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEventAllowableValues() + { + return [ + self::EVENT_BOUNCES, + self::EVENT_HARD_BOUNCES, + self::EVENT_SOFT_BOUNCES, + self::EVENT_DELIVERED, + self::EVENT_SENT, + self::EVENT_ACCEPTED, + self::EVENT_UNSUBSCRIPTION, + self::EVENT_REPLIES, + self::EVENT_BLOCKED, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['phoneNumber'] = isset($data['phoneNumber']) ? $data['phoneNumber'] : null; + $this->container['date'] = isset($data['date']) ? $data['date'] : null; + $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null; + $this->container['event'] = isset($data['event']) ? $data['event'] : null; + $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; + $this->container['reply'] = isset($data['reply']) ? $data['reply'] : null; + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['phoneNumber'] === null) { + $invalidProperties[] = "'phoneNumber' can't be null"; + } + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if ($this->container['messageId'] === null) { + $invalidProperties[] = "'messageId' can't be null"; + } + if ($this->container['event'] === null) { + $invalidProperties[] = "'event' can't be null"; + } + $allowedValues = $this->getEventAllowableValues(); + if (!in_array($this->container['event'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'event', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['phoneNumber'] === null) { + return false; + } + if ($this->container['date'] === null) { + return false; + } + if ($this->container['messageId'] === null) { + return false; + } + if ($this->container['event'] === null) { + return false; + } + $allowedValues = $this->getEventAllowableValues(); + if (!in_array($this->container['event'], $allowedValues)) { + return false; + } + return true; + } + + + /** + * Gets phoneNumber + * + * @return string + */ + public function getPhoneNumber() + { + return $this->container['phoneNumber']; + } + + /** + * Sets phoneNumber + * + * @param string $phoneNumber Phone number which has generated the event + * + * @return $this + */ + public function setPhoneNumber($phoneNumber) + { + $this->container['phoneNumber'] = $phoneNumber; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime $date UTC date-time on which the event has been generated + * + * @return $this + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets messageId + * + * @return string + */ + public function getMessageId() + { + return $this->container['messageId']; + } + + /** + * Sets messageId + * + * @param string $messageId Message ID which generated the event + * + * @return $this + */ + public function setMessageId($messageId) + { + $this->container['messageId'] = $messageId; + + return $this; + } + + /** + * Gets event + * + * @return string + */ + public function getEvent() + { + return $this->container['event']; + } + + /** + * Sets event + * + * @param string $event Event which occurred + * + * @return $this + */ + public function setEvent($event) + { + $allowedValues = $this->getEventAllowableValues(); + if (!in_array($event, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'event', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['event'] = $event; + + return $this; + } + + /** + * Gets reason + * + * @return string + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string $reason Reason of bounce (only available if the event is hardbounce or softbounce) + * + * @return $this + */ + public function setReason($reason) + { + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets reply + * + * @return string + */ + public function getReply() + { + return $this->container['reply']; + } + + /** + * Sets reply + * + * @param string $reply reply + * + * @return $this + */ + public function setReply($reply) + { + $this->container['reply'] = $reply; + + return $this; + } + + /** + * Gets tag + * + * @return string + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string $tag Tag of the SMS which generated the event + * + * @return $this + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmtpTemplateOverview.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmtpTemplateOverview.php new file mode 100644 index 0000000..fc119b0 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmtpTemplateOverview.php @@ -0,0 +1,704 @@ + 'int', + 'name' => 'string', + 'subject' => 'string', + 'isActive' => 'bool', + 'testSent' => 'bool', + 'sender' => '\SendinBlue\Client\Model\GetSmtpTemplateOverviewSender', + 'replyTo' => 'string', + 'toField' => 'string', + 'tag' => 'string', + 'htmlContent' => 'string', + 'createdAt' => '\DateTime', + 'modifiedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'subject' => null, + 'isActive' => null, + 'testSent' => null, + 'sender' => null, + 'replyTo' => 'email', + 'toField' => null, + 'tag' => null, + 'htmlContent' => null, + 'createdAt' => 'date-time', + 'modifiedAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'subject' => 'subject', + 'isActive' => 'isActive', + 'testSent' => 'testSent', + 'sender' => 'sender', + 'replyTo' => 'replyTo', + 'toField' => 'toField', + 'tag' => 'tag', + 'htmlContent' => 'htmlContent', + 'createdAt' => 'createdAt', + 'modifiedAt' => 'modifiedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'subject' => 'setSubject', + 'isActive' => 'setIsActive', + 'testSent' => 'setTestSent', + 'sender' => 'setSender', + 'replyTo' => 'setReplyTo', + 'toField' => 'setToField', + 'tag' => 'setTag', + 'htmlContent' => 'setHtmlContent', + 'createdAt' => 'setCreatedAt', + 'modifiedAt' => 'setModifiedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'subject' => 'getSubject', + 'isActive' => 'getIsActive', + 'testSent' => 'getTestSent', + 'sender' => 'getSender', + 'replyTo' => 'getReplyTo', + 'toField' => 'getToField', + 'tag' => 'getTag', + 'htmlContent' => 'getHtmlContent', + 'createdAt' => 'getCreatedAt', + 'modifiedAt' => 'getModifiedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['isActive'] = isset($data['isActive']) ? $data['isActive'] : null; + $this->container['testSent'] = isset($data['testSent']) ? $data['testSent'] : null; + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null; + $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null; + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['subject'] === null) { + $invalidProperties[] = "'subject' can't be null"; + } + if ($this->container['isActive'] === null) { + $invalidProperties[] = "'isActive' can't be null"; + } + if ($this->container['testSent'] === null) { + $invalidProperties[] = "'testSent' can't be null"; + } + if ($this->container['sender'] === null) { + $invalidProperties[] = "'sender' can't be null"; + } + if ($this->container['replyTo'] === null) { + $invalidProperties[] = "'replyTo' can't be null"; + } + if ($this->container['toField'] === null) { + $invalidProperties[] = "'toField' can't be null"; + } + if ($this->container['tag'] === null) { + $invalidProperties[] = "'tag' can't be null"; + } + if ($this->container['htmlContent'] === null) { + $invalidProperties[] = "'htmlContent' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['modifiedAt'] === null) { + $invalidProperties[] = "'modifiedAt' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['id'] === null) { + return false; + } + if ($this->container['name'] === null) { + return false; + } + if ($this->container['subject'] === null) { + return false; + } + if ($this->container['isActive'] === null) { + return false; + } + if ($this->container['testSent'] === null) { + return false; + } + if ($this->container['sender'] === null) { + return false; + } + if ($this->container['replyTo'] === null) { + return false; + } + if ($this->container['toField'] === null) { + return false; + } + if ($this->container['tag'] === null) { + return false; + } + if ($this->container['htmlContent'] === null) { + return false; + } + if ($this->container['createdAt'] === null) { + return false; + } + if ($this->container['modifiedAt'] === null) { + return false; + } + return true; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the template + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the template + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Subject of the template + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets isActive + * + * @return bool + */ + public function getIsActive() + { + return $this->container['isActive']; + } + + /** + * Sets isActive + * + * @param bool $isActive Status of template (true=active, false=inactive) + * + * @return $this + */ + public function setIsActive($isActive) + { + $this->container['isActive'] = $isActive; + + return $this; + } + + /** + * Gets testSent + * + * @return bool + */ + public function getTestSent() + { + return $this->container['testSent']; + } + + /** + * Sets testSent + * + * @param bool $testSent Status of test sending for the template (true=test email has been sent, false=test email has not been sent) + * + * @return $this + */ + public function setTestSent($testSent) + { + $this->container['testSent'] = $testSent; + + return $this; + } + + /** + * Gets sender + * + * @return \SendinBlue\Client\Model\GetSmtpTemplateOverviewSender + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param \SendinBlue\Client\Model\GetSmtpTemplateOverviewSender $sender sender + * + * @return $this + */ + public function setSender($sender) + { + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets replyTo + * + * @return string + */ + public function getReplyTo() + { + return $this->container['replyTo']; + } + + /** + * Sets replyTo + * + * @param string $replyTo Email defined as the \"Reply to\" for the template + * + * @return $this + */ + public function setReplyTo($replyTo) + { + $this->container['replyTo'] = $replyTo; + + return $this; + } + + /** + * Gets toField + * + * @return string + */ + public function getToField() + { + return $this->container['toField']; + } + + /** + * Sets toField + * + * @param string $toField Customisation of the \"to\" field for the template + * + * @return $this + */ + public function setToField($toField) + { + $this->container['toField'] = $toField; + + return $this; + } + + /** + * Gets tag + * + * @return string + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string $tag Tag of the template + * + * @return $this + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets htmlContent + * + * @return string + */ + public function getHtmlContent() + { + return $this->container['htmlContent']; + } + + /** + * Sets htmlContent + * + * @param string $htmlContent HTML content of the template + * + * @return $this + */ + public function setHtmlContent($htmlContent) + { + $this->container['htmlContent'] = $htmlContent; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets modifiedAt + * + * @return \DateTime + */ + public function getModifiedAt() + { + return $this->container['modifiedAt']; + } + + /** + * Sets modifiedAt + * + * @param \DateTime $modifiedAt Last modification UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setModifiedAt($modifiedAt) + { + $this->container['modifiedAt'] = $modifiedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmtpTemplateOverviewSender.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmtpTemplateOverviewSender.php new file mode 100644 index 0000000..7ae6e3f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmtpTemplateOverviewSender.php @@ -0,0 +1,332 @@ + 'string', + 'email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'email' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name From email for the template + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email From email for the template + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmtpTemplates.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmtpTemplates.php new file mode 100644 index 0000000..98d2324 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSmtpTemplates.php @@ -0,0 +1,332 @@ + 'int', + 'templates' => '\SendinBlue\Client\Model\GetSmtpTemplateOverview[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'count' => 'int64', + 'templates' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'templates' => 'templates' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'templates' => 'setTemplates' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'templates' => 'getTemplates' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + $this->container['templates'] = isset($data['templates']) ? $data['templates'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Count of smtp templates + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets templates + * + * @return \SendinBlue\Client\Model\GetSmtpTemplateOverview[] + */ + public function getTemplates() + { + return $this->container['templates']; + } + + /** + * Sets templates + * + * @param \SendinBlue\Client\Model\GetSmtpTemplateOverview[] $templates templates + * + * @return $this + */ + public function setTemplates($templates) + { + $this->container['templates'] = $templates; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSsoToken.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSsoToken.php new file mode 100644 index 0000000..fccdb85 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetSsoToken.php @@ -0,0 +1,308 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'token' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'token' => 'token' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'token' => 'setToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'token' => 'getToken' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['token'] = isset($data['token']) ? $data['token'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['token'] === null) { + $invalidProperties[] = "'token' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['token'] === null) { + return false; + } + return true; + } + + + /** + * Gets token + * + * @return string + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param string $token Session token. It will remain valid for a short period of time only. + * + * @return $this + */ + public function setToken($token) + { + $this->container['token'] = $token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetStatsByDomain.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetStatsByDomain.php new file mode 100644 index 0000000..cedf4f0 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetStatsByDomain.php @@ -0,0 +1,280 @@ +container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetTransacAggregatedSmsReport.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetTransacAggregatedSmsReport.php new file mode 100644 index 0000000..57bb501 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetTransacAggregatedSmsReport.php @@ -0,0 +1,632 @@ + 'string', + 'requests' => 'int', + 'delivered' => 'int', + 'hardBounces' => 'int', + 'softBounces' => 'int', + 'blocked' => 'int', + 'unsubscribed' => 'int', + 'replied' => 'int', + 'accepted' => 'int', + 'rejected' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'range' => null, + 'requests' => 'int64', + 'delivered' => 'int64', + 'hardBounces' => 'int64', + 'softBounces' => 'int64', + 'blocked' => 'int64', + 'unsubscribed' => 'int64', + 'replied' => 'int64', + 'accepted' => 'int64', + 'rejected' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'range' => 'range', + 'requests' => 'requests', + 'delivered' => 'delivered', + 'hardBounces' => 'hardBounces', + 'softBounces' => 'softBounces', + 'blocked' => 'blocked', + 'unsubscribed' => 'unsubscribed', + 'replied' => 'replied', + 'accepted' => 'accepted', + 'rejected' => 'rejected' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'range' => 'setRange', + 'requests' => 'setRequests', + 'delivered' => 'setDelivered', + 'hardBounces' => 'setHardBounces', + 'softBounces' => 'setSoftBounces', + 'blocked' => 'setBlocked', + 'unsubscribed' => 'setUnsubscribed', + 'replied' => 'setReplied', + 'accepted' => 'setAccepted', + 'rejected' => 'setRejected' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'range' => 'getRange', + 'requests' => 'getRequests', + 'delivered' => 'getDelivered', + 'hardBounces' => 'getHardBounces', + 'softBounces' => 'getSoftBounces', + 'blocked' => 'getBlocked', + 'unsubscribed' => 'getUnsubscribed', + 'replied' => 'getReplied', + 'accepted' => 'getAccepted', + 'rejected' => 'getRejected' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['range'] = isset($data['range']) ? $data['range'] : null; + $this->container['requests'] = isset($data['requests']) ? $data['requests'] : null; + $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null; + $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null; + $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null; + $this->container['blocked'] = isset($data['blocked']) ? $data['blocked'] : null; + $this->container['unsubscribed'] = isset($data['unsubscribed']) ? $data['unsubscribed'] : null; + $this->container['replied'] = isset($data['replied']) ? $data['replied'] : null; + $this->container['accepted'] = isset($data['accepted']) ? $data['accepted'] : null; + $this->container['rejected'] = isset($data['rejected']) ? $data['rejected'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['range'] === null) { + $invalidProperties[] = "'range' can't be null"; + } + if ($this->container['requests'] === null) { + $invalidProperties[] = "'requests' can't be null"; + } + if ($this->container['delivered'] === null) { + $invalidProperties[] = "'delivered' can't be null"; + } + if ($this->container['hardBounces'] === null) { + $invalidProperties[] = "'hardBounces' can't be null"; + } + if ($this->container['softBounces'] === null) { + $invalidProperties[] = "'softBounces' can't be null"; + } + if ($this->container['blocked'] === null) { + $invalidProperties[] = "'blocked' can't be null"; + } + if ($this->container['unsubscribed'] === null) { + $invalidProperties[] = "'unsubscribed' can't be null"; + } + if ($this->container['replied'] === null) { + $invalidProperties[] = "'replied' can't be null"; + } + if ($this->container['accepted'] === null) { + $invalidProperties[] = "'accepted' can't be null"; + } + if ($this->container['rejected'] === null) { + $invalidProperties[] = "'rejected' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['range'] === null) { + return false; + } + if ($this->container['requests'] === null) { + return false; + } + if ($this->container['delivered'] === null) { + return false; + } + if ($this->container['hardBounces'] === null) { + return false; + } + if ($this->container['softBounces'] === null) { + return false; + } + if ($this->container['blocked'] === null) { + return false; + } + if ($this->container['unsubscribed'] === null) { + return false; + } + if ($this->container['replied'] === null) { + return false; + } + if ($this->container['accepted'] === null) { + return false; + } + if ($this->container['rejected'] === null) { + return false; + } + return true; + } + + + /** + * Gets range + * + * @return string + */ + public function getRange() + { + return $this->container['range']; + } + + /** + * Sets range + * + * @param string $range Time frame of the report + * + * @return $this + */ + public function setRange($range) + { + $this->container['range'] = $range; + + return $this; + } + + /** + * Gets requests + * + * @return int + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param int $requests Number of requests for the timeframe + * + * @return $this + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + + /** + * Gets delivered + * + * @return int + */ + public function getDelivered() + { + return $this->container['delivered']; + } + + /** + * Sets delivered + * + * @param int $delivered Number of delivered SMS for the timeframe + * + * @return $this + */ + public function setDelivered($delivered) + { + $this->container['delivered'] = $delivered; + + return $this; + } + + /** + * Gets hardBounces + * + * @return int + */ + public function getHardBounces() + { + return $this->container['hardBounces']; + } + + /** + * Sets hardBounces + * + * @param int $hardBounces Number of hardbounces for the timeframe + * + * @return $this + */ + public function setHardBounces($hardBounces) + { + $this->container['hardBounces'] = $hardBounces; + + return $this; + } + + /** + * Gets softBounces + * + * @return int + */ + public function getSoftBounces() + { + return $this->container['softBounces']; + } + + /** + * Sets softBounces + * + * @param int $softBounces Number of softbounces for the timeframe + * + * @return $this + */ + public function setSoftBounces($softBounces) + { + $this->container['softBounces'] = $softBounces; + + return $this; + } + + /** + * Gets blocked + * + * @return int + */ + public function getBlocked() + { + return $this->container['blocked']; + } + + /** + * Sets blocked + * + * @param int $blocked Number of blocked contact for the timeframe + * + * @return $this + */ + public function setBlocked($blocked) + { + $this->container['blocked'] = $blocked; + + return $this; + } + + /** + * Gets unsubscribed + * + * @return int + */ + public function getUnsubscribed() + { + return $this->container['unsubscribed']; + } + + /** + * Sets unsubscribed + * + * @param int $unsubscribed Number of unsubscription for the timeframe + * + * @return $this + */ + public function setUnsubscribed($unsubscribed) + { + $this->container['unsubscribed'] = $unsubscribed; + + return $this; + } + + /** + * Gets replied + * + * @return int + */ + public function getReplied() + { + return $this->container['replied']; + } + + /** + * Sets replied + * + * @param int $replied Number of answered SMS for the timeframe + * + * @return $this + */ + public function setReplied($replied) + { + $this->container['replied'] = $replied; + + return $this; + } + + /** + * Gets accepted + * + * @return int + */ + public function getAccepted() + { + return $this->container['accepted']; + } + + /** + * Sets accepted + * + * @param int $accepted Number of accepted for the timeframe + * + * @return $this + */ + public function setAccepted($accepted) + { + $this->container['accepted'] = $accepted; + + return $this; + } + + /** + * Gets rejected + * + * @return int + */ + public function getRejected() + { + return $this->container['rejected']; + } + + /** + * Sets rejected + * + * @param int $rejected Number of rejected for the timeframe + * + * @return $this + */ + public function setRejected($rejected) + { + $this->container['rejected'] = $rejected; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetTransacSmsReport.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetTransacSmsReport.php new file mode 100644 index 0000000..8de91a6 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetTransacSmsReport.php @@ -0,0 +1,302 @@ + '\SendinBlue\Client\Model\GetTransacSmsReportReports[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'reports' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'reports' => 'reports' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'reports' => 'setReports' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'reports' => 'getReports' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['reports'] = isset($data['reports']) ? $data['reports'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets reports + * + * @return \SendinBlue\Client\Model\GetTransacSmsReportReports[] + */ + public function getReports() + { + return $this->container['reports']; + } + + /** + * Sets reports + * + * @param \SendinBlue\Client\Model\GetTransacSmsReportReports[] $reports reports + * + * @return $this + */ + public function setReports($reports) + { + $this->container['reports'] = $reports; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetTransacSmsReportReports.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetTransacSmsReportReports.php new file mode 100644 index 0000000..232e1e8 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetTransacSmsReportReports.php @@ -0,0 +1,632 @@ + '\DateTime', + 'requests' => 'int', + 'delivered' => 'int', + 'hardBounces' => 'int', + 'softBounces' => 'int', + 'blocked' => 'int', + 'unsubscribed' => 'int', + 'replied' => 'int', + 'accepted' => 'int', + 'rejected' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'date' => 'date', + 'requests' => 'int64', + 'delivered' => 'int64', + 'hardBounces' => 'int64', + 'softBounces' => 'int64', + 'blocked' => 'int64', + 'unsubscribed' => 'int64', + 'replied' => 'int64', + 'accepted' => 'int64', + 'rejected' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'date' => 'date', + 'requests' => 'requests', + 'delivered' => 'delivered', + 'hardBounces' => 'hardBounces', + 'softBounces' => 'softBounces', + 'blocked' => 'blocked', + 'unsubscribed' => 'unsubscribed', + 'replied' => 'replied', + 'accepted' => 'accepted', + 'rejected' => 'rejected' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date' => 'setDate', + 'requests' => 'setRequests', + 'delivered' => 'setDelivered', + 'hardBounces' => 'setHardBounces', + 'softBounces' => 'setSoftBounces', + 'blocked' => 'setBlocked', + 'unsubscribed' => 'setUnsubscribed', + 'replied' => 'setReplied', + 'accepted' => 'setAccepted', + 'rejected' => 'setRejected' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date' => 'getDate', + 'requests' => 'getRequests', + 'delivered' => 'getDelivered', + 'hardBounces' => 'getHardBounces', + 'softBounces' => 'getSoftBounces', + 'blocked' => 'getBlocked', + 'unsubscribed' => 'getUnsubscribed', + 'replied' => 'getReplied', + 'accepted' => 'getAccepted', + 'rejected' => 'getRejected' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['date'] = isset($data['date']) ? $data['date'] : null; + $this->container['requests'] = isset($data['requests']) ? $data['requests'] : null; + $this->container['delivered'] = isset($data['delivered']) ? $data['delivered'] : null; + $this->container['hardBounces'] = isset($data['hardBounces']) ? $data['hardBounces'] : null; + $this->container['softBounces'] = isset($data['softBounces']) ? $data['softBounces'] : null; + $this->container['blocked'] = isset($data['blocked']) ? $data['blocked'] : null; + $this->container['unsubscribed'] = isset($data['unsubscribed']) ? $data['unsubscribed'] : null; + $this->container['replied'] = isset($data['replied']) ? $data['replied'] : null; + $this->container['accepted'] = isset($data['accepted']) ? $data['accepted'] : null; + $this->container['rejected'] = isset($data['rejected']) ? $data['rejected'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if ($this->container['requests'] === null) { + $invalidProperties[] = "'requests' can't be null"; + } + if ($this->container['delivered'] === null) { + $invalidProperties[] = "'delivered' can't be null"; + } + if ($this->container['hardBounces'] === null) { + $invalidProperties[] = "'hardBounces' can't be null"; + } + if ($this->container['softBounces'] === null) { + $invalidProperties[] = "'softBounces' can't be null"; + } + if ($this->container['blocked'] === null) { + $invalidProperties[] = "'blocked' can't be null"; + } + if ($this->container['unsubscribed'] === null) { + $invalidProperties[] = "'unsubscribed' can't be null"; + } + if ($this->container['replied'] === null) { + $invalidProperties[] = "'replied' can't be null"; + } + if ($this->container['accepted'] === null) { + $invalidProperties[] = "'accepted' can't be null"; + } + if ($this->container['rejected'] === null) { + $invalidProperties[] = "'rejected' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['date'] === null) { + return false; + } + if ($this->container['requests'] === null) { + return false; + } + if ($this->container['delivered'] === null) { + return false; + } + if ($this->container['hardBounces'] === null) { + return false; + } + if ($this->container['softBounces'] === null) { + return false; + } + if ($this->container['blocked'] === null) { + return false; + } + if ($this->container['unsubscribed'] === null) { + return false; + } + if ($this->container['replied'] === null) { + return false; + } + if ($this->container['accepted'] === null) { + return false; + } + if ($this->container['rejected'] === null) { + return false; + } + return true; + } + + + /** + * Gets date + * + * @return \DateTime + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime $date Date for which statistics are retrieved + * + * @return $this + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets requests + * + * @return int + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param int $requests Number of requests for the date + * + * @return $this + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + + /** + * Gets delivered + * + * @return int + */ + public function getDelivered() + { + return $this->container['delivered']; + } + + /** + * Sets delivered + * + * @param int $delivered Number of delivered SMS for the date + * + * @return $this + */ + public function setDelivered($delivered) + { + $this->container['delivered'] = $delivered; + + return $this; + } + + /** + * Gets hardBounces + * + * @return int + */ + public function getHardBounces() + { + return $this->container['hardBounces']; + } + + /** + * Sets hardBounces + * + * @param int $hardBounces Number of hardbounces for the date + * + * @return $this + */ + public function setHardBounces($hardBounces) + { + $this->container['hardBounces'] = $hardBounces; + + return $this; + } + + /** + * Gets softBounces + * + * @return int + */ + public function getSoftBounces() + { + return $this->container['softBounces']; + } + + /** + * Sets softBounces + * + * @param int $softBounces Number of softbounces for the date + * + * @return $this + */ + public function setSoftBounces($softBounces) + { + $this->container['softBounces'] = $softBounces; + + return $this; + } + + /** + * Gets blocked + * + * @return int + */ + public function getBlocked() + { + return $this->container['blocked']; + } + + /** + * Sets blocked + * + * @param int $blocked Number of blocked contact for the date + * + * @return $this + */ + public function setBlocked($blocked) + { + $this->container['blocked'] = $blocked; + + return $this; + } + + /** + * Gets unsubscribed + * + * @return int + */ + public function getUnsubscribed() + { + return $this->container['unsubscribed']; + } + + /** + * Sets unsubscribed + * + * @param int $unsubscribed Number of unsubscription for the date + * + * @return $this + */ + public function setUnsubscribed($unsubscribed) + { + $this->container['unsubscribed'] = $unsubscribed; + + return $this; + } + + /** + * Gets replied + * + * @return int + */ + public function getReplied() + { + return $this->container['replied']; + } + + /** + * Sets replied + * + * @param int $replied Number of answered SMS for the date + * + * @return $this + */ + public function setReplied($replied) + { + $this->container['replied'] = $replied; + + return $this; + } + + /** + * Gets accepted + * + * @return int + */ + public function getAccepted() + { + return $this->container['accepted']; + } + + /** + * Sets accepted + * + * @param int $accepted Number of accepted for the date + * + * @return $this + */ + public function setAccepted($accepted) + { + $this->container['accepted'] = $accepted; + + return $this; + } + + /** + * Gets rejected + * + * @return int + */ + public function getRejected() + { + return $this->container['rejected']; + } + + /** + * Sets rejected + * + * @param int $rejected Number of rejected for the date + * + * @return $this + */ + public function setRejected($rejected) + { + $this->container['rejected'] = $rejected; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetWebhook.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetWebhook.php new file mode 100644 index 0000000..be79919 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetWebhook.php @@ -0,0 +1,560 @@ + 'string', + 'id' => 'int', + 'description' => 'string', + 'events' => 'string[]', + 'type' => 'string', + 'createdAt' => '\DateTime', + 'modifiedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'url' => 'url', + 'id' => 'int64', + 'description' => null, + 'events' => null, + 'type' => null, + 'createdAt' => 'date-time', + 'modifiedAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'url' => 'url', + 'id' => 'id', + 'description' => 'description', + 'events' => 'events', + 'type' => 'type', + 'createdAt' => 'createdAt', + 'modifiedAt' => 'modifiedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'url' => 'setUrl', + 'id' => 'setId', + 'description' => 'setDescription', + 'events' => 'setEvents', + 'type' => 'setType', + 'createdAt' => 'setCreatedAt', + 'modifiedAt' => 'setModifiedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'url' => 'getUrl', + 'id' => 'getId', + 'description' => 'getDescription', + 'events' => 'getEvents', + 'type' => 'getType', + 'createdAt' => 'getCreatedAt', + 'modifiedAt' => 'getModifiedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const TYPE_MARKETING = 'marketing'; + const TYPE_TRANSAC = 'transac'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_MARKETING, + self::TYPE_TRANSAC, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['events'] = isset($data['events']) ? $data['events'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['events'] === null) { + $invalidProperties[] = "'events' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['modifiedAt'] === null) { + $invalidProperties[] = "'modifiedAt' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['url'] === null) { + return false; + } + if ($this->container['id'] === null) { + return false; + } + if ($this->container['description'] === null) { + return false; + } + if ($this->container['events'] === null) { + return false; + } + if ($this->container['type'] === null) { + return false; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + return false; + } + if ($this->container['createdAt'] === null) { + return false; + } + if ($this->container['modifiedAt'] === null) { + return false; + } + return true; + } + + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url URL of the webhook + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the webhook + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description Description of the webhook + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets events + * + * @return string[] + */ + public function getEvents() + { + return $this->container['events']; + } + + /** + * Sets events + * + * @param string[] $events events + * + * @return $this + */ + public function setEvents($events) + { + $this->container['events'] = $events; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of webhook (marketing or transac) + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets modifiedAt + * + * @return \DateTime + */ + public function getModifiedAt() + { + return $this->container['modifiedAt']; + } + + /** + * Sets modifiedAt + * + * @param \DateTime $modifiedAt Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setModifiedAt($modifiedAt) + { + $this->container['modifiedAt'] = $modifiedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetWebhooks.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetWebhooks.php new file mode 100644 index 0000000..302be51 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/GetWebhooks.php @@ -0,0 +1,308 @@ + 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'webhooks' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'webhooks' => 'webhooks' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'webhooks' => 'setWebhooks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'webhooks' => 'getWebhooks' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['webhooks'] = isset($data['webhooks']) ? $data['webhooks'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['webhooks'] === null) { + $invalidProperties[] = "'webhooks' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['webhooks'] === null) { + return false; + } + return true; + } + + + /** + * Gets webhooks + * + * @return object[] + */ + public function getWebhooks() + { + return $this->container['webhooks']; + } + + /** + * Sets webhooks + * + * @param object[] $webhooks webhooks + * + * @return $this + */ + public function setWebhooks($webhooks) + { + $this->container['webhooks'] = $webhooks; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/ManageIp.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/ManageIp.php new file mode 100644 index 0000000..9fc28a7 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/ManageIp.php @@ -0,0 +1,302 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'ip' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ip' => 'ip' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ip' => 'setIp' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ip' => 'getIp' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets ip + * + * @return string + */ + public function getIp() + { + return $this->container['ip']; + } + + /** + * Sets ip + * + * @param string $ip Dedicated ID + * + * @return $this + */ + public function setIp($ip) + { + $this->container['ip'] = $ip; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/ModelInterface.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/ModelInterface.php new file mode 100644 index 0000000..79f6796 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/ModelInterface.php @@ -0,0 +1,96 @@ + '\SendinBlue\Client\Model\PostContactInfoContacts' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'contacts' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'contacts' => 'contacts' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'contacts' => 'setContacts' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'contacts' => 'getContacts' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['contacts'] = isset($data['contacts']) ? $data['contacts'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['contacts'] === null) { + $invalidProperties[] = "'contacts' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['contacts'] === null) { + return false; + } + return true; + } + + + /** + * Gets contacts + * + * @return \SendinBlue\Client\Model\PostContactInfoContacts + */ + public function getContacts() + { + return $this->container['contacts']; + } + + /** + * Sets contacts + * + * @param \SendinBlue\Client\Model\PostContactInfoContacts $contacts contacts + * + * @return $this + */ + public function setContacts($contacts) + { + $this->container['contacts'] = $contacts; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/PostContactInfoContacts.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/PostContactInfoContacts.php new file mode 100644 index 0000000..b6c9a1c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/PostContactInfoContacts.php @@ -0,0 +1,362 @@ + 'string[]', + 'failure' => 'string[]', + 'total' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'success' => 'email', + 'failure' => 'email', + 'total' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'failure' => 'failure', + 'total' => 'total' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'failure' => 'setFailure', + 'total' => 'setTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'failure' => 'getFailure', + 'total' => 'getTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = isset($data['success']) ? $data['success'] : null; + $this->container['failure'] = isset($data['failure']) ? $data['failure'] : null; + $this->container['total'] = isset($data['total']) ? $data['total'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets success + * + * @return string[] + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param string[] $success success + * + * @return $this + */ + public function setSuccess($success) + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets failure + * + * @return string[] + */ + public function getFailure() + { + return $this->container['failure']; + } + + /** + * Sets failure + * + * @param string[] $failure failure + * + * @return $this + */ + public function setFailure($failure) + { + $this->container['failure'] = $failure; + + return $this; + } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int $total Displays the count of total number of contacts removed from list when user opts for \"all\" option. + * + * @return $this + */ + public function setTotal($total) + { + $this->container['total'] = $total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/PostSendFailed.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/PostSendFailed.php new file mode 100644 index 0000000..b0b71f3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/PostSendFailed.php @@ -0,0 +1,434 @@ + 'int', + 'message' => 'string', + 'unexistingEmails' => 'string[]', + 'withoutListEmails' => 'string[]', + 'blackListedEmails' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'code' => 'int64', + 'message' => null, + 'unexistingEmails' => 'email', + 'withoutListEmails' => 'email', + 'blackListedEmails' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'message' => 'message', + 'unexistingEmails' => 'unexistingEmails', + 'withoutListEmails' => 'withoutListEmails', + 'blackListedEmails' => 'blackListedEmails' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage', + 'unexistingEmails' => 'setUnexistingEmails', + 'withoutListEmails' => 'setWithoutListEmails', + 'blackListedEmails' => 'setBlackListedEmails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage', + 'unexistingEmails' => 'getUnexistingEmails', + 'withoutListEmails' => 'getWithoutListEmails', + 'blackListedEmails' => 'getBlackListedEmails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + $this->container['unexistingEmails'] = isset($data['unexistingEmails']) ? $data['unexistingEmails'] : null; + $this->container['withoutListEmails'] = isset($data['withoutListEmails']) ? $data['withoutListEmails'] : null; + $this->container['blackListedEmails'] = isset($data['blackListedEmails']) ? $data['blackListedEmails'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['code'] === null) { + return false; + } + if ($this->container['message'] === null) { + return false; + } + return true; + } + + + /** + * Gets code + * + * @return int + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param int $code Response code + * + * @return $this + */ + public function setCode($code) + { + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message Response message + * + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets unexistingEmails + * + * @return string[] + */ + public function getUnexistingEmails() + { + return $this->container['unexistingEmails']; + } + + /** + * Sets unexistingEmails + * + * @param string[] $unexistingEmails unexistingEmails + * + * @return $this + */ + public function setUnexistingEmails($unexistingEmails) + { + $this->container['unexistingEmails'] = $unexistingEmails; + + return $this; + } + + /** + * Gets withoutListEmails + * + * @return string[] + */ + public function getWithoutListEmails() + { + return $this->container['withoutListEmails']; + } + + /** + * Sets withoutListEmails + * + * @param string[] $withoutListEmails withoutListEmails + * + * @return $this + */ + public function setWithoutListEmails($withoutListEmails) + { + $this->container['withoutListEmails'] = $withoutListEmails; + + return $this; + } + + /** + * Gets blackListedEmails + * + * @return string[] + */ + public function getBlackListedEmails() + { + return $this->container['blackListedEmails']; + } + + /** + * Sets blackListedEmails + * + * @param string[] $blackListedEmails blackListedEmails + * + * @return $this + */ + public function setBlackListedEmails($blackListedEmails) + { + $this->container['blackListedEmails'] = $blackListedEmails; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/PostSendSmsTestFailed.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/PostSendSmsTestFailed.php new file mode 100644 index 0000000..07ed3cc --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/PostSendSmsTestFailed.php @@ -0,0 +1,404 @@ + 'int', + 'message' => 'string', + 'unexistingSms' => 'string[]', + 'withoutListSms' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'code' => 'int64', + 'message' => null, + 'unexistingSms' => 'email', + 'withoutListSms' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'message' => 'message', + 'unexistingSms' => 'unexistingSms', + 'withoutListSms' => 'withoutListSms' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage', + 'unexistingSms' => 'setUnexistingSms', + 'withoutListSms' => 'setWithoutListSms' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage', + 'unexistingSms' => 'getUnexistingSms', + 'withoutListSms' => 'getWithoutListSms' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + $this->container['unexistingSms'] = isset($data['unexistingSms']) ? $data['unexistingSms'] : null; + $this->container['withoutListSms'] = isset($data['withoutListSms']) ? $data['withoutListSms'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['code'] === null) { + return false; + } + if ($this->container['message'] === null) { + return false; + } + return true; + } + + + /** + * Gets code + * + * @return int + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param int $code Response code + * + * @return $this + */ + public function setCode($code) + { + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message Response message + * + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets unexistingSms + * + * @return string[] + */ + public function getUnexistingSms() + { + return $this->container['unexistingSms']; + } + + /** + * Sets unexistingSms + * + * @param string[] $unexistingSms unexistingSms + * + * @return $this + */ + public function setUnexistingSms($unexistingSms) + { + $this->container['unexistingSms'] = $unexistingSms; + + return $this; + } + + /** + * Gets withoutListSms + * + * @return string[] + */ + public function getWithoutListSms() + { + return $this->container['withoutListSms']; + } + + /** + * Sets withoutListSms + * + * @param string[] $withoutListSms withoutListSms + * + * @return $this + */ + public function setWithoutListSms($withoutListSms) + { + $this->container['withoutListSms'] = $withoutListSms; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemainingCreditModel.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemainingCreditModel.php new file mode 100644 index 0000000..95cad1e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemainingCreditModel.php @@ -0,0 +1,344 @@ + '\SendinBlue\Client\Model\RemainingCreditModelChild', + 'reseller' => '\SendinBlue\Client\Model\RemainingCreditModelReseller' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'child' => null, + 'reseller' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'child' => 'child', + 'reseller' => 'reseller' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'child' => 'setChild', + 'reseller' => 'setReseller' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'child' => 'getChild', + 'reseller' => 'getReseller' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['child'] = isset($data['child']) ? $data['child'] : null; + $this->container['reseller'] = isset($data['reseller']) ? $data['reseller'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['child'] === null) { + $invalidProperties[] = "'child' can't be null"; + } + if ($this->container['reseller'] === null) { + $invalidProperties[] = "'reseller' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['child'] === null) { + return false; + } + if ($this->container['reseller'] === null) { + return false; + } + return true; + } + + + /** + * Gets child + * + * @return \SendinBlue\Client\Model\RemainingCreditModelChild + */ + public function getChild() + { + return $this->container['child']; + } + + /** + * Sets child + * + * @param \SendinBlue\Client\Model\RemainingCreditModelChild $child child + * + * @return $this + */ + public function setChild($child) + { + $this->container['child'] = $child; + + return $this; + } + + /** + * Gets reseller + * + * @return \SendinBlue\Client\Model\RemainingCreditModelReseller + */ + public function getReseller() + { + return $this->container['reseller']; + } + + /** + * Sets reseller + * + * @param \SendinBlue\Client\Model\RemainingCreditModelReseller $reseller reseller + * + * @return $this + */ + public function setReseller($reseller) + { + $this->container['reseller'] = $reseller; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemainingCreditModelChild.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemainingCreditModelChild.php new file mode 100644 index 0000000..088bd9a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemainingCreditModelChild.php @@ -0,0 +1,345 @@ + 'int', + 'email' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'sms' => 'int64', + 'email' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sms' => 'sms', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sms' => 'setSms', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sms' => 'getSms', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['sms'] = isset($data['sms']) ? $data['sms'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['sms'] === null) { + $invalidProperties[] = "'sms' can't be null"; + } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['sms'] === null) { + return false; + } + if ($this->container['email'] === null) { + return false; + } + return true; + } + + + /** + * Gets sms + * + * @return int + */ + public function getSms() + { + return $this->container['sms']; + } + + /** + * Sets sms + * + * @param int $sms SMS Credits remaining for child account + * + * @return $this + */ + public function setSms($sms) + { + $this->container['sms'] = $sms; + + return $this; + } + + /** + * Gets email + * + * @return int + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param int $email Email Credits remaining for child account + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemainingCreditModelReseller.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemainingCreditModelReseller.php new file mode 100644 index 0000000..c6398f9 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemainingCreditModelReseller.php @@ -0,0 +1,344 @@ + 'int', + 'email' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'sms' => 'int64', + 'email' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sms' => 'sms', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sms' => 'setSms', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sms' => 'getSms', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['sms'] = isset($data['sms']) ? $data['sms'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['sms'] === null) { + $invalidProperties[] = "'sms' can't be null"; + } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['sms'] === null) { + return false; + } + if ($this->container['email'] === null) { + return false; + } + return true; + } + + + /** + * Gets sms + * + * @return int + */ + public function getSms() + { + return $this->container['sms']; + } + + /** + * Sets sms + * + * @param int $sms SMS Credits remaining for reseller account + * + * @return $this + */ + public function setSms($sms) + { + $this->container['sms'] = $sms; + + return $this; + } + + /** + * Gets email + * + * @return int + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param int $email Email Credits remaining for reseller account + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemoveContactFromList.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemoveContactFromList.php new file mode 100644 index 0000000..017371b --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemoveContactFromList.php @@ -0,0 +1,332 @@ + 'string[]', + 'all' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'emails' => 'email', + 'all' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'emails' => 'emails', + 'all' => 'all' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'emails' => 'setEmails', + 'all' => 'setAll' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'emails' => 'getEmails', + 'all' => 'getAll' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['emails'] = isset($data['emails']) ? $data['emails'] : null; + $this->container['all'] = isset($data['all']) ? $data['all'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets emails + * + * @return string[] + */ + public function getEmails() + { + return $this->container['emails']; + } + + /** + * Sets emails + * + * @param string[] $emails Required if 'all' is false. Emails to remove from a list + * + * @return $this + */ + public function setEmails($emails) + { + $this->container['emails'] = $emails; + + return $this; + } + + /** + * Gets all + * + * @return bool + */ + public function getAll() + { + return $this->container['all']; + } + + /** + * Sets all + * + * @param bool $all Required if 'emails' is empty. Remove all existing contacts from a list + * + * @return $this + */ + public function setAll($all) + { + $this->container['all'] = $all; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemoveCredits.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemoveCredits.php new file mode 100644 index 0000000..9f9aaf9 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RemoveCredits.php @@ -0,0 +1,332 @@ + 'int', + 'email' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'sms' => 'int64', + 'email' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sms' => 'sms', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sms' => 'setSms', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sms' => 'getSms', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['sms'] = isset($data['sms']) ? $data['sms'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets sms + * + * @return int + */ + public function getSms() + { + return $this->container['sms']; + } + + /** + * Sets sms + * + * @param int $sms Required if email credits are empty. SMS credits to be removed from the child account + * + * @return $this + */ + public function setSms($sms) + { + $this->container['sms'] = $sms; + + return $this; + } + + /** + * Gets email + * + * @return int + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param int $email Required if sms credits are empty. Email credits to be removed from the child account + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RequestContactExport.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RequestContactExport.php new file mode 100644 index 0000000..42d86ae --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RequestContactExport.php @@ -0,0 +1,368 @@ + 'string[]', + 'contactFilter' => 'object', + 'notifyUrl' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'exportAttributes' => null, + 'contactFilter' => null, + 'notifyUrl' => 'url' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'exportAttributes' => 'exportAttributes', + 'contactFilter' => 'contactFilter', + 'notifyUrl' => 'notifyUrl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'exportAttributes' => 'setExportAttributes', + 'contactFilter' => 'setContactFilter', + 'notifyUrl' => 'setNotifyUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'exportAttributes' => 'getExportAttributes', + 'contactFilter' => 'getContactFilter', + 'notifyUrl' => 'getNotifyUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['exportAttributes'] = isset($data['exportAttributes']) ? $data['exportAttributes'] : null; + $this->container['contactFilter'] = isset($data['contactFilter']) ? $data['contactFilter'] : null; + $this->container['notifyUrl'] = isset($data['notifyUrl']) ? $data['notifyUrl'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['contactFilter'] === null) { + $invalidProperties[] = "'contactFilter' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['contactFilter'] === null) { + return false; + } + return true; + } + + + /** + * Gets exportAttributes + * + * @return string[] + */ + public function getExportAttributes() + { + return $this->container['exportAttributes']; + } + + /** + * Sets exportAttributes + * + * @param string[] $exportAttributes List of all the attributes that you want to export. These attributes must be present in your contact database. For example, ['fname', 'lname', 'email']. + * + * @return $this + */ + public function setExportAttributes($exportAttributes) + { + $this->container['exportAttributes'] = $exportAttributes; + + return $this; + } + + /** + * Gets contactFilter + * + * @return object + */ + public function getContactFilter() + { + return $this->container['contactFilter']; + } + + /** + * Sets contactFilter + * + * @param object $contactFilter Set the filter for the contacts to be exported. For example, `{\"blacklisted\":true}` will export all the blacklisted contacts. + * + * @return $this + */ + public function setContactFilter($contactFilter) + { + $this->container['contactFilter'] = $contactFilter; + + return $this; + } + + /** + * Gets notifyUrl + * + * @return string + */ + public function getNotifyUrl() + { + return $this->container['notifyUrl']; + } + + /** + * Sets notifyUrl + * + * @param string $notifyUrl Webhook that will be called once the export process is finished + * + * @return $this + */ + public function setNotifyUrl($notifyUrl) + { + $this->container['notifyUrl'] = $notifyUrl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RequestContactImport.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RequestContactImport.php new file mode 100644 index 0000000..b545b75 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RequestContactImport.php @@ -0,0 +1,542 @@ + 'string', + 'fileBody' => 'string', + 'listIds' => 'int[]', + 'notifyUrl' => 'string', + 'newList' => '\SendinBlue\Client\Model\RequestContactImportNewList', + 'emailBlacklist' => 'bool', + 'smsBlacklist' => 'bool', + 'updateExistingContacts' => 'bool', + 'emptyContactsAttributes' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'fileUrl' => 'url', + 'fileBody' => null, + 'listIds' => 'int64', + 'notifyUrl' => 'url', + 'newList' => null, + 'emailBlacklist' => null, + 'smsBlacklist' => null, + 'updateExistingContacts' => null, + 'emptyContactsAttributes' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'fileUrl' => 'fileUrl', + 'fileBody' => 'fileBody', + 'listIds' => 'listIds', + 'notifyUrl' => 'notifyUrl', + 'newList' => 'newList', + 'emailBlacklist' => 'emailBlacklist', + 'smsBlacklist' => 'smsBlacklist', + 'updateExistingContacts' => 'updateExistingContacts', + 'emptyContactsAttributes' => 'emptyContactsAttributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fileUrl' => 'setFileUrl', + 'fileBody' => 'setFileBody', + 'listIds' => 'setListIds', + 'notifyUrl' => 'setNotifyUrl', + 'newList' => 'setNewList', + 'emailBlacklist' => 'setEmailBlacklist', + 'smsBlacklist' => 'setSmsBlacklist', + 'updateExistingContacts' => 'setUpdateExistingContacts', + 'emptyContactsAttributes' => 'setEmptyContactsAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fileUrl' => 'getFileUrl', + 'fileBody' => 'getFileBody', + 'listIds' => 'getListIds', + 'notifyUrl' => 'getNotifyUrl', + 'newList' => 'getNewList', + 'emailBlacklist' => 'getEmailBlacklist', + 'smsBlacklist' => 'getSmsBlacklist', + 'updateExistingContacts' => 'getUpdateExistingContacts', + 'emptyContactsAttributes' => 'getEmptyContactsAttributes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['fileUrl'] = isset($data['fileUrl']) ? $data['fileUrl'] : null; + $this->container['fileBody'] = isset($data['fileBody']) ? $data['fileBody'] : null; + $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null; + $this->container['notifyUrl'] = isset($data['notifyUrl']) ? $data['notifyUrl'] : null; + $this->container['newList'] = isset($data['newList']) ? $data['newList'] : null; + $this->container['emailBlacklist'] = isset($data['emailBlacklist']) ? $data['emailBlacklist'] : false; + $this->container['smsBlacklist'] = isset($data['smsBlacklist']) ? $data['smsBlacklist'] : false; + $this->container['updateExistingContacts'] = isset($data['updateExistingContacts']) ? $data['updateExistingContacts'] : true; + $this->container['emptyContactsAttributes'] = isset($data['emptyContactsAttributes']) ? $data['emptyContactsAttributes'] : false; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets fileUrl + * + * @return string + */ + public function getFileUrl() + { + return $this->container['fileUrl']; + } + + /** + * Sets fileUrl + * + * @param string $fileUrl Mandatory if fileBody is not defined. URL of the file to be imported (no local file). Possible file formats: .txt, .csv + * + * @return $this + */ + public function setFileUrl($fileUrl) + { + $this->container['fileUrl'] = $fileUrl; + + return $this; + } + + /** + * Gets fileBody + * + * @return string + */ + public function getFileBody() + { + return $this->container['fileBody']; + } + + /** + * Sets fileBody + * + * @param string $fileBody Mandatory if fileUrl is not defined. CSV content to be imported. Use semicolon to separate multiple attributes + * + * @return $this + */ + public function setFileBody($fileBody) + { + $this->container['fileBody'] = $fileBody; + + return $this; + } + + /** + * Gets listIds + * + * @return int[] + */ + public function getListIds() + { + return $this->container['listIds']; + } + + /** + * Sets listIds + * + * @param int[] $listIds Mandatory if newList is not defined. Ids of the lists in which the contacts shall be imported. For example, [2, 4, 7]. + * + * @return $this + */ + public function setListIds($listIds) + { + $this->container['listIds'] = $listIds; + + return $this; + } + + /** + * Gets notifyUrl + * + * @return string + */ + public function getNotifyUrl() + { + return $this->container['notifyUrl']; + } + + /** + * Sets notifyUrl + * + * @param string $notifyUrl URL that will be called once the export process is finished + * + * @return $this + */ + public function setNotifyUrl($notifyUrl) + { + $this->container['notifyUrl'] = $notifyUrl; + + return $this; + } + + /** + * Gets newList + * + * @return \SendinBlue\Client\Model\RequestContactImportNewList + */ + public function getNewList() + { + return $this->container['newList']; + } + + /** + * Sets newList + * + * @param \SendinBlue\Client\Model\RequestContactImportNewList $newList newList + * + * @return $this + */ + public function setNewList($newList) + { + $this->container['newList'] = $newList; + + return $this; + } + + /** + * Gets emailBlacklist + * + * @return bool + */ + public function getEmailBlacklist() + { + return $this->container['emailBlacklist']; + } + + /** + * Sets emailBlacklist + * + * @param bool $emailBlacklist To blacklist all the contacts for email + * + * @return $this + */ + public function setEmailBlacklist($emailBlacklist) + { + $this->container['emailBlacklist'] = $emailBlacklist; + + return $this; + } + + /** + * Gets smsBlacklist + * + * @return bool + */ + public function getSmsBlacklist() + { + return $this->container['smsBlacklist']; + } + + /** + * Sets smsBlacklist + * + * @param bool $smsBlacklist To blacklist all the contacts for sms + * + * @return $this + */ + public function setSmsBlacklist($smsBlacklist) + { + $this->container['smsBlacklist'] = $smsBlacklist; + + return $this; + } + + /** + * Gets updateExistingContacts + * + * @return bool + */ + public function getUpdateExistingContacts() + { + return $this->container['updateExistingContacts']; + } + + /** + * Sets updateExistingContacts + * + * @param bool $updateExistingContacts To facilitate the choice to update the existing contacts + * + * @return $this + */ + public function setUpdateExistingContacts($updateExistingContacts) + { + $this->container['updateExistingContacts'] = $updateExistingContacts; + + return $this; + } + + /** + * Gets emptyContactsAttributes + * + * @return bool + */ + public function getEmptyContactsAttributes() + { + return $this->container['emptyContactsAttributes']; + } + + /** + * Sets emptyContactsAttributes + * + * @param bool $emptyContactsAttributes To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in SendinBlue, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( only available if `updateExistingContacts` set to true ) + * + * @return $this + */ + public function setEmptyContactsAttributes($emptyContactsAttributes) + { + $this->container['emptyContactsAttributes'] = $emptyContactsAttributes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RequestContactImportNewList.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RequestContactImportNewList.php new file mode 100644 index 0000000..ec1ebda --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RequestContactImportNewList.php @@ -0,0 +1,333 @@ + 'string', + 'folderId' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'listName' => null, + 'folderId' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'listName' => 'listName', + 'folderId' => 'folderId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'listName' => 'setListName', + 'folderId' => 'setFolderId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'listName' => 'getListName', + 'folderId' => 'getFolderId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['listName'] = isset($data['listName']) ? $data['listName'] : null; + $this->container['folderId'] = isset($data['folderId']) ? $data['folderId'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets listName + * + * @return string + */ + public function getListName() + { + return $this->container['listName']; + } + + /** + * Sets listName + * + * @param string $listName List with listName will be created first and users will be imported in it (Mandatory if listIds is empty). + * + * @return $this + */ + public function setListName($listName) + { + $this->container['listName'] = $listName; + + return $this; + } + + /** + * Gets folderId + * + * @return int + */ + public function getFolderId() + { + return $this->container['folderId']; + } + + /** + * Sets folderId + * + * @param int $folderId Id of the folder where this new list shall be created (Mandatory if listName is not empty). + * + * @return $this + */ + public function setFolderId($folderId) + { + $this->container['folderId'] = $folderId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RequestSMSRecipientExport.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RequestSMSRecipientExport.php new file mode 100644 index 0000000..d8797ce --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/RequestSMSRecipientExport.php @@ -0,0 +1,382 @@ + 'string', + 'recipientsType' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'notifyURL' => 'url', + 'recipientsType' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'notifyURL' => 'notifyURL', + 'recipientsType' => 'recipientsType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'notifyURL' => 'setNotifyURL', + 'recipientsType' => 'setRecipientsType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'notifyURL' => 'getNotifyURL', + 'recipientsType' => 'getRecipientsType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const RECIPIENTS_TYPE_ALL = 'all'; + const RECIPIENTS_TYPE_DELIVERED = 'delivered'; + const RECIPIENTS_TYPE_ANSWERED = 'answered'; + const RECIPIENTS_TYPE_SOFT_BOUNCES = 'softBounces'; + const RECIPIENTS_TYPE_HARD_BOUNCES = 'hardBounces'; + const RECIPIENTS_TYPE_UNSUBSCRIBED = 'unsubscribed'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRecipientsTypeAllowableValues() + { + return [ + self::RECIPIENTS_TYPE_ALL, + self::RECIPIENTS_TYPE_DELIVERED, + self::RECIPIENTS_TYPE_ANSWERED, + self::RECIPIENTS_TYPE_SOFT_BOUNCES, + self::RECIPIENTS_TYPE_HARD_BOUNCES, + self::RECIPIENTS_TYPE_UNSUBSCRIBED, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['notifyURL'] = isset($data['notifyURL']) ? $data['notifyURL'] : null; + $this->container['recipientsType'] = isset($data['recipientsType']) ? $data['recipientsType'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['recipientsType'] === null) { + $invalidProperties[] = "'recipientsType' can't be null"; + } + $allowedValues = $this->getRecipientsTypeAllowableValues(); + if (!in_array($this->container['recipientsType'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'recipientsType', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['recipientsType'] === null) { + return false; + } + $allowedValues = $this->getRecipientsTypeAllowableValues(); + if (!in_array($this->container['recipientsType'], $allowedValues)) { + return false; + } + return true; + } + + + /** + * Gets notifyURL + * + * @return string + */ + public function getNotifyURL() + { + return $this->container['notifyURL']; + } + + /** + * Sets notifyURL + * + * @param string $notifyURL URL that will be called once the export process is finished + * + * @return $this + */ + public function setNotifyURL($notifyURL) + { + $this->container['notifyURL'] = $notifyURL; + + return $this; + } + + /** + * Gets recipientsType + * + * @return string + */ + public function getRecipientsType() + { + return $this->container['recipientsType']; + } + + /** + * Sets recipientsType + * + * @param string $recipientsType Filter the recipients based on how they interacted with the campaign + * + * @return $this + */ + public function setRecipientsType($recipientsType) + { + $allowedValues = $this->getRecipientsTypeAllowableValues(); + if (!in_array($recipientsType, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'recipientsType', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['recipientsType'] = $recipientsType; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendEmail.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendEmail.php new file mode 100644 index 0000000..93f9ec3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendEmail.php @@ -0,0 +1,548 @@ + 'string[]', + 'emailBcc' => 'string[]', + 'emailCc' => 'string[]', + 'replyTo' => 'string', + 'attachmentUrl' => 'string', + 'attachment' => '\SendinBlue\Client\Model\SendEmailAttachment[]', + 'headers' => 'object', + 'attributes' => 'object', + 'tags' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'emailTo' => 'email', + 'emailBcc' => 'email', + 'emailCc' => 'email', + 'replyTo' => 'email', + 'attachmentUrl' => 'url', + 'attachment' => null, + 'headers' => null, + 'attributes' => null, + 'tags' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'emailTo' => 'emailTo', + 'emailBcc' => 'emailBcc', + 'emailCc' => 'emailCc', + 'replyTo' => 'replyTo', + 'attachmentUrl' => 'attachmentUrl', + 'attachment' => 'attachment', + 'headers' => 'headers', + 'attributes' => 'attributes', + 'tags' => 'tags' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'emailTo' => 'setEmailTo', + 'emailBcc' => 'setEmailBcc', + 'emailCc' => 'setEmailCc', + 'replyTo' => 'setReplyTo', + 'attachmentUrl' => 'setAttachmentUrl', + 'attachment' => 'setAttachment', + 'headers' => 'setHeaders', + 'attributes' => 'setAttributes', + 'tags' => 'setTags' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'emailTo' => 'getEmailTo', + 'emailBcc' => 'getEmailBcc', + 'emailCc' => 'getEmailCc', + 'replyTo' => 'getReplyTo', + 'attachmentUrl' => 'getAttachmentUrl', + 'attachment' => 'getAttachment', + 'headers' => 'getHeaders', + 'attributes' => 'getAttributes', + 'tags' => 'getTags' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['emailTo'] = isset($data['emailTo']) ? $data['emailTo'] : null; + $this->container['emailBcc'] = isset($data['emailBcc']) ? $data['emailBcc'] : null; + $this->container['emailCc'] = isset($data['emailCc']) ? $data['emailCc'] : null; + $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null; + $this->container['attachmentUrl'] = isset($data['attachmentUrl']) ? $data['attachmentUrl'] : null; + $this->container['attachment'] = isset($data['attachment']) ? $data['attachment'] : null; + $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null; + $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + $this->container['tags'] = isset($data['tags']) ? $data['tags'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['emailTo'] === null) { + $invalidProperties[] = "'emailTo' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['emailTo'] === null) { + return false; + } + return true; + } + + + /** + * Gets emailTo + * + * @return string[] + */ + public function getEmailTo() + { + return $this->container['emailTo']; + } + + /** + * Sets emailTo + * + * @param string[] $emailTo List of the email addresses of the recipients. For example, ['abc@example.com', 'asd@example.com']. + * + * @return $this + */ + public function setEmailTo($emailTo) + { + $this->container['emailTo'] = $emailTo; + + return $this; + } + + /** + * Gets emailBcc + * + * @return string[] + */ + public function getEmailBcc() + { + return $this->container['emailBcc']; + } + + /** + * Sets emailBcc + * + * @param string[] $emailBcc List of the email addresses of the recipients in bcc + * + * @return $this + */ + public function setEmailBcc($emailBcc) + { + $this->container['emailBcc'] = $emailBcc; + + return $this; + } + + /** + * Gets emailCc + * + * @return string[] + */ + public function getEmailCc() + { + return $this->container['emailCc']; + } + + /** + * Sets emailCc + * + * @param string[] $emailCc List of the email addresses of the recipients in cc + * + * @return $this + */ + public function setEmailCc($emailCc) + { + $this->container['emailCc'] = $emailCc; + + return $this; + } + + /** + * Gets replyTo + * + * @return string + */ + public function getReplyTo() + { + return $this->container['replyTo']; + } + + /** + * Sets replyTo + * + * @param string $replyTo Email address which shall be used by campaign recipients to reply back + * + * @return $this + */ + public function setReplyTo($replyTo) + { + $this->container['replyTo'] = $replyTo; + + return $this; + } + + /** + * Gets attachmentUrl + * + * @return string + */ + public function getAttachmentUrl() + { + return $this->container['attachmentUrl']; + } + + /** + * Sets attachmentUrl + * + * @param string $attachmentUrl Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps + * + * @return $this + */ + public function setAttachmentUrl($attachmentUrl) + { + $this->container['attachmentUrl'] = $attachmentUrl; + + return $this; + } + + /** + * Gets attachment + * + * @return \SendinBlue\Client\Model\SendEmailAttachment[] + */ + public function getAttachment() + { + return $this->container['attachment']; + } + + /** + * Sets attachment + * + * @param \SendinBlue\Client\Model\SendEmailAttachment[] $attachment Pass the list of content (base64 encoded) and name of the attachment. For example, `[{\"content\":\"base64 encoded content 1\", \"name\":\"attcahment1\"}, {\"content\":\"base64 encoded content 2\", \"name\":\"attcahment2\"}]` + * + * @return $this + */ + public function setAttachment($attachment) + { + $this->container['attachment'] = $attachment; + + return $this; + } + + /** + * Gets headers + * + * @return object + */ + public function getHeaders() + { + return $this->container['headers']; + } + + /** + * Sets headers + * + * @param object $headers Pass the set of headers that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, `{\"Content-Type\":\"text/html\", \"charset\":\"iso-8859-1\", \"sender.ip\":\"1.2.3.4\"}` + * + * @return $this + */ + public function setHeaders($headers) + { + $this->container['headers'] = $headers; + + return $this; + } + + /** + * Gets attributes + * + * @return object + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param object $attributes Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"} + * + * @return $this + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + return $this; + } + + /** + * Gets tags + * + * @return string[] + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[] $tags Tag your emails to find them more easily + * + * @return $this + */ + public function setTags($tags) + { + $this->container['tags'] = $tags; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendEmailAttachment.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendEmailAttachment.php new file mode 100644 index 0000000..a36e8ef --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendEmailAttachment.php @@ -0,0 +1,356 @@ + 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'content' => 'byte', + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['content'] = isset($data['content']) ? $data['content'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['content'] === null) { + $invalidProperties[] = "'content' can't be null"; + } + if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['content'])) { + $invalidProperties[] = "invalid value for 'content', must be conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."; + } + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['content'] === null) { + return false; + } + if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['content'])) { + return false; + } + if ($this->container['name'] === null) { + return false; + } + return true; + } + + + /** + * Gets content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content Base64 encoded chunk data of the attachment generated on the fly + * + * @return $this + */ + public function setContent($content) + { + + if ((!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $content))) { + throw new \InvalidArgumentException("invalid value for $content when calling SendEmailAttachment., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."); + } + + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Required for content. Name of the attachment + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendReport.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendReport.php new file mode 100644 index 0000000..73f77c2 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendReport.php @@ -0,0 +1,382 @@ + 'string', + 'email' => '\SendinBlue\Client\Model\SendReportEmail' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'language' => null, + 'email' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'language' => 'language', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'language' => 'setLanguage', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'language' => 'getLanguage', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const LANGUAGE_FR = 'fr'; + const LANGUAGE_ES = 'es'; + const LANGUAGE_PT = 'pt'; + const LANGUAGE_IT = 'it'; + const LANGUAGE_DE = 'de'; + const LANGUAGE_EN = 'en'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getLanguageAllowableValues() + { + return [ + self::LANGUAGE_FR, + self::LANGUAGE_ES, + self::LANGUAGE_PT, + self::LANGUAGE_IT, + self::LANGUAGE_DE, + self::LANGUAGE_EN, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['language'] = isset($data['language']) ? $data['language'] : 'fr'; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getLanguageAllowableValues(); + if (!in_array($this->container['language'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'language', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + $allowedValues = $this->getLanguageAllowableValues(); + if (!in_array($this->container['language'], $allowedValues)) { + return false; + } + if ($this->container['email'] === null) { + return false; + } + return true; + } + + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language Language of email content for campaign report sending. + * + * @return $this + */ + public function setLanguage($language) + { + $allowedValues = $this->getLanguageAllowableValues(); + if (!is_null($language) && !in_array($language, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'language', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets email + * + * @return \SendinBlue\Client\Model\SendReportEmail + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param \SendinBlue\Client\Model\SendReportEmail $email email + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendReportEmail.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendReportEmail.php new file mode 100644 index 0000000..0f42a2d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendReportEmail.php @@ -0,0 +1,507 @@ + 'string', + 'to' => 'string[]', + 'contentType' => 'string', + 'bcc' => 'string[]', + 'cc' => 'string[]', + 'body' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'subject' => null, + 'to' => 'email', + 'contentType' => null, + 'bcc' => 'email', + 'cc' => 'email', + 'body' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'subject' => 'subject', + 'to' => 'to', + 'contentType' => 'contentType', + 'bcc' => 'bcc', + 'cc' => 'cc', + 'body' => 'body' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'subject' => 'setSubject', + 'to' => 'setTo', + 'contentType' => 'setContentType', + 'bcc' => 'setBcc', + 'cc' => 'setCc', + 'body' => 'setBody' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'subject' => 'getSubject', + 'to' => 'getTo', + 'contentType' => 'getContentType', + 'bcc' => 'getBcc', + 'cc' => 'getCc', + 'body' => 'getBody' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const CONTENT_TYPE_TEXT = 'text'; + const CONTENT_TYPE_HTML = 'html'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getContentTypeAllowableValues() + { + return [ + self::CONTENT_TYPE_TEXT, + self::CONTENT_TYPE_HTML, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['to'] = isset($data['to']) ? $data['to'] : null; + $this->container['contentType'] = isset($data['contentType']) ? $data['contentType'] : 'html'; + $this->container['bcc'] = isset($data['bcc']) ? $data['bcc'] : null; + $this->container['cc'] = isset($data['cc']) ? $data['cc'] : null; + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['subject'] === null) { + $invalidProperties[] = "'subject' can't be null"; + } + if ($this->container['to'] === null) { + $invalidProperties[] = "'to' can't be null"; + } + $allowedValues = $this->getContentTypeAllowableValues(); + if (!in_array($this->container['contentType'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'contentType', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['body'] === null) { + $invalidProperties[] = "'body' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['subject'] === null) { + return false; + } + if ($this->container['to'] === null) { + return false; + } + $allowedValues = $this->getContentTypeAllowableValues(); + if (!in_array($this->container['contentType'], $allowedValues)) { + return false; + } + if ($this->container['body'] === null) { + return false; + } + return true; + } + + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Subject of the email message + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets to + * + * @return string[] + */ + public function getTo() + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param string[] $to Email addresses of the recipients + * + * @return $this + */ + public function setTo($to) + { + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets contentType + * + * @return string + */ + public function getContentType() + { + return $this->container['contentType']; + } + + /** + * Sets contentType + * + * @param string $contentType Type of the message body + * + * @return $this + */ + public function setContentType($contentType) + { + $allowedValues = $this->getContentTypeAllowableValues(); + if (!is_null($contentType) && !in_array($contentType, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'contentType', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['contentType'] = $contentType; + + return $this; + } + + /** + * Gets bcc + * + * @return string[] + */ + public function getBcc() + { + return $this->container['bcc']; + } + + /** + * Sets bcc + * + * @param string[] $bcc Email addresses of the recipients in bcc + * + * @return $this + */ + public function setBcc($bcc) + { + $this->container['bcc'] = $bcc; + + return $this; + } + + /** + * Gets cc + * + * @return string[] + */ + public function getCc() + { + return $this->container['cc']; + } + + /** + * Sets cc + * + * @param string[] $cc Email addresses of the recipients in cc + * + * @return $this + */ + public function setCc($cc) + { + $this->container['cc'] = $cc; + + return $this; + } + + /** + * Gets body + * + * @return string + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * + * @param string $body Body of the email message + * + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSms.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSms.php new file mode 100644 index 0000000..f6c3e71 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSms.php @@ -0,0 +1,434 @@ + 'string', + 'messageId' => 'int', + 'smsCount' => 'int', + 'usedCredits' => 'float', + 'remainingCredits' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'reference' => null, + 'messageId' => 'int64', + 'smsCount' => 'int64', + 'usedCredits' => 'float', + 'remainingCredits' => 'float' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'reference' => 'reference', + 'messageId' => 'messageId', + 'smsCount' => 'smsCount', + 'usedCredits' => 'usedCredits', + 'remainingCredits' => 'remainingCredits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'reference' => 'setReference', + 'messageId' => 'setMessageId', + 'smsCount' => 'setSmsCount', + 'usedCredits' => 'setUsedCredits', + 'remainingCredits' => 'setRemainingCredits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'reference' => 'getReference', + 'messageId' => 'getMessageId', + 'smsCount' => 'getSmsCount', + 'usedCredits' => 'getUsedCredits', + 'remainingCredits' => 'getRemainingCredits' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['reference'] = isset($data['reference']) ? $data['reference'] : null; + $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null; + $this->container['smsCount'] = isset($data['smsCount']) ? $data['smsCount'] : null; + $this->container['usedCredits'] = isset($data['usedCredits']) ? $data['usedCredits'] : null; + $this->container['remainingCredits'] = isset($data['remainingCredits']) ? $data['remainingCredits'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['reference'] === null) { + $invalidProperties[] = "'reference' can't be null"; + } + if ($this->container['messageId'] === null) { + $invalidProperties[] = "'messageId' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['reference'] === null) { + return false; + } + if ($this->container['messageId'] === null) { + return false; + } + return true; + } + + + /** + * Gets reference + * + * @return string + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string $reference reference + * + * @return $this + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets messageId + * + * @return int + */ + public function getMessageId() + { + return $this->container['messageId']; + } + + /** + * Sets messageId + * + * @param int $messageId messageId + * + * @return $this + */ + public function setMessageId($messageId) + { + $this->container['messageId'] = $messageId; + + return $this; + } + + /** + * Gets smsCount + * + * @return int + */ + public function getSmsCount() + { + return $this->container['smsCount']; + } + + /** + * Sets smsCount + * + * @param int $smsCount Count of SMS's to send multiple text messages + * + * @return $this + */ + public function setSmsCount($smsCount) + { + $this->container['smsCount'] = $smsCount; + + return $this; + } + + /** + * Gets usedCredits + * + * @return float + */ + public function getUsedCredits() + { + return $this->container['usedCredits']; + } + + /** + * Sets usedCredits + * + * @param float $usedCredits SMS credits used per text message + * + * @return $this + */ + public function setUsedCredits($usedCredits) + { + $this->container['usedCredits'] = $usedCredits; + + return $this; + } + + /** + * Gets remainingCredits + * + * @return float + */ + public function getRemainingCredits() + { + return $this->container['remainingCredits']; + } + + /** + * Sets remainingCredits + * + * @param float $remainingCredits Remaining SMS credits of the user + * + * @return $this + */ + public function setRemainingCredits($remainingCredits) + { + $this->container['remainingCredits'] = $remainingCredits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmail.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmail.php new file mode 100644 index 0000000..c9c6c9c --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmail.php @@ -0,0 +1,668 @@ + '\SendinBlue\Client\Model\SendSmtpEmailSender', + 'to' => '\SendinBlue\Client\Model\SendSmtpEmailTo[]', + 'bcc' => '\SendinBlue\Client\Model\SendSmtpEmailBcc[]', + 'cc' => '\SendinBlue\Client\Model\SendSmtpEmailCc[]', + 'htmlContent' => 'string', + 'textContent' => 'string', + 'subject' => 'string', + 'replyTo' => '\SendinBlue\Client\Model\SendSmtpEmailReplyTo', + 'attachment' => '\SendinBlue\Client\Model\SendSmtpEmailAttachment[]', + 'headers' => 'object', + 'templateId' => 'int', + 'params' => 'object', + 'tags' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'sender' => null, + 'to' => null, + 'bcc' => null, + 'cc' => null, + 'htmlContent' => null, + 'textContent' => null, + 'subject' => null, + 'replyTo' => null, + 'attachment' => null, + 'headers' => null, + 'templateId' => 'int64', + 'params' => null, + 'tags' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sender' => 'sender', + 'to' => 'to', + 'bcc' => 'bcc', + 'cc' => 'cc', + 'htmlContent' => 'htmlContent', + 'textContent' => 'textContent', + 'subject' => 'subject', + 'replyTo' => 'replyTo', + 'attachment' => 'attachment', + 'headers' => 'headers', + 'templateId' => 'templateId', + 'params' => 'params', + 'tags' => 'tags' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sender' => 'setSender', + 'to' => 'setTo', + 'bcc' => 'setBcc', + 'cc' => 'setCc', + 'htmlContent' => 'setHtmlContent', + 'textContent' => 'setTextContent', + 'subject' => 'setSubject', + 'replyTo' => 'setReplyTo', + 'attachment' => 'setAttachment', + 'headers' => 'setHeaders', + 'templateId' => 'setTemplateId', + 'params' => 'setParams', + 'tags' => 'setTags' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sender' => 'getSender', + 'to' => 'getTo', + 'bcc' => 'getBcc', + 'cc' => 'getCc', + 'htmlContent' => 'getHtmlContent', + 'textContent' => 'getTextContent', + 'subject' => 'getSubject', + 'replyTo' => 'getReplyTo', + 'attachment' => 'getAttachment', + 'headers' => 'getHeaders', + 'templateId' => 'getTemplateId', + 'params' => 'getParams', + 'tags' => 'getTags' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['to'] = isset($data['to']) ? $data['to'] : null; + $this->container['bcc'] = isset($data['bcc']) ? $data['bcc'] : null; + $this->container['cc'] = isset($data['cc']) ? $data['cc'] : null; + $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null; + $this->container['textContent'] = isset($data['textContent']) ? $data['textContent'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null; + $this->container['attachment'] = isset($data['attachment']) ? $data['attachment'] : null; + $this->container['headers'] = isset($data['headers']) ? $data['headers'] : null; + $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null; + $this->container['params'] = isset($data['params']) ? $data['params'] : null; + $this->container['tags'] = isset($data['tags']) ? $data['tags'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['to'] === null) { + $invalidProperties[] = "'to' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['to'] === null) { + return false; + } + return true; + } + + + /** + * Gets sender + * + * @return \SendinBlue\Client\Model\SendSmtpEmailSender + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param \SendinBlue\Client\Model\SendSmtpEmailSender $sender sender + * + * @return $this + */ + public function setSender($sender) + { + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets to + * + * @return \SendinBlue\Client\Model\SendSmtpEmailTo[] + */ + public function getTo() + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param \SendinBlue\Client\Model\SendSmtpEmailTo[] $to List of email addresses and names (optional) of the recipients. For example, `[{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}]` + * + * @return $this + */ + public function setTo($to) + { + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets bcc + * + * @return \SendinBlue\Client\Model\SendSmtpEmailBcc[] + */ + public function getBcc() + { + return $this->container['bcc']; + } + + /** + * Sets bcc + * + * @param \SendinBlue\Client\Model\SendSmtpEmailBcc[] $bcc List of email addresses and names (optional) of the recipients in bcc + * + * @return $this + */ + public function setBcc($bcc) + { + $this->container['bcc'] = $bcc; + + return $this; + } + + /** + * Gets cc + * + * @return \SendinBlue\Client\Model\SendSmtpEmailCc[] + */ + public function getCc() + { + return $this->container['cc']; + } + + /** + * Sets cc + * + * @param \SendinBlue\Client\Model\SendSmtpEmailCc[] $cc List of email addresses and names (optional) of the recipients in cc + * + * @return $this + */ + public function setCc($cc) + { + $this->container['cc'] = $cc; + + return $this; + } + + /** + * Gets htmlContent + * + * @return string + */ + public function getHtmlContent() + { + return $this->container['htmlContent']; + } + + /** + * Sets htmlContent + * + * @param string $htmlContent HTML body of the message ( Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed ) + * + * @return $this + */ + public function setHtmlContent($htmlContent) + { + $this->container['htmlContent'] = $htmlContent; + + return $this; + } + + /** + * Gets textContent + * + * @return string + */ + public function getTextContent() + { + return $this->container['textContent']; + } + + /** + * Sets textContent + * + * @param string $textContent Plain Text body of the message ( Ignored if 'templateId' is passed ) + * + * @return $this + */ + public function setTextContent($textContent) + { + $this->container['textContent'] = $textContent; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Subject of the message. Mandatory if 'templateId' is not passed + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets replyTo + * + * @return \SendinBlue\Client\Model\SendSmtpEmailReplyTo + */ + public function getReplyTo() + { + return $this->container['replyTo']; + } + + /** + * Sets replyTo + * + * @param \SendinBlue\Client\Model\SendSmtpEmailReplyTo $replyTo replyTo + * + * @return $this + */ + public function setReplyTo($replyTo) + { + $this->container['replyTo'] = $replyTo; + + return $this; + } + + /** + * Gets attachment + * + * @return \SendinBlue\Client\Model\SendSmtpEmailAttachment[] + */ + public function getAttachment() + { + return $this->container['attachment']; + } + + /** + * Sets attachment + * + * @param \SendinBlue\Client\Model\SendSmtpEmailAttachment[] $attachment Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, `[{\"url\":\"https://attachment.domain.com/myAttachmentFromUrl.jpg\", \"name\":\"My attachment 1\"}, {\"content\":\"base64 exmaple content\", \"name\":\"My attachment 2\"}]`. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps and odt ( If 'templateId' is passed and is in New Template Language format then only attachment url is accepted. If template is in Old template Language format, then 'attachment' is ignored ) + * + * @return $this + */ + public function setAttachment($attachment) + { + $this->container['attachment'] = $attachment; + + return $this; + } + + /** + * Gets headers + * + * @return object + */ + public function getHeaders() + { + return $this->container['headers']; + } + + /** + * Sets headers + * + * @param object $headers Pass the set of headers that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, `{\"Content-Type\":\"text/html\", \"charset\":\"iso-8859-1\", \"sender.ip\":\"1.2.3.4\"}` + * + * @return $this + */ + public function setHeaders($headers) + { + $this->container['headers'] = $headers; + + return $this; + } + + /** + * Gets templateId + * + * @return int + */ + public function getTemplateId() + { + return $this->container['templateId']; + } + + /** + * Sets templateId + * + * @param int $templateId Id of the template + * + * @return $this + */ + public function setTemplateId($templateId) + { + $this->container['templateId'] = $templateId; + + return $this; + } + + /** + * Gets params + * + * @return object + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param object $params Pass the set of attributes to customize the template. For example, `{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}`. It's considered only if template is in New Template Language format. + * + * @return $this + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets tags + * + * @return string[] + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[] $tags Tag your emails to find them more easily + * + * @return $this + */ + public function setTags($tags) + { + $this->container['tags'] = $tags; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailAttachment.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailAttachment.php new file mode 100644 index 0000000..48909d1 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailAttachment.php @@ -0,0 +1,374 @@ + 'string', + 'content' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'url' => 'url', + 'content' => 'byte', + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'url' => 'url', + 'content' => 'content', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'url' => 'setUrl', + 'content' => 'setContent', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'url' => 'getUrl', + 'content' => 'getContent', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['content'] = isset($data['content']) ? $data['content'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['content']) && !preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['content'])) { + $invalidProperties[] = "invalid value for 'content', must be conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['content'])) { + return false; + } + return true; + } + + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url Absolute url of the attachment (no local file). + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content Base64 encoded chunk data of the attachment generated on the fly + * + * @return $this + */ + public function setContent($content) + { + + if (!is_null($content) && (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $content))) { + throw new \InvalidArgumentException("invalid value for $content when calling SendSmtpEmailAttachment., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."); + } + + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Required if content is passed. Name of the attachment + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailBcc.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailBcc.php new file mode 100644 index 0000000..50d5a20 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailBcc.php @@ -0,0 +1,338 @@ + 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + return true; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email address of the recipient in bcc + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the recipient in bcc + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailCc.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailCc.php new file mode 100644 index 0000000..c73cc01 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailCc.php @@ -0,0 +1,338 @@ + 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + return true; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email address of the recipient in cc + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the recipient in cc + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailReplyTo.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailReplyTo.php new file mode 100644 index 0000000..ded04bc --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailReplyTo.php @@ -0,0 +1,339 @@ + 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + return true; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email address in reply to + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name in reply to + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailSender.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailSender.php new file mode 100644 index 0000000..ce50e46 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailSender.php @@ -0,0 +1,339 @@ + 'string', + 'email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'email' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the sender from which the emails will be sent + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email of the sender from which the emails will be sent + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailTo.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailTo.php new file mode 100644 index 0000000..eec8a18 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendSmtpEmailTo.php @@ -0,0 +1,338 @@ + 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['email'] === null) { + return false; + } + return true; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email address of the recipient + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the recipient + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendTemplateEmail.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendTemplateEmail.php new file mode 100644 index 0000000..7dac243 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendTemplateEmail.php @@ -0,0 +1,308 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'messageId' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'messageId' => 'messageId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'messageId' => 'setMessageId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'messageId' => 'getMessageId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['messageId'] === null) { + $invalidProperties[] = "'messageId' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['messageId'] === null) { + return false; + } + return true; + } + + + /** + * Gets messageId + * + * @return string + */ + public function getMessageId() + { + return $this->container['messageId']; + } + + /** + * Sets messageId + * + * @param string $messageId Message ID of the template Email sent + * + * @return $this + */ + public function setMessageId($messageId) + { + $this->container['messageId'] = $messageId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendTestEmail.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendTestEmail.php new file mode 100644 index 0000000..4131759 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendTestEmail.php @@ -0,0 +1,302 @@ + 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'emailTo' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'emailTo' => 'emailTo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'emailTo' => 'setEmailTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'emailTo' => 'getEmailTo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['emailTo'] = isset($data['emailTo']) ? $data['emailTo'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets emailTo + * + * @return string[] + */ + public function getEmailTo() + { + return $this->container['emailTo']; + } + + /** + * Sets emailTo + * + * @param string[] $emailTo List of the email addresses of the recipients whom you wish to send the test mail. If left empty, the test mail will be sent to your entire test list. + * + * @return $this + */ + public function setEmailTo($emailTo) + { + $this->container['emailTo'] = $emailTo; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendTestSms.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendTestSms.php new file mode 100644 index 0000000..f2576d3 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendTestSms.php @@ -0,0 +1,302 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'phoneNumber' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'phoneNumber' => 'phoneNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'phoneNumber' => 'setPhoneNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'phoneNumber' => 'getPhoneNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['phoneNumber'] = isset($data['phoneNumber']) ? $data['phoneNumber'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets phoneNumber + * + * @return string + */ + public function getPhoneNumber() + { + return $this->container['phoneNumber']; + } + + /** + * Sets phoneNumber + * + * @param string $phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted + * + * @return $this + */ + public function setPhoneNumber($phoneNumber) + { + $this->container['phoneNumber'] = $phoneNumber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendTransacSms.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendTransacSms.php new file mode 100644 index 0000000..44b9201 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/SendTransacSms.php @@ -0,0 +1,517 @@ + 'string', + 'recipient' => 'string', + 'content' => 'string', + 'type' => 'string', + 'tag' => 'string', + 'webUrl' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'sender' => null, + 'recipient' => null, + 'content' => null, + 'type' => null, + 'tag' => null, + 'webUrl' => 'url' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sender' => 'sender', + 'recipient' => 'recipient', + 'content' => 'content', + 'type' => 'type', + 'tag' => 'tag', + 'webUrl' => 'webUrl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sender' => 'setSender', + 'recipient' => 'setRecipient', + 'content' => 'setContent', + 'type' => 'setType', + 'tag' => 'setTag', + 'webUrl' => 'setWebUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sender' => 'getSender', + 'recipient' => 'getRecipient', + 'content' => 'getContent', + 'type' => 'getType', + 'tag' => 'getTag', + 'webUrl' => 'getWebUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const TYPE_TRANSACTIONAL = 'transactional'; + const TYPE_MARKETING = 'marketing'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_TRANSACTIONAL, + self::TYPE_MARKETING, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['recipient'] = isset($data['recipient']) ? $data['recipient'] : null; + $this->container['content'] = isset($data['content']) ? $data['content'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : 'transactional'; + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['webUrl'] = isset($data['webUrl']) ? $data['webUrl'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['sender'] === null) { + $invalidProperties[] = "'sender' can't be null"; + } + if ((strlen($this->container['sender']) > 11)) { + $invalidProperties[] = "invalid value for 'sender', the character length must be smaller than or equal to 11."; + } + + if ($this->container['recipient'] === null) { + $invalidProperties[] = "'recipient' can't be null"; + } + if ($this->container['content'] === null) { + $invalidProperties[] = "'content' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['sender'] === null) { + return false; + } + if (strlen($this->container['sender']) > 11) { + return false; + } + if ($this->container['recipient'] === null) { + return false; + } + if ($this->container['content'] === null) { + return false; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($this->container['type'], $allowedValues)) { + return false; + } + return true; + } + + + /** + * Gets sender + * + * @return string + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param string $sender Name of the sender. Only alphanumeric characters. No more than 11 characters + * + * @return $this + */ + public function setSender($sender) + { + if ((strlen($sender) > 11)) { + throw new \InvalidArgumentException('invalid length for $sender when calling SendTransacSms., must be smaller than or equal to 11.'); + } + + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets recipient + * + * @return string + */ + public function getRecipient() + { + return $this->container['recipient']; + } + + /** + * Sets recipient + * + * @param string $recipient Mobile number to send SMS with the country code + * + * @return $this + */ + public function setRecipient($recipient) + { + $this->container['recipient'] = $recipient; + + return $this; + } + + /** + * Gets content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content Content of the message. If more than 160 characters long, will be sent as multiple text messages + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array($type, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets tag + * + * @return string + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string $tag Tag of the message + * + * @return $this + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets webUrl + * + * @return string + */ + public function getWebUrl() + { + return $this->container['webUrl']; + } + + /** + * Sets webUrl + * + * @param string $webUrl Webhook to call for each event triggered by the message (delivered etc.) + * + * @return $this + */ + public function setWebUrl($webUrl) + { + $this->container['webUrl'] = $webUrl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateAttribute.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateAttribute.php new file mode 100644 index 0000000..7228a81 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateAttribute.php @@ -0,0 +1,332 @@ + 'string', + 'enumeration' => '\SendinBlue\Client\Model\UpdateAttributeEnumeration[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'value' => null, + 'enumeration' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'enumeration' => 'enumeration' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'enumeration' => 'setEnumeration' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'enumeration' => 'getEnumeration' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = isset($data['value']) ? $data['value'] : null; + $this->container['enumeration'] = isset($data['enumeration']) ? $data['enumeration'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value Value of the attribute to update. Use only if the attribute's category is 'calculated' or 'global' + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets enumeration + * + * @return \SendinBlue\Client\Model\UpdateAttributeEnumeration[] + */ + public function getEnumeration() + { + return $this->container['enumeration']; + } + + /** + * Sets enumeration + * + * @param \SendinBlue\Client\Model\UpdateAttributeEnumeration[] $enumeration List of the values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, `[{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}]` + * + * @return $this + */ + public function setEnumeration($enumeration) + { + $this->container['enumeration'] = $enumeration; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateAttributeEnumeration.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateAttributeEnumeration.php new file mode 100644 index 0000000..7c67fbc --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateAttributeEnumeration.php @@ -0,0 +1,344 @@ + 'int', + 'label' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'value' => null, + 'label' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'label' => 'label' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'label' => 'setLabel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'label' => 'getLabel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = isset($data['value']) ? $data['value'] : null; + $this->container['label'] = isset($data['label']) ? $data['label'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['value'] === null) { + return false; + } + if ($this->container['label'] === null) { + return false; + } + return true; + } + + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value Id of the value + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets label + * + * @return string + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string $label Label of the value + * + * @return $this + */ + public function setLabel($label) + { + $this->container['label'] = $label; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateCampaignStatus.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateCampaignStatus.php new file mode 100644 index 0000000..4dcac9a --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateCampaignStatus.php @@ -0,0 +1,351 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'status' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const STATUS_SUSPENDED = 'suspended'; + const STATUS_ARCHIVE = 'archive'; + const STATUS_DARCHIVE = 'darchive'; + const STATUS_SENT = 'sent'; + const STATUS_QUEUED = 'queued'; + const STATUS_REPLICATE = 'replicate'; + const STATUS_REPLICATE_TEMPLATE = 'replicateTemplate'; + const STATUS_DRAFT = 'draft'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_SUSPENDED, + self::STATUS_ARCHIVE, + self::STATUS_DARCHIVE, + self::STATUS_SENT, + self::STATUS_QUEUED, + self::STATUS_REPLICATE, + self::STATUS_REPLICATE_TEMPLATE, + self::STATUS_DRAFT, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + return false; + } + return true; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Note:- replicateTemplate status will be available only for template type campaigns. + * + * @return $this + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateChild.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateChild.php new file mode 100644 index 0000000..2af8482 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateChild.php @@ -0,0 +1,422 @@ + 'string', + 'firstName' => 'string', + 'lastName' => 'string', + 'companyName' => 'string', + 'password' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'firstName' => null, + 'lastName' => null, + 'companyName' => null, + 'password' => 'password' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'firstName' => 'firstName', + 'lastName' => 'lastName', + 'companyName' => 'companyName', + 'password' => 'password' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'firstName' => 'setFirstName', + 'lastName' => 'setLastName', + 'companyName' => 'setCompanyName', + 'password' => 'setPassword' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'firstName' => 'getFirstName', + 'lastName' => 'getLastName', + 'companyName' => 'getCompanyName', + 'password' => 'getPassword' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['firstName'] = isset($data['firstName']) ? $data['firstName'] : null; + $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null; + $this->container['companyName'] = isset($data['companyName']) ? $data['companyName'] : null; + $this->container['password'] = isset($data['password']) ? $data['password'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email New Email address to update the child account + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets firstName + * + * @return string + */ + public function getFirstName() + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string $firstName New First name to use to update the child account + * + * @return $this + */ + public function setFirstName($firstName) + { + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string + */ + public function getLastName() + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string $lastName New Last name to use to update the child account + * + * @return $this + */ + public function setLastName($lastName) + { + $this->container['lastName'] = $lastName; + + return $this; + } + + /** + * Gets companyName + * + * @return string + */ + public function getCompanyName() + { + return $this->container['companyName']; + } + + /** + * Sets companyName + * + * @param string $companyName New Company name to use to update the child account + * + * @return $this + */ + public function setCompanyName($companyName) + { + $this->container['companyName'] = $companyName; + + return $this; + } + + /** + * Gets password + * + * @return string + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string $password New password for the child account to login + * + * @return $this + */ + public function setPassword($password) + { + $this->container['password'] = $password; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateChildAccountStatus.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateChildAccountStatus.php new file mode 100644 index 0000000..c5153ef --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateChildAccountStatus.php @@ -0,0 +1,362 @@ + 'bool', + 'transactionalSms' => 'bool', + 'marketingAutomation' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'transactionalEmail' => null, + 'transactionalSms' => null, + 'marketingAutomation' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'transactionalEmail' => 'transactionalEmail', + 'transactionalSms' => 'transactionalSms', + 'marketingAutomation' => 'marketingAutomation' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transactionalEmail' => 'setTransactionalEmail', + 'transactionalSms' => 'setTransactionalSms', + 'marketingAutomation' => 'setMarketingAutomation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transactionalEmail' => 'getTransactionalEmail', + 'transactionalSms' => 'getTransactionalSms', + 'marketingAutomation' => 'getMarketingAutomation' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['transactionalEmail'] = isset($data['transactionalEmail']) ? $data['transactionalEmail'] : null; + $this->container['transactionalSms'] = isset($data['transactionalSms']) ? $data['transactionalSms'] : null; + $this->container['marketingAutomation'] = isset($data['marketingAutomation']) ? $data['marketingAutomation'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets transactionalEmail + * + * @return bool + */ + public function getTransactionalEmail() + { + return $this->container['transactionalEmail']; + } + + /** + * Sets transactionalEmail + * + * @param bool $transactionalEmail Status of Transactional Email (SMTP) Platform activation for your account (true=enabled, false=disabled) + * + * @return $this + */ + public function setTransactionalEmail($transactionalEmail) + { + $this->container['transactionalEmail'] = $transactionalEmail; + + return $this; + } + + /** + * Gets transactionalSms + * + * @return bool + */ + public function getTransactionalSms() + { + return $this->container['transactionalSms']; + } + + /** + * Sets transactionalSms + * + * @param bool $transactionalSms Status of Transactional SMS Platform activation for your account (true=enabled, false=disabled) + * + * @return $this + */ + public function setTransactionalSms($transactionalSms) + { + $this->container['transactionalSms'] = $transactionalSms; + + return $this; + } + + /** + * Gets marketingAutomation + * + * @return bool + */ + public function getMarketingAutomation() + { + return $this->container['marketingAutomation']; + } + + /** + * Sets marketingAutomation + * + * @param bool $marketingAutomation Status of Marketing Automation Platform activation for your account (true=enabled, false=disabled) + * + * @return $this + */ + public function setMarketingAutomation($marketingAutomation) + { + $this->container['marketingAutomation'] = $marketingAutomation; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateChildDomain.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateChildDomain.php new file mode 100644 index 0000000..36d4fae --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateChildDomain.php @@ -0,0 +1,302 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'domain' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'domain' => 'domain' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'domain' => 'setDomain' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'domain' => 'getDomain' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets domain + * + * @return string + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string $domain Value for the sender domain that will replace the existing domain + * + * @return $this + */ + public function setDomain($domain) + { + $this->container['domain'] = $domain; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateContact.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateContact.php new file mode 100644 index 0000000..c59691d --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateContact.php @@ -0,0 +1,452 @@ + 'object', + 'emailBlacklisted' => 'bool', + 'smsBlacklisted' => 'bool', + 'listIds' => 'int[]', + 'unlinkListIds' => 'int[]', + 'smtpBlacklistSender' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'attributes' => null, + 'emailBlacklisted' => null, + 'smsBlacklisted' => null, + 'listIds' => 'int64', + 'unlinkListIds' => 'int64', + 'smtpBlacklistSender' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'attributes' => 'attributes', + 'emailBlacklisted' => 'emailBlacklisted', + 'smsBlacklisted' => 'smsBlacklisted', + 'listIds' => 'listIds', + 'unlinkListIds' => 'unlinkListIds', + 'smtpBlacklistSender' => 'smtpBlacklistSender' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'attributes' => 'setAttributes', + 'emailBlacklisted' => 'setEmailBlacklisted', + 'smsBlacklisted' => 'setSmsBlacklisted', + 'listIds' => 'setListIds', + 'unlinkListIds' => 'setUnlinkListIds', + 'smtpBlacklistSender' => 'setSmtpBlacklistSender' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'attributes' => 'getAttributes', + 'emailBlacklisted' => 'getEmailBlacklisted', + 'smsBlacklisted' => 'getSmsBlacklisted', + 'listIds' => 'getListIds', + 'unlinkListIds' => 'getUnlinkListIds', + 'smtpBlacklistSender' => 'getSmtpBlacklistSender' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + $this->container['emailBlacklisted'] = isset($data['emailBlacklisted']) ? $data['emailBlacklisted'] : null; + $this->container['smsBlacklisted'] = isset($data['smsBlacklisted']) ? $data['smsBlacklisted'] : null; + $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null; + $this->container['unlinkListIds'] = isset($data['unlinkListIds']) ? $data['unlinkListIds'] : null; + $this->container['smtpBlacklistSender'] = isset($data['smtpBlacklistSender']) ? $data['smtpBlacklistSender'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets attributes + * + * @return object + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param object $attributes Pass the set of attributes to be updated. These attributes must be present in your account. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, `{\"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}` + * + * @return $this + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + return $this; + } + + /** + * Gets emailBlacklisted + * + * @return bool + */ + public function getEmailBlacklisted() + { + return $this->container['emailBlacklisted']; + } + + /** + * Sets emailBlacklisted + * + * @param bool $emailBlacklisted Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) + * + * @return $this + */ + public function setEmailBlacklisted($emailBlacklisted) + { + $this->container['emailBlacklisted'] = $emailBlacklisted; + + return $this; + } + + /** + * Gets smsBlacklisted + * + * @return bool + */ + public function getSmsBlacklisted() + { + return $this->container['smsBlacklisted']; + } + + /** + * Sets smsBlacklisted + * + * @param bool $smsBlacklisted Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) + * + * @return $this + */ + public function setSmsBlacklisted($smsBlacklisted) + { + $this->container['smsBlacklisted'] = $smsBlacklisted; + + return $this; + } + + /** + * Gets listIds + * + * @return int[] + */ + public function getListIds() + { + return $this->container['listIds']; + } + + /** + * Sets listIds + * + * @param int[] $listIds Ids of the lists to add the contact to + * + * @return $this + */ + public function setListIds($listIds) + { + $this->container['listIds'] = $listIds; + + return $this; + } + + /** + * Gets unlinkListIds + * + * @return int[] + */ + public function getUnlinkListIds() + { + return $this->container['unlinkListIds']; + } + + /** + * Sets unlinkListIds + * + * @param int[] $unlinkListIds Ids of the lists to remove the contact from + * + * @return $this + */ + public function setUnlinkListIds($unlinkListIds) + { + $this->container['unlinkListIds'] = $unlinkListIds; + + return $this; + } + + /** + * Gets smtpBlacklistSender + * + * @return string[] + */ + public function getSmtpBlacklistSender() + { + return $this->container['smtpBlacklistSender']; + } + + /** + * Sets smtpBlacklistSender + * + * @param string[] $smtpBlacklistSender SMTP forbidden sender for contact. Use only for email Contact + * + * @return $this + */ + public function setSmtpBlacklistSender($smtpBlacklistSender) + { + $this->container['smtpBlacklistSender'] = $smtpBlacklistSender; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateEmailCampaign.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateEmailCampaign.php new file mode 100644 index 0000000..d1683bb --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateEmailCampaign.php @@ -0,0 +1,1102 @@ + 'string', + 'sender' => '\SendinBlue\Client\Model\UpdateEmailCampaignSender', + 'name' => 'string', + 'htmlContent' => 'string', + 'htmlUrl' => 'string', + 'scheduledAt' => '\DateTime', + 'subject' => 'string', + 'replyTo' => 'string', + 'toField' => 'string', + 'recipients' => '\SendinBlue\Client\Model\UpdateEmailCampaignRecipients', + 'attachmentUrl' => 'string', + 'inlineImageActivation' => 'bool', + 'mirrorActive' => 'bool', + 'recurring' => 'bool', + 'footer' => 'string', + 'header' => 'string', + 'utmCampaign' => 'string', + 'params' => 'object', + 'sendAtBestTime' => 'bool', + 'abTesting' => 'bool', + 'subjectA' => 'string', + 'subjectB' => 'string', + 'splitRule' => 'int', + 'winnerCriteria' => 'string', + 'winnerDelay' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'tag' => null, + 'sender' => null, + 'name' => null, + 'htmlContent' => null, + 'htmlUrl' => 'url', + 'scheduledAt' => 'date-time', + 'subject' => null, + 'replyTo' => 'email', + 'toField' => null, + 'recipients' => null, + 'attachmentUrl' => 'url', + 'inlineImageActivation' => null, + 'mirrorActive' => null, + 'recurring' => null, + 'footer' => null, + 'header' => null, + 'utmCampaign' => null, + 'params' => null, + 'sendAtBestTime' => null, + 'abTesting' => null, + 'subjectA' => null, + 'subjectB' => null, + 'splitRule' => 'int64', + 'winnerCriteria' => null, + 'winnerDelay' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tag' => 'tag', + 'sender' => 'sender', + 'name' => 'name', + 'htmlContent' => 'htmlContent', + 'htmlUrl' => 'htmlUrl', + 'scheduledAt' => 'scheduledAt', + 'subject' => 'subject', + 'replyTo' => 'replyTo', + 'toField' => 'toField', + 'recipients' => 'recipients', + 'attachmentUrl' => 'attachmentUrl', + 'inlineImageActivation' => 'inlineImageActivation', + 'mirrorActive' => 'mirrorActive', + 'recurring' => 'recurring', + 'footer' => 'footer', + 'header' => 'header', + 'utmCampaign' => 'utmCampaign', + 'params' => 'params', + 'sendAtBestTime' => 'sendAtBestTime', + 'abTesting' => 'abTesting', + 'subjectA' => 'subjectA', + 'subjectB' => 'subjectB', + 'splitRule' => 'splitRule', + 'winnerCriteria' => 'winnerCriteria', + 'winnerDelay' => 'winnerDelay' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tag' => 'setTag', + 'sender' => 'setSender', + 'name' => 'setName', + 'htmlContent' => 'setHtmlContent', + 'htmlUrl' => 'setHtmlUrl', + 'scheduledAt' => 'setScheduledAt', + 'subject' => 'setSubject', + 'replyTo' => 'setReplyTo', + 'toField' => 'setToField', + 'recipients' => 'setRecipients', + 'attachmentUrl' => 'setAttachmentUrl', + 'inlineImageActivation' => 'setInlineImageActivation', + 'mirrorActive' => 'setMirrorActive', + 'recurring' => 'setRecurring', + 'footer' => 'setFooter', + 'header' => 'setHeader', + 'utmCampaign' => 'setUtmCampaign', + 'params' => 'setParams', + 'sendAtBestTime' => 'setSendAtBestTime', + 'abTesting' => 'setAbTesting', + 'subjectA' => 'setSubjectA', + 'subjectB' => 'setSubjectB', + 'splitRule' => 'setSplitRule', + 'winnerCriteria' => 'setWinnerCriteria', + 'winnerDelay' => 'setWinnerDelay' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tag' => 'getTag', + 'sender' => 'getSender', + 'name' => 'getName', + 'htmlContent' => 'getHtmlContent', + 'htmlUrl' => 'getHtmlUrl', + 'scheduledAt' => 'getScheduledAt', + 'subject' => 'getSubject', + 'replyTo' => 'getReplyTo', + 'toField' => 'getToField', + 'recipients' => 'getRecipients', + 'attachmentUrl' => 'getAttachmentUrl', + 'inlineImageActivation' => 'getInlineImageActivation', + 'mirrorActive' => 'getMirrorActive', + 'recurring' => 'getRecurring', + 'footer' => 'getFooter', + 'header' => 'getHeader', + 'utmCampaign' => 'getUtmCampaign', + 'params' => 'getParams', + 'sendAtBestTime' => 'getSendAtBestTime', + 'abTesting' => 'getAbTesting', + 'subjectA' => 'getSubjectA', + 'subjectB' => 'getSubjectB', + 'splitRule' => 'getSplitRule', + 'winnerCriteria' => 'getWinnerCriteria', + 'winnerDelay' => 'getWinnerDelay' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const WINNER_CRITERIA_OPEN = 'open'; + const WINNER_CRITERIA_CLICK = 'click'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getWinnerCriteriaAllowableValues() + { + return [ + self::WINNER_CRITERIA_OPEN, + self::WINNER_CRITERIA_CLICK, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null; + $this->container['htmlUrl'] = isset($data['htmlUrl']) ? $data['htmlUrl'] : null; + $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null; + $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null; + $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null; + $this->container['attachmentUrl'] = isset($data['attachmentUrl']) ? $data['attachmentUrl'] : null; + $this->container['inlineImageActivation'] = isset($data['inlineImageActivation']) ? $data['inlineImageActivation'] : false; + $this->container['mirrorActive'] = isset($data['mirrorActive']) ? $data['mirrorActive'] : null; + $this->container['recurring'] = isset($data['recurring']) ? $data['recurring'] : false; + $this->container['footer'] = isset($data['footer']) ? $data['footer'] : null; + $this->container['header'] = isset($data['header']) ? $data['header'] : null; + $this->container['utmCampaign'] = isset($data['utmCampaign']) ? $data['utmCampaign'] : null; + $this->container['params'] = isset($data['params']) ? $data['params'] : null; + $this->container['sendAtBestTime'] = isset($data['sendAtBestTime']) ? $data['sendAtBestTime'] : null; + $this->container['abTesting'] = isset($data['abTesting']) ? $data['abTesting'] : false; + $this->container['subjectA'] = isset($data['subjectA']) ? $data['subjectA'] : null; + $this->container['subjectB'] = isset($data['subjectB']) ? $data['subjectB'] : null; + $this->container['splitRule'] = isset($data['splitRule']) ? $data['splitRule'] : null; + $this->container['winnerCriteria'] = isset($data['winnerCriteria']) ? $data['winnerCriteria'] : null; + $this->container['winnerDelay'] = isset($data['winnerDelay']) ? $data['winnerDelay'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['splitRule']) && ($this->container['splitRule'] > 50)) { + $invalidProperties[] = "invalid value for 'splitRule', must be smaller than or equal to 50."; + } + + if (!is_null($this->container['splitRule']) && ($this->container['splitRule'] < 1)) { + $invalidProperties[] = "invalid value for 'splitRule', must be bigger than or equal to 1."; + } + + $allowedValues = $this->getWinnerCriteriaAllowableValues(); + if (!in_array($this->container['winnerCriteria'], $allowedValues)) { + $invalidProperties[] = sprintf( + "invalid value for 'winnerCriteria', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['winnerDelay']) && ($this->container['winnerDelay'] > 168)) { + $invalidProperties[] = "invalid value for 'winnerDelay', must be smaller than or equal to 168."; + } + + if (!is_null($this->container['winnerDelay']) && ($this->container['winnerDelay'] < 1)) { + $invalidProperties[] = "invalid value for 'winnerDelay', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['splitRule'] > 50) { + return false; + } + if ($this->container['splitRule'] < 1) { + return false; + } + $allowedValues = $this->getWinnerCriteriaAllowableValues(); + if (!in_array($this->container['winnerCriteria'], $allowedValues)) { + return false; + } + if ($this->container['winnerDelay'] > 168) { + return false; + } + if ($this->container['winnerDelay'] < 1) { + return false; + } + return true; + } + + + /** + * Gets tag + * + * @return string + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string $tag Tag of the campaign + * + * @return $this + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets sender + * + * @return \SendinBlue\Client\Model\UpdateEmailCampaignSender + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param \SendinBlue\Client\Model\UpdateEmailCampaignSender $sender sender + * + * @return $this + */ + public function setSender($sender) + { + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the campaign + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets htmlContent + * + * @return string + */ + public function getHtmlContent() + { + return $this->container['htmlContent']; + } + + /** + * Sets htmlContent + * + * @param string $htmlContent Body of the message (HTML version). REQUIRED if htmlUrl is empty + * + * @return $this + */ + public function setHtmlContent($htmlContent) + { + $this->container['htmlContent'] = $htmlContent; + + return $this; + } + + /** + * Gets htmlUrl + * + * @return string + */ + public function getHtmlUrl() + { + return $this->container['htmlUrl']; + } + + /** + * Sets htmlUrl + * + * @param string $htmlUrl Url which contents the body of the email message. REQUIRED if htmlContent is empty + * + * @return $this + */ + public function setHtmlUrl($htmlUrl) + { + $this->container['htmlUrl'] = $htmlUrl; + + return $this; + } + + /** + * Gets scheduledAt + * + * @return \DateTime + */ + public function getScheduledAt() + { + return $this->container['scheduledAt']; + } + + /** + * Sets scheduledAt + * + * @param \DateTime $scheduledAt UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). + * + * @return $this + */ + public function setScheduledAt($scheduledAt) + { + $this->container['scheduledAt'] = $scheduledAt; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Subject of the campaign + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets replyTo + * + * @return string + */ + public function getReplyTo() + { + return $this->container['replyTo']; + } + + /** + * Sets replyTo + * + * @param string $replyTo Email on which campaign recipients will be able to reply to + * + * @return $this + */ + public function setReplyTo($replyTo) + { + $this->container['replyTo'] = $replyTo; + + return $this; + } + + /** + * Gets toField + * + * @return string + */ + public function getToField() + { + return $this->container['toField']; + } + + /** + * Sets toField + * + * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add `{FNAME} {LNAME}`. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use `{{contact.FNAME}} {{contact.LNAME}}` for personalization + * + * @return $this + */ + public function setToField($toField) + { + $this->container['toField'] = $toField; + + return $this; + } + + /** + * Gets recipients + * + * @return \SendinBlue\Client\Model\UpdateEmailCampaignRecipients + */ + public function getRecipients() + { + return $this->container['recipients']; + } + + /** + * Sets recipients + * + * @param \SendinBlue\Client\Model\UpdateEmailCampaignRecipients $recipients recipients + * + * @return $this + */ + public function setRecipients($recipients) + { + $this->container['recipients'] = $recipients; + + return $this; + } + + /** + * Gets attachmentUrl + * + * @return string + */ + public function getAttachmentUrl() + { + return $this->container['attachmentUrl']; + } + + /** + * Sets attachmentUrl + * + * @param string $attachmentUrl Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps + * + * @return $this + */ + public function setAttachmentUrl($attachmentUrl) + { + $this->container['attachmentUrl'] = $attachmentUrl; + + return $this; + } + + /** + * Gets inlineImageActivation + * + * @return bool + */ + public function getInlineImageActivation() + { + return $this->container['inlineImageActivation']; + } + + /** + * Sets inlineImageActivation + * + * @param bool $inlineImageActivation Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than 4MB with images embedded in the email. Campaigns with the images embedded in the email must be sent to less than 5000 contacts. + * + * @return $this + */ + public function setInlineImageActivation($inlineImageActivation) + { + $this->container['inlineImageActivation'] = $inlineImageActivation; + + return $this; + } + + /** + * Gets mirrorActive + * + * @return bool + */ + public function getMirrorActive() + { + return $this->container['mirrorActive']; + } + + /** + * Sets mirrorActive + * + * @param bool $mirrorActive Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign + * + * @return $this + */ + public function setMirrorActive($mirrorActive) + { + $this->container['mirrorActive'] = $mirrorActive; + + return $this; + } + + /** + * Gets recurring + * + * @return bool + */ + public function getRecurring() + { + return $this->container['recurring']; + } + + /** + * Sets recurring + * + * @param bool $recurring FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times + * + * @return $this + */ + public function setRecurring($recurring) + { + $this->container['recurring'] = $recurring; + + return $this; + } + + /** + * Gets footer + * + * @return string + */ + public function getFooter() + { + return $this->container['footer']; + } + + /** + * Sets footer + * + * @param string $footer Footer of the email campaign + * + * @return $this + */ + public function setFooter($footer) + { + $this->container['footer'] = $footer; + + return $this; + } + + /** + * Gets header + * + * @return string + */ + public function getHeader() + { + return $this->container['header']; + } + + /** + * Sets header + * + * @param string $header Header of the email campaign + * + * @return $this + */ + public function setHeader($header) + { + $this->container['header'] = $header; + + return $this; + } + + /** + * Gets utmCampaign + * + * @return string + */ + public function getUtmCampaign() + { + return $this->container['utmCampaign']; + } + + /** + * Sets utmCampaign + * + * @param string $utmCampaign Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed + * + * @return $this + */ + public function setUtmCampaign($utmCampaign) + { + $this->container['utmCampaign'] = $utmCampaign; + + return $this; + } + + /** + * Gets params + * + * @return object + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param object $params Pass the set of attributes to customize the type 'classic' campaign. For example, `{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}`. The 'params' field will get updated, only if the campaign is in New Template Language, else ignored. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' + * + * @return $this + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets sendAtBestTime + * + * @return bool + */ + public function getSendAtBestTime() + { + return $this->container['sendAtBestTime']; + } + + /** + * Sets sendAtBestTime + * + * @param bool $sendAtBestTime Set this to true if you want to send your campaign at best time. Note:- if true, warmup ip will be disabled. + * + * @return $this + */ + public function setSendAtBestTime($sendAtBestTime) + { + $this->container['sendAtBestTime'] = $sendAtBestTime; + + return $this; + } + + /** + * Gets abTesting + * + * @return bool + */ + public function getAbTesting() + { + return $this->container['abTesting']; + } + + /** + * Sets abTesting + * + * @param bool $abTesting Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. 'subjectA', 'subjectB', 'splitRule', 'winnerCriteria' & 'winnerDelay' will be considered if abTesting is set to true. 'subject' if passed is ignored. Can be set to true only if 'sendAtBestTime' is 'false'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B + * + * @return $this + */ + public function setAbTesting($abTesting) + { + $this->container['abTesting'] = $abTesting; + + return $this; + } + + /** + * Gets subjectA + * + * @return string + */ + public function getSubjectA() + { + return $this->container['subjectA']; + } + + /** + * Sets subjectA + * + * @param string $subjectA Subject A of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value + * + * @return $this + */ + public function setSubjectA($subjectA) + { + $this->container['subjectA'] = $subjectA; + + return $this; + } + + /** + * Gets subjectB + * + * @return string + */ + public function getSubjectB() + { + return $this->container['subjectB']; + } + + /** + * Sets subjectB + * + * @param string $subjectB Subject B of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value + * + * @return $this + */ + public function setSubjectB($subjectB) + { + $this->container['subjectB'] = $subjectB; + + return $this; + } + + /** + * Gets splitRule + * + * @return int + */ + public function getSplitRule() + { + return $this->container['splitRule']; + } + + /** + * Sets splitRule + * + * @param int $splitRule Add the size of your test groups. Considered if abTesting = true. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else + * + * @return $this + */ + public function setSplitRule($splitRule) + { + + if (!is_null($splitRule) && ($splitRule > 50)) { + throw new \InvalidArgumentException('invalid value for $splitRule when calling UpdateEmailCampaign., must be smaller than or equal to 50.'); + } + if (!is_null($splitRule) && ($splitRule < 1)) { + throw new \InvalidArgumentException('invalid value for $splitRule when calling UpdateEmailCampaign., must be bigger than or equal to 1.'); + } + + $this->container['splitRule'] = $splitRule; + + return $this; + } + + /** + * Gets winnerCriteria + * + * @return string + */ + public function getWinnerCriteria() + { + return $this->container['winnerCriteria']; + } + + /** + * Sets winnerCriteria + * + * @param string $winnerCriteria Choose the metrics that will determinate the winning version. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed or alreday exist in record + * + * @return $this + */ + public function setWinnerCriteria($winnerCriteria) + { + $allowedValues = $this->getWinnerCriteriaAllowableValues(); + if (!is_null($winnerCriteria) && !in_array($winnerCriteria, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'winnerCriteria', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['winnerCriteria'] = $winnerCriteria; + + return $this; + } + + /** + * Gets winnerDelay + * + * @return int + */ + public function getWinnerDelay() + { + return $this->container['winnerDelay']; + } + + /** + * Sets winnerDelay + * + * @param int $winnerDelay Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed or alreday exist in record + * + * @return $this + */ + public function setWinnerDelay($winnerDelay) + { + + if (!is_null($winnerDelay) && ($winnerDelay > 168)) { + throw new \InvalidArgumentException('invalid value for $winnerDelay when calling UpdateEmailCampaign., must be smaller than or equal to 168.'); + } + if (!is_null($winnerDelay) && ($winnerDelay < 1)) { + throw new \InvalidArgumentException('invalid value for $winnerDelay when calling UpdateEmailCampaign., must be bigger than or equal to 1.'); + } + + $this->container['winnerDelay'] = $winnerDelay; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateEmailCampaignRecipients.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateEmailCampaignRecipients.php new file mode 100644 index 0000000..d933339 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateEmailCampaignRecipients.php @@ -0,0 +1,333 @@ + 'int[]', + 'listIds' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'exclusionListIds' => 'int64', + 'listIds' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'exclusionListIds' => 'exclusionListIds', + 'listIds' => 'listIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'exclusionListIds' => 'setExclusionListIds', + 'listIds' => 'setListIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'exclusionListIds' => 'getExclusionListIds', + 'listIds' => 'getListIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['exclusionListIds'] = isset($data['exclusionListIds']) ? $data['exclusionListIds'] : null; + $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets exclusionListIds + * + * @return int[] + */ + public function getExclusionListIds() + { + return $this->container['exclusionListIds']; + } + + /** + * Sets exclusionListIds + * + * @param int[] $exclusionListIds List ids which have to be excluded from a campaign + * + * @return $this + */ + public function setExclusionListIds($exclusionListIds) + { + $this->container['exclusionListIds'] = $exclusionListIds; + + return $this; + } + + /** + * Gets listIds + * + * @return int[] + */ + public function getListIds() + { + return $this->container['listIds']; + } + + /** + * Sets listIds + * + * @param int[] $listIds Lists Ids to send the campaign to. REQUIRED if already not present in campaign and scheduledAt is not empty + * + * @return $this + */ + public function setListIds($listIds) + { + $this->container['listIds'] = $listIds; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateEmailCampaignSender.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateEmailCampaignSender.php new file mode 100644 index 0000000..6c40fd8 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateEmailCampaignSender.php @@ -0,0 +1,333 @@ + 'string', + 'email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'email' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Sender Name from which the campaign emails are sent + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Sender email from which the campaign emails are sent + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateList.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateList.php new file mode 100644 index 0000000..1055fa9 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateList.php @@ -0,0 +1,332 @@ + 'string', + 'folderId' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'folderId' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'folderId' => 'folderId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'folderId' => 'setFolderId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'folderId' => 'getFolderId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['folderId'] = isset($data['folderId']) ? $data['folderId'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the list. Either of the two parameters (name, folderId) can be updated at a time. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets folderId + * + * @return int + */ + public function getFolderId() + { + return $this->container['folderId']; + } + + /** + * Sets folderId + * + * @param int $folderId Id of the folder in which the list is to be moved. Either of the two parameters (name, folderId) can be updated at a time. + * + * @return $this + */ + public function setFolderId($folderId) + { + $this->container['folderId'] = $folderId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateSender.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateSender.php new file mode 100644 index 0000000..0a3b855 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateSender.php @@ -0,0 +1,362 @@ + 'string', + 'email' => 'string', + 'ips' => '\SendinBlue\Client\Model\CreateSenderIps[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'email' => 'email', + 'ips' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'email' => 'email', + 'ips' => 'ips' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'email' => 'setEmail', + 'ips' => 'setIps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'email' => 'getEmail', + 'ips' => 'getIps' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['ips'] = isset($data['ips']) ? $data['ips'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name From Name to update the sender + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email From Email to update the sender + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets ips + * + * @return \SendinBlue\Client\Model\CreateSenderIps[] + */ + public function getIps() + { + return $this->container['ips']; + } + + /** + * Sets ips + * + * @param \SendinBlue\Client\Model\CreateSenderIps[] $ips Only in case of dedicated IP, IPs to associate to the sender. If passed, will replace all the existing IPs. + * + * @return $this + */ + public function setIps($ips) + { + $this->container['ips'] = $ips; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateSmsCampaign.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateSmsCampaign.php new file mode 100644 index 0000000..4a8322f --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateSmsCampaign.php @@ -0,0 +1,433 @@ + 'string', + 'sender' => 'string', + 'content' => 'string', + 'recipients' => '\SendinBlue\Client\Model\CreateSmsCampaignRecipients', + 'scheduledAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'sender' => null, + 'content' => null, + 'recipients' => null, + 'scheduledAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'sender' => 'sender', + 'content' => 'content', + 'recipients' => 'recipients', + 'scheduledAt' => 'scheduledAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'sender' => 'setSender', + 'content' => 'setContent', + 'recipients' => 'setRecipients', + 'scheduledAt' => 'setScheduledAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'sender' => 'getSender', + 'content' => 'getContent', + 'recipients' => 'getRecipients', + 'scheduledAt' => 'getScheduledAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['content'] = isset($data['content']) ? $data['content'] : null; + $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null; + $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['sender']) && (strlen($this->container['sender']) > 11)) { + $invalidProperties[] = "invalid value for 'sender', the character length must be smaller than or equal to 11."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if (strlen($this->container['sender']) > 11) { + return false; + } + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the campaign + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets sender + * + * @return string + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param string $sender Name of the sender. The number of characters is limited to 11 + * + * @return $this + */ + public function setSender($sender) + { + if (!is_null($sender) && (strlen($sender) > 11)) { + throw new \InvalidArgumentException('invalid length for $sender when calling UpdateSmsCampaign., must be smaller than or equal to 11.'); + } + + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets recipients + * + * @return \SendinBlue\Client\Model\CreateSmsCampaignRecipients + */ + public function getRecipients() + { + return $this->container['recipients']; + } + + /** + * Sets recipients + * + * @param \SendinBlue\Client\Model\CreateSmsCampaignRecipients $recipients recipients + * + * @return $this + */ + public function setRecipients($recipients) + { + $this->container['recipients'] = $recipients; + + return $this; + } + + /** + * Gets scheduledAt + * + * @return \DateTime + */ + public function getScheduledAt() + { + return $this->container['scheduledAt']; + } + + /** + * Sets scheduledAt + * + * @param \DateTime $scheduledAt UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. + * + * @return $this + */ + public function setScheduledAt($scheduledAt) + { + $this->container['scheduledAt'] = $scheduledAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateSmtpTemplate.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateSmtpTemplate.php new file mode 100644 index 0000000..ebebe21 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateSmtpTemplate.php @@ -0,0 +1,572 @@ + 'string', + 'sender' => '\SendinBlue\Client\Model\UpdateSmtpTemplateSender', + 'templateName' => 'string', + 'htmlContent' => 'string', + 'htmlUrl' => 'string', + 'subject' => 'string', + 'replyTo' => 'string', + 'toField' => 'string', + 'attachmentUrl' => 'string', + 'isActive' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'tag' => null, + 'sender' => null, + 'templateName' => null, + 'htmlContent' => null, + 'htmlUrl' => 'url', + 'subject' => null, + 'replyTo' => 'email', + 'toField' => null, + 'attachmentUrl' => 'url', + 'isActive' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tag' => 'tag', + 'sender' => 'sender', + 'templateName' => 'templateName', + 'htmlContent' => 'htmlContent', + 'htmlUrl' => 'htmlUrl', + 'subject' => 'subject', + 'replyTo' => 'replyTo', + 'toField' => 'toField', + 'attachmentUrl' => 'attachmentUrl', + 'isActive' => 'isActive' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tag' => 'setTag', + 'sender' => 'setSender', + 'templateName' => 'setTemplateName', + 'htmlContent' => 'setHtmlContent', + 'htmlUrl' => 'setHtmlUrl', + 'subject' => 'setSubject', + 'replyTo' => 'setReplyTo', + 'toField' => 'setToField', + 'attachmentUrl' => 'setAttachmentUrl', + 'isActive' => 'setIsActive' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tag' => 'getTag', + 'sender' => 'getSender', + 'templateName' => 'getTemplateName', + 'htmlContent' => 'getHtmlContent', + 'htmlUrl' => 'getHtmlUrl', + 'subject' => 'getSubject', + 'replyTo' => 'getReplyTo', + 'toField' => 'getToField', + 'attachmentUrl' => 'getAttachmentUrl', + 'isActive' => 'getIsActive' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['templateName'] = isset($data['templateName']) ? $data['templateName'] : null; + $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null; + $this->container['htmlUrl'] = isset($data['htmlUrl']) ? $data['htmlUrl'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null; + $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null; + $this->container['attachmentUrl'] = isset($data['attachmentUrl']) ? $data['attachmentUrl'] : null; + $this->container['isActive'] = isset($data['isActive']) ? $data['isActive'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets tag + * + * @return string + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string $tag Tag of the template + * + * @return $this + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets sender + * + * @return \SendinBlue\Client\Model\UpdateSmtpTemplateSender + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param \SendinBlue\Client\Model\UpdateSmtpTemplateSender $sender sender + * + * @return $this + */ + public function setSender($sender) + { + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets templateName + * + * @return string + */ + public function getTemplateName() + { + return $this->container['templateName']; + } + + /** + * Sets templateName + * + * @param string $templateName Name of the template + * + * @return $this + */ + public function setTemplateName($templateName) + { + $this->container['templateName'] = $templateName; + + return $this; + } + + /** + * Gets htmlContent + * + * @return string + */ + public function getHtmlContent() + { + return $this->container['htmlContent']; + } + + /** + * Sets htmlContent + * + * @param string $htmlContent Required if htmlUrl is empty. Body of the message (HTML must have more than 10 characters) + * + * @return $this + */ + public function setHtmlContent($htmlContent) + { + $this->container['htmlContent'] = $htmlContent; + + return $this; + } + + /** + * Gets htmlUrl + * + * @return string + */ + public function getHtmlUrl() + { + return $this->container['htmlUrl']; + } + + /** + * Sets htmlUrl + * + * @param string $htmlUrl Required if htmlContent is empty. URL to the body of the email (HTML) + * + * @return $this + */ + public function setHtmlUrl($htmlUrl) + { + $this->container['htmlUrl'] = $htmlUrl; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Subject of the email + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets replyTo + * + * @return string + */ + public function getReplyTo() + { + return $this->container['replyTo']; + } + + /** + * Sets replyTo + * + * @param string $replyTo Email on which campaign recipients will be able to reply to + * + * @return $this + */ + public function setReplyTo($replyTo) + { + $this->container['replyTo'] = $replyTo; + + return $this; + } + + /** + * Gets toField + * + * @return string + */ + public function getToField() + { + return $this->container['toField']; + } + + /** + * Sets toField + * + * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add `{FNAME} {LNAME}`. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use `{{contact.FNAME}} {{contact.LNAME}}` for personalization + * + * @return $this + */ + public function setToField($toField) + { + $this->container['toField'] = $toField; + + return $this; + } + + /** + * Gets attachmentUrl + * + * @return string + */ + public function getAttachmentUrl() + { + return $this->container['attachmentUrl']; + } + + /** + * Sets attachmentUrl + * + * @param string $attachmentUrl Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps + * + * @return $this + */ + public function setAttachmentUrl($attachmentUrl) + { + $this->container['attachmentUrl'] = $attachmentUrl; + + return $this; + } + + /** + * Gets isActive + * + * @return bool + */ + public function getIsActive() + { + return $this->container['isActive']; + } + + /** + * Sets isActive + * + * @param bool $isActive Status of the template. isActive = false means template is inactive, isActive = true means template is active + * + * @return $this + */ + public function setIsActive($isActive) + { + $this->container['isActive'] = $isActive; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateSmtpTemplateSender.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateSmtpTemplateSender.php new file mode 100644 index 0000000..f675d27 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateSmtpTemplateSender.php @@ -0,0 +1,333 @@ + 'string', + 'email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'email' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the sender + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email of the sender + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateWebhook.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateWebhook.php new file mode 100644 index 0000000..9e2012e --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/Model/UpdateWebhook.php @@ -0,0 +1,408 @@ + 'string', + 'description' => 'string', + 'events' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'url' => 'url', + 'description' => null, + 'events' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'url' => 'url', + 'description' => 'description', + 'events' => 'events' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'url' => 'setUrl', + 'description' => 'setDescription', + 'events' => 'setEvents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'url' => 'getUrl', + 'description' => 'getDescription', + 'events' => 'getEvents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const EVENTS_HARD_BOUNCE = 'hardBounce'; + const EVENTS_SOFT_BOUNCE = 'softBounce'; + const EVENTS_BLOCKED = 'blocked'; + const EVENTS_SPAM = 'spam'; + const EVENTS_DELIVERED = 'delivered'; + const EVENTS_REQUEST = 'request'; + const EVENTS_CLICK = 'click'; + const EVENTS_INVALID = 'invalid'; + const EVENTS_DEFERRED = 'deferred'; + const EVENTS_OPENED = 'opened'; + const EVENTS_UNIQUE_OPENED = 'uniqueOpened'; + const EVENTS_UNSUBSCRIBED = 'unsubscribed'; + const EVENTS_LIST_ADDITION = 'listAddition'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEventsAllowableValues() + { + return [ + self::EVENTS_HARD_BOUNCE, + self::EVENTS_SOFT_BOUNCE, + self::EVENTS_BLOCKED, + self::EVENTS_SPAM, + self::EVENTS_DELIVERED, + self::EVENTS_REQUEST, + self::EVENTS_CLICK, + self::EVENTS_INVALID, + self::EVENTS_DEFERRED, + self::EVENTS_OPENED, + self::EVENTS_UNIQUE_OPENED, + self::EVENTS_UNSUBSCRIBED, + self::EVENTS_LIST_ADDITION, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['events'] = isset($data['events']) ? $data['events'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url URL of the webhook + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description Description of the webhook + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets events + * + * @return string[] + */ + public function getEvents() + { + return $this->container['events']; + } + + /** + * Sets events + * + * @param string[] $events Events triggering the webhook. Possible values for Transactional type webhook – request, delivered, hardBounce, softBounce, blocked, spam, invalid, deferred, click, opened, uniqueOpened and unsubscribed and possible values for Marketing type webhook – spam, opened, click, hardBounce, softBounce, unsubscribed, listAddition and delivered + * + * @return $this + */ + public function setEvents($events) + { + $allowedValues = $this->getEventsAllowableValues(); + if (!is_null($events) && array_diff($events, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'events', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['events'] = $events; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/ObjectSerializer.php b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/ObjectSerializer.php new file mode 100644 index 0000000..3068625 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/vendor/sendinblue/api-v3-sdk/lib/ObjectSerializer.php @@ -0,0 +1,317 @@ +format('Y-m-d') : $data->format(\DateTime::ATOM); + } elseif (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } elseif (is_object($data)) { + $values = []; + $formats = $data::swaggerFormats(); + foreach ($data::swaggerTypes() as $property => $swaggerType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null + && !in_array($swaggerType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) + && method_exists($swaggerType, 'getAllowableEnumValues') + && !in_array($value, $swaggerType::getAllowableEnumValues())) { + $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $swaggerType, $formats[$property]); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue($value) + { + return rawurlencode(self::toString($value)); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the query, by imploding comma-separated if it's an object. + * If it's a string, pass through unchanged. It will be url-encoded + * later. + * + * @param string[]|string|\DateTime $object an object to be serialized to a string + * + * @return string the serialized object + */ + public static function toQueryValue($object) + { + if (is_array($object)) { + return implode(',', $object); + } else { + return self::toString($object); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue($value) + { + return self::toString($value); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\SplFileObject $value the value of the form parameter + * + * @return string the form string + */ + public static function toFormValue($value) + { + if ($value instanceof \SplFileObject) { + return $value->getRealPath(); + } else { + return self::toString($value); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\DateTime $value the value of the parameter + * + * @return string the header string + */ + public static function toString($value) + { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(\DateTime::ATOM); + } else { + return $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $collectionFormat the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($collectionFormat) { + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'ssv': + return implode(' ', $collection); + + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null an single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } elseif (strcasecmp(substr($class, -2), '[]') === 0) { + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } elseif ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === '\DateTime') { + // Some API's return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + return new \DateTime($data); + } else { + return null; + } + } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } elseif ($class === '\SplFileObject') { + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (array_key_exists('Content-Disposition', $httpHeaders) && + preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } elseif (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues())) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\SendinBlue\Client\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + $instance = new $class(); + foreach ($instance::swaggerTypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + continue; + } + + $propertyValue = $data->{$instance::attributeMap()[$property]}; + if (isset($propertyValue)) { + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/wp-content/plugins/wp-mail-smtp/wp-mail-smtp-0.11.2.php b/wp-content/plugins/wp-mail-smtp/wp-mail-smtp-0.11.2.php new file mode 100644 index 0000000..21b2511 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/wp-mail-smtp-0.11.2.php @@ -0,0 +1,759 @@ + '', + 'mail_from_name' => '', + 'mailer' => 'smtp', + 'mail_set_return_path' => 'false', + 'smtp_host' => 'localhost', + 'smtp_port' => '25', + 'smtp_ssl' => 'none', + 'smtp_auth' => false, + 'smtp_user' => '', + 'smtp_pass' => '', + 'pepipost_user' => '', + 'pepipost_pass' => '', + 'pepipost_port' => '2525', + 'pepipost_ssl' => 'none', +); + +/** + * Activation function. This function creates the required options and defaults. + */ +if ( ! function_exists( 'wp_mail_smtp_activate' ) ) : + /** + * What to do on plugin activation. + */ + function wp_mail_smtp_activate() { + + global $wpms_options; + + // Create the required options... + foreach ( $wpms_options as $name => $val ) { + add_option( $name, $val ); + } + } +endif; + +if ( ! function_exists( 'wp_mail_smtp_whitelist_options' ) ) : + /** + * Whitelist plugin options. + * + * @param array $whitelist_options + * + * @return mixed + */ + function wp_mail_smtp_whitelist_options( $whitelist_options ) { + + global $wpms_options; + + // Add our options to the array. + $whitelist_options['email'] = array_keys( $wpms_options ); + + return $whitelist_options; + } +endif; + +/** + * To avoid any (very unlikely) clashes, check if the function already exists. + */ +if ( ! function_exists( 'phpmailer_init_smtp' ) ) : + /** + * This code is copied, from wp-includes/pluggable.php as at version 2.2.2. + * + * @param PHPMailer $phpmailer It's passed by reference, so no need to return anything. + */ + function phpmailer_init_smtp( $phpmailer ) { + /* + * If constants are defined, apply them. + * We should have defined all required constants before using them. + */ + if ( + defined( 'WPMS_ON' ) && WPMS_ON && + defined( 'WPMS_MAILER' ) + ) { + $phpmailer->Mailer = WPMS_MAILER; + + if ( defined( 'WPMS_SET_RETURN_PATH' ) && WPMS_SET_RETURN_PATH ) { + $phpmailer->Sender = $phpmailer->From; + } + + if ( + WPMS_MAILER === 'smtp' && + defined( 'WPMS_SSL' ) && + defined( 'WPMS_SMTP_HOST' ) && + defined( 'WPMS_SMTP_PORT' ) + ) { + $phpmailer->SMTPSecure = WPMS_SSL; + $phpmailer->Host = WPMS_SMTP_HOST; + $phpmailer->Port = WPMS_SMTP_PORT; + + if ( + defined( 'WPMS_SMTP_AUTH' ) && WPMS_SMTP_AUTH && + defined( 'WPMS_SMTP_USER' ) && + defined( 'WPMS_SMTP_PASS' ) + ) { + $phpmailer->SMTPAuth = true; + $phpmailer->Username = WPMS_SMTP_USER; + $phpmailer->Password = WPMS_SMTP_PASS; + } + } + } else { + $option_mailer = get_option( 'mailer' ); + $option_smtp_host = get_option( 'smtp_host' ); + $option_smtp_ssl = get_option( 'smtp_ssl' ); + + // Check that mailer is not blank, and if mailer=smtp, host is not blank. + if ( + ! $option_mailer || + ( 'smtp' === $option_mailer && ! $option_smtp_host ) + ) { + return; + } + + // If the mailer is pepipost, make sure we have a username and password. + if ( 'pepipost' === $option_mailer && ( ! get_option( 'pepipost_user' ) && ! get_option( 'pepipost_pass' ) ) ) { + return; + } + + // Set the mailer type as per config above, this overrides the already called isMail method. + $phpmailer->Mailer = $option_mailer; + + // Set the Sender (return-path) if required. + if ( get_option( 'mail_set_return_path' ) ) { + $phpmailer->Sender = $phpmailer->From; + } + + // Set the SMTPSecure value, if set to none, leave this blank. + $phpmailer->SMTPSecure = $option_smtp_ssl; + if ( 'none' === $option_smtp_ssl ) { + $phpmailer->SMTPSecure = ''; + $phpmailer->SMTPAutoTLS = false; + } + + // If we're sending via SMTP, set the host. + if ( 'smtp' === $option_mailer ) { + // Set the other options. + $phpmailer->Host = $option_smtp_host; + $phpmailer->Port = get_option( 'smtp_port' ); + + // If we're using smtp auth, set the username & password. + if ( get_option( 'smtp_auth' ) === 'true' ) { + $phpmailer->SMTPAuth = true; + $phpmailer->Username = get_option( 'smtp_user' ); + $phpmailer->Password = get_option( 'smtp_pass' ); + } + } elseif ( 'pepipost' === $option_mailer ) { + // Set the Pepipost settings. + $phpmailer->Mailer = 'smtp'; + $phpmailer->Host = 'smtp.pepipost.com'; + $phpmailer->Port = get_option( 'pepipost_port' ); + $phpmailer->SMTPSecure = get_option( 'pepipost_ssl' ) === 'none' ? '' : get_option( 'pepipost_ssl' ); + $phpmailer->SMTPAuth = true; + $phpmailer->Username = get_option( 'pepipost_user' ); + $phpmailer->Password = get_option( 'pepipost_pass' ); + } + } + + // You can add your own options here, see the phpmailer documentation for more info: http://phpmailer.sourceforge.net/docs/. + /** @noinspection PhpUnusedLocalVariableInspection It's passed by reference. */ + $phpmailer = apply_filters( 'wp_mail_smtp_custom_options', $phpmailer ); + } +endif; + +if ( ! function_exists( 'wp_mail_smtp_options_page' ) ) : + /** + * This function outputs the plugin options page. + */ + function wp_mail_smtp_options_page() { + + global $phpmailer; + + // Make sure the PHPMailer class has been instantiated + // (copied verbatim from wp-includes/pluggable.php) + // (Re)create it, if it's gone missing. + if ( ! is_object( $phpmailer ) || ! is_a( $phpmailer, 'PHPMailer' ) ) { + require_once ABSPATH . WPINC . '/class-phpmailer.php'; + $phpmailer = new PHPMailer( true ); + } + + // Send a test mail if necessary. + if ( + isset( $_POST['wpms_action'] ) && + esc_html__( 'Send Test', 'wp-mail-smtp' ) === sanitize_text_field( $_POST['wpms_action'] ) && + is_email( $_POST['to'] ) + ) { + + check_admin_referer( 'test-email' ); + + // Set up the mail variables. + $to = sanitize_text_field( $_POST['to'] ); + /* translators: %s - email address where test mail will be sent to. */ + $subject = 'WP Mail SMTP: ' . sprintf( esc_html__( 'Test mail to %s', 'wp-mail-smtp' ), $to ); + $message = esc_html__( 'This is a test email generated by the WP Mail SMTP WordPress plugin.', 'wp-mail-smtp' ); + + // Set SMTPDebug level, default is 2 (commands + data + connection status). + $phpmailer->SMTPDebug = apply_filters( 'wp_mail_smtp_admin_test_email_smtp_debug', 2 ); + + // Start output buffering to grab smtp debugging output. + ob_start(); + + // Send the test mail. + $result = wp_mail( $to, $subject, $message ); + + // Grab the smtp debugging output. + $smtp_debug = ob_get_clean(); + + // Output the response. + ?> +

        +

        +
        + +

        +
        + +

        +
        +
        + +
        +

        + +

        + +
        + + + + + + + + + + + +
        + + + + +

        + ' ); + _e( 'Please Note: You appear to be using a version of WordPress prior to 2.3. Please ignore the From Name field and instead enter Name<email@domain.com> in this field.', 'wp-mail-smtp' ); + print( '' ); + } + ?> +

        +
        + + + + +

        + +

        +
        + + + + + + +
        + + +
        + + + + +

        + /> + +

        +

        + /> + +

        + + +

        + /> + +

        +

        + ', + '' + ); + ?> +

        + +
        +
        + + + + + + +
        + + +
        + + + + + + +

        + +

        +
        +
        + +

        + +

        + +
        +

        + +

        +

        + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + +
        + + + +
        +
        + + + + + /> +
        + + /> +
        + + /> + + +

        +
        +
        +
        + + + + + /> +
        + + /> +
        + +

        + +

        +
        +
        + + + +
        + + + + +

        + +

        +
        + +

        + +

        +
        + + +
        +

        + +

        +

        + Pepipost', + '' + ); + ?> +

        + + + + + + + + + + + + + + + + + +
        + + + +
        + + + +
        + + + +
        + + +
        + + + + + + + /> +
        + + /> +
        + + /> + +
        +
        + +

        + +

        +
        + + + + +
        + +

        + +
        + + + + + + + +
        + + + +

        +
        + +

        + +

        +
        + + + +
        + ' . esc_html__( 'Settings', 'wp-mail-smtp' ) . ''; + + array_unshift( $links, $settings_link ); + + return $links; +} + +/** + * Check whether the site is using Pepipost or not. + * + * @since 0.11 + * + * @return bool + */ +function wp_mail_smtp_is_pepipost_active() { + return apply_filters( 'wp_mail_smtp_options_is_pepipost_active', 'pepipost' === get_option( 'mailer' ) ); +} + +/** + * Check the current PHP version and display a notice if on unsupported PHP. + * + * @since 0.11 + */ +function wp_mail_smtp_check_php_version() { + + // Display for admins only. + if ( ! is_super_admin() ) { + return; + } + + // Display on Dashboard page only. + if ( isset( $GLOBALS['pagenow'] ) && 'index.php' !== $GLOBALS['pagenow'] ) { + return; + } + + echo '
        ' . + '

        ' . + sprintf( + /* translators: %1$s - WP Mail SMTP plugin name; %2$s - opening a link tag; %3$s - closing a link tag. */ + esc_html__( + 'Your site is running an outdated version of PHP that is no longer supported and may cause issues with %1$s. %2$sRead more%3$s for additional information.', + 'wp-mail-smtp' + ), + 'WP Mail SMTP', + '', + '' + ) . + '

        ' . + '
        '; +} + +add_action( 'admin_notices', 'wp_mail_smtp_check_php_version' ); + +// Add an action on phpmailer_init. +add_action( 'phpmailer_init', 'phpmailer_init_smtp' ); + +if ( ! defined( 'WPMS_ON' ) || ! WPMS_ON ) { + // Whitelist our options. + add_filter( 'whitelist_options', 'wp_mail_smtp_whitelist_options' ); + // Add the create pages options. + add_action( 'admin_menu', 'wp_mail_smtp_menus' ); + // Add an activation hook for this plugin. + register_activation_hook( __FILE__, 'wp_mail_smtp_activate' ); + // Adds "Settings" link to the Plugins page. + add_filter( 'plugin_action_links', 'wp_mail_plugin_action_links', 10, 2 ); +} + +// Add filters to replace the mail from name and email address. +add_filter( 'wp_mail_from', 'wp_mail_smtp_mail_from' ); +add_filter( 'wp_mail_from_name', 'wp_mail_smtp_mail_from_name' ); + +load_plugin_textdomain( 'wp-mail-smtp', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); diff --git a/wp-content/plugins/wp-mail-smtp/wp-mail-smtp.php b/wp-content/plugins/wp-mail-smtp/wp-mail-smtp.php new file mode 100644 index 0000000..d28cd25 --- /dev/null +++ b/wp-content/plugins/wp-mail-smtp/wp-mail-smtp.php @@ -0,0 +1,83 @@ +wp_mail() function to use Gmail/Mailgun/SendGrid/SMTP instead of the default mail() and creates an options page to manage the settings. + * Author: WPForms + * Author URI: https://wpforms.com/ + * Network: false + * Text Domain: wp-mail-smtp + * Domain Path: /assets/languages + */ + +/** + * @author WPForms + * @copyright WPForms, 2007-20, All Rights Reserved + * This code is released under the GPL licence version 3 or later, available here + * https://www.gnu.org/licenses/gpl.txt + */ + +/** + * Setting options in wp-config.php + * + * Specifically aimed at WP Multisite users, you can set the options for this plugin as + * constants in wp-config.php. Copy the code below into wp-config.php and tweak settings. + * Values from constants are NOT stripslash()'ed. + * + * When enabled, make sure to comment out (at the beginning of the line using //) those constants that you do not need, + * or remove them completely, so they won't interfere with plugin settings. + */ + +/* +define( 'WPMS_ON', true ); // True turns on the whole constants support and usage, false turns it off. + +define( 'WPMS_DO_NOT_SEND', true ); // Or false, in that case constant is ignored. + +define( 'WPMS_MAIL_FROM', 'mail@example.com' ); +define( 'WPMS_MAIL_FROM_FORCE', true ); // True turns it on, false turns it off. +define( 'WPMS_MAIL_FROM_NAME', 'From Name' ); +define( 'WPMS_MAIL_FROM_NAME_FORCE', true ); // True turns it on, false turns it off. +define( 'WPMS_MAILER', 'sendinblue' ); // Possible values: 'mail', 'sendinblue', 'mailgun', 'sendgrid', 'gmail', 'smtp'. +define( 'WPMS_SET_RETURN_PATH', true ); // Sets $phpmailer->Sender if true, relevant only for Other SMTP mailer. + +// Recommended mailers. +define( 'WPMS_PEPIPOST_API_KEY', '' ); +define( 'WPMS_SENDINBLUE_API_KEY', '' ); + +define( 'WPMS_MAILGUN_API_KEY', '' ); +define( 'WPMS_MAILGUN_DOMAIN', '' ); +define( 'WPMS_MAILGUN_REGION', 'US' ); // or 'EU' for Europe. + +define( 'WPMS_SENDGRID_API_KEY', '' ); + +define( 'WPMS_GMAIL_CLIENT_ID', '' ); +define( 'WPMS_GMAIL_CLIENT_SECRET', '' ); + +define( 'WPMS_SMTP_HOST', 'localhost' ); // The SMTP mail host. +define( 'WPMS_SMTP_PORT', 25 ); // The SMTP server port number. +define( 'WPMS_SSL', '' ); // Possible values '', 'ssl', 'tls' - note TLS is not STARTTLS. +define( 'WPMS_SMTP_AUTH', true ); // True turns it on, false turns it off. +define( 'WPMS_SMTP_USER', 'username' ); // SMTP authentication username, only used if WPMS_SMTP_AUTH is true. +define( 'WPMS_SMTP_PASS', 'password' ); // SMTP authentication password, only used if WPMS_SMTP_AUTH is true. +define( 'WPMS_SMTP_AUTOTLS', true ); // True turns it on, false turns it off. +*/ + +/** + * Don't allow multiple versions of 1.5.x (Lite and Pro) and above to be active. + * + * @since 1.5.0 + */ +if ( function_exists( 'wp_mail_smtp' ) ) { + + if ( ! function_exists( 'wp_mail_smtp_deactivate' ) ) { + /** + * Deactivate if plugin already activated. + * Needed when transitioning from 1.5+ Lite to Pro. + * + * @since 1.5.0 + */ + function wp_mail_smtp_deactivate() { + + deactivate_plugins( plugin_basename( __FILE__ ) ); + } + } + add_action( 'admin_init', 'wp_mail_smtp_deactivate' ); + + // Do not process the plugin code further. + return; +} + +if ( ! function_exists( 'wp_mail_smtp_check_pro_loading_allowed' ) ) { + /** + * Don't allow 1.4.x and below to break when 1.5+ Pro is activated. + * This will stop the current plugin from loading and display a message in admin area. + * + * @since 1.5.0 + */ + function wp_mail_smtp_check_pro_loading_allowed() { + + // Check for pro without using wp_mail_smtp()->is_pro(), because at this point it's too early. + if ( ! is_readable( rtrim( plugin_dir_path( __FILE__ ), '/\\' ) . '/src/Pro/Pro.php' ) ) { + // Currently, not a pro version of the plugin is loaded. + return false; + } + + if ( ! function_exists( 'is_plugin_active' ) ) { + require_once ABSPATH . '/wp-admin/includes/plugin.php'; + } + + // Search for old plugin name. + if ( is_plugin_active( 'wp-mail-smtp/wp_mail_smtp.php' ) ) { + // As Pro is loaded and Lite too - deactivate *silently* itself not to break older SMTP plugin. + deactivate_plugins( plugin_basename( __FILE__ ) ); + + add_action( 'admin_notices', 'wp_mail_smtp_lite_deactivation_notice' ); + + return true; + } + + return false; + } + + if ( ! function_exists( 'wp_mail_smtp_lite_deactivation_notice' ) ) { + /** + * Display the notice after deactivation. + * + * @since 1.5.0 + */ + function wp_mail_smtp_lite_deactivation_notice() { + + echo '

        ' . esc_html__( 'Please deactivate the free version of the WP Mail SMTP plugin before activating WP Mail SMTP Pro.', 'wp-mail-smtp' ) . '

        '; + + if ( isset( $_GET['activate'] ) ) { // phpcs:ignore + unset( $_GET['activate'] ); // phpcs:ignore + } + } + } + + // Stop the plugin loading. + if ( wp_mail_smtp_check_pro_loading_allowed() === true ) { + return; + } +} + +if ( ! defined( 'WPMS_PLUGIN_VER' ) ) { + define( 'WPMS_PLUGIN_VER', '1.9.0' ); +} +if ( ! defined( 'WPMS_PHP_VER' ) ) { + define( 'WPMS_PHP_VER', '5.3.6' ); +} + +/** + * Newer PHP version 5.3+ will be handled a lot differently, + * with better code and newer logic. + * + * @since 1.0.0 + */ +if ( version_compare( phpversion(), WPMS_PHP_VER, '>=' ) ) { + require_once dirname( __FILE__ ) . '/wp-mail-smtp.php'; + + return; +} + +/** + * PHP 5.2 only. + */ +require_once dirname( __FILE__ ) . '/wp-mail-smtp-0.11.2.php'; diff --git a/wp-content/plugins/wp-piwik/LICENSE b/wp-content/plugins/wp-piwik/LICENSE new file mode 100644 index 0000000..733c072 --- /dev/null +++ b/wp-content/plugins/wp-piwik/LICENSE @@ -0,0 +1,675 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + 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 . + +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: + + {project} Copyright (C) {year} {fullname} + 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 +. + + 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 +. + diff --git a/wp-content/plugins/wp-piwik/README.md b/wp-content/plugins/wp-piwik/README.md new file mode 100644 index 0000000..6fdc77b --- /dev/null +++ b/wp-content/plugins/wp-piwik/README.md @@ -0,0 +1,9 @@ +# WP-Matomo (former WP-Piwik) + +This [WordPress](https://wordpress.org) plugin adds a [Matomo](http://matomo.org) stats site to your blog's dashboard. It's also able to add the Matomo tracking code to your blog. + +## How to use this plugin + +To use this plugin you will need your own Matomo instance. If you do not already have a Matomo setup, you have two simple options: use either [self-hosted](http://matomo.org/) or [cloud-hosted](http://matomo.org/hosting/). + +This repository was created to develop and maintain WP-Matomo (WP-Piwik). Please see the WordPress plugin directory if you like to use this plugin: https://wordpress.org/plugins/wp-piwik/ diff --git a/wp-content/plugins/wp-piwik/bitcoin.png b/wp-content/plugins/wp-piwik/bitcoin.png new file mode 100644 index 0000000..e565fab Binary files /dev/null and b/wp-content/plugins/wp-piwik/bitcoin.png differ diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik.php new file mode 100644 index 0000000..fed1618 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik.php @@ -0,0 +1,1327 @@ + + * @package WP_Piwik + */ +class WP_Piwik { + + /** + * + * @var Runtime environment variables + */ + private static $revisionId = 2019072901, $version = '1.0.22', $blog_id, $pluginBasename = NULL, $logger, $settings, $request, $optionsPageId; + + /** + * Constructor class to configure and register all WP-Piwik components + */ + public function __construct() { + global $blog_id; + self::$blog_id = (isset ( $blog_id ) ? $blog_id : 'n/a'); + $this->openLogger (); + $this->openSettings (); + $this->setup (); + $this->addFilters (); + $this->addActions (); + $this->addShortcodes (); + } + + /** + * Destructor class to finish logging + */ + public function __destruct() { + $this->closeLogger (); + } + + /** + * Setup class to prepare settings and check for installation and update + */ + private function setup() { + self::$pluginBasename = plugin_basename ( __FILE__ ); + if (! $this->isInstalled ()) + $this->installPlugin (); + elseif ($this->isUpdated ()) + $this->updatePlugin (); + if ($this->isConfigSubmitted ()) + $this->applySettings (); + self::$settings->save (); + } + + /** + * Register WordPress actions + */ + private function addActions() { + if ( is_admin () ) { + add_action ( 'admin_menu', array ( + $this, + 'buildAdminMenu' + ) ); + add_action ( 'admin_post_save_wp-piwik_stats', array ( + $this, + 'onStatsPageSaveChanges' + ) ); + add_action ( 'load-post.php', array ( + $this, + 'addPostMetaboxes' + ) ); + add_action ( 'load-post-new.php', array ( + $this, + 'addPostMetaboxes' + ) ); + if ($this->isNetworkMode ()) { + add_action ( 'network_admin_notices', array ( + $this, + 'showNotices' + ) ); + add_action ( 'network_admin_menu', array ( + $this, + 'buildNetworkAdminMenu' + ) ); + add_action ( 'update_site_option_blogname', array ( + $this, + 'onBlogNameChange' + ) ); + add_action ( 'update_site_option_siteurl', array ( + $this, + 'onSiteUrlChange' + ) ); + } else { + add_action ( 'admin_notices', array ( + $this, + 'showNotices' + ) ); + add_action ( 'update_option_blogname', array ( + $this, + 'onBlogNameChange' + ) ); + add_action ( 'update_option_siteurl', array ( + $this, + 'onSiteUrlChange' + ) ); + } + if ($this->isDashboardActive ()) + add_action ( 'wp_dashboard_setup', array ( + $this, + 'extendWordPressDashboard' + ) ); + } + if ($this->isToolbarActive ()) { + add_action ( is_admin () ? 'admin_head' : 'wp_head', array ( + $this, + 'loadToolbarRequirements' + ) ); + add_action ( 'admin_bar_menu', array ( + $this, + 'extendWordPressToolbar' + ), 1000 ); + } + if ($this->isTrackingActive ()) { + if ( !is_admin () || $this->isAdminTrackingActive ()) { + $prefix = is_admin ()?'admin':'wp'; + add_action ( self::$settings->getGlobalOption ( 'track_codeposition' ) == 'footer' ? $prefix.'_footer' : $prefix.'_head', array ( + $this, + 'addJavascriptCode' + ) ); + if (self::$settings->getGlobalOption ( 'dnsprefetch' )) + add_action ( $prefix.'_head', array ( + $this, + 'addDNSPrefetchTag' + ) ); + if ($this->isAddNoScriptCode ()) + add_action ( $prefix.'_footer', array ( + $this, + 'addNoscriptCode' + ) ); + } + if (self::$settings->getGlobalOption ( 'add_post_annotations' )) + add_action ( 'transition_post_status', array ( + $this, + 'addPiwikAnnotation' + ), 10, 3 ); + } + + } + + /** + * Register WordPress filters + */ + private function addFilters() { + if (is_admin()) { + add_filter ( 'plugin_row_meta', array ( + $this, + 'setPluginMeta' + ), 10, 2 ); + add_filter ( 'screen_layout_columns', array ( + $this, + 'onScreenLayoutColumns' + ), 10, 2 ); + } elseif ($this->isTrackingActive ()) { + if ($this->isTrackFeed ()) { + add_filter ( 'the_excerpt_rss', array ( + $this, + 'addFeedTracking' + ) ); + add_filter ( 'the_content', array ( + $this, + 'addFeedTracking' + ) ); + } + if ($this->isAddFeedCampaign ()) { + add_filter ( 'post_link', array ( + $this, + 'addFeedCampaign' + ) ); + } + if ($this->isCrossDomainLinkingEnabled ()) { + add_filter ( 'wp_redirect', array ( + $this, + 'forwardCrossDomainVisitorId' + ) ); + } + } + } + + /** + * Register WordPress shortcodes + */ + private function addShortcodes() { + if ($this->isAddShortcode ()) + add_shortcode ( 'wp-piwik', array ( + $this, + 'shortcode' + ) ); + } + + /** + * Install WP-Piwik for the first time + */ + private function installPlugin($isUpdate = false) { + self::$logger->log ( 'Running WP-Piwik installation' ); + if (! $isUpdate) + $this->addNotice ( 'install', sprintf ( __ ( '%s %s installed.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), self::$version ), __ ( 'Next you should connect to Piwik', 'wp-piwik' ) ); + self::$settings->setGlobalOption ( 'revision', self::$revisionId ); + self::$settings->setGlobalOption ( 'last_settings_update', time () ); + } + + /** + * Uninstall WP-Piwik + */ + public function uninstallPlugin() { + self::$logger->log ( 'Running WP-Piwik uninstallation' ); + if (! defined ( 'WP_UNINSTALL_PLUGIN' )) + exit (); + self::deleteWordPressOption ( 'wp-piwik-notices' ); + self::$settings->resetSettings ( true ); + } + + /** + * Update WP-Piwik + */ + private function updatePlugin() { + self::$logger->log ( 'Upgrade WP-Piwik to ' . self::$version ); + $patches = glob ( dirname ( __FILE__ ) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'update' . DIRECTORY_SEPARATOR . '*.php' ); + $isPatched = false; + if (is_array ( $patches )) { + sort ( $patches ); + foreach ( $patches as $patch ) { + $patchVersion = ( int ) pathinfo ( $patch, PATHINFO_FILENAME ); + if ($patchVersion && self::$settings->getGlobalOption ( 'revision' ) < $patchVersion) { + self::includeFile ( 'update' . DIRECTORY_SEPARATOR . $patchVersion ); + $isPatched = true; + } + } + } + if ((self::$settings->getGlobalOption('update_notice') == 'enabled') || ((self::$settings->getGlobalOption('update_notice') == 'script') && $isPatched)) + $this->addNotice ( 'update', sprintf ( __ ( '%s updated to %s.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), self::$version ), __ ( 'Please validate your configuration', 'wp-piwik' ) ); + $this->installPlugin ( true ); + } + + /** + * Define a notice + * + * @param string $type + * identifier + * @param string $subject + * notice headline + * @param string $text + * notice content + * @param boolean $stay + * set to true if the message should persist (default: false) + */ + private function addNotice($type, $subject, $text, $stay = false) { + $notices = $this->getWordPressOption ( 'wp-piwik-notices', array () ); + $notices [$type] = array ( + 'subject' => $subject, + 'text' => $text, + 'stay' => $stay + ); + $this->updateWordPressOption ( 'wp-piwik-notices', $notices ); + } + + /** + * Show all notices defined previously + * + * @see addNotice() + */ + public function showNotices() { + $link = sprintf ( '%s', __ ( 'Settings', 'wp-piwik' ) ); + if ($notices = $this->getWordPressOption ( 'wp-piwik-notices' )) { + foreach ( $notices as $type => $notice ) { + printf ( '

        %s %s: %s: %s

        ', $notice ['subject'], __ ( 'Important', 'wp-piwik' ), $notice ['text'], $link ); + if (! $notice ['stay']) + unset ( $notices [$type] ); + } + } + $this->updateWordPressOption ( 'wp-piwik-notices', $notices ); + } + + /** + * Get the settings page URL + * + * @return string settings page URL + */ + private function getSettingsURL() { + return (self::$settings->checkNetworkActivation () ? 'settings' : 'options-general') . '.php?page=' . self::$pluginBasename; + } + + /** + * Echo javascript tracking code + */ + public function addJavascriptCode() { + if ($this->isHiddenUser ()) { + self::$logger->log ( 'Do not add tracking code to site (user should not be tracked) Blog ID: ' . self::$blog_id . ' Site ID: ' . self::$settings->getOption ( 'site_id' ) ); + return; + } + $trackingCode = new WP_Piwik\TrackingCode ( $this ); + $trackingCode->is404 = (is_404 () && self::$settings->getGlobalOption ( 'track_404' )); + $trackingCode->isUsertracking = self::$settings->getGlobalOption ( 'track_user_id' ) != 'disabled'; + $trackingCode->isSearch = (is_search () && self::$settings->getGlobalOption ( 'track_search' )); + self::$logger->log ( 'Add tracking code. Blog ID: ' . self::$blog_id . ' Site ID: ' . self::$settings->getOption ( 'site_id' ) ); + if ($this->isNetworkMode () && self::$settings->getGlobalOption ( 'track_mode' ) == 'manually') { + $siteId = $this->getPiwikSiteId (); + if ($siteId != 'n/a') + echo str_replace ( '{ID}', $siteId, $trackingCode->getTrackingCode () ); + else + echo ''; + } else + echo $trackingCode->getTrackingCode (); + } + + /** + * Echo DNS prefetch tag + */ + public function addDNSPrefetchTag() { + echo ''; + } + + /** + * Get Piwik Domain + */ + public function getPiwikDomain() { + switch (self::$settings->getGlobalOption ( 'piwik_mode' )) { + case 'php' : + return '//' . parse_url(self::$settings->getGlobalOption ( 'proxy_url' ), PHP_URL_HOST); + case 'cloud' : + return '//' . self::$settings->getGlobalOption ( 'piwik_user' ) . '.innocraft.cloud'; + case 'cloud-matomo' : + return '//' . self::$settings->getGlobalOption ( 'matomo_user' ) . '.matomo.cloud'; + default : + return '//' . parse_url(self::$settings->getGlobalOption ( 'piwik_url' ), PHP_URL_HOST); + } + } + + /** + * Echo noscript tracking code + */ + public function addNoscriptCode() { + if (self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy') + return; + if ($this->isHiddenUser ()) { + self::$logger->log ( 'Do not add noscript code to site (user should not be tracked) Blog ID: ' . self::$blog_id . ' Site ID: ' . self::$settings->getOption ( 'site_id' ) ); + return; + } + self::$logger->log ( 'Add noscript code. Blog ID: ' . self::$blog_id . ' Site ID: ' . self::$settings->getOption ( 'site_id' ) ); + echo self::$settings->getOption ( 'noscript_code' ) . "\n"; + } + + /** + * Register post view meta boxes + */ + public function addPostMetaboxes() { + if (self::$settings->getGlobalOption ( 'add_customvars_box' )) { + add_action ( 'add_meta_boxes', array ( + new WP_Piwik\Template\MetaBoxCustomVars ( $this, self::$settings ), + 'addMetabox' + ) ); + add_action ( 'save_post', array ( + new WP_Piwik\Template\MetaBoxCustomVars ( $this, self::$settings ), + 'saveCustomVars' + ), 10, 2 ); + } + if (self::$settings->getGlobalOption ( 'perpost_stats' )) { + add_action ( 'add_meta_boxes', array ( + $this, + 'onloadPostPage' + ) ); + } + } + + /** + * Register admin menu components + */ + public function buildAdminMenu() { + if (self::isConfigured ()) { + $cap = 'wp-piwik_read_stats'; + if (self::$settings->checkNetworkActivation ()) { + global $current_user; + $userRoles = $current_user->roles; + $allowed = self::$settings->getGlobalOption ( 'capability_read_stats' ); + if (is_array($userRoles) && is_array($allowed)) + foreach ($userRoles as $userRole) + if (isset( $allowed[$userRole] ) && $allowed[$userRole]) { + $cap = 'read'; + break; + } + } + $statsPage = new WP_Piwik\Admin\Statistics ( $this, self::$settings ); + $this->statsPageId = add_dashboard_page ( __ ( 'Piwik Statistics', 'wp-piwik' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), $cap, 'wp-piwik_stats', array ( + $statsPage, + 'show' + ) ); + $this->loadAdminStatsHeader ( $this->statsPageId, $statsPage ); + } + if (! self::$settings->checkNetworkActivation ()) { + $optionsPage = new WP_Piwik\Admin\Settings ( $this, self::$settings ); + self::$optionsPageId = add_options_page ( self::$settings->getGlobalOption ( 'plugin_display_name' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), 'activate_plugins', __FILE__, array ( + $optionsPage, + 'show' + ) ); + $this->loadAdminSettingsHeader ( self::$optionsPageId, $optionsPage ); + } + } + + /** + * Register network admin menu components + */ + public function buildNetworkAdminMenu() { + if (self::isConfigured ()) { + $statsPage = new WP_Piwik\Admin\Network ( $this, self::$settings ); + $this->statsPageId = add_dashboard_page ( __ ( 'Piwik Statistics', 'wp-piwik' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), 'manage_sites', 'wp-piwik_stats', array ( + $statsPage, + 'show' + ) ); + $this->loadAdminStatsHeader ( $this->statsPageId, $statsPage ); + } + $optionsPage = new WP_Piwik\Admin\Settings ( $this, self::$settings ); + self::$optionsPageId = add_submenu_page ( 'settings.php', self::$settings->getGlobalOption ( 'plugin_display_name' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), 'manage_sites', __FILE__, array ( + $optionsPage, + 'show' + ) ); + $this->loadAdminSettingsHeader ( self::$optionsPageId, $optionsPage ); + } + + /** + * Register admin header extensions for stats page + * + * @param $optionsPageId options + * page id + * @param $optionsPage options + * page object + */ + public function loadAdminStatsHeader($statsPageId, $statsPage) { + add_action ( 'admin_print_scripts-' . $statsPageId, array ( + $statsPage, + 'printAdminScripts' + ) ); + add_action ( 'admin_print_styles-' . $statsPageId, array ( + $statsPage, + 'printAdminStyles' + ) ); + add_action ( 'admin_head-' . $statsPageId, array ( + $statsPage, + 'extendAdminHeader' + ) ); + add_action ( 'load-' . $statsPageId, array ( + $this, + 'onloadStatsPage' + ) ); + } + + /** + * Register admin header extensions for settings page + * + * @param $optionsPageId options + * page id + * @param $optionsPage options + * page object + */ + public function loadAdminSettingsHeader($optionsPageId, $optionsPage) { + add_action ( 'admin_head-' . $optionsPageId, array ( + $optionsPage, + 'extendAdminHeader' + ) ); + add_action ( 'admin_print_styles-' . $optionsPageId, array ( + $optionsPage, + 'printAdminStyles' + ) ); + } + + /** + * Register WordPress dashboard widgets + */ + public function extendWordPressDashboard() { + if (current_user_can ( 'wp-piwik_read_stats' )) { + if (self::$settings->getGlobalOption ( 'dashboard_widget' ) != 'disabled') + new WP_Piwik\Widget\Overview ( $this, self::$settings, 'dashboard', 'side', 'default', array ( + 'date' => self::$settings->getGlobalOption ( 'dashboard_widget' ), + 'period' => 'day' + ) ); + if (self::$settings->getGlobalOption ( 'dashboard_chart' )) + new WP_Piwik\Widget\Chart ( $this, self::$settings ); + if (self::$settings->getGlobalOption ( 'dashboard_ecommerce' )) + new WP_Piwik\Widget\Ecommerce ( $this, self::$settings ); + if (self::$settings->getGlobalOption ( 'dashboard_seo' )) + new WP_Piwik\Widget\Seo ( $this, self::$settings ); + } + } + + /** + * Register WordPress toolbar components + */ + public function extendWordPressToolbar($toolbar) { + if (current_user_can ( 'wp-piwik_read_stats' ) && is_admin_bar_showing ()) { + $id = WP_Piwik\Request::register ( 'VisitsSummary.getUniqueVisitors', array ( + 'period' => 'day', + 'date' => 'last30' + ) ); + $unique = $this->request ( $id ); + $url = is_network_admin () ? $this->getSettingsURL () : false; + $content = is_network_admin () ? __('Configure WP-Piwik', 'wp-piwik') : ''; + // Leave if result array does contain a message instead of valid data + if (isset($unique['result'])) + $content .= ''; + elseif (is_array ( $unique ) ) { + $content = "Loading..."; + $url = $this->getStatsURL (); + } + $toolbar->add_menu ( array ( + 'id' => 'wp-piwik_stats', + 'title' => $content, + 'href' => $url + ) ); + } + } + + /** + * Add plugin meta data + * + * @param array $links + * list of already defined plugin meta data + * @param string $file + * handled file + * @return array complete list of plugin meta data + */ + public function setPluginMeta($links, $file) { + if ($file == 'wp-piwik/wp-piwik.php' && (!$this->isNetworkMode () || is_network_admin()) ) + return array_merge ( $links, array ( + sprintf ( '%s', self::getSettingsURL (), __ ( 'Settings', 'wp-piwik' ) ) + ) ); + return $links; + } + + /** + * Prepare toolbar widget requirements + */ + public function loadToolbarRequirements() { + if (is_admin_bar_showing ()) { + wp_enqueue_script ( 'wp-piwik-sparkline', $this->getPluginURL () . 'js/sparkline/jquery.sparkline.min.js', array ( + 'jquery' + ), self::$version ); + wp_enqueue_style ( 'wp-piwik', $this->getPluginURL () . 'css/wp-piwik-spark.css', array (), $this->getPluginVersion () ); + } + } + + /** + * Add tracking pixels to feed content + * + * @param string $content + * post content + * @return string post content extended by tracking pixel + */ + public function addFeedTracking($content) { + global $post; + if (is_feed ()) { + self::$logger->log ( 'Add tracking image to feed entry.' ); + if (! self::$settings->getOption ( 'site_id' )) { + $siteId = $this->requestPiwikSiteId (); + if ($siteId != 'n/a') + self::$settings->setOption ( 'site_id', $siteId ); + else + return false; + } + $title = the_title ( null, null, false ); + $posturl = get_permalink ( $post->ID ); + $urlref = get_bloginfo ( 'rss2_url' ); + if (self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy') + $url = plugins_url ( 'wp-piwik' ) . '/proxy/piwik.php'; + else { + $url = self::$settings->getGlobalOption ( 'piwik_url' ); + if (substr($url, -10, 10) == '/index.php') + $url = str_replace('/index.php', '/piwik.php', $url); + else + $url .= 'piwik.php'; + } + $trackingImage = $url . '?idsite=' . self::$settings->getOption ( 'site_id' ) . '&rec=1&url=' . urlencode ( $posturl ) . '&action_name=' . urlencode ( $title ) . '&urlref=' . urlencode ( $urlref ); + $content .= ''; + } + return $content; + } + + /** + * Add a campaign parameter to feed permalink + * + * @param string $permalink + * permalink + * @return string permalink extended by campaign parameter + */ + public function addFeedCampaign($permalink) { + global $post; + if (is_feed ()) { + self::$logger->log ( 'Add campaign to feed permalink.' ); + $sep = (strpos ( $permalink, '?' ) === false ? '?' : '&'); + $permalink .= $sep . 'pk_campaign=' . urlencode ( self::$settings->getGlobalOption ( 'track_feed_campaign' ) ) . '&pk_kwd=' . urlencode ( $post->post_name ); + } + return $permalink; + } + + /** + * Forwards the cross domain parameter pk_vid if the URL parameter is set and a user is about to be redirected. + * When another website links to WooCommerce with a pk_vid parameter, and WooCommerce redirects the user to another + * URL, the pk_vid parameter would get lost and the visitorId would later not be applied by the tracking code + * due to the lost pk_vid URL parameter. If the URL parameter is set, we make sure to forward this parameter. + * + * @param string $location + * + * @return string location extended by pk_vid URL parameter if the URL parameter is set + */ + public function forwardCrossDomainVisitorId($location) { + + if (!empty($_GET['pk_vid']) + && preg_match('/^[a-zA-Z0-9]{24,48}$/', $_GET['pk_vid'])) { + // currently, the pk_vid parameter is 32 characters long, but it may vary over time. + $location = add_query_arg( 'pk_vid', $_GET['pk_vid'], $location ); + } + + return $location; + } + + /** + * Apply settings update + * + * @return boolean settings update applied + */ + private function applySettings() { + self::$settings->applyChanges ( $_POST ['wp-piwik'] ); + if (self::$settings->getGlobalOption ( 'auto_site_config' ) && self::isConfigured ()) { + if ($this->isPHPMode () && ! defined ( 'PIWIK_INCLUDE_PATH' )) + self::definePiwikConstants (); + $siteId = $this->getPiwikSiteId (); + $trackingCode = $this->updateTrackingCode ( $siteId ); + self::$settings->setOption ( 'site_id', $siteId ); + } + self::$settings->setGlobalOption ( 'revision', self::$revisionId ); + self::$settings->setGlobalOption ( 'last_settings_update', time () ); + return true; + } + + /** + * Check if WP-Piwik is configured + * + * @return boolean Is WP-Piwik configured? + */ + public static function isConfigured() { + return (self::$settings->getGlobalOption ( 'piwik_token' ) && (self::$settings->getGlobalOption ( 'piwik_mode' ) != 'disabled') && (((self::$settings->getGlobalOption ( 'piwik_mode' ) == 'http') && (self::$settings->getGlobalOption ( 'piwik_url' ))) || ((self::$settings->getGlobalOption ( 'piwik_mode' ) == 'php') && (self::$settings->getGlobalOption ( 'piwik_path' ))) || ((self::$settings->getGlobalOption ( 'piwik_mode' ) == 'cloud') && (self::$settings->getGlobalOption ( 'piwik_user' ))) || ((self::$settings->getGlobalOption ( 'piwik_mode' ) == 'cloud-matomo') && (self::$settings->getGlobalOption ( 'matomo_user' ))))); + } + + /** + * Check if WP-Piwik was updated + * + * @return boolean Was WP-Piwik updated? + */ + private function isUpdated() { + return self::$settings->getGlobalOption ( 'revision' ) && self::$settings->getGlobalOption ( 'revision' ) < self::$revisionId; + } + + /** + * Check if WP-Piwik is already installed + * + * @return boolean Is WP-Piwik installed? + */ + private function isInstalled() { + $oldSettings = $this->getWordPressOption ( 'wp-piwik_global-settings', false ); + if ($oldSettings && isset( $oldSettings['revision'] )) { + self::log('Save old settings'); + self::$settings->setGlobalOption ( 'revision', $oldSettings['revision'] ); + } else self::log( 'Current revision '.self::$settings->getGlobalOption ( 'revision' ) ); + return self::$settings->getGlobalOption ( 'revision' ) > 0; + } + + /** + * Check if new settings were submitted + * + * @return boolean Are new settings submitted? + */ + public static function isConfigSubmitted() { + return isset ( $_POST ) && isset ( $_POST ['wp-piwik'] ) && self::isValidOptionsPost(); + } + + /** + * Check if PHP mode is chosen + * + * @return Is PHP mode chosen? + */ + public function isPHPMode() { + return self::$settings->getGlobalOption ( 'piwik_mode' ) && self::$settings->getGlobalOption ( 'piwik_mode' ) == 'php'; + } + + /** + * Check if WordPress is running in network mode + * + * @return boolean Is WordPress running in network mode? + */ + public function isNetworkMode() { + return self::$settings->checkNetworkActivation (); + } + + /** + * Check if a WP-Piwik dashboard widget is enabled + * + * @return boolean Is a dashboard widget enabled? + */ + private function isDashboardActive() { + return self::$settings->getGlobalOption ( 'dashboard_widget' ) || self::$settings->getGlobalOption ( 'dashboard_chart' ) || self::$settings->getGlobalOption ( 'dashboard_seo' ); + } + + /** + * Check if a WP-Piwik toolbar widget is enabled + * + * @return boolean Is a toolbar widget enabled? + */ + private function isToolbarActive() { + return self::$settings->getGlobalOption ( 'toolbar' ); + } + + /** + * Check if WP-Piwik tracking code insertion is enabled + * + * @return boolean Insert tracking code? + */ + private function isTrackingActive() { + return self::$settings->getGlobalOption ( 'track_mode' ) != 'disabled'; + } + + /** + * Check if admin tracking is enabled + * + * @return boolean Is admin tracking enabled? + */ + private function isAdminTrackingActive() { + return self::$settings->getGlobalOption ( 'track_admin' ) && is_admin (); + } + + /** + * Check if WP-Piwik noscript code insertion is enabled + * + * @return boolean Insert noscript code? + */ + private function isAddNoScriptCode() { + return self::$settings->getGlobalOption ( 'track_noscript' ); + } + + /** + * Check if feed tracking is enabled + * + * @return boolean Is feed tracking enabled? + */ + private function isTrackFeed() { + return self::$settings->getGlobalOption ( 'track_feed' ); + } + + /** + * Check if feed permalinks get a campaign parameter + * + * @return boolean Add campaign parameter to feed permalinks? + */ + private function isAddFeedCampaign() { + return self::$settings->getGlobalOption ( 'track_feed_addcampaign' ); + } + + /** + * Check if feed permalinks get a campaign parameter + * + * @return boolean Add campaign parameter to feed permalinks? + */ + private function isCrossDomainLinkingEnabled() { + return self::$settings->getGlobalOption ( 'track_crossdomain_linking' ); + } + + /** + * Check if WP-Piwik shortcodes are enabled + * + * @return boolean Are shortcodes enabled? + */ + private function isAddShortcode() { + return self::$settings->getGlobalOption ( 'shortcodes' ); + } + + /** + * Define Piwik constants for PHP reporting API + */ + public static function definePiwikConstants() { + if (! defined ( 'PIWIK_INCLUDE_PATH' )) { + //@header('Content-type: text/html'); + define ( 'PIWIK_INCLUDE_PATH', self::$settings->getGlobalOption ( 'piwik_path' ) ); + define ( 'PIWIK_USER_PATH', self::$settings->getGlobalOption ( 'piwik_path' ) ); + define ( 'PIWIK_ENABLE_DISPATCH', false ); + define ( 'PIWIK_ENABLE_ERROR_HANDLER', false ); + define ( 'PIWIK_ENABLE_SESSION_START', false ); + } + } + + /** + * Start chosen logging method + */ + private function openLogger() { + switch (WP_PIWIK_ACTIVATE_LOGGER) { + case 1 : + self::$logger = new WP_Piwik\Logger\Screen ( __CLASS__ ); + break; + case 2 : + self::$logger = new WP_Piwik\Logger\File ( __CLASS__ ); + break; + default : + self::$logger = new WP_Piwik\Logger\Dummy ( __CLASS__ ); + } + } + + /** + * Log a message + * + * @param string $message + * logger message + */ + public static function log($message) { + self::$logger->log ( $message ); + } + + /** + * End logging + */ + private function closeLogger() { + self::$logger = null; + } + + /** + * Load WP-Piwik settings + */ + private function openSettings() { + self::$settings = new WP_Piwik\Settings ( $this, self::$logger ); + if (! $this->isConfigSubmitted () && $this->isPHPMode () && ! defined ( 'PIWIK_INCLUDE_PATH' )) + self::definePiwikConstants (); + } + + /** + * Include a WP-Piwik file + */ + private function includeFile($strFile) { + self::$logger->log ( 'Include ' . $strFile . '.php' ); + if (WP_PIWIK_PATH . $strFile . '.php') + include (WP_PIWIK_PATH . $strFile . '.php'); + } + + /** + * Check if user should not be tracked + * + * @return boolean Do not track user? + */ + private function isHiddenUser() { + if (is_multisite ()) + foreach ( self::$settings->getGlobalOption ( 'capability_stealth' ) as $key => $val ) + if ($val && current_user_can ( $key )) + return true; + return current_user_can ( 'wp-piwik_stealth' ); + } + + /** + * Check if tracking code is up to date + * + * @return boolean Is tracking code up to date? + */ + public function isCurrentTrackingCode() { + return (self::$settings->getOption ( 'last_tracking_code_update' ) && self::$settings->getOption ( 'last_tracking_code_update' ) > self::$settings->getGlobalOption ( 'last_settings_update' )); + } + + /** + * DEPRECTAED Add javascript code to site header + * + * @deprecated + * + */ + public function site_header() { + self::$logger->log ( 'Using deprecated function site_header' ); + $this->addJavascriptCode (); + } + + /** + * DEPRECTAED Add javascript code to site footer + * + * @deprecated + * + */ + public function site_footer() { + self::$logger->log ( 'Using deprecated function site_footer' ); + $this->addNoscriptCode (); + } + + /** + * Identify new posts if an annotation is required + * and create Piwik annotation + * + * @param string $newStatus + * new post status + * @param strint $oldStatus + * new post status + * @param object $post + * current post object + */ + public function addPiwikAnnotation($newStatus, $oldStatus, $post) { + $enabledPostTypes = self::$settings->getGlobalOption ( 'add_post_annotations' ); + if (isset($enabledPostTypes[$post->post_type]) && $enabledPostTypes[$post->post_type] && $newStatus == 'publish' && $oldStatus != 'publish') { + $note = 'Published: ' . $post->post_title . ' - URL: ' . get_permalink ( $post->ID ); + $id = WP_Piwik\Request::register ( 'Annotations.add', array ( + 'idSite' => $this->getPiwikSiteId (), + 'date' => date ( 'Y-m-d' ), + 'note' => $note + ) ); + $result = $this->request ( $id ); + self::$logger->log ( 'Add post annotation. ' . $note . ' - ' . serialize ( $result ) ); + } + } + + /** + * Get WP-Piwik's URL + */ + public function getPluginURL() { + return trailingslashit ( plugins_url () . '/wp-piwik/' ); + } + + /** + * Get WP-Piwik's version + */ + public function getPluginVersion() { + return self::$version; + } + + /** + * Enable three columns for WP-Piwik stats screen + * + * @param + * array full list of column settings + * @param + * mixed current screen id + * @return array updated list of column settings + */ + public function onScreenLayoutColumns($columns, $screen) { + if (isset( $this->statsPageId ) && $screen == $this->statsPageId) + $columns [$this->statsPageId] = 3; + return $columns; + } + + /** + * Add tracking code to admin header + */ + function addAdminHeaderTracking() { + $this->addJavascriptCode (); + } + + /** + * Get option value + * + * @param string $key + * option key + * @return mixed option value + */ + public function getOption($key) { + return self::$settings->getOption ( $key ); + } + + /** + * Get global option value + * + * @param string $key + * global option key + * @return mixed global option value + */ + public function getGlobalOption($key) { + return self::$settings->getGlobalOption ( $key ); + } + + /** + * Get stats page URL + * + * @return string stats page URL + */ + public function getStatsURL() { + return admin_url () . '?page=wp-piwik_stats'; + } + + /** + * Execute WP-Piwik test script + */ + private function loadTestscript() { + $this->includeFile ( 'debug' . DIRECTORY_SEPARATOR . 'testscript' ); + } + + /** + * Echo an error message + * + * @param string $message + * message content + */ + private static function showErrorMessage($message) { + echo '' . __ ( 'An error occured', 'wp-piwik' ) . ': ' . $message . ' [' . __ ( 'Support', 'wp-piwik' ) . ']'; + } + + /** + * Perform a Piwik request + * + * @param string $id + * request ID + * @return mixed request result + */ + public function request($id, $debug = false) { + if ( self::$settings->getGlobalOption ( 'piwik_mode' ) == 'disabled' ) + return 'n/a'; + if (! isset ( self::$request ) || empty ( self::$request )) + self::$request = (self::$settings->getGlobalOption ( 'piwik_mode' ) == 'http' || self::$settings->getGlobalOption ( 'piwik_mode' ) == 'cloud' || self::$settings->getGlobalOption ( 'piwik_mode' ) == 'cloud-matomo' ? new WP_Piwik\Request\Rest ( $this, self::$settings ) : new WP_Piwik\Request\Php ( $this, self::$settings )); + if ($debug) + return self::$request->getDebug ( $id ); + return self::$request->perform ( $id ); + } + + /** + * Reset request object + */ + public function resetRequest() { + if (is_object(self::$request)) + self::$request->reset(); + self::$request = NULL; + } + + /** + * Execute WP-Piwik shortcode + * + * @param array $attributes + * attribute list + */ + public function shortcode($attributes) { + shortcode_atts ( array ( + 'title' => '', + 'module' => 'overview', + 'period' => 'day', + 'date' => 'yesterday', + 'limit' => 10, + 'width' => '100%', + 'height' => '200px', + 'idsite' => '', + 'language' => 'en', + 'range' => false, + 'key' => 'sum_daily_nb_uniq_visitors' + ), $attributes ); + $shortcodeObject = new \WP_Piwik\Shortcode ( $attributes, $this, self::$settings ); + return $shortcodeObject->get(); + } + + /** + * Get Piwik site ID by blog ID + * + * @param int $blogId + * which blog's Piwik site ID to get, default is the current blog + * @return mixed Piwik site ID or n/a + */ + public function getPiwikSiteId($blogId = null) { + if (! $blogId && $this->isNetworkMode ()) + $blogId = get_current_blog_id (); + $result = self::$settings->getOption ( 'site_id', $blogId ); + self::$logger->log ( 'Database result: ' . $result ); + return (! empty ( $result ) ? $result : $this->requestPiwikSiteId ( $blogId )); + } + + /** + * Get a detailed list of all Piwik sites + * + * @return array Piwik sites + */ + public function getPiwikSiteDetails() { + $id = WP_Piwik\Request::register ( 'SitesManager.getSitesWithAtLeastViewAccess', array () ); + $piwikSiteDetails = $this->request ( $id ); + return $piwikSiteDetails; + } + + /** + * Estimate a Piwik site ID by blog ID + * + * @param int $blogId + * which blog's Piwik site ID to estimate, default is the current blog + * @return mixed Piwik site ID or n/a + */ + private function requestPiwikSiteId($blogId = null) { + $isCurrent = ! self::$settings->checkNetworkActivation () || empty ( $blogId ); + if (self::$settings->getGlobalOption ( 'auto_site_config' )) { + $id = WP_Piwik\Request::register ( 'SitesManager.getSitesIdFromSiteUrl', array ( + 'url' => $isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl + ) ); + $result = $this->request ( $id ); + $this->log ( 'Tried to identify current site, result: ' . serialize ( $result ) ); + if (is_array( $result ) && empty( $result )) + $result = $this->addPiwikSite ( $blogId ); + elseif ( $result != 'n/a' && isset($result [0]) ) + $result = $result [0] ['idsite']; + else $result = null; + } else $result = null; + self::$logger->log ( 'Get Piwik ID: WordPress site ' . ($isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl) . ' = Piwik ID ' . $result ); + if ($result !== null) { + self::$settings->setOption ( 'site_id', $result, $blogId ); + if (self::$settings->getGlobalOption ( 'track_mode' ) != 'disabled' && self::$settings->getGlobalOption ( 'track_mode' ) != 'manually') { + $code = $this->updateTrackingCode ( $result, $blogId ); + } + $this::$settings->save (); + return $result; + } + return 'n/a'; + } + + /** + * Add a new Piwik + * + * @param int $blogId + * which blog's Piwik site to create, default is the current blog + * @return int Piwik site ID + */ + public function addPiwikSite($blogId = null) { + $isCurrent = ! self::$settings->checkNetworkActivation () || empty ( $blogId ); + // Do not add site if Piwik connection is unreliable + if (! $this->request ( 'global.getPiwikVersion' )) + return null; + $id = WP_Piwik\Request::register ( 'SitesManager.addSite', array ( + 'urls' => $isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl, + 'siteName' => urlencode( $isCurrent ? get_bloginfo ( 'name' ) : get_blog_details ( $blogId )->blogname ) + ) ); + $result = (int) $this->request ( $id ); + self::$logger->log ( 'Create Piwik ID: WordPress site ' . ($isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl) . ' = Piwik ID ' . $result ); + if (empty ( $result )) + return null; + else { + do_action('wp-piwik_site_created', $result); + return $result; + } + } + + /** + * Update a Piwik site's detail information + * + * @param int $siteId + * which Piwik site to updated + * @param int $blogId + * which blog's Piwik site ID to get, default is the current blog + */ + private function updatePiwikSite($siteId, $blogId = null) { + $isCurrent = ! self::$settings->checkNetworkActivation () || empty ( $blogId ); + $id = WP_Piwik\Request::register ( 'SitesManager.updateSite', array ( + 'idSite' => $siteId, + 'urls' => $isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl, + 'siteName' => $isCurrent ? get_bloginfo ( 'name' ) : get_blog_details ( $blogId )->blogname + ) ); + $this->request ( $id ); + self::$logger->log ( 'Update Piwik site: WordPress site ' . ($isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl) ); + } + + /** + * Update a site's tracking code + * + * @param int $siteId + * which Piwik site to updated + * @param int $blogId + * which blog's Piwik site ID to get, default is the current blog + * @return string tracking code + */ + public function updateTrackingCode($siteId = false, $blogId = null) { + if (!$siteId) + $siteId = $this->getPiwikSiteId (); + if (self::$settings->getGlobalOption ( 'track_mode' ) == 'disabled' || self::$settings->getGlobalOption ( 'track_mode' ) == 'manually') + return false; + $id = WP_Piwik\Request::register ( 'SitesManager.getJavascriptTag', array ( + 'idSite' => $siteId, + 'mergeSubdomains' => self::$settings->getGlobalOption ( 'track_across' ) ? 1 : 0, + 'mergeAliasUrls' => self::$settings->getGlobalOption ( 'track_across_alias' ) ? 1 : 0, + 'disableCookies' => self::$settings->getGlobalOption ( 'disable_cookies' ) ? 1 : 0, + 'crossDomain' => self::$settings->getGlobalOption ( 'track_crossdomain_linking' ) ? 1 : 0, + 'trackNoScript' => 1 + ) ); + $code = $this->request ( $id ); + if (is_array($code) && isset($code['value'])) + $code = $code['value']; + $result = !is_array ( $code ) ? html_entity_decode ( $code ) : ''; + self::$logger->log ( 'Delivered tracking code: ' . $result ); + $result = WP_Piwik\TrackingCode::prepareTrackingCode ( $result, self::$settings, self::$logger, true ); + if (isset ( $result ['script'] ) && ! empty ( $result ['script'] )) { + self::$settings->setOption ( 'tracking_code', $result ['script'], $blogId ); + self::$settings->setOption ( 'noscript_code', $result ['noscript'], $blogId ); + self::$settings->setGlobalOption ( 'proxy_url', $result ['proxy'], $blogId ); + } + return $result; + } + + /** + * Update Piwik site if blog name changes + * + * @param string $oldValue + * old blog name + * @param string $newValue + * new blog name + */ + public function onBlogNameChange($oldValue, $newValue = null) { + $this->updatePiwikSite ( self::$settings->getOption ( 'site_id' ) ); + } + + /** + * Update Piwik site if blog URL changes + * + * @param string $oldValue + * old blog URL + * @param string $newValue + * new blog URL + */ + public function onSiteUrlChange($oldValue, $newValue = null) { + $this->updatePiwikSite ( self::$settings->getOption ( 'site_id' ) ); + } + + /** + * Register stats page meta boxes + * + * @param mixed $statsPageId + * WordPress stats page ID + */ + public function onloadStatsPage($statsPageId) { + if (self::$settings->getGlobalOption ( 'disable_timelimit' )) + set_time_limit ( 0 ); + wp_enqueue_script ( 'common' ); + wp_enqueue_script ( 'wp-lists' ); + wp_enqueue_script ( 'postbox' ); + wp_enqueue_script ( 'wp-piwik', $this->getPluginURL () . 'js/wp-piwik.js', array (), self::$version, true ); + wp_enqueue_script ( 'wp-piwik-jqplot', $this->getPluginURL () . 'js/jqplot/wp-piwik.jqplot.js', array ( + 'jquery' + ), self::$version ); + new \WP_Piwik\Widget\Chart ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\Visitors ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\Overview ( $this, self::$settings, $this->statsPageId ); + if (self::$settings->getGlobalOption ( 'stats_ecommerce' )) { + new \WP_Piwik\Widget\Ecommerce ($this, self::$settings, $this->statsPageId); + new \WP_Piwik\Widget\Items ($this, self::$settings, $this->statsPageId); + new \WP_Piwik\Widget\ItemsCategory ($this, self::$settings, $this->statsPageId); + } + if (self::$settings->getGlobalOption ( 'stats_seo' )) + new \WP_Piwik\Widget\Seo ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\Pages ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\Keywords ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\Referrers ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\Plugins ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\Search ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\Noresult ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\Browsers ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\BrowserDetails ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\Screens ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\Types ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\Models ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\Systems ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\SystemDetails ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\City ( $this, self::$settings, $this->statsPageId ); + new \WP_Piwik\Widget\Country ( $this, self::$settings, $this->statsPageId ); + } + + /** + * Add per post statistics to a post's page + * + * @param mixed $postPageId + * WordPress post page ID + */ + public function onloadPostPage($postPageId) { + global $post; + $postUrl = get_permalink ( $post->ID ); + $this->log ( 'Load per post statistics: ' . $postUrl ); + array ( + new \WP_Piwik\Widget\Post ( $this, self::$settings, array('post', 'page', 'custom_post_type'), 'side', 'default', array ( + 'url' => $postUrl + ) ), + 'show' + ); + } + + /** + * Stats page changes by POST submit + * + * @see http://tinyurl.com/5r5vnzs + */ + function onStatsPageSaveChanges() { + if (! current_user_can ( 'manage_options' )) + wp_die ( __ ( 'Cheatin’ uh?' ) ); + check_admin_referer ( 'wp-piwik_stats' ); + wp_redirect ( $_POST ['_wp_http_referer'] ); + } + + /** + * Get option value, choose method depending on network mode + * + * @param string $option option key + * @return string option value + */ + private function getWordPressOption($option, $default = null) { + return ($this->isNetworkMode () ? get_site_option ( $option, $default ) : get_option ( $option, $default )); + } + + /** + * Delete option, choose method depending on network mode + * + * @param string $option option key + */ + private function deleteWordPressOption($option) { + if ( $this->isNetworkMode () ) + delete_site_option ( $option ); + else + delete_option ( $option ); + } + + /** + * Set option value, choose method depending on network mode + * + * @param string $option option key + * @param mixed $value option value + */ + private function updateWordPressOption($option, $value) { + if ( $this->isNetworkMode () ) + update_site_option ( $option, $value ); + else + update_option ( $option, $value ); + } + + /** + * Check if WP-Piwik options page + * + * @return boolean True if current page is WP-Piwik's option page + */ + public static function isValidOptionsPost() { + return is_admin() && check_admin_referer( 'wp-piwik_settings' ) && current_user_can( 'manage_options' ) ; + } +} diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin.php new file mode 100644 index 0000000..23d83db --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin.php @@ -0,0 +1,26 @@ +getPluginURL().'css/wp-piwik.css', array(), self::$wpPiwik->getPluginVersion()); + } + + public function onLoad() {} + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Network.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Network.php new file mode 100644 index 0000000..b60575e --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Network.php @@ -0,0 +1,25 @@ +getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true); + wp_enqueue_script('wp-piwik-jqplot', self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'), self::$wpPiwik->getPluginVersion()); + } + + public function extendAdminHeader() { + echo ''; + echo ''; + echo ''; + } + + public function onLoad() { + self::$wpPiwik->onloadStatsPage(self::$pageID); + } + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php new file mode 100644 index 0000000..06b8a15 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Admin/Settings.php @@ -0,0 +1,720 @@ + + */ +class Settings extends \WP_Piwik\Admin { + + /** + * Builds and displays the settings page + */ + public function show() { + if (isset($_GET['sitebrowser']) && $_GET['sitebrowser']) { + new \WP_Piwik\Admin\Sitebrowser(self::$wpPiwik); + return; + } + if (isset($_GET['clear']) && $_GET['clear']) { + $this->clear($_GET['clear'] == 2); + self::$wpPiwik->resetRequest(); + echo '
        '; + return; + } elseif (self::$wpPiwik->isConfigSubmitted()) { + $this->showBox ( 'updated', 'yes', __ ( 'Changes saved.' ) ); + self::$wpPiwik->resetRequest(); + self::$wpPiwik->updateTrackingCode(); + } + global $wp_roles; + ?> +
        + getHeadline ( 1, 'admin-generic', 'Settings', true ); + if (isset($_GET['testscript']) && $_GET['testscript']) + $this->runTestscript(); + ?> + isConfigured ()) { + $piwikVersion = self::$wpPiwik->request ( 'global.getPiwikVersion' ); + if (is_array ( $piwikVersion ) && isset( $piwikVersion['value'] )) + $piwikVersion = $piwikVersion['value']; + if (! empty ( $piwikVersion ) && !is_array( $piwikVersion )) + $this->showDonation(); + } + ?> +
        + + + + + '; + printf ( '', __ ( 'Thanks for using WP-Matomo!', 'wp-piwik' ) ); + if (self::$wpPiwik->isConfigured ()) { + if (! empty ( $piwikVersion ) && !is_array( $piwikVersion )) { + $this->showText ( sprintf ( __ ( 'WP-Matomo %s is successfully connected to Matomo %s.', 'wp-piwik' ), self::$wpPiwik->getPluginVersion (), $piwikVersion ) . ' ' . (! self::$wpPiwik->isNetworkMode () ? sprintf ( __ ( 'You are running WordPress %s.', 'wp-piwik' ), get_bloginfo ( 'version' ) ) : sprintf ( __ ( 'You are running a WordPress %s blog network (WPMU). WP-Matomo will handle your sites as different websites.', 'wp-piwik' ), get_bloginfo ( 'version' ) )) ); + } else { + $errorMessage = \WP_Piwik\Request::getLastError(); + if ( empty( $errorMessage ) ) + $this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Matomo %s was not able to connect to Matomo using your configuration. Check the »Connect to Matomo« section below.', 'wp-piwik' ), self::$wpPiwik->getPluginVersion () ) ); + else + $this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Matomo %s was not able to connect to Matomo using your configuration. During connection the following error occured:
        %s', 'wp-piwik' ), self::$wpPiwik->getPluginVersion (), $errorMessage ) ); + } + } else + $this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Matomo %s has to be connected to Matomo first. Check the »Connect to Matomo« section below.', 'wp-piwik' ), self::$wpPiwik->getPluginVersion () ) ); + + $tabs ['connect'] = array ( + 'icon' => 'admin-plugins', + 'name' => __('Connect to Matomo', 'wp-piwik') + ); + if (self::$wpPiwik->isConfigured ()) { + $tabs ['statistics'] = array ( + 'icon' => 'chart-pie', + 'name' => __('Show Statistics', 'wp-piwik') + ); + $tabs ['tracking'] = array ( + 'icon' => 'location-alt', + 'name' => __('Enable Tracking', 'wp-piwik') + ); + } + $tabs ['expert'] = array ( + 'icon' => 'shield', + 'name' => __('Expert Settings', 'wp-piwik') + ); + $tabs ['support'] = array ( + 'icon' => 'lightbulb', + 'name' => __('Support', 'wp-piwik') + ); + $tabs ['credits'] = array ( + 'icon' => 'groups', + 'name' => __('Credits', 'wp-piwik') + ); + + echo '

        %s
        '; + + if (! self::$wpPiwik->isConfigured ()) + $this->showBox ( 'updated', 'info', sprintf ( '%s %s %s %s.', __ ( 'WP-Matomo is a WordPress plugin to show a selection of Matomo stats in your WordPress admin dashboard and to add and configure your Matomo tracking code. To use this you will need your own Matomo instance. If you do not already have a Matomo setup, you have two simple options: use either', 'wp-piwik' ), 'http://piwik.org/', __ ( 'a self-hosted Matomo', 'wp-piwik' ), __ ( 'or', 'wp-piwik' ), 'https://www.innocraft.cloud/?pk_campaign=WP-Matomo', __ ( 'a cloud-hosted Matomo by InnoCraft', 'wp-piwik' ) ) ); + + if (! function_exists ( 'curl_init' ) && ! ini_get ( 'allow_url_fopen' )) + $this->showBox ( 'error', 'no', __ ( 'Neither cURL nor fopen are available. So WP-Matomo can not use the HTTP API and not connect to InnoCraft Cloud.' ) . ' ' . sprintf ( '%s.', 'https://wordpress.org/plugins/wp-piwik/faq/', __ ( 'More information', 'wp-piwik' ) ) ); + + $description = sprintf ( '%s
        %s: %s
        %s: %s
        %s: %s', __ ( 'You can choose between three connection methods:', 'wp-piwik' ), __ ( 'Self-hosted (HTTP API, default)', 'wp-piwik' ), __ ( 'This is the default option for a self-hosted Matomo and should work for most configurations. WP-Matomo will connect to Matomo using http(s).', 'wp-piwik' ), __ ( 'Self-hosted (PHP API)', 'wp-piwik' ), __ ( 'Choose this, if your self-hosted Matomo and WordPress are running on the same machine and you know the full server path to your Matomo instance.', 'wp-piwik' ), __ ( 'Cloud-hosted', 'wp-piwik' ), __ ( 'If you are using a cloud-hosted Matomo by InnoCraft, you can simply use this option. Be carefull to choose the option which fits to your cloud domain (matomo.cloud or innocraft.cloud).', 'wp-piwik' ) ); + $this->showSelect ( 'piwik_mode', __ ( 'Matomo Mode', 'wp-piwik' ), array ( + 'disabled' => __ ( 'Disabled (WP-Matomo will not connect to Matomo)', 'wp-piwik' ), + 'http' => __ ( 'Self-hosted (HTTP API, default)', 'wp-piwik' ), + 'php' => __ ( 'Self-hosted (PHP API)', 'wp-piwik' ), + 'cloud-matomo' => __('Cloud-hosted (Innocraft Cloud, *.matomo.cloud)', 'wp-piwik'), + 'cloud' => __ ( 'Cloud-hosted (InnoCraft Cloud, *.innocraft.cloud)', 'wp-piwik' ) + ), $description, '$j(\'tr.wp-piwik-mode-option\').addClass(\'hidden\'); $j(\'#wp-piwik-mode-option-\' + $j(\'#piwik_mode\').val()).removeClass(\'hidden\');', false, '', self::$wpPiwik->isConfigured () ); + + $this->showInput ( 'piwik_url', __ ( 'Matomo URL', 'wp-piwik' ), __( 'Enter your Matomo URL. This is the same URL you use to access your Matomo instance, e.g. http://www.example.com/matomo/.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'http', 'wp-piwik-mode-option', 'http', self::$wpPiwik->isConfigured (), true ); + $this->showInput ( 'piwik_path', __ ( 'Matomo path', 'wp-piwik' ), __( 'Enter the file path to your Matomo instance, e.g. /var/www/matomo/.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'php', 'wp-piwik-mode-option', 'php', self::$wpPiwik->isConfigured (), true ); + $this->showInput ( 'piwik_user', __ ( 'Innocraft subdomain', 'wp-piwik' ), __( 'Enter your InnoCraft Cloud subdomain. It is also part of your URL: https://SUBDOMAIN.innocraft.cloud.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'cloud', 'wp-piwik-mode-option', 'cloud', self::$wpPiwik->isConfigured () ); + $this->showInput ( 'matomo_user', __ ( 'Matomo subdomain', 'wp-piwik' ), __( 'Enter your Matomo Cloud subdomain. It is also part of your URL: https://SUBDOMAIN.matomo.cloud.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'cloud-matomo', 'wp-piwik-mode-option', 'cloud-matomo', self::$wpPiwik->isConfigured () ); + $this->showInput ( 'piwik_token', __ ( 'Auth token', 'wp-piwik' ), __( 'Enter your Matomo auth token here. It is an alphanumerical code like 0a1b2c34d56e78901fa2bc3d45678efa.', 'wp-piwik' ).' '.sprintf ( __ ( 'See %sWP-Matomo FAQ%s.', 'wp-piwik' ), '', '' ), false, '', '', self::$wpPiwik->isConfigured (), true ); + + // Site configuration + $piwikSiteId = self::$wpPiwik->isConfigured () ? self::$wpPiwik->getPiwikSiteId () : false; + if (! self::$wpPiwik->isNetworkMode() ) { + $this->showCheckbox ( 'auto_site_config', __ ( 'Auto config', 'wp-piwik' ), __ ( 'Check this to automatically choose your blog from your Matomo sites by URL. If your blog is not added to Matomo yet, WP-Matomo will add a new site.', 'wp-piwik' ), false, '$j(\'tr.wp-piwik-auto-option\').toggle(\'hidden\');' . ($piwikSiteId ? '$j(\'#site_id\').val(' . $piwikSiteId . ');' : '') ); + if (self::$wpPiwik->isConfigured ()) { + $piwikSiteList = self::$wpPiwik->getPiwikSiteDetails (); + if (isset($piwikSiteList['result']) && $piwikSiteList['result'] == 'error') { + $this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Matomo %s was not able to get sites with at least view access:
        %s', 'wp-piwik' ), self::$wpPiwik->getPluginVersion (), $errorMessage ) ); + } else { + if (is_array($piwikSiteList)) + foreach ($piwikSiteList as $details) + $piwikSiteDetails[$details['idsite']] = $details; + unset($piwikSiteList); + if ($piwikSiteId != 'n/a' && isset($piwikSiteDetails) && is_array($piwikSiteDetails)) + $piwikSiteDescription = $piwikSiteDetails [$piwikSiteId] ['name'] . ' (' . $piwikSiteDetails [$piwikSiteId] ['main_url'] . ')'; + else + $piwikSiteDescription = 'n/a'; + echo ''; + if (isset ($piwikSiteDetails) && is_array($piwikSiteDetails)) + foreach ($piwikSiteDetails as $key => $siteData) + $siteList [$siteData['idsite']] = $siteData ['name'] . ' (' . $siteData ['main_url'] . ')'; + if (isset($siteList)) + $this->showSelect('site_id', __('Select site', 'wp-piwik'), $siteList, 'Choose the Matomo site corresponding to this blog.', '', self::$settings->getGlobalOption('auto_site_config'), 'wp-piwik-auto-option', true, false); + } + } + } else echo ''; + + echo $submitButton; + + echo '
        ' . __('Determined site', 'wp-piwik') . ':' . $piwikSiteDescription . '
        '; + // Stats configuration + $this->showSelect ( 'default_date', __ ( 'Matomo default date', 'wp-piwik' ), array ( + 'today' => __ ( 'Today', 'wp-piwik' ), + 'yesterday' => __ ( 'Yesterday', 'wp-piwik' ), + 'current_month' => __ ( 'Current month', 'wp-piwik' ), + 'last_month' => __ ( 'Last month', 'wp-piwik' ), + 'current_week' => __ ( 'Current week', 'wp-piwik' ), + 'last_week' => __ ( 'Last week', 'wp-piwik' ) + ), __ ( 'Default date shown on statistics page.', 'wp-piwik' ) ); + + $this->showCheckbox ( 'stats_seo', __ ( 'Show SEO data', 'wp-piwik' ), __ ( 'Display SEO ranking data on statistics page.', 'wp-piwik' ) . ' (' . __ ( 'Slow!', 'wp-piwik' ) . ')' ); + $this->showCheckbox ( 'stats_ecommerce', __ ( 'Show e-commerce data', 'wp-piwik' ), __ ( 'Display e-commerce data on statistics page.', 'wp-piwik' ) ); + + $this->showSelect ( 'dashboard_widget', __ ( 'Dashboard overview', 'wp-piwik' ), array ( + 'disabled' => __ ( 'Disabled', 'wp-piwik' ), + 'yesterday' => __ ( 'Yesterday', 'wp-piwik' ), + 'today' => __ ( 'Today', 'wp-piwik' ), + 'last30' => __ ( 'Last 30 days', 'wp-piwik' ) + ), __ ( 'Enable WP-Matomo dashboard widget "Overview".', 'wp-piwik' ) ); + + $this->showCheckbox ( 'dashboard_chart', __ ( 'Dashboard graph', 'wp-piwik' ), __ ( 'Enable WP-Matomo dashboard widget "Graph".', 'wp-piwik' ) ); + + $this->showCheckbox ( 'dashboard_seo', __ ( 'Dashboard SEO', 'wp-piwik' ), __ ( 'Enable WP-Matomo dashboard widget "SEO".', 'wp-piwik' ) . ' (' . __ ( 'Slow!', 'wp-piwik' ) . ')' ); + + $this->showCheckbox ( 'dashboard_ecommerce', __ ( 'Dashboard e-commerce', 'wp-piwik' ), __ ( 'Enable WP-Matomo dashboard widget "E-commerce".', 'wp-piwik' ) ); + + $this->showCheckbox ( 'toolbar', __ ( 'Show graph on WordPress Toolbar', 'wp-piwik' ), __ ( 'Display a last 30 days visitor graph on WordPress\' toolbar.', 'wp-piwik' ) ); + + echo ''; + + $this->showCheckbox ( 'perpost_stats', __ ( 'Show per post stats', 'wp-piwik' ), __ ( 'Show stats about single posts at the post edit admin page.', 'wp-piwik' ) ); + + $this->showCheckbox ( 'piwik_shortcut', __ ( 'Matomo shortcut', 'wp-piwik' ), __ ( 'Display a shortcut to Matomo itself.', 'wp-piwik' ) ); + + $this->showInput ( 'plugin_display_name', __ ( 'WP-Matomo display name', 'wp-piwik' ), __ ( 'Plugin name shown in WordPress.', 'wp-piwik' ) ); + + $this->showCheckbox ( 'shortcodes', __ ( 'Enable shortcodes', 'wp-piwik' ), __ ( 'Enable shortcodes in post or page content.', 'wp-piwik' ) ); + + echo $submitButton; + + echo ''; + + // Tracking Configuration + $isNotTracking = self::$settings->getGlobalOption ( 'track_mode' ) == 'disabled'; + $isNotGeneratedTracking = $isNotTracking || self::$settings->getGlobalOption ( 'track_mode' ) == 'manually'; + $fullGeneratedTrackingGroup = 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-proxy'; + + $description = sprintf ( '%s
        %s: %s
        %s: %s
        %s: %s
        %s: %s
        %s: %s', __ ( 'You can choose between four tracking code modes:', 'wp-piwik' ), __ ( 'Disabled', 'wp-piwik' ), __ ( 'WP-Matomo will not add the tracking code. Use this, if you want to add the tracking code to your template files or you use another plugin to add the tracking code.', 'wp-piwik' ), __ ( 'Default tracking', 'wp-piwik' ), __ ( 'WP-Matomo will use Matomo\'s standard tracking code.', 'wp-piwik' ), __ ( 'Use js/index.php', 'wp-piwik' ), __ ( 'You can choose this tracking code, to deliver a minified proxy code and to avoid using the files called piwik.js or piwik.php.', 'wp-piwik' ).' '.sprintf( __( 'See %sreadme file%s.', 'wp-piwik' ), '', ''), __ ( 'Use proxy script', 'wp-piwik' ), __ ( 'Use this tracking code to not reveal the Matomo server URL.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo FAQ%s.', 'wp-piwik' ), '', '' ) , __ ( 'Enter manually', 'wp-piwik' ), __ ( 'Enter your own tracking code manually. You can choose one of the prior options, pre-configure your tracking code and switch to manually editing at last.', 'wp-piwik' ).( self::$wpPiwik->isNetworkMode() ? ' '.__ ( 'Use the placeholder {ID} to add the Matomo site ID.', 'wp-piwik' ) : '' ) ); + $this->showSelect ( 'track_mode', __ ( 'Add tracking code', 'wp-piwik' ), array ( + 'disabled' => __ ( 'Disabled', 'wp-piwik' ), + 'default' => __ ( 'Default tracking', 'wp-piwik' ), + 'js' => __ ( 'Use js/index.php', 'wp-piwik' ), + 'proxy' => __ ( 'Use proxy script', 'wp-piwik' ), + 'manually' => __ ( 'Enter manually', 'wp-piwik' ) + ), $description, '$j(\'tr.wp-piwik-track-option\').addClass(\'hidden\'); $j(\'tr.wp-piwik-track-option-\' + $j(\'#track_mode\').val()).removeClass(\'hidden\'); $j(\'#tracking_code, #noscript_code\').prop(\'readonly\', $j(\'#track_mode\').val() != \'manually\');' ); + + $this->showTextarea ( 'tracking_code', __ ( 'Tracking code', 'wp-piwik' ), 15, 'This is a preview of your current tracking code. If you choose to enter your tracking code manually, you can change it here.', $isNotTracking, 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-proxy wp-piwik-track-option-manually', true, '', (self::$settings->getGlobalOption ( 'track_mode' ) != 'manually'), false ); + + $this->showSelect ( 'track_codeposition', __ ( 'JavaScript code position', 'wp-piwik' ), array ( + 'footer' => __ ( 'Footer', 'wp-piwik' ), + 'header' => __ ( 'Header', 'wp-piwik' ) + ), __ ( 'Choose whether the JavaScript code is added to the footer or the header.', 'wp-piwik' ), '', $isNotTracking, 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-proxy wp-piwik-track-option-manually' ); + + $this->showTextarea ( 'noscript_code', __ ( 'Noscript code', 'wp-piwik' ), 2, 'This is a preview of your <noscript> code which is part of your tracking code.', self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually', true, '', (self::$settings->getGlobalOption ( 'track_mode' ) != 'manually'), false ); + + $this->showCheckbox ( 'track_noscript', __ ( 'Add <noscript>', 'wp-piwik' ), __ ( 'Adds the <noscript> code to your footer.', 'wp-piwik' ) . ' ' . __ ( 'Disabled in proxy mode.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually' ); + + $this->showCheckbox ( 'track_nojavascript', __ ( 'Add rec parameter to noscript code', 'wp-piwik' ), __ ( 'Enable tracking for visitors without JavaScript (not recommended).', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo FAQ%s.', 'wp-piwik' ), '', '' ) . ' ' . __ ( 'Disabled in proxy mode.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually' ); + + $this->showSelect ( 'track_content', __ ( 'Enable content tracking', 'wp-piwik' ), array ( + 'disabled' => __ ( 'Disabled', 'wp-piwik' ), + 'all' => __ ( 'Track all content blocks', 'wp-piwik' ), + 'visible' => __ ( 'Track only visible content blocks', 'wp-piwik' ) + ), __ ( 'Content tracking allows you to track interaction with the content of a web page or application.' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '', '' ), '', $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' ); + + $this->showCheckbox ( 'track_search', __ ( 'Track search', 'wp-piwik' ), __ ( 'Use Matomo\'s advanced Site Search Analytics feature.' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '', '' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' ); + + $this->showCheckbox ( 'track_404', __ ( 'Track 404', 'wp-piwik' ), __ ( 'WP-Matomo can automatically add a 404-category to track 404-page-visits.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo FAQ%s.', 'wp-piwik' ), '', '' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' ); + + echo ''; + echo ''; + + $this->showCheckbox ( 'add_customvars_box', __ ( 'Show custom variables box', 'wp-piwik' ), __ ( ' Show a "custom variables" edit box on post edit page.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '', '' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' ); + + $this->showInput ( 'add_download_extensions', __ ( 'Add new file types for download tracking', 'wp-piwik' ), __ ( 'Add file extensions for download tracking, divided by a vertical bar (|).', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '', '' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup ); + + $this->showCheckbox ( 'disable_cookies', __ ( 'Disable cookies', 'wp-piwik' ), __ ( 'Disable all tracking cookies for a visitor.', 'wp-piwik' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup ); + + $this->showCheckbox ( 'limit_cookies', __ ( 'Limit cookie lifetime', 'wp-piwik' ), __ ( 'You can limit the cookie lifetime to avoid tracking your users over a longer period as necessary.', 'wp-piwik' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup, true, '$j(\'tr.wp-piwik-cookielifetime-option\').toggleClass(\'wp-piwik-hidden\');' ); + + $this->showInput ( 'limit_cookies_visitor', __ ( 'Visitor timeout (seconds)', 'wp-piwik' ), false, $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'limit_cookies' ), $fullGeneratedTrackingGroup.' wp-piwik-cookielifetime-option'. (self::$settings->getGlobalOption ( 'limit_cookies' )? '': ' wp-piwik-hidden') ); + + $this->showInput ( 'limit_cookies_session', __ ( 'Session timeout (seconds)', 'wp-piwik' ), false, $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'limit_cookies' ), $fullGeneratedTrackingGroup .' wp-piwik-cookielifetime-option'. (self::$settings->getGlobalOption ( 'limit_cookies' )? '': ' wp-piwik-hidden') ); + + $this->showInput ( 'limit_cookies_referral', __ ( 'Referral timeout (seconds)', 'wp-piwik' ), false, $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'limit_cookies' ), $fullGeneratedTrackingGroup .' wp-piwik-cookielifetime-option'. (self::$settings->getGlobalOption ( 'limit_cookies' )? '': ' wp-piwik-hidden') ); + + $this->showCheckbox ( 'track_admin', __ ( 'Track admin pages', 'wp-piwik' ), __ ( 'Enable to track users on admin pages (remember to configure the tracking filter appropriately).', 'wp-piwik' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' ); + + echo ''; + echo ''; + + $this->showCheckbox ( 'track_across', __ ( 'Track subdomains in the same website', 'wp-piwik' ), __ ( 'Adds *.-prefix to cookie domain.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '', '' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup ); + + $this->showCheckbox ( 'track_across_alias', __ ( 'Do not count subdomains as outlink', 'wp-piwik' ), __ ( 'Adds *.-prefix to tracked domain.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '', '' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup ); + + $this->showCheckbox ( 'track_crossdomain_linking', __ ( 'Enable cross domain linking', 'wp-piwik' ), __ ( 'When enabled, it will make sure to use the same visitor ID for the same visitor across several domains. This works only when this feature is enabled because the visitor ID is stored in a cookie and cannot be read on the other domain by default. When this feature is enabled, it will append a URL parameter "pk_vid" that contains the visitor ID when a user clicks on a URL that belongs to one of your domains. For this feature to work, you also have to configure which domains should be treated as local in your Matomo website settings. This feature requires Matomo 3.0.2.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually'); + + $this->showCheckbox ( 'track_feed', __ ( 'Track RSS feeds', 'wp-piwik' ), __ ( 'Enable to track posts in feeds via tracking pixel.', 'wp-piwik' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' ); + + $this->showCheckbox ( 'track_feed_addcampaign', __ ( 'Track RSS feed links as campaign', 'wp-piwik' ), __ ( 'This will add Matomo campaign parameters to the RSS feed links.' . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '', '' ), 'wp-piwik' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually', true, '$j(\'tr.wp-piwik-feed_campaign-option\').toggle(\'hidden\');' ); + + $this->showInput ( 'track_feed_campaign', __ ( 'RSS feed campaign', 'wp-piwik' ), __ ( 'Keyword: post name.', 'wp-piwik' ), $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'track_feed_addcampaign' ), $fullGeneratedTrackingGroup . ' wp-piwik-feed_campaign-option' ); + + $this->showInput ( 'track_heartbeat', __ ( 'Enable heartbeat timer', 'wp-piwik' ), __ ( 'Enable a heartbeat timer to get more accurate visit lengths by sending periodical HTTP ping requests as long as the site is opened. Enter the time between the pings in seconds (Matomo default: 15) to enable or 0 to disable this feature. Note: This will cause a lot of additional HTTP requests on your site.', 'wp-piwik' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup ); + + $this->showSelect ( 'track_user_id', __ ( 'User ID Tracking', 'wp-piwik' ), array ( + 'disabled' => __ ( 'Disabled', 'wp-piwik' ), + 'uid' => __ ( 'WP User ID', 'wp-piwik' ), + 'email' => __ ( 'Email Address', 'wp-piwik' ), + 'username' => __ ( 'Username', 'wp-piwik' ), + 'displayname' => __ ( 'Display Name (Not Recommended!)', 'wp-piwik' ) + ), __ ( 'When a user is logged in to WordPress, track their "User ID". You can select which field from the User\'s profile is tracked as the "User ID". When enabled, Tracking based on Email Address is recommended.', 'wp-piwik' ), '', $isNotTracking, $fullGeneratedTrackingGroup ); + + echo $submitButton; + echo ''; + + $this->showText ( __ ( 'Usually, you do not need to change these settings. If you want to do so, you should know what you do or you got an expert\'s advice.', 'wp-piwik' ) ); + + $this->showCheckbox ( 'cache', __ ( 'Enable cache', 'wp-piwik' ), __ ( 'Cache API calls, which not contain today\'s values, for a week.', 'wp-piwik' ) ); + + if (function_exists('curl_init') && ini_get('allow_url_fopen')) + $this->showSelect ( 'http_connection', __ ( 'HTTP connection via', 'wp-piwik' ), array ( + 'curl' => __ ( 'cURL', 'wp-piwik' ), + 'fopen' => __ ( 'fopen', 'wp-piwik' ) + ), __('Choose whether WP-Matomo should use cURL or fopen to connect to Matomo in HTTP or Cloud mode.', 'wp-piwik' ) ); + + $this->showSelect ( 'http_method', __ ( 'HTTP method', 'wp-piwik' ), array ( + 'post' => __ ( 'POST', 'wp-piwik' ), + 'get' => __ ( 'GET', 'wp-piwik' ) + ), __('Choose whether WP-Matomo should use POST or GET in HTTP or Cloud mode.', 'wp-piwik' ) ); + + $this->showCheckbox ( 'disable_timelimit', __ ( 'Disable time limit', 'wp-piwik' ), __ ( 'Use set_time_limit(0) if stats page causes a time out.', 'wp-piwik' ) ); + + $this->showInput ( 'filter_limit', __ ( 'Filter limit', 'wp-piwik' ), __ ( 'Use filter_limit if you need to get more than 100 results per page.', 'wp-piwik' ) ); + + $this->showInput ( 'connection_timeout', __ ( 'Connection timeout', 'wp-piwik' ), 'Define a connection timeout for all HTTP requests done by WP-Matomo in seconds.' ); + + $this->showCheckbox ( 'disable_ssl_verify', __ ( 'Disable SSL peer verification', 'wp-piwik' ), '(' . __ ( 'not recommended', 'wp-piwik' ) . ')' ); + $this->showCheckbox ( 'disable_ssl_verify_host', __ ( 'Disable SSL host verification', 'wp-piwik' ), '(' . __ ( 'not recommended', 'wp-piwik' ) . ')' ); + + $this->showSelect ( 'piwik_useragent', __ ( 'User agent', 'wp-piwik' ), array ( + 'php' => __ ( 'Use the PHP default user agent', 'wp-piwik' ) . (ini_get ( 'user_agent' ) ? '(' . ini_get ( 'user_agent' ) . ')' : ' (' . __ ( 'empty', 'wp-piwik' ) . ')'), + 'own' => __ ( 'Define a specific user agent', 'wp-piwik' ) + ), 'WP-Matomo can send the default user agent defined by your PHP settings or use a specific user agent below. The user agent is send by WP-Matomo if HTTP requests are performed.', '$j(\'tr.wp-piwik-useragent-option\').toggleClass(\'hidden\');' ); + $this->showInput ( 'piwik_useragent_string', __ ( 'Specific user agent', 'wp-piwik' ), 'Define a user agent description which is send by WP-Matomo if HTTP requests are performed.', self::$settings->getGlobalOption ( 'piwik_useragent' ) != 'own', 'wp-piwik-useragent-option' ); + + $this->showCheckbox ( 'dnsprefetch', __ ( 'Enable DNS prefetch', 'wp-piwik' ), __ ( 'Add a DNS prefetch tag.' . ' ' . sprintf ( __ ( 'See %sMatomo Blog%s.', 'wp-piwik' ), '', '' ), 'wp-piwik' ) ); + + $this->showCheckbox ( 'track_datacfasync', __ ( 'Add data-cfasync=false', 'wp-piwik' ), __ ( 'Adds data-cfasync=false to the script tag, e.g., to ask Rocket Loader to ignore the script.' . ' ' . sprintf ( __ ( 'See %sCloudFlare Knowledge Base%s.', 'wp-piwik' ), '', '' ), 'wp-piwik' ) ); + + $this->showInput ( 'track_cdnurl', __ ( 'CDN URL', 'wp-piwik' ).' http://', 'Enter URL if you want to load the tracking code via CDN.' ); + + $this->showInput ( 'track_cdnurlssl', __ ( 'CDN URL (SSL)', 'wp-piwik' ).' https://', 'Enter URL if you want to load the tracking code via a separate SSL CDN.' ); + + $this->showSelect ( 'force_protocol', __ ( 'Force Matomo to use a specific protocol', 'wp-piwik' ), array ( + 'disabled' => __ ( 'Disabled (default)', 'wp-piwik' ), + 'http' => __ ( 'http', 'wp-piwik' ), + 'https' => __ ( 'https (SSL)', 'wp-piwik' ) + ), __ ( 'Choose if you want to explicitly force Matomo to use HTTP or HTTPS. Does not work with a CDN URL.', 'wp-piwik' ) ); + + $this->showSelect ( 'update_notice', __ ( 'Update notice', 'wp-piwik' ), array ( + 'enabled' => __ ( 'Show always if WP-Matomo is updated', 'wp-piwik' ), + 'script' => __ ( 'Show only if WP-Matomo is updated and settings were changed', 'wp-piwik' ), + 'disabled' => __ ( 'Disabled', 'wp-piwik' ) + ), __ ( 'Choose if you want to get an update notice if WP-Matomo is updated.', 'wp-piwik' ) ); + + $this->showInput ( 'set_download_extensions', __ ( 'Define all file types for download tracking', 'wp-piwik' ), __ ( 'Replace Matomo\'s default file extensions for download tracking, divided by a vertical bar (|). Leave blank to keep Matomo\'s default settings.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '', '' ) ); + + $this->showInput ( 'set_download_classes', __ ( 'Set classes to be treated as downloads', 'wp-piwik' ), __ ( 'Set classes to be treated as downloads (in addition to piwik_download), divided by a vertical bar (|). Leave blank to keep Matomo\'s default settings.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo JavaScript Tracking Client reference%s.', 'wp-piwik' ), '', '' ) ); + + $this->showInput ( 'set_link_classes', __ ( 'Set classes to be treated as outlinks', 'wp-piwik' ), __ ( 'Set classes to be treated as outlinks (in addition to piwik_link), divided by a vertical bar (|). Leave blank to keep Matomo\'s default settings.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo JavaScript Tracking Client reference%s.', 'wp-piwik' ), '', '' ) ); + + echo $submitButton; + ?> + + + + + + + + + + + + + +
        +
        +

        %s

        ', $id, $description ); + } + + /** + * Show a checkbox option + * + * @param string $id option id + * @param string $name descriptive option name + * @param string $description option description + * @param boolean $isHidden set to true to initially hide the option (default: false) + * @param string $groupName define a class name to access a group of option rows by javascript (default: empty) + * @param boolean $hideDescription $hideDescription set to false to show description initially (default: true) + * @param string $onChange javascript for onchange event (default: empty) + */ + private function showCheckbox($id, $name, $description, $isHidden = false, $groupName = '', $hideDescription = true, $onChange = '') { + printf ( ':getGlobalOption ( $id ) ? ' checked="checked"' : '') . ' onchange="$j(\'#%s\').val(this.checked?1:0);%s" /> %s', $name, $id, $onChange, $this->getDescription ( $id, $description, $hideDescription ) ); + } + + /** + * Show a textarea option + * + * @param string $id option id + * @param string $name descriptive option name + * @param int $rows number of rows to show + * @param string $description option description + * @param boolean $isHidden set to true to initially hide the option (default: false) + * @param string $groupName define a class name to access a group of option rows by javascript (default: empty) + * @param boolean $hideDescription $hideDescription set to false to show description initially (default: true) + * @param string $onChange javascript for onchange event (default: empty) + * @param boolean $isReadonly set textarea to read only (default: false) + * @param boolean $global set to false if the textarea shows a site-specific option (default: true) + */ + private function showTextarea($id, $name, $rows, $description, $isHidden, $groupName, $hideDescription = true, $onChange = '', $isReadonly = false, $global = true) { + printf ( + ': %s', $name, $id, $onChange, ($global ? self::$settings->getGlobalOption ( $id ) : self::$settings->getOption ( $id )), $this->getDescription ( $id, $description, $hideDescription ) ); + } + + /** + * Show a simple text + * + * @param string $text Text to show + */ + private function showText($text) { + printf ( '

        %s

        ', $text ); + } + + /** + * Show an input option + * + * @param string $id option id + * @param string $name descriptive option name + * @param string $description option description + * @param boolean $isHidden set to true to initially hide the option (default: false) + * @param string $groupName define a class name to access a group of option rows by javascript (default: empty) + * @param string $rowName define a class name to access the specific option row by javascript (default: empty) + * @param boolean $hideDescription $hideDescription set to false to show description initially (default: true) + * @param boolean $wide Create a wide box (default: false) + */ + private function showInput($id, $name, $description, $isHidden = false, $groupName = '', $rowName = false, $hideDescription = true, $wide = false) { + printf ( ' %s', $isHidden ? 'hidden ' : '', $groupName ? $groupName : '', $rowName ? ' id="' . $groupName . '-' . $rowName . '"' : '', $name, $id, htmlentities(self::$settings->getGlobalOption( $id ), ENT_QUOTES, 'UTF-8', false), !empty($description) ? $this->getDescription ( $id, $description, $hideDescription ) : '' ); + } + + /** + * Show a select box option + * + * @param string $id option id + * @param string $name descriptive option name + * @param array $options list of options to show array[](option id => descriptive name) + * @param string $description option description + * @param string $onChange javascript for onchange event (default: empty) + * @param boolean $isHidden set to true to initially hide the option (default: false) + * @param string $groupName define a class name to access a group of option rows by javascript (default: empty) + * @param boolean $hideDescription $hideDescription set to false to show description initially (default: true) + * @param boolean $global set to false if the textarea shows a site-specific option (default: true) + */ + private function showSelect($id, $name, $options = array(), $description = '', $onChange = '', $isHidden = false, $groupName = '', $hideDescription = true, $global = true) { + $optionList = ''; + $default = $global ? self::$settings->getGlobalOption ( $id ) : self::$settings->getOption ( $id ); + if (is_array ( $options )) + foreach ( $options as $key => $value ) + $optionList .= sprintf ( '', $key, $value ); + printf ( ' %s', $name, $id, $onChange, $optionList, $this->getDescription ( $id, $description, $hideDescription ) ); + } + + /** + * Show an info box + * + * @param string $type box style (e.g., updated, error) + * @param string $icon box icon, see https://developer.wordpress.org/resource/dashicons/ + * @param string $content box message + */ + private function showBox($type, $icon, $content) { + printf ( '

        %s

        ', $type, $icon, $content ); + } + + /** + * Show headline + * @param int $order headline order (h?-tag), set to 0 to avoid headline-tagging + * @param string $icon headline icon, see https://developer.wordpress.org/resource/dashicons/ + * @param string $headline headline text + * @param string $addPluginName set to true to add the plugin name to the headline (default: false) + */ + private function showHeadline($order, $icon, $headline, $addPluginName = false) { + echo $this->getHeadline ( $order, $icon, $headline, $addPluginName = false ); + } + + /** + * Get headline HTML + * + * @param int $order headline order (h?-tag), set to 0 to avoid headline-tagging + * @param string $icon headline icon, see https://developer.wordpress.org/resource/dashicons/ + * @param string $headline headline text + * @param string $addPluginName set to true to add the plugin name to the headline (default: false) + */ + private function getHeadline($order, $icon, $headline, $addPluginName = false) { + echo ($order > 0 ? "" : '') . sprintf ( ' %s%s', $icon, ($addPluginName ? self::$settings->getGlobalOption ( 'plugin_display_name' ) . ' ' : ''), __ ( $headline, 'wp-piwik' ) ) . ($order > 0 ? "" : ''); + } + + /** + * Show donation info + */ + private function showDonation() { + ?> +
        +

        + +

        +

        + +

        +
        + +
        +
        + Paypal +
        + + + + +
        +
        + +
        + +
        + +
        var $j = jQuery.noConflict();'; + } + + /** + * Show credits + */ + public function showCredits() { + ?> +

        : Marco L., Rolf W., Tobias U., Lars K., Donna F., Kevin D., Ramos S., Thomas M., John C., Andreas G., Ben M., Myra R. I., Carlos U. R.-S., Oleg I., M. N., Daniel K., James L., Jochen K., Cyril P., Thomas K., Patrik K., Zach, Sebastian W., Peakkom, Patrik K., Kati K., Helmut O., Valerie S., Jochen D., Atlas R., Harald W., Jan M., Addy K., Hans-Georg E.-B., Yvonne K., Andrew D., Nicolas, J., Andre M., Steve J., Jakub P., ditho.berlin, Robert R., Simon B., Grzegorz O., Bjarne O., !

        +

        jqPlot (License: GPL 2.0 and MIT) and jQuery Sparklines (License: New BSD License).','wp-piwik'); ?>

        +

        , !

        +

        +

        you for using my plugin. It is the best commendation if my piece of code is really used!','wp-piwik'); ?>

        + +

        +

        or cURL has to be available:', 'wp-piwik'); ?>

        +
          +
        1. '.(function_exists('curl_init')?'':__('not','wp-piwik')).' '; + _e('available','wp-piwik'); + ?>.
        2. +
        3. '.(ini_get('allow_url_fopen')?'':__('not','wp-piwik')).' '; + _e('enabled','wp-piwik'); + ?>.
        4. +
        5. getGlobalOption('http_connection') == 'curl') || (function_exists('curl_init') && !ini_get('allow_url_fopen')))?__('cURL', 'wp-piwik'):__('fopen', 'wp-piwik')).' ('.(self::$settings->getGlobalOption('http_method')=='post'?__('POST','wp-piwik'):__('GET','wp-piwik')).') '.__('is used.', 'wp-piwik'); ?>
        6. + getGlobalOption('piwik_mode') == 'php') { ?>
        7. '.(self::$settings->getGlobalOption('proxy_url')).''; + ?>
        8. +
        +

        :

        +
          +
        1. +
        2. +
        3. +
        4. +
        +

        readRSSFeed('http://wordpress.org/support/rss/plugin/wp-piwik'); + if (!empty($supportThreads)) { + echo '
          '; + foreach ($supportThreads as $supportThread) + echo '
        1. '.$supportThread['title'].'
        2. '; + echo '
        '; + } + } + + /** + * Read RSS feed + * + * @param string $feed + * feed URL + * @param int $cnt + * item limit + * @return array feed items array[](title, url) + * + */ + private function readRSSFeed($feed, $cnt = 5) { + $result = array (); + if (function_exists ( 'simplexml_load_file' ) && ! empty ( $feed )) { + $xml = @simplexml_load_file ( $feed ); + if (! $xml || ! isset ( $xml->channel [0]->item )) + return array ( + array ( + 'title' => 'Can\'t read RSS feed.', + 'url' => $xml + ) + ); + foreach ( $xml->channel [0]->item as $item ) { + if ($cnt -- == 0) + break; + $result [] = array ( + 'title' => $item->title [0], + 'url' => $item->link [0] + ); + } + } + return $result; + } + + /** + * Clear cache and reset settings + * + * @param boolean $clearSettings set to true to reset settings (default: false) + */ + private function clear($clearSettings = false) { + if ($clearSettings) { + self::$settings->resetSettings(); + $this->showBox ( 'updated', 'yes', __ ( 'Settings cleared (except connection settings).' ) ); + } + global $wpdb; + if (self::$settings->checkNetworkActivation()) { + $aryBlogs = \WP_Piwik\Settings::getBlogList(); + if (is_array($aryBlogs)) + foreach ($aryBlogs as $aryBlog) { + switch_to_blog($aryBlog['blog_id']); + $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_wp-piwik_%'"); + $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_wp-piwik_%'"); + restore_current_blog(); + } + } else { + $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_wp-piwik_%'"); + $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_wp-piwik_%'"); + } + $this->showBox ( 'updated', 'yes', __ ( 'Cache cleared.' ) ); + } + + /** + * Execute test script and display results + */ + private function runTestscript() { ?> +
        +

        Testscript Result

        + isConfigured()) { + if (isset($_GET['testscript_id']) && $_GET['testscript_id']) + switch_to_blog((int) $_GET['testscript_id']); + ?> + + Please configure WP-Matomo first.

        '; + ?> +
        + wpPiwik = $wpPiwik; + if( isset($_POST['s']) ){ + $cnt = $this->prepare_items ($_POST['s']); + } else { + $cnt = $this->prepare_items (); + } + global $status, $page; + $this->showSearchForm(); + parent::__construct ( array ( + 'singular' => __ ( 'site', 'wp-piwik' ), + 'plural' => __ ( 'sites', 'wp-piwik' ), + 'ajax' => false + ) ); + if ($cnt > 0) + $this->display (); + else + echo '

        ' . __ ( 'No site configured yet.', 'wp-piwik' ) . '

        '; + } + + public function get_columns() { + $columns = array ( + 'id' => __ ( 'Blog ID', 'wp-piwik' ), + 'name' => __ ( 'Title', 'wp-piwik' ), + 'siteurl' => __ ( 'URL', 'wp-piwik' ), + 'piwikid' => __ ( 'Site ID (Piwik)', 'wp-piwik' ) + ); + return $columns; + } + + public function prepare_items($search = '') { + $current_page = $this->get_pagenum (); + $per_page = 10; + global $blog_id; + global $wpdb; + global $pagenow; + if (is_plugin_active_for_network ( 'wp-piwik/wp-piwik.php' )) { + $total_items = $wpdb->get_var ( $wpdb->prepare('SELECT COUNT(*) FROM ' . $wpdb->blogs . ' WHERE CONCAT(domain, path) LIKE "%%%s%%" AND spam = 0 AND deleted = 0', $search)); + $blogs = \WP_Piwik\Settings::getBlogList($per_page, $current_page, $search); + foreach ( $blogs as $blog ) { + $blogDetails = get_blog_details ( $blog['blog_id'], true ); + $this->data [] = array ( + 'name' => $blogDetails->blogname, + 'id' => $blogDetails->blog_id, + 'siteurl' => $blogDetails->siteurl, + 'piwikid' => $this->wpPiwik->getPiwikSiteId ( $blogDetails->blog_id ) + ); + } + } else { + $blogDetails = get_bloginfo (); + $this->data [] = array ( + 'name' => get_bloginfo ( 'name' ), + 'id' => '-', + 'siteurl' => get_bloginfo ( 'url' ), + 'piwikid' => $this->wpPiwik->getPiwikSiteId () + ); + $total_items = 1; + } + $columns = $this->get_columns (); + $hidden = array (); + $sortable = array (); + $this->_column_headers = array ( + $columns, + $hidden, + $sortable + ); + $this->set_pagination_args ( array ( + 'total_items' => $total_items, + 'per_page' => $per_page + ) ); + foreach ( $this->data as $key => $dataset ) { + if (empty ( $dataset ['piwikid'] ) || $dataset ['piwikid'] == 'n/a') + $this->data [$key] ['piwikid'] = __ ( 'Site not created yet.', 'wp-piwik' ); + if ($this->wpPiwik->isNetworkMode ()) + $this->data [$key] ['name'] = '' . $dataset ['name'] . ''; + } + $this->items = $this->data; + return count ( $this->items ); + } + + public function column_default($item, $column_name) { + switch ($column_name) { + case 'id' : + case 'name' : + case 'siteurl' : + case 'piwikid' : + return $item [$column_name]; + default : + return print_r ( $item, true ); + } + } + + private function showSearchForm() { + ?> +
        + + search_box('Search domain and path', 'wpPiwikSiteSearch'); ?> +
        + getGlobalOption('disable_timelimit')) set_time_limit(0); + echo '
        '; + echo '

        '.(self::$settings->getGlobalOption('plugin_display_name') == 'WP-Piwik'?'Piwik '.__('Statistics', 'wp-piwik'):self::$settings->getGlobalOption('plugin_display_name')).'

        '; + if (self::$settings->checkNetworkActivation() && function_exists('is_super_admin') && is_super_admin()) { + + if (isset($_GET['wpmu_show_stats'])) { + switch_to_blog((int) $_GET['wpmu_show_stats']); + } elseif ((isset($_GET['overview']) && $_GET['overview']) || (function_exists('is_network_admin') && is_network_admin())) { + new \WP_Piwik\Admin\Sitebrowser(self::$wpPiwik); + return; + } + echo '

        '.__('Currently shown stats:').' '.get_bloginfo('name').'.'.' Show site overview.

        '; + echo ''."\n"; + } + echo '
        '; + wp_nonce_field('wp-piwik_stats-general'); + wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); + wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); + $columns = array('normal', 'side', 'column3'); + for ($i = 0; $i < 3; $i++) { + echo '
        '; + do_meta_boxes(self::$wpPiwik->statsPageId, $columns[$i], null); + echo '
        '; + } + echo '
        '; + echo ''."\n"; + if (self::$settings->checkNetworkActivation() && function_exists('is_super_admin') && is_super_admin()) { + restore_current_blog(); + } + } + + public function printAdminScripts() { + wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true); + wp_enqueue_script('wp-piwik-jqplot', self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'), self::$wpPiwik->getPluginVersion()); + } + + public function extendAdminHeader() { + echo ''; + echo ''; + echo ''; + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Logger.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Logger.php new file mode 100644 index 0000000..d016661 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Logger.php @@ -0,0 +1,47 @@ +setName($loggerName); + $this->setStartMicrotime(microtime(true)); + $this->log('Logging started -------------------------------'); + } + + public function __destruct() { + $this->log('Logging finished ------------------------------'); + } + + public function log($loggerMessage) { + $this->loggerOutput($this->getElapsedMicrotime(), $loggerMessage); + } + + private function setName($loggerName) { + $this->loggerName = $loggerName; + } + + public function getName() { + return $this->loggerName; + } + + private function setStartMicrotime($startMicrotime) { + $this->startMicrotime = $startMicrotime; + } + + public function getStartMicrotime() { + return $this->startMicrotime; + } + + public function getElapsedMicrotime() { + return microtime(true) - $this->getStartMicrotime(); + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Logger/Dummy.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Logger/Dummy.php new file mode 100644 index 0000000..211c871 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Logger/Dummy.php @@ -0,0 +1,9 @@ +loggerFile = WP_PIWIK_PATH.'logs'.DIRECTORY_SEPARATOR. + date('Ymd').'_'.$this->encodeFilename($this->getName()).'.log'; + } + + private function getFilename() { + return $this->loggerFile; + } + + private function openFile() { + if (!$this->loggerFile) + $this->setFilename(); + return fopen($this->getFilename(), 'a'); + } + + private function closeFile($fileHandle) { + fclose($fileHandle); + } + + private function writeFile($fileHandle, $fileContent) { + fwrite($fileHandle, $fileContent."\n"); + } + + private function formatMicrotime($loggerTime) { + return sprintf('[%6s sec]',number_format($loggerTime,3)); + } + + public function loggerOutput($loggerTime, $loggerMessage) { + if ($fileHandle = $this->openFile()) { + $this->writeFile($fileHandle, $this->formatMicrotime($loggerTime).' '.$loggerMessage); + $this->closeFile($fileHandle); + } + } + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Logger/Screen.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Logger/Screen.php new file mode 100644 index 0000000..88afa23 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Logger/Screen.php @@ -0,0 +1,27 @@ +logs[] = $this->formatMicrotime($loggerTime).' '.$loggerMessage; + } + + public function echoResults() { + echo '
        ';
        +			print_r($this->logs);
        +			echo '
        '; + } + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Request.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Request.php new file mode 100644 index 0000000..c26e229 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Request.php @@ -0,0 +1,95 @@ + $method, 'parameter' => $parameter); + return $id; + } + + private static function parameterToString($parameter) { + $return = ''; + if (is_array($parameter)) + foreach ($parameter as $key => $value) + $return .= '&'.$key.'='.$value; + return $return; + } + + public function perform($id) { + if ( self::$settings->getGlobalOption('cache') && false !== ( $cached = get_transient( 'wp-piwik_c_'.md5(self::$isCacheable[$id] ) ) ) ) { + if (!empty ( $cached ) && !(! empty ( $cached['result'] ) && $cached['result'] == 'error') ) { + self::$wpPiwik->log("Deliver cached data: ".$id); + return $cached; + } + } + self::$wpPiwik->log("Perform request: ".$id); + if (!isset(self::$requests[$id])) + return array('result' => 'error', 'message' => 'Request '.$id.' was not registered.'); + elseif (!isset(self::$results[$id])) { + $this->request($id); + } + if ( isset ( self::$results[$id] ) ) { + if ( self::$settings->getGlobalOption('cache') && self::$isCacheable[$id] ) { + set_transient( 'wp-piwik_c_'.md5(self::$isCacheable[$id]) , self::$results[$id], WEEK_IN_SECONDS ); + } + return self::$results[$id]; + } else return false; + } + + public function getDebug($id) { + return isset( self::$debug[$id] )? self::$debug[$id] : false; + } + + protected function buildURL($config, $urlDecode = false) { + $url = 'method='.($config['method']).'&idSite='.self::$settings->getOption('site_id'); + foreach ($config['parameter'] as $key => $value) + $url .= '&'.$key.'='.($urlDecode?urldecode($value):$value); + return $url; + } + + protected function unserialize($str) { + self::$wpPiwik->log("Result string: ".$str); + return ($str == json_decode(false, true) || @json_decode($str, true) !== false)?json_decode($str, true):array(); + } + + public static function getLastError() { + return self::$lastError; + } + + abstract protected function request($id); + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Request/Php.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Request/Php.php new file mode 100644 index 0000000..bbd4d38 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Request/Php.php @@ -0,0 +1,55 @@ +getGlobalOption('piwik_url'); + foreach (self::$requests as $requestID => $config) { + if (!isset(self::$results[$requestID])) { + if (self::$settings->getGlobalOption('filter_limit') != "" && self::$settings->getGlobalOption('filter_limit') == (int) self::$settings->getGlobalOption('filter_limit')) + $config['parameter']['filter_limit'] = self::$settings->getGlobalOption('filter_limit'); + $params = 'module=API&format=json&'.$this->buildURL($config, true); + $map[$count] = $requestID; + $result = $this->call($id, $url, $params); + self::$results[$map[$count]] = $result; + $count++; + } + } + } + + private function call($id, $url, $params) { + if (!defined('PIWIK_INCLUDE_PATH')) + return false; + if (PIWIK_INCLUDE_PATH === FALSE) + return array('result' => 'error', 'message' => __('Could not resolve','wp-piwik').' "'.htmlentities(self::$settings->getGlobalOption('piwik_path')).'": '.__('realpath() returns false','wp-piwik').'.'); + if (file_exists(PIWIK_INCLUDE_PATH . "/index.php")) + require_once PIWIK_INCLUDE_PATH . "/index.php"; + if (file_exists(PIWIK_INCLUDE_PATH . "/core/API/Request.php")) + require_once PIWIK_INCLUDE_PATH . "/core/API/Request.php"; + if (class_exists('\Piwik\Application\Environment') && !self::$piwikEnvironment) { + // Piwik 2.14.* compatibility fix + self::$piwikEnvironment = new \Piwik\Application\Environment(null); + self::$piwikEnvironment->init(); + } + if (class_exists('Piwik\FrontController')) + \Piwik\FrontController::getInstance()->init(); + else return array('result' => 'error', 'message' => __('Class Piwik\FrontController does not exists.','wp-piwik')); + if (class_exists('Piwik\API\Request')) + $request = new \Piwik\API\Request($params.'&token_auth='.self::$settings->getGlobalOption('piwik_token')); + else return array('result' => 'error', 'message' => __('Class Piwik\API\Request does not exists.','wp-piwik')); + if (isset($request)) + $result = $request->process(); + else $result = null; + if (!headers_sent()) + header("Content-Type: text/html", true); + $result = $this->unserialize($result); + if ($GLOBALS ['wp-piwik_debug']) + self::$debug[$id] = array ( $params.'&token_auth=...' ); + return $result; + } + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Request/Rest.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Request/Rest.php new file mode 100644 index 0000000..198ad84 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Request/Rest.php @@ -0,0 +1,81 @@ +getGlobalOption('piwik_mode') == 'http') + $url = self::$settings->getGlobalOption('piwik_url'); + else if (self::$settings->getGlobalOption('piwik_mode') == 'cloud') + $url = 'https://'.self::$settings->getGlobalOption('piwik_user').'.innocraft.cloud/'; + else $url = 'https://'.self::$settings->getGlobalOption('matomo_user').'.matomo.cloud/'; + $params = 'module=API&method=API.getBulkRequest&format=json'; + if (self::$settings->getGlobalOption('filter_limit') != "" && self::$settings->getGlobalOption('filter_limit') == (int) self::$settings->getGlobalOption('filter_limit')) + $params .= '&filter_limit='.self::$settings->getGlobalOption('filter_limit'); + foreach (self::$requests as $requestID => $config) { + if (!isset(self::$results[$requestID])) { + $params .= '&urls['.$count.']='.urlencode($this->buildURL($config)); + $map[$count] = $requestID; + $count++; + } + } + $results = ((function_exists('curl_init') && ini_get('allow_url_fopen') && self::$settings->getGlobalOption('http_connection') == 'curl') || (function_exists('curl_init') && !ini_get('allow_url_fopen')))?$this->curl($id, $url, $params):$this->fopen($id, $url, $params); + if (is_array($results)) + foreach ($results as $num => $result) + if (isset($map[$num])) + self::$results[$map[$num]] = $result; + } + + private function curl($id, $url, $params) { + if (self::$settings->getGlobalOption('http_method')=='post') { + $c = curl_init($url); + curl_setopt($c, CURLOPT_POST, 1); + curl_setopt($c, CURLOPT_POSTFIELDS, $params.'&token_auth='.self::$settings->getGlobalOption('piwik_token')); + } else $c = curl_init($url.'?'.$params.'&token_auth='.self::$settings->getGlobalOption('piwik_token')); + curl_setopt($c, CURLOPT_SSL_VERIFYPEER, !self::$settings->getGlobalOption('disable_ssl_verify')); + curl_setopt($c, CURLOPT_SSL_VERIFYHOST, !self::$settings->getGlobalOption('disable_ssl_verify_host')?2:0); + curl_setopt($c, CURLOPT_USERAGENT, self::$settings->getGlobalOption('piwik_useragent')=='php'?ini_get('user_agent'):self::$settings->getGlobalOption('piwik_useragent_string')); + curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($c, CURLOPT_HEADER, $GLOBALS ['wp-piwik_debug'] ); + curl_setopt($c, CURLOPT_TIMEOUT, self::$settings->getGlobalOption('connection_timeout')); + $httpProxyClass = new \WP_HTTP_Proxy(); + if ($httpProxyClass->is_enabled() && $httpProxyClass->send_through_proxy($url)) { + curl_setopt($c, CURLOPT_PROXY, $httpProxyClass->host()); + curl_setopt($c, CURLOPT_PROXYPORT, $httpProxyClass->port()); + if ($httpProxyClass->use_authentication()) + curl_setopt($c, CURLOPT_PROXYUSERPWD, $httpProxyClass->username().':'.$httpProxyClass->password()); + } + $result = curl_exec($c); + self::$lastError = curl_error($c); + if ($GLOBALS ['wp-piwik_debug']) { + $header_size = curl_getinfo($c, CURLINFO_HEADER_SIZE); + $header = substr($result, 0, $header_size); + $body = substr($result, $header_size); + $result = $this->unserialize($body); + self::$debug[$id] = array ( $header, $url.'?'.$params.'&token_auth=...' ); + } else $result = $this->unserialize($result); + curl_close($c); + return $result; + } + + private function fopen($id, $url, $params) { + $contextDefinition = array('http'=>array('timeout' => self::$settings->getGlobalOption('connection_timeout'), 'header' => "Content-type: application/x-www-form-urlencoded\r\n") ); + $contextDefinition['ssl'] = array(); + if (self::$settings->getGlobalOption('disable_ssl_verify')) + $contextDefinition['ssl'] = array('allow_self_signed' => true, 'verify_peer' => false ); + if (self::$settings->getGlobalOption('disable_ssl_verify_host')) + $contextDefinition['ssl']['verify_peer_name'] = false; + if (self::$settings->getGlobalOption('http_method')=='post') { + $fullUrl = $url; + $contextDefinition['http']['method'] = 'POST'; + $contextDefinition['http']['content'] = $params.'&token_auth='.self::$settings->getGlobalOption('piwik_token'); + } else $fullUrl = $url.'?'.$params.'&token_auth='.self::$settings->getGlobalOption('piwik_token'); + $context = stream_context_create($contextDefinition); + $result = $this->unserialize(@file_get_contents($fullUrl, false, $context)); + if ($GLOBALS ['wp-piwik_debug']) + self::$debug[$id] = array ( get_headers($fullUrl, 1), $url.'?'.$params.'&token_auth=...' ); + return $result; + } + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Settings.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Settings.php new file mode 100644 index 0000000..7c6060f --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Settings.php @@ -0,0 +1,408 @@ + 'checkPiwikUrl', + 'piwik_token' => 'checkPiwikToken', + 'site_id' => 'requestPiwikSiteID', + 'tracking_code' => 'prepareTrackingCode', + 'noscript_code' => 'prepareNocscriptCode' + ); + + /** + * + * @var Register default configuration set + */ + private $globalSettings = array ( + // Plugin settings + 'revision' => 0, + 'last_settings_update' => 0, + // User settings: Piwik configuration + 'piwik_mode' => 'http', + 'piwik_url' => '', + 'piwik_path' => '', + 'piwik_user' => '', + 'matomo_user' => '', + 'piwik_token' => '', + 'auto_site_config' => true, + // User settings: Stats configuration + 'default_date' => 'yesterday', + 'stats_seo' => false, + 'stats_ecommerce' => false, + 'dashboard_widget' => false, + 'dashboard_ecommerce' => false, + 'dashboard_chart' => false, + 'dashboard_seo' => false, + 'toolbar' => false, + 'capability_read_stats' => array ( + 'administrator' => true + ), + 'perpost_stats' => false, + 'plugin_display_name' => 'WP-Piwik', + 'piwik_shortcut' => false, + 'shortcodes' => false, + // User settings: Tracking configuration + 'track_mode' => 'disabled', + 'track_codeposition' => 'footer', + 'track_noscript' => false, + 'track_nojavascript' => false, + 'proxy_url' => '', + 'track_content' => 'disabled', + 'track_search' => false, + 'track_404' => false, + 'add_post_annotations' => array(), + 'add_customvars_box' => false, + 'add_download_extensions' => '', + 'set_download_extensions' => '', + 'set_link_classes' => '', + 'set_download_classes' => '', + 'disable_cookies' => false, + 'limit_cookies' => false, + 'limit_cookies_visitor' => 34186669, // Piwik default 13 months + 'limit_cookies_session' => 1800, // Piwik default 30 minutes + 'limit_cookies_referral' => 15778463, // Piwik default 6 months + 'track_admin' => false, + 'capability_stealth' => array (), + 'track_across' => false, + 'track_across_alias' => false, + 'track_crossdomain_linking' => false, + 'track_feed' => false, + 'track_feed_addcampaign' => false, + 'track_feed_campaign' => 'feed', + 'track_heartbeat' => 0, + 'track_user_id' => 'disabled', + // User settings: Expert configuration + 'cache' => true, + 'http_connection' => 'curl', + 'http_method' => 'post', + 'disable_timelimit' => false, + 'filter_limit' => '', + 'connection_timeout' => 5, + 'disable_ssl_verify' => false, + 'disable_ssl_verify_host' => false, + 'piwik_useragent' => 'php', + 'piwik_useragent_string' => 'WP-Piwik', + 'dnsprefetch' => false, + 'track_datacfasync' => false, + 'track_cdnurl' => '', + 'track_cdnurlssl' => '', + 'force_protocol' => 'disabled', + 'update_notice' => 'enabled' + ), $settings = array ( + 'name' => '', + 'site_id' => NULL, + 'noscript_code' => '', + 'tracking_code' => '', + 'last_tracking_code_update' => 0, + 'dashboard_revision' => 0 + ), $settingsChanged = false; + + /** + * Constructor class to prepare settings manager + * + * @param WP_Piwik $wpPiwik + * active WP-Piwik instance + */ + public function __construct($wpPiwik) { + self::$wpPiwik = $wpPiwik; + self::$wpPiwik->log ( 'Store default settings' ); + self::$defaultSettings = array ( + 'globalSettings' => $this->globalSettings, + 'settings' => $this->settings + ); + self::$wpPiwik->log ( 'Load settings' ); + foreach ( $this->globalSettings as $key => $default ) { + $this->globalSettings [$key] = ($this->checkNetworkActivation () ? get_site_option ( 'wp-piwik_global-' . $key, $default ) : get_option ( 'wp-piwik_global-' . $key, $default )); + } + foreach ( $this->settings as $key => $default ) + $this->settings [$key] = get_option ( 'wp-piwik-' . $key, $default ); + } + + /** + * Save all settings as WordPress options + */ + public function save() { + if (! $this->settingsChanged) { + self::$wpPiwik->log ( 'No settings changed yet' ); + return; + } + self::$wpPiwik->log ( 'Save settings' ); + foreach ( $this->globalSettings as $key => $value ) { + if ( $this->checkNetworkActivation() ) + update_site_option ( 'wp-piwik_global-' . $key, $value ); + else + update_option ( 'wp-piwik_global-' . $key, $value ); + } + foreach ( $this->settings as $key => $value ) { + update_option ( 'wp-piwik-' . $key, $value ); + } + global $wp_roles; + if (! is_object ( $wp_roles )) + $wp_roles = new \WP_Roles (); + if (! is_object ( $wp_roles )) + die ( "STILL NO OBJECT" ); + foreach ( $wp_roles->role_names as $strKey => $strName ) { + $objRole = get_role ( $strKey ); + foreach ( array ( + 'stealth', + 'read_stats' + ) as $strCap ) { + $aryCaps = $this->getGlobalOption ( 'capability_' . $strCap ); + if (isset ( $aryCaps [$strKey] ) && $aryCaps [$strKey]) + $wp_roles->add_cap ( $strKey, 'wp-piwik_' . $strCap ); + else $wp_roles->remove_cap ( $strKey, 'wp-piwik_' . $strCap ); + } + } + $this->settingsChanged = false; + } + + /** + * Get a global option's value + * + * @param string $key + * option key + * @return string option value + */ + public function getGlobalOption($key) { + return isset ( $this->globalSettings [$key] ) ? $this->globalSettings [$key] : self::$defaultSettings ['globalSettings'] [$key]; + } + + /** + * Get an option's value related to a specific blog + * + * @param string $key + * option key + * @param int $blogID + * blog ID (default: current blog) + * @return \WP_Piwik\Register + */ + public function getOption($key, $blogID = null) { + if ($this->checkNetworkActivation () && ! empty ( $blogID )) { + return get_blog_option ( $blogID, 'wp-piwik-'.$key ); + } + return isset ( $this->settings [$key] ) ? $this->settings [$key] : self::$defaultSettings ['settings'] [$key]; + } + + /** + * Set a global option's value + * + * @param string $key + * option key + * @param string $value + * new option value + */ + public function setGlobalOption($key, $value) { + $this->settingsChanged = true; + self::$wpPiwik->log ( 'Changed global option ' . $key . ': ' . (is_array ( $value ) ? serialize ( $value ) : $value) ); + $this->globalSettings [$key] = $value; + } + + /** + * Set an option's value related to a specific blog + * + * @param string $key + * option key + * @param int $blogID + * blog ID (default: current blog) + * @param string $value + * new option value + */ + public function setOption($key, $value, $blogID = null) { + $this->settingsChanged = true; + self::$wpPiwik->log ( 'Changed option ' . $key . ': ' . $value ); + if ($this->checkNetworkActivation () && ! empty ( $blogID )) { + add_blog_option ( $blogID, 'wp-piwik-'.$key, $value ); + } else + $this->settings [$key] = $value; + } + + /** + * Reset settings to default + */ + public function resetSettings() { + self::$wpPiwik->log ( 'Reset WP-Piwik settings' ); + global $wpdb; + if ( $this->checkNetworkActivation() ) { + $aryBlogs = self::getBlogList(); + if (is_array($aryBlogs)) + foreach ($aryBlogs as $aryBlog) { + switch_to_blog($aryBlog['blog_id']); + $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'wp-piwik-%'"); + restore_current_blog(); + } + $wpdb->query("DELETE FROM $wpdb->sitemeta WHERE meta_key LIKE 'wp-piwik_global-%'"); + } + else $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'wp-piwik_global-%'"); + } + + /** + * Get blog list + */ + public static function getBlogList($limit = null, $page = null, $search = '') { + if ($limit && $page) + $queryLimit = ' LIMIT '.(int) (($page - 1) * $limit).','.(int) $limit; + global $wpdb; + return $wpdb->get_results($wpdb->prepare('SELECT blog_id FROM '.$wpdb->blogs.' WHERE CONCAT(domain, path) LIKE "%%%s%%" AND spam = 0 AND deleted = 0 ORDER BY blog_id'.$queryLimit, $search), ARRAY_A); + } + + /** + * Check if plugin is network activated + * + * @return boolean Is network activated? + */ + public function checkNetworkActivation() { + if (! function_exists ( "is_plugin_active_for_network" )) + require_once (ABSPATH . 'wp-admin/includes/plugin.php'); + return is_plugin_active_for_network ( 'wp-piwik/wp-piwik.php' ); + } + + /** + * Apply new configuration + * + * @param array $in + * new configuration set + */ + public function applyChanges($in) { + if (!self::$wpPiwik->isValidOptionsPost()) + die("Invalid config changes."); + $in = $this->checkSettings ( $in ); + self::$wpPiwik->log ( 'Apply changed settings:' ); + foreach ( self::$defaultSettings ['globalSettings'] as $key => $val ) + $this->setGlobalOption ( $key, isset ( $in [$key] ) ? $in [$key] : $val ); + foreach ( self::$defaultSettings ['settings'] as $key => $val ) + $this->setOption ( $key, isset ( $in [$key] ) ? $in [$key] : $val ); + $this->setGlobalOption ( 'last_settings_update', time () ); + $this->save (); + } + + /** + * Apply callback function on new settings + * + * @param array $in + * new configuration set + * @return array configuration set after callback functions were applied + */ + private function checkSettings($in) { + foreach ( $this->checkSettings as $key => $value ) + if (isset ( $in [$key] )) + $in [$key] = call_user_func_array ( array ( + $this, + $value + ), array ( + $in [$key], + $in + ) ); + return $in; + } + + /** + * Add slash to Piwik URL if necessary + * + * @param string $value + * Piwik URL + * @param array $in + * configuration set + * @return string Piwik URL + */ + private function checkPiwikUrl($value, $in) { + return substr ( $value, - 1, 1 ) != '/' ? $value . '/' : $value; + } + + /** + * Remove &token_auth= from auth token + * + * @param string $value + * Piwik auth token + * @param array $in + * configuration set + * @return string Piwik auth token + */ + private function checkPiwikToken($value, $in) { + return str_replace ( '&token_auth=', '', $value ); + } + + /** + * Request the site ID (if not set before) + * + * @param string $value + * tracking code + * @param array $in + * configuration set + * @return int Piwik site ID + */ + private function requestPiwikSiteID($value, $in) { + if ($in ['auto_site_config'] && ! $value) + return self::$wpPiwik->getPiwikSiteId(); + return $value; + } + + /** + * Prepare the tracking code + * + * @param string $value + * tracking code + * @param array $in + * configuration set + * @return string tracking code + */ + private function prepareTrackingCode($value, $in) { + if ($in ['track_mode'] == 'manually' || $in ['track_mode'] == 'disabled') { + $value = stripslashes ( $value ); + if ($this->checkNetworkActivation ()) + add_site_option ( 'wp-piwik-manually', $value ); + return $value; + } + /*$result = self::$wpPiwik->updateTrackingCode (); + echo '
        '; print_r($result); echo '
        '; + $this->setOption ( 'noscript_code', $result ['noscript'] );*/ + return; // $result ['script']; + } + + /** + * Prepare the nocscript code + * + * @param string $value + * noscript code + * @param array $in + * configuration set + * @return string noscript code + */ + private function prepareNocscriptCode($value, $in) { + if ($in ['track_mode'] == 'manually') + return stripslashes ( $value ); + return $this->getOption ( 'noscript_code' ); + } + + /** + * Get debug data + * + * @return array WP-Piwik settings for debug output + */ + public function getDebugData() { + $debug = array( + 'global_settings' => $this->globalSettings, + 'settings' => $this->settings + ); + $debug['global_settings']['piwik_token'] = !empty($debug['global_settings']['piwik_token'])?'set':'not set'; + return $debug; + } +} diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Shortcode.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Shortcode.php new file mode 100644 index 0000000..c2c9ee5 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Shortcode.php @@ -0,0 +1,28 @@ + 'OptOut', + 'post' => 'Post', + 'overview' => 'Overview' + ), $content; + + public function __construct($attributes, $wpPiwik, $settings) { + $wpPiwik->log('Check requested shortcode widget '.$attributes['module']); + if (isset($attributes['module']) && isset($this->available[$attributes['module']])) { + $wpPiwik->log('Add shortcode widget '.$this->available[$attributes['module']]); + $class = '\\WP_Piwik\\Widget\\'.$this->available[$attributes['module']]; + $widget = new $class($wpPiwik, $settings, null, null, null, $attributes, true); + $widget->show(); + $this->content = $widget->get(); + } + } + + public function get() { + return $this->content; + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Template.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Template.php new file mode 100644 index 0000000..8342a10 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Template.php @@ -0,0 +1,31 @@ +'.$name.''.$value.''; + } + + public function getRangeLast30() { + $diff = (self::$settings->getGlobalOption('default_date') == 'yesterday') ? -86400 : 0; + $end = time() + $diff; + $start = time() - 2592000 + $diff; + return date('Y-m-d', $start).','.date('Y-m-d', $end); + } + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Template/MetaBoxCustomVars.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Template/MetaBoxCustomVars.php new file mode 100644 index 0000000..9f8b5ce --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Template/MetaBoxCustomVars.php @@ -0,0 +1,63 @@ + + + + + + + + + + +
        +

        . (.)

        + post_type); + // Check if the current user has permission to edit the post. + if (!current_user_can($objPostType->cap->edit_post, $intID)) + return $intID; + $aryNames = array('cat', 'val'); + for ($i = 1; $i <= 5; $i++) + for ($j = 0; $j <= 1; $j++) { + // Get data + $strMetaVal = (isset($_POST['wp-piwik_custom_'.$aryNames[$j].$i])?htmlentities($_POST['wp-piwik_custom_'.$aryNames[$j].$i]):''); + // Create key + $strMetaKey = 'wp-piwik_custom_'.$aryNames[$j].$i; + // Get the meta value of the custom field key + $strCurVal = get_post_meta($intID, $strMetaKey, true); + // Add meta val: + if ($strMetaVal && '' == $strCurVal) + add_post_meta($intID, $strMetaKey, $strMetaVal, true); + // Update meta val: + elseif ($strMetaVal && $strMetaVal != $strCurVal) + update_post_meta($intID, $strMetaKey, $strMetaVal); + // Delete meta val: + elseif (''==$strMetaVal && $strCurVal) + delete_post_meta($intID, $strMetaKey, $strCurVal); + } + } + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/TrackingCode.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/TrackingCode.php new file mode 100644 index 0000000..de80b8d --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/TrackingCode.php @@ -0,0 +1,150 @@ +isCurrentTrackingCode () || ! self::$wpPiwik->getOption ( 'tracking_code' ) || strpos( self::$wpPiwik->getOption ( 'tracking_code' ), '{"result":"error",' ) !== false ) + self::$wpPiwik->updateTrackingCode (); + $this->trackingCode = (self::$wpPiwik->isNetworkMode () && self::$wpPiwik->getGlobalOption ( 'track_mode' ) == 'manually') ? get_site_option ( 'wp-piwik-manually' ) : self::$wpPiwik->getOption ( 'tracking_code' ); + } + + public function getTrackingCode() { + if ($this->isUsertracking) + $this->applyUserTracking (); + if ($this->is404) + $this->apply404Changes (); + if ($this->isSearch) + $this->applySearchChanges (); + if (is_single () || is_page()) + $this->addCustomValues (); + $this->trackingCode = apply_filters('wp-piwik_tracking_code', $this->trackingCode); + return $this->trackingCode; + } + + public static function prepareTrackingCode($code, $settings, $logger) { + global $current_user; + $logger->log ( 'Apply tracking code changes:' ); + $settings->setOption ( 'last_tracking_code_update', time () ); + if (preg_match ( '/var u="([^"]*)";/', $code, $hits )) { + $fetchedProxyUrl = $hits [1]; + } else $fetchedProxyUrl = ''; + if ($settings->getGlobalOption ( 'track_mode' ) == 'js') + $code = str_replace ( array ( + 'piwik.js', + 'piwik.php' + ), 'js/index.php', $code ); + elseif ($settings->getGlobalOption ( 'track_mode' ) == 'proxy') { + $code = str_replace ( 'piwik.js', 'piwik.php', $code ); + $proxy = str_replace ( array ( + 'https://', + 'http://' + ), '//', plugins_url ( 'wp-piwik' ) . '/proxy' ) . '/'; + $code = preg_replace ( '/var u="([^"]*)";/', 'var u="' . $proxy . '"', $code ); + $code = preg_replace ( '/img src="([^"]*)piwik.php/', 'img src="' . $proxy . 'piwik.php', $code ); + } + if ($settings->getGlobalOption ( 'track_cdnurl' ) || $settings->getGlobalOption ( 'track_cdnurlssl' )) + $code = str_replace ( array ( + "var d=doc", + "g.src=u+" + ), array ( + "var ucdn=(('https:' == document.location.protocol) ? 'https://" . ($settings->getGlobalOption ( 'track_cdnurlssl' ) ? $settings->getGlobalOption ( 'track_cdnurlssl' ) : $settings->getGlobalOption ( 'track_cdnurl' )) . "/' : 'http://" . ($settings->getGlobalOption ( 'track_cdnurl' ) ? $settings->getGlobalOption ( 'track_cdnurl' ) : $settings->getGlobalOption ( 'track_cdnurlssl' )) . "/');\nvar d=doc", + "g.src=ucdn+" + ), $code ); + + if ($settings->getGlobalOption ( 'track_datacfasync' )) + $code = str_replace ( '' ); + } + + /** + * Return an array value by key, return '-' if not set + * + * @param array $array + * array to get a value from + * @param string $key + * key of the value to get from array + * @return string found value or '-' as a placeholder + */ + protected function value($array, $key) { + return (isset ( $array [$key] ) ? $array [$key] : '-'); + } +} \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/BrowserDetails.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/BrowserDetails.php new file mode 100644 index 0000000..a065e1c --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/BrowserDetails.php @@ -0,0 +1,77 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Browser Details', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'DevicesDetection.getBrowserVersions'; + $this->context = 'normal'; + wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true); + wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery')); + wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion()); + add_action('admin_head-index.php', array($this, 'addHeaderLines')); + } + + public function addHeaderLines() { + echo ''; + echo ''; + echo ''; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + $tableBody = array(); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = array(__('Browser', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik')); + if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors'; + else $unique = 'sum_daily_nb_uniq_visitors'; + $count = 0; + $sum = 0; + $js = array(); + $class = array(); + if (is_array($response)) + foreach ($response as $row) { + $count++; + $sum += isset($row[$unique])?$row[$unique]:0; + if ($count < $this->limit) + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + elseif (!isset($tableBody['Others'])) { + $tableBody['Others'] = array($row['label'], $row[$unique], 0); + $class['Others'] = 'wp-piwik-hideDetails'; + $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } else { + $tableBody['Others'][1] += $row[$unique]; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } + } + if ($count > $this->limit) + $tableBody['Others'][0] = __('Others', 'wp-piwik'); + + foreach ($tableBody as $key => $row) + $tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%'; + + if (!empty($tableBody)) $this->pieChart($tableBody); + $this->table($tableHead, $tableBody, null, false, $js, $class); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Browsers.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Browsers.php new file mode 100644 index 0000000..f974685 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Browsers.php @@ -0,0 +1,80 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Browsers', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'DevicesDetection.getBrowsers'; + $this->context = 'normal'; + wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true); + wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery')); + wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion()); + add_action('admin_head-index.php', array($this, 'addHeaderLines')); + } + + public function addHeaderLines() { + echo ''; + echo ''; + echo ''; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + $tableBody = array(); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = array(__('Browser', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik')); + if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors'; + else $unique = 'sum_daily_nb_uniq_visitors'; + $count = 0; + $sum = 0; + $js = array(); + $class = array(); + if (is_array($response)) + foreach ($response as $row) { + $count++; + $sum += isset($row[$unique])?$row[$unique]:0; + if ($count < $this->limit) + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + elseif (!isset($tableBody['Others'])) { + $tableBody['Others'] = array($row['label'], $row[$unique], 0); + $class['Others'] = 'wp-piwik-hideDetails'; + $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } else { + $tableBody['Others'][1] += $row[$unique]; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } + } + if ($count > $this->limit) + $tableBody['Others'][0] = __('Others', 'wp-piwik'); + elseif ($count == $this->limit) { + $class['Others'] = $js['Others'] = ''; + } + + foreach ($tableBody as $key => $row) + $tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%'; + + if (!empty($tableBody)) $this->pieChart($tableBody); + $this->table($tableHead, $tableBody, null, false, $js, $class); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Chart.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Chart.php new file mode 100644 index 0000000..62d4c70 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Chart.php @@ -0,0 +1,78 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => isset($params['period'])?$params['period']:$timeSettings['period'], + 'date' => 'last'.($timeSettings['period']=='day'?'30':'12'), + 'limit' => null + ); + $this->title = $prefix.__('Visitors', 'wp-piwik').' ('.__($this->rangeName(),'wp-piwik').')'; + $this->method = array('VisitsSummary.getVisits', 'VisitsSummary.getUniqueVisitors', 'VisitsSummary.getBounceCount', 'VisitsSummary.getActions'); + $this->context = 'normal'; + wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true); + wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery')); + wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion()); + add_action('admin_head-index.php', array($this, 'addHeaderLines')); + } + + public function addHeaderLines() { + echo ''; + echo ''; + echo ''; + } + + public function show() { + $response = array(); + $success = true; + foreach ($this->method as $method) { + $response[$method] = self::$wpPiwik->request($this->apiID[$method]); + if (!empty($response[$method]['result']) && $response[$method]['result'] ='error') + $success = false; + } + if (!$success) + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response[$method]['message'], ENT_QUOTES, 'utf-8'); + else { + $values = $labels = $bounced = $unique = ''; + $count = $uniqueSum = 0; + if (is_array($response['VisitsSummary.getVisits'])) + foreach ($response['VisitsSummary.getVisits'] as $date => $value) { + $count++; + $values .= $value.','; + $unique .= $response['VisitsSummary.getUniqueVisitors'][$date].','; + $bounced .= $response['VisitsSummary.getBounceCount'][$date].','; + if ($this->parameter['period'] == 'week') { + preg_match("/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/", $date, $dateList); + $textKey = $this->dateFormat($dateList[0], 'short_week'); + } else $textKey = substr($date, -2); + $labels .= '['.$count.',"'.$textKey.'"],'; + $uniqueSum += $response['VisitsSummary.getActions'][$date]; + } + else { + $values = '0,'; + $labels = '[0,"-"],'; + $unique = '0,'; + $bounced = '0,'; + } + $average = round($uniqueSum/30,0); + $values = substr($values, 0, -1); + $unique = substr($unique, 0, -1); + $labels = substr($labels, 0, -1); + $bounced = substr($bounced, 0, -1); + echo '
        '; + echo ''; + } + } + + } diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/City.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/City.php new file mode 100644 index 0000000..d041ed8 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/City.php @@ -0,0 +1,80 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Countries', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'UserCountry.getCity'; + $this->context = 'normal'; + wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true); + wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery')); + wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion()); + add_action('admin_head-index.php', array($this, 'addHeaderLines')); + } + + public function addHeaderLines() { + echo ''; + echo ''; + echo ''; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + $tableBody = array(); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = array(__('City', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik')); + if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors'; + else $unique = 'sum_daily_nb_uniq_visitors'; + $count = 0; + $sum = 0; + $js = array(); + $class = array(); + if (is_array($response)) + foreach ($response as $row) { + $count++; + $sum += isset($row[$unique])?$row[$unique]:0; + if ($count < $this->limit) + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + elseif (!isset($tableBody['Others'])) { + $tableBody['Others'] = array($row['label'], $row[$unique], 0); + $class['Others'] = 'wp-piwik-hideDetails'; + $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } else { + $tableBody['Others'][1] += $row[$unique]; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } + } + if ($count > $this->limit) + $tableBody['Others'][0] = __('Others', 'wp-piwik'); + elseif ($count == $this->limit) { + $class['Others'] = $js['Others'] = ''; + } + + foreach ($tableBody as $key => $row) + $tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%'; + + if (!empty($tableBody)) $this->pieChart($tableBody); + $this->table($tableHead, $tableBody, null, false, $js, $class); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Country.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Country.php new file mode 100644 index 0000000..90108f5 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Country.php @@ -0,0 +1,80 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Countries', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'UserCountry.getCountry '; + $this->context = 'normal'; + wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true); + wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery')); + wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion()); + add_action('admin_head-index.php', array($this, 'addHeaderLines')); + } + + public function addHeaderLines() { + echo ''; + echo ''; + echo ''; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + $tableBody = array(); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = array(__('Country', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik')); + if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors'; + else $unique = 'sum_daily_nb_uniq_visitors'; + $count = 0; + $sum = 0; + $js = array(); + $class = array(); + if (is_array($response)) + foreach ($response as $row) { + $count++; + $sum += isset($row[$unique])?$row[$unique]:0; + if ($count < $this->limit) + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + elseif (!isset($tableBody['Others'])) { + $tableBody['Others'] = array($row['label'], $row[$unique], 0); + $class['Others'] = 'wp-piwik-hideDetails'; + $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } else { + $tableBody['Others'][1] += $row[$unique]; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } + } + if ($count > $this->limit) + $tableBody['Others'][0] = __('Others', 'wp-piwik'); + elseif ($count == $this->limit) { + $class['Others'] = $js['Others'] = ''; + } + + foreach ($tableBody as $key => $row) + $tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%'; + + if (!empty($tableBody)) $this->pieChart($tableBody); + $this->table($tableHead, $tableBody, null, false, $js, $class); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Ecommerce.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Ecommerce.php new file mode 100644 index 0000000..af0dafa --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Ecommerce.php @@ -0,0 +1,45 @@ +getTimeSettings(); + $this->title = $prefix.__('E-Commerce', 'wp-piwik'); + $this->method = 'Goals.get'; + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = null; + $tableBody = array( + array(__('Conversions', 'wp-piwik').':', $this->value($response, 'nb_conversions')), + array(__('Visits converted', 'wp-piwik').':', $this->value($response, 'nb_visits_converted')), + array(__('Revenue', 'wp-piwik').':', number_format($this->value($response, 'revenue'),2)), + array(__('Conversion rate', 'wp-piwik').':', $this->value($response, 'conversion_rate')), + array(__('Conversions (new visitor)', 'wp-piwik').':', $this->value($response, 'nb_conversions_new_visit')), + array(__('Visits converted (new visitor)', 'wp-piwik').':', $this->value($response, 'nb_visits_converted_new_visit')), + array(__('Revenue (new visitor)', 'wp-piwik').':', number_format($this->value($response, 'revenue_new_visit'),2)), + array(__('Conversion rate (new visitor)', 'wp-piwik').':', $this->value($response, 'conversion_rate_new_visit')), + array(__('Conversions (returning visitor)', 'wp-piwik').':', $this->value($response, 'nb_conversions_returning_visit')), + array(__('Visits converted (returning visitor)', 'wp-piwik').':', $this->value($response, 'nb_visits_converted_returning_visit')), + array(__('Revenue (returning visitor)', 'wp-piwik').':', number_format($this->value($response, 'revenue_returning_visit'),2)), + array(__('Conversion rate (returning visitor)', 'wp-piwik').':', $this->value($response, 'conversion_rate_returning_visit')), + ); + $tableFoot = (self::$settings->getGlobalOption('piwik_shortcut')?array(__('Shortcut', 'wp-piwik').':', 'Piwik'.(isset($aryConf['inline']) && $aryConf['inline']?' - WP-Piwik':'')):null); + $this->table($tableHead, $tableBody, $tableFoot); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Items.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Items.php new file mode 100644 index 0000000..e339cac --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Items.php @@ -0,0 +1,52 @@ +getTimeSettings(); + $this->title = $prefix.__('E-Commerce Items', 'wp-piwik'); + $this->method = 'Goals.getItemsName'; + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = array( + __('Label', 'wp-piwik'), + __('Revenue', 'wp-piwik'), + __('Quantity', 'wp-piwik'), + __('Orders', 'wp-piwik'), + __('Avg. price', 'wp-piwik'), + __('Avg. quantity', 'wp-piwik'), + __('Conversion rate', 'wp-piwik'), + ); + $tableBody = array(); + if (is_array($response)) + foreach ($response as $data) { + array_push($tableBody, array( + $data['label'], + number_format($data['revenue'],2), + $data['quantity'], + $data['orders'], + number_format($data['avg_price'],2), + $data['avg_quantity'], + $data['conversion_rate'] + )); + } + $tableFoot = array(); + $this->table($tableHead, $tableBody, $tableFoot); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/ItemsCategory.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/ItemsCategory.php new file mode 100644 index 0000000..2ed58ae --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/ItemsCategory.php @@ -0,0 +1,52 @@ +getTimeSettings(); + $this->title = $prefix.__('E-Commerce Item Categories', 'wp-piwik'); + $this->method = 'Goals.getItemsCategory'; + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = array( + __('Label', 'wp-piwik'), + __('Revenue', 'wp-piwik'), + __('Quantity', 'wp-piwik'), + __('Orders', 'wp-piwik'), + __('Avg. price', 'wp-piwik'), + __('Avg. quantity', 'wp-piwik'), + __('Conversion rate', 'wp-piwik'), + ); + $tableBody = array(); + if (is_array($response)) + foreach ($response as $data) { + array_push($tableBody, array( + $data['label'], + isset($data['revenue'])?number_format($data['revenue'],2):"-.--", + isset($data['quantity'])?$data['quantity']:'-', + isset($data['orders'])?$data['orders']:'-', + number_format($data['avg_price'],2), + $data['avg_quantity'], + $data['conversion_rate'] + )); + } + $tableFoot = array(); + $this->table($tableHead, $tableBody, $tableFoot); + } + } + +} \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Keywords.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Keywords.php new file mode 100644 index 0000000..bb50c0c --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Keywords.php @@ -0,0 +1,21 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Keywords', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'Referrers.getKeywords'; + $this->name = 'Keyword'; + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Models.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Models.php new file mode 100644 index 0000000..089b506 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Models.php @@ -0,0 +1,80 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Models', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'DevicesDetection.getModel'; + $this->context = 'normal'; + wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true); + wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery')); + wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion()); + add_action('admin_head-index.php', array($this, 'addHeaderLines')); + } + + public function addHeaderLines() { + echo ''; + echo ''; + echo ''; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + $tableBody = array(); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = array(__('Model', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik')); + if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors'; + else $unique = 'sum_daily_nb_uniq_visitors'; + $count = 0; + $sum = 0; + $js = array(); + $class = array(); + if (is_array($response)) + foreach ($response as $row) { + $count++; + $sum += isset($row[$unique])?$row[$unique]:0; + if ($count < $this->limit) + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + elseif (!isset($tableBody['Others'])) { + $tableBody['Others'] = array($row['label'], $row[$unique], 0); + $class['Others'] = 'wp-piwik-hideDetails'; + $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } else { + $tableBody['Others'][1] += $row[$unique]; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } + } + if ($count > $this->limit) + $tableBody['Others'][0] = __('Others', 'wp-piwik'); + elseif ($count == $this->limit) { + $class['Others'] = $js['Others'] = ''; + } + + foreach ($tableBody as $key => $row) + $tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%'; + + if (!empty($tableBody)) $this->pieChart($tableBody); + $this->table($tableHead, $tableBody, null, false, $js, $class); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Noresult.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Noresult.php new file mode 100644 index 0000000..11b7c31 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Noresult.php @@ -0,0 +1,38 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Site Search', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'Actions.getSiteSearchNoResultKeywords'; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = array(__('Keyword', 'wp-piwik'), __('Requests', 'wp-piwik'), __('Bounced', 'wp-piwik')); + $tableBody = array(); + $count = 0; + if (is_array($response)) + foreach ($response as $row) { + $count++; + $tableBody[] = array($row['label'], $row['nb_visits'], $row['bounce_rate']); + if ($count == 10) break; + } + $this->table($tableHead, $tableBody, null); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/OptOut.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/OptOut.php new file mode 100644 index 0000000..deaf018 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/OptOut.php @@ -0,0 +1,31 @@ +parameter = $params; + } + + public function show() { + $protocol = (isset ( $_SERVER ['HTTPS'] ) && $_SERVER ['HTTPS'] != 'off') ? 'https' : 'http'; + switch (self::$settings->getGlobalOption ( 'piwik_mode' )) { + case 'php' : + $PIWIK_URL = $protocol . ':' . self::$settings->getGlobalOption ( 'proxy_url' ); + break; + case 'cloud' : + $PIWIK_URL = 'https://' . self::$settings->getGlobalOption ( 'piwik_user' ) . '.innocraft.cloud/'; + break; + case 'cloud-matomo': + $PIWIK_URL = 'https://' . self::$settings->getGlobalOption ( 'matomo_user' ) . '.matomo.cloud/'; + break; + default : + $PIWIK_URL = self::$settings->getGlobalOption ( 'piwik_url' ); + } + $this->out ( '' ); + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Overview.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Overview.php new file mode 100644 index 0000000..e47e9f3 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Overview.php @@ -0,0 +1,63 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => isset($params['period'])?$params['period']:$timeSettings['period'], + 'date' => isset($params['date'])?$params['date']: $timeSettings['date'], + 'description' => $timeSettings['description'] + ); + $this->title = !$this->isShortcode?$prefix.__('Overview', 'wp-piwik').' ('.__($this->pageId == 'dashboard'?$this->rangeName():$timeSettings['description'],'wp-piwik').')':($params['title']?$params['title']:''); + $this->method = 'VisitsSummary.get'; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + if ($this->parameter['date'] == 'last30') { + $result = array(); + if (is_array($response)) { + foreach ($response as $data) + foreach ($data as $key => $value) + if (isset($result[$key]) && is_numeric($value)) + $result[$key] += $value; + elseif (is_numeric($value)) + $result[$key] = $value; + else + $result[$key] = 0; + if (isset($result['nb_visits']) && $result['nb_visits'] > 0) { + $result['nb_actions_per_visit'] = round($result['nb_actions'] / $result['nb_visits'], 1); + $result['bounce_rate'] = round($result['bounce_count'] / $result['nb_visits'] * 100, 1) . '%'; + $result['avg_time_on_site'] = round($result['sum_visit_length'] / $result['nb_visits'], 0); + } else $result['nb_actions_per_visit'] = $result['bounce_rate'] = $result['avg_time_on_site'] = 0; + } + $response = $result; + } + $time = isset($response['sum_visit_length'])?$this->timeFormat($response['sum_visit_length']):'-'; + $avgTime = isset($response['avg_time_on_site'])?$this->timeFormat($response['avg_time_on_site']):'-'; + $tableHead = null; + $tableBody = array(array(__('Visitors', 'wp-piwik').':', $this->value($response, 'nb_visits'))); + if ($this->value($response, 'nb_uniq_visitors') != '-') + array_push($tableBody, array(__('Unique visitors', 'wp-piwik').':', $this->value($response, 'nb_uniq_visitors'))); + array_push($tableBody, + array(__('Page views', 'wp-piwik').':', $this->value($response, 'nb_actions').' (Ø '.$this->value($response, 'nb_actions_per_visit').')'), + array(__('Total time spent', 'wp-piwik').':', $time.' (Ø '.$avgTime.')'), + array(__('Bounce count', 'wp-piwik').':', $this->value($response, 'bounce_count').' ('.$this->value($response, 'bounce_rate').')') + ); + if ($this->parameter['date'] != 'last30') + array_push($tableBody, array(__('Time/visit', 'wp-piwik').':', $avgTime), array(__('Max. page views in one visit', 'wp-piwik').':', $this->value($response, 'max_actions'))); + $tableFoot = (self::$settings->getGlobalOption('piwik_shortcut')?array(__('Shortcut', 'wp-piwik').':', 'Piwik'.(isset($aryConf['inline']) && $aryConf['inline']?' - WP-Piwik':'')):null); + $this->table($tableHead, $tableBody, $tableFoot); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Pages.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Pages.php new file mode 100644 index 0000000..0b16ea5 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Pages.php @@ -0,0 +1,21 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Pages', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'Actions.getPageTitles'; + $this->name = __('Page', 'wp-piwik' ); + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Plugins.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Plugins.php new file mode 100644 index 0000000..a5c7b92 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Plugins.php @@ -0,0 +1,38 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Plugins', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'DevicePlugins.getPlugin'; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = array(__('Plugin', 'wp-piwik'), __('Visits', 'wp-piwik'), __('Percent', 'wp-piwik')); + $tableBody = array(); + $count = 0; + if (is_array($response)) + foreach ($response as $row) { + $count++; + $tableBody[] = array($row['label'], $row['nb_visits'], $row['nb_visits_percentage']); + if ($count == 10) break; + } + $this->table($tableHead, $tableBody, null); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Post.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Post.php new file mode 100644 index 0000000..1ec86a2 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Post.php @@ -0,0 +1,51 @@ +parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => 'range', + 'date' => isset($params['range'])?$params['range']:'last30', + 'key' => isset($params['key'])?$params['key']:null, + 'pageUrl' => isset($params['url'])?$params['url']:urlencode(get_permalink($post->ID)), + ); + $this->title = $prefix.__('Overview', 'wp-piwik').' ('.__($this->parameter['date'],'wp-piwik').')'; + $this->method = 'Actions.getPageUrl'; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + if (isset($response[0])) + $response = $response[0]; + if ($this->parameter['key']) { + $this->out(isset($response[$this->parameter['key']])?$response[$this->parameter['key']]:'not defined'); + return; + } + $time = isset($response['entry_sum_visit_length'])?$this->timeFormat($response['entry_sum_visit_length']):'-'; + $avgTime = isset($response['avg_time_on_page'])?$this->timeFormat($response['avg_time_on_page']):'-'; + $tableHead = null; + $tableBody = array( + array(__('Visitors', 'wp-piwik').':', $this->value($response, 'nb_visits')), + array(__('Unique visitors', 'wp-piwik').':', $this->value($response, 'sum_daily_nb_uniq_visitors')), + array(__('Page views', 'wp-piwik').':', $this->value($response, 'nb_hits').' (Ø '.$this->value($response, 'entry_nb_actions').')'), + array(__('Total time spent', 'wp-piwik').':', $time), + array(__('Time/visit', 'wp-piwik').':', $avgTime), + array(__('Bounce count', 'wp-piwik').':', $this->value($response, 'entry_bounce_count').' ('.$this->value($response, 'bounce_rate').')'), + array(__('Min. generation time', 'wp-piwik').':', $this->value($response, 'min_time_generation')), + array(__('Max. generation time', 'wp-piwik').':', $this->value($response, 'max_time_generation')) + ); + $tableFoot = (self::$settings->getGlobalOption('piwik_shortcut')?array(__('Shortcut', 'wp-piwik').':', 'Piwik'.(isset($aryConf['inline']) && $aryConf['inline']?' - WP-Piwik':'')):null); + $this->table($tableHead, $tableBody, $tableFoot); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Referrers.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Referrers.php new file mode 100644 index 0000000..51c8882 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Referrers.php @@ -0,0 +1,21 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Referrers', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'Referrers.getWebsites'; + $this->name = 'Referrer'; + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Screens.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Screens.php new file mode 100644 index 0000000..d6cd460 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Screens.php @@ -0,0 +1,75 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Resolutions', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'Resolution.getResolution'; + $this->context = 'normal'; + wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true); + wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery')); + wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion()); + add_action('admin_head-index.php', array($this, 'addHeaderLines')); + } + + public function addHeaderLines() { + echo ''; + echo ''; + echo ''; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + $tableBody = array(); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = array(__('Resolution', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik')); + if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors'; + else $unique = 'sum_daily_nb_uniq_visitors'; + $count = 0; + $sum = 0; + $js = array(); + $class = array(); + if (is_array($response)) + foreach ($response as $row) { + $count++; + $sum += isset($row[$unique])?$row[$unique]:0; + if ($count < $this->limit) + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + elseif (!isset($tableBody['Others'])) { + $tableBody['Others'] = array($row['label'], $row[$unique], 0); + $class['Others'] = 'wp-piwik-hideDetails'; + $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } else { + $tableBody['Others'][1] += $row[$unique]; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } + } + if ($count > $this->limit) + $tableBody['Others'][0] = __('Others', 'wp-piwik'); + + foreach ($tableBody as $key => $row) + $tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%'; + + if (!empty($tableBody)) $this->pieChart($tableBody); + $this->table($tableHead, $tableBody, null, false, $js, $class); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Search.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Search.php new file mode 100644 index 0000000..2cddf7e --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Search.php @@ -0,0 +1,38 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Site Search', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'Actions.getSiteSearchKeywords'; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = array(__('Keyword', 'wp-piwik'), __('Requests', 'wp-piwik'), __('Bounced', 'wp-piwik')); + $tableBody = array(); + $count = 0; + if (is_array($response)) + foreach ($response as $row) { + $count++; + $tableBody[] = array(htmlentities($row['label']), $row['nb_visits'], $row['bounce_rate']); + if ($count == 10) break; + } + $this->table($tableHead, $tableBody, null); + } + } + + } diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Seo.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Seo.php new file mode 100644 index 0000000..a552225 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Seo.php @@ -0,0 +1,31 @@ +parameter = array( + 'url' => get_bloginfo('url') + ); + $this->title = $prefix.__('SEO', 'wp-piwik'); + $this->method = 'SEO.getRank'; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + echo '
        '; + if (is_array($response)) + foreach ($response as $val) + echo ''; + else echo ''; + echo '
        '.(isset($val['logo_link']) && !empty($val['logo_link'])?''.$val['label'].'':$val['label']).''.$val['rank'].'
        SEO module currently not available.
        '; + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/SystemDetails.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/SystemDetails.php new file mode 100644 index 0000000..c5f48bc --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/SystemDetails.php @@ -0,0 +1,73 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Operation System Details', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'DevicesDetection.getOsVersions'; + $this->context = 'normal'; + wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true); + wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery')); + wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion()); + add_action('admin_head-index.php', array($this, 'addHeaderLines')); + } + + public function addHeaderLines() { + echo ''; + echo ''; + echo ''; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + $tableBody = array(); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = array(__('Operation System', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik')); + if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors'; + else $unique = 'sum_daily_nb_uniq_visitors'; + $count = 0; + $sum = 0; + $js = array(); + $class = array(); + if (is_array($response)) + foreach ($response as $row) { + $count++; + $sum += isset($row[$unique])?$row[$unique]:0; + if ($count < $this->limit) + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + elseif (!isset($tableBody['Others'])) { + $tableBody['Others'] = array($row['label'], $row[$unique], 0); + $class['Others'] = 'wp-piwik-hideDetails'; + $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } else { + $tableBody['Others'][1] += $row[$unique]; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } + } + if ($count > $this->limit) + $tableBody['Others'][0] = __('Others', 'wp-piwik'); + + foreach ($tableBody as $key => $row) + $tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%'; + + if (!empty($tableBody)) $this->pieChart($tableBody); + $this->table($tableHead, $tableBody, null, false, $js, $class); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Systems.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Systems.php new file mode 100644 index 0000000..aae05ec --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Systems.php @@ -0,0 +1,73 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Operation Systems', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'DevicesDetection.getOsFamilies'; + $this->context = 'normal'; + wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true); + wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery')); + wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion()); + add_action('admin_head-index.php', array($this, 'addHeaderLines')); + } + + public function addHeaderLines() { + echo ''; + echo ''; + echo ''; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + $tableBody = array(); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = array(__('Operation System', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik')); + if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors'; + else $unique = 'sum_daily_nb_uniq_visitors'; + $count = 0; + $sum = 0; + $js = array(); + $class = array(); + if (is_array($response)) + foreach ($response as $row) { + $count++; + $sum += isset($row[$unique])?$row[$unique]:0; + if ($count < $this->limit) + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + elseif (!isset($tableBody['Others'])) { + $tableBody['Others'] = array($row['label'], $row[$unique], 0); + $class['Others'] = 'wp-piwik-hideDetails'; + $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } else { + $tableBody['Others'][1] += $row[$unique]; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } + } + if ($count > $this->limit) + $tableBody['Others'][0] = __('Others', 'wp-piwik'); + + foreach ($tableBody as $key => $row) + $tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%'; + + if (!empty($tableBody)) $this->pieChart($tableBody); + $this->table($tableHead, $tableBody, null, false, $js, $class); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Types.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Types.php new file mode 100644 index 0000000..8aea5d0 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Types.php @@ -0,0 +1,80 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => $timeSettings['period'], + 'date' => $timeSettings['date'] + ); + $this->title = $prefix.__('Types', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')'; + $this->method = 'DevicesDetection.getType'; + $this->context = 'normal'; + wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true); + wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery')); + wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion()); + add_action('admin_head-index.php', array($this, 'addHeaderLines')); + } + + public function addHeaderLines() { + echo ''; + echo ''; + echo ''; + } + + public function show() { + $response = self::$wpPiwik->request($this->apiID[$this->method]); + $tableBody = array(); + if (!empty($response['result']) && $response['result'] ='error') + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response['message'], ENT_QUOTES, 'utf-8'); + else { + $tableHead = array(__('Type', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik')); + if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors'; + else $unique = 'sum_daily_nb_uniq_visitors'; + $count = 0; + $sum = 0; + $js = array(); + $class = array(); + if (is_array($response)) + foreach ($response as $row) { + $count++; + $sum += isset($row[$unique])?$row[$unique]:0; + if ($count < $this->limit) + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + elseif (!isset($tableBody['Others'])) { + $tableBody['Others'] = array($row['label'], $row[$unique], 0); + $class['Others'] = 'wp-piwik-hideDetails'; + $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } else { + $tableBody['Others'][1] += $row[$unique]; + $tableBody[$row['label']] = array($row['label'], $row[$unique], 0); + $class[$row['label']] = 'wp-piwik-hideDetails hidden'; + $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );"; + } + } + if ($count > $this->limit) + $tableBody['Others'][0] = __('Others', 'wp-piwik'); + elseif ($count == $this->limit) { + $class['Others'] = $js['Others'] = ''; + } + + foreach ($tableBody as $key => $row) + $tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%'; + + if (!empty($tableBody)) $this->pieChart($tableBody); + $this->table($tableHead, $tableBody, null, false, $js, $class); + } + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Visitors.php b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Visitors.php new file mode 100644 index 0000000..e54cd35 --- /dev/null +++ b/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Visitors.php @@ -0,0 +1,68 @@ +getTimeSettings(); + $this->parameter = array( + 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId), + 'period' => isset($params['period'])?$params['period']:$timeSettings['period'], + 'date' => 'last'.($timeSettings['period']=='day'?'30':'12'), + 'limit' => null + ); + $this->title = $prefix.__('Visitors', 'wp-piwik').' ('.__($this->rangeName(),'wp-piwik').')'; + $this->method = array('VisitsSummary.getVisits', 'VisitsSummary.getUniqueVisitors', 'VisitsSummary.getBounceCount', 'VisitsSummary.getActions'); + $this->context = 'normal'; + wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true); + wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery')); + wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion()); + add_action('admin_head-index.php', array($this, 'addHeaderLines')); + } + + public function show() { + $response = array(); + $success = true; + foreach ($this->method as $method) { + $response[$method] = self::$wpPiwik->request($this->apiID[$method]); + if (!empty($response[$method]['result']) && $response[$method]['result'] ='error') + $success = false; + } + if (!$success) + echo ''.__('Piwik error', 'wp-piwik').': '.htmlentities($response[$method]['message'], ENT_QUOTES, 'utf-8'); + else { + $data = array(); + if (is_array($response) && is_array($response['VisitsSummary.getVisits'])) + foreach ($response['VisitsSummary.getVisits'] as $key => $value) { + if ($this->parameter['period'] == 'week') { + preg_match("/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/", $key, $dateList); + $jsKey = $dateList[0]; + $textKey = $this->dateFormat($jsKey, 'week'); + } elseif ($this->parameter['period'] == 'month') { + $jsKey = $key.'-01'; + $textKey = $key; + } else $jsKey = $textKey = $key; + $data[] = array( + $textKey, + $value, + $response['VisitsSummary.getUniqueVisitors'][$key]?$response['VisitsSummary.getUniqueVisitors'][$key]:'-', + $response['VisitsSummary.getBounceCount'][$key]?$response['VisitsSummary.getBounceCount'][$key]:'-', + $response['VisitsSummary.getActions'][$key]?$response['VisitsSummary.getActions'][$key]:'-' + ); + $javaScript[] = 'javascript:wp_piwik_datelink(\''.urlencode('wp-piwik_stats').'\',\''.str_replace('-', '', $jsKey).'\',\''.(isset($_GET['wpmu_show_stats'])?(int) $_GET['wpmu_show_stats']:'').'\');'; + } + $this->table( + array(__('Date', 'wp-piwik'), __('Visits', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Bounced', 'wp-piwik'), __('Page Views', 'wp-piwik')), + array_reverse($data), + array(), + 'clickable', + array_reverse(isset($javaScript)?$javaScript:[]) + ); + } + + } + + } \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/config.php b/wp-content/plugins/wp-piwik/config.php new file mode 100644 index 0000000..49d441e --- /dev/null +++ b/wp-content/plugins/wp-piwik/config.php @@ -0,0 +1,9 @@ + + + + + + GNU General Public License - GNU Project - Free Software Foundation (FSF) + +

        GNU GENERAL PUBLIC LICENSE

        +

        Version 3, 29 June 2007

        + +

        Copyright © 2007 Free Software Foundation, Inc. <http://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 <http://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 +<http://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 +<http://www.gnu.org/philosophy/why-not-lgpl.html>.

        + + + \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/index.php b/wp-content/plugins/wp-piwik/index.php new file mode 100644 index 0000000..9b3347d --- /dev/null +++ b/wp-content/plugins/wp-piwik/index.php @@ -0,0 +1,2 @@ +. + +Downloads can be found at . + +The mailing list is at . + +Examples and unit tests are at . + +Documentation is at . + +The project page and source code are at . + +Bugs, issues, feature requests: . + +Basic Usage Instructions: + +jqPlot requires jQuery (1.4+ required for certain features). jQuery 1.9.1 is included in +the distribution. To use jqPlot include jQuery, the jqPlot jQuery plugin, the jqPlot css file and +optionally the excanvas script to support IE version prior to IE 9 in your web page: + +> +> +> +> + +For usage instructions, see in usage.txt. For available options, see + in jqPlotOptions.txt. + +Building from source: + +If you've cloned the repository, you can build a distribution from source. +You need to have ant installed. You can simply +type "ant" from the jqplot directory to build the default "all" target. +There are 6 pertinent targets: clean, dist, min, docs, compress and all. Use: + +> ant -p + +to get a description of the various build targets. + +Legal Notices: + +Copyright (c) 2009-2013 Chris Leonello +jqPlot is currently available for use in all personal or commercial projects +under both the MIT and GPL version 2.0 licenses. This means that you can +choose the license that best suits your project and use it accordingly. + +Although not required, the author would appreciate an email letting him +know of any substantial use of jqPlot. You can reach the author at: +chris at jqplot or see http://www.jqplot.com/info.php . + +If you are feeling kind and generous, consider supporting the project by +making a donation at: http://www.jqplot.com/donate.php . + +jqPlot includes date instance methods and printf/sprintf functions by other authors: + +Date instance methods: + + author Ken Snyder (ken d snyder at gmail dot com) + date 2008-09-10 + version 2.0.2 (http://kendsnyder.com/sandbox/date/) + license Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/) + +JavaScript printf/sprintf functions. + + version 2007.04.27 + author Ash Searle + http://hexmen.com/blog/2007/03/printf-sprintf/ + http://hexmen.com/js/sprintf.js + The author (Ash Searle) has placed this code in the public domain: + "This code is unrestricted: you are free to use it however you like." diff --git a/wp-content/plugins/wp-piwik/js/jqplot/changes.txt b/wp-content/plugins/wp-piwik/js/jqplot/changes.txt new file mode 100644 index 0000000..ce990ea --- /dev/null +++ b/wp-content/plugins/wp-piwik/js/jqplot/changes.txt @@ -0,0 +1,458 @@ +Title: Change Log + +1.0.8: +* Issue #375: sortMergedLabels does not sort string labels +* Issue #279: Groups > 3 Causes Alignment Issues +* Issue #439: IE can't display a customized legend in Quirks mode +* Issue #482: "Undefined" error message when plotting a chart with no data +* Issue #116: Don't mix spaces and tabs for indentation +* Issue #564: Metergauge renderer not resizable when replotting +* Issue #409: MeterGaugeRenderer replot/redraw offsets center +* Issue #523: Adding rectangles to Canvas Overlay plugin +* Issue #756: jqplot.min files contain non-UTF-8 characters +* Issue #223: fillToZero does not color negative values when crossover point is 0 +* Pull Request #23: Adding rectangles to Canvas Overlay plugin +* Pull Request #28: Cross-over points of 0 will actually change colors +* Pull Request #35: Don't highlight hidden bars or show tooltips for them +* Pull Request #41: Add dutch(nl) and svenska(sv) translations for dates +* Add tooltip support for Pie Charts +* Update to latest YUI compressor + +1.0.7: +* Issue #726: Bug in sprintf %p, sometimes it outputs exponential form rather than decimal +* Issue #717: Plot's preDrawHooks not called +* Issue #707: Browser hangs with LogAxisRenderer when value is 0 +* Issue #695: Horizontal Bar Chart Negative Series Colors Not Working +* Issue #670: Examples IE7, IE8 and IE9 multipleBarColors.html failure and fix +* Issue #636: X Axis Date Renderer Single Day Not plotting +* Issue #607: Integration issue +* Issue #571: Decimal numbers not properly formatted +* Issue #552: jqPlot crashes when interval too small +* Issue #536: DateAxisRenderer invalid scaling +* Issue #534: "decimalMark" in the "jqplot.sprintf.js" +* Issue #529: Scientific notation on label values ending in 0 +* Issue #521: invalid JS in meterGaugeRenderer.js +* Issue #516: Including BezierCurveRenderer plugin and initializing jqplot with no options give error +* Issue #500: DateAxisRenderer has timezone related issues +* Issue #452: Including ALL jqPlot plugins causes an Error +* Issue #494: No point when use LogAxisRenderer and a point has a zero value +* Issue #430: getIsoWeek: invalid method call +* Issue #280: jqplot Options +* Issue #179: Spelling/grammar +* Pull Request #18: Implement getTop in CanvasAxisTickRenderer +* Pull Request #21: Performance issue when drawing pointlabels with zeros/null values +* Pull Request #24: Added suggested fix in comment #8 for issue #536 +* Pull Request #29: Removed unbalanced addition of UTC offset +* Pull Request #33: Documentation fixes (issue #179, other changes) +* Pull Request #34: Start of updating jqPlotOptions.txt +* Pull Request #37: Example and suggested fix for issues #552 and issue #536 +* Pull Request #39: Fixed trailing comma which caused issues with IE7 + +1.0.6: +* Add left sidebar navigation to examples +* Update examples for jquery 1.9.1 and jquery ui 1.10.0 +* Add colorpicker.js to distribution +* Fix some problems with examples when viewing with local file system +* Add "minified" copyright notice for minified files, similar to jquery's notice. +* Pull Request #25: jqplot.sprintf.js is no longer the last file in the concatenated jquery.jqplot.js +* Pull Request #17: Fixed bug causing custom pointLabels passed with plot data to be ignored for horizontal bar graphs. +* Pull Request #10: Build error by invalid encoding. +* Issue #714: handle tickColor in meterGaugeRenderer +* Issue #519: jsDate Polish Localization + +1.0.5: +* Updated to jQuery 1.9 + +1.0.0b2: +* Major improvements in memory usage: +** Merged in changes from Timo Besenruether to reuse canvas elements and improve + memory performance. +** Fixed all identifiable DOM leaks. +** Mergged in changes from cguillot for memory improvements in IE < 9. +* Added vertical and dashed vertical line support for canvas overlay. +* Fixed bug where initially hidden plots would not display. +* Fixed bug with point labels and null data points. +* Updated to jQuery 1.6.1. +* Improved pie slice margin calculation and fixed slice margin and pie positioning + with small slices. +* Improved bar renderer so bars always start at 0 if: +** The axis is a linear axis (not log/date). +** There are no other line types besides bars attached to the axis. +** The data on the axis is all >= 0. +** The user has not specified a pad, padMin or forceTickAt0 = true option. +* Modified tick prefix behavious so prefix no added to all ticks, even if format + string is specified. +* Fix to ensure original tick formats are applied when zooming and resetting + zoom. +* Updated auto tick format string so format adjusted when zooming. +* Modified auto tick computation to put less ticks on small plots and more + ticks on large plots. +* Update bubble render to support gradients in IE 9. + +1.0.0b1: +* Much improved tick generation algorithm to get precise rounded + tick values (Thanks Scott Prahl!). +* Auto compute tick format string if none is provided. +* Much better "slicing" of pie charts when using "sliceMargin" option to set + a gap between the slices. +* Expanded canvasOverlay plugin to create arbitrary dashed and solid + horizontal and vertical lines on top of plot. +* Added defaultColors and defaultNegativeColors options to $.jqplot.config. +* Fixed issue #318, highlighter & bar renderer incompatability. +* Improve highlighter tooltip positioning with negative bars. +* Fixed #305, mispelling of jqlotDragStart and jqlotDragStop. MUST NOW BIND + TO jqplotDragStart and jqplotDragStop. +* Fixed #290, some variables left in global scope. +* Fixed #289, OHLC line widths hard coded at 1.5. Now set by lineWidth option. +* Fixed #296 for determining databounds on log axes. +* Updated to jQuery 1.5.1 +* Fixed waterfall plot to ensure first and last bars always fill to zero. +* Added lineJoin and lineCap option to series lines. +* Bar widths now based on width of grid, not plot target for better scaling. +* Added looseZoom option to cursor so zooming can produce well rounded ticks. +* Added forceTickAt0 and forceTickAt100 options to ensure there will always + be a tick at 0 or 100 in the plot. +* Fixed bug where cursor legend didn't honor series showLabel option. + + +1.0.0a: + +* Series can now be moved forward or backward in stack to e.g. bring a line + forward when mousing over a point. +* Can now move outside of grid area while zooming. Can have zoom + constrained to grid area or allow zooming outside. +* Fixed issue #142 with tooltip drawn on top of event canvas, hiding + mouse events. +* Fixed #147 where pie slices with 0 value not rendering properly in IE. +* Fixed #130 where stack data not sorted properly. +* Fixed bug with null values not handled properly in category axes. +* Fixed #156 where pie charts not rendering on QTWebKit. +* Now using feature detection for canvas and canvas text capability + rather than browser version. +* Added enahncedLegendRenderer plugin to allow multi row/column legends + and clickable labels to show/hide series. +* Added fillToValue option to allow filled line plot to fill to an + arbitrary value. +* Added block plot plugin. +* Added funnel type charts. +* Added meter gauge type charts. +* Added plot theming support. +* $.jqplot.config.enablePlugins now false by default. +* Implemented highlighting on bar, pie, donut, funnel, etc. charts. +* Fix to pointlabels plugin to align labels properly on multi series plots. +* Added custom error handling to display error message in plot area. +* Fixed issue where would call to draw grid border of 0 width would + result in a default border being drawn. +* Added options to place legend outside of grid and shrink grid so everything + stays within plot div. +* Fixed bug in color generator so now calls to get() continually cycle + through colors just like next(). +* Added defaultAxisStart option. +* Added gradient fills to bubbles. +* Added bubble charts. +* Added showLabels option to bubble charts. +* Pass bubble radius to event callback in bubble charts. +* Fixed #207, typo in docs. +* Fixed #206 where "value" pie slice data labels were displaying wrong + value. +* Fixed #147 with 0 value slices in IE6. +* Fixed issue #241, disabled varyBarColor option in stacked charts. +* Added dataRenderer option to allow custom processors for JSON, AJAX + and anywhere else you might want to get data. +* Fixed null value handling so plot now properly skip or join over nulls. +* Fixed showTicks and showTickMarks option conflicts. +* Fixed issue #185 where pointLabels plugin incompatibility could crash + pie, donut and other plots. +* Fixed #23 and #143 to obey gridPadding option. +* Fixed #233 with highlighter tooltip separator. +* Fixed #224 where type checking failing on GWT. +* Fixed #272 with pie highlighting not working on replot. +* Memory performance improvements. +* Changes to build script so everything should build when pulled from repo. +* Fixed issue #275, IE 6/7 don't support array indexing of strings. +* Added event listener hooks for mouseUp, mouseDown, etc. to all line plots. +* Fixed bug with highlighter not working when null in data. +* Updated to jQuery 1.4.4 +* Fixed bug where donut plots showed value of radians of slice instead + of actual data. +* Reverted to excanvas r3 so IE8 no longer has to emulate IE7. +* Added tooltipContentEditor option to highlighter, allowing callback + to manipulate tooltip content at run time (thanks Tim Bunce!). +* Fixed bug where axes scale not resetting. +* Fixed bug with date axes where data bounds not properly set. +* Fixed issue where tick marks disappear if grid lines turned off. +* Updated replot method to allow passing in axes options for more control. +* Added experimental support for "broken" axes. +* Fixed bug with pies where pies with 0 valued slices did not draw correctly. +* Added canvasOverlay plugin to allow drawing of arbitrary shapes on a canvas + over the plot. +* Added option to display arbitrary text/html (message, animated gif, etc.) if + plot is constructed without data. Allow a "data loading" indicator to be shown. +* Added resetAxisValues method to manually update axis ticks without + redrawing the plot. +* Fix to labels on negative bars so label postiion of 'n' will be below a negative bar, + just as it is above a positive bar (thanks guigod!). +* Added thousands separator character (') to sprintf formatting (thanks yuichi1004!). +* Re-factored date parsing/formatting to use new jsDate module which does not + extend the Date prototype. + + +0.9.7: + +* Added Mekko chart plot type with enhanced legend and axes support. +* Implemented vertical waterfall charts. Can create waterfall plot as + option to bar chart. See examples folder of distribution. +* Enhanced plot labels for waterfall style. +* Enhanced bar plots so you can now color each bar of a series + independently with the "varyBarColor" option. +* Re-factored series drawing so that each series and series shadow drawn + on its own canvas. Allows series to be redrawn independently of each other. +* Added additional default series colors. +* Added useNegativeColors option to turn off negative color array and use + only seriesColors array to define all bar/filled line colors. +* Fix css for cursor legend. +* Modified shape renderer so rectangles can be stroked and filled. +* Re-factored date methods out of dateAxisRenderer so that date formatter + and methods can be accesses outside of dateAxisRenderer plugin. +* Fixed #132, now trigger series change event on plot target instead of drag canvas. +* Fixes issue #116 where some source files had mix of tabs and spaces + for indentation. Should have been all spaces. +* Fixed issue #126, some links broken in docs section of web site. +* Fixed issue #90, trendline plugin incompatibility with pie renderer. +* Updated samples in examples folder of distribution to include navigation + links if web server is set up to process .html files with php. + + +0.9.6: + +* New, easier to use, replot() method for placing plots in tabs, accordions, + resizable containers or for changing plot parameters programmatically. +* Updated legend renderer for pie charts to draw swatches which will + print correctly. +* Fixed issue #118 with patch from taum so autoscale option will + honor tickInterval and numberTicks options +* Fix to plot diameter calculation for initially hidden plots. +* Added examples for making plots in jQuery UI tabs and accordions. +* Fixed issue #120 where pie chart with single slice not displaying + correctly in IE and Chrome + + +0.9.5.2: + +* Fixed #102 where double clicking on plot that has zoom enabled, but + has not been zoomed resulted in error. +* Fixed bug where candlestick coloring options not working. +* Added option to turn individual series labels off in the legend. + + +0.9.5.1: + +* Fixed bug where tooltip not working with OHLC and candlestick charts. +* Added additional marker styles: plus, X and dash. + + +0.9.5: + +* Implemented "zoomProxy". zoomProxy allows zooming one plot from another + such as an overview plot. +* Zooming can now be constrained to just x or y axis. +* Enhanced cursor plugin with vertical "dataTracking" line. This is a line + at the cursor location with a readout of data points at the line location + which are displayed in the chart legend. +* Changed cursor tooltip format string. Now one format string is used for + entire tooltip. +* Added mechanisms to specify plot size when plot target is hidden or plot + height/width otherwise cannot be determined from markup. +* Added $.jqplot.config object to specify jqplot wide configuration options. + These include enablePlugins to globally set the default plugin state on/off + and defaultHeight/defaultWidth to specify default plot height/width. +* Added fillToZero option which forces filled charts to fill to zero as opposed + to axis minimum. Thus negative filled bar/line values will fill upwards to + zero axis value. +* Added option to disable stacking on individual lines. +* Changed targetId property of the plot object so it now includes a "#" before + the id string. +* Improved tick and body sizing of Open Hi Low Close and candlestick charts. +* Removed lots of web site related files from the repository. This means that, + if working from the sources, user's won't be able to build the jqplot web + site and the docs/tests that are hosted on that site. The minified and + compressed distribution packages will build fine. +* Lots of examples were added to a separate examples directory to better show + functionality of jqPlot for local testing with the distribution. +* Many various bug fixes and other minor enhancements. + + +0.9.4: + +* Implemented axis labels. Labels can be rendered in div tags or as canvas + elements supporting rotated text. +* Improved rotated axis label positioning so labels will start or end at a + tick position. +* Fixed bug where an empty data series would hang plot rendering. +* completed issue #66 for misc. improvements to documentation. +* Fixed issue #64 where the same ID's were assigned to cursor and highlighter + elements. +* Added option to legend to encode special HTML characters. +* Fixed undesirable behavior where point labels for points off the plot + were being rendered. +* Added edgeTolerance option to point label renderer to control rendering of + labels near plot edges. + + +0.9.3: + +* Preliminary support for axis labels. Currently rendered into DIV tags, + so no rotated label support. This feature is currently experimental. +* Fixed bug #52, needed space in tick div tag between style and class declarations + or plot failed in certain application doctypes. +* Fixed issue #54, miter style line join for chart lines causing spikes at steep + changes in slope. Changed miter style to round. +* Added examples for new autoscaling algorithm. +* Fixed bug #57, category axis labels disappear on redraw() +* Improved algorithm which controlled maximum number of labels that would display + on a category axis. +* Fixed bug #45 where null values causing errors in plotData and gridData. +* Fixed issue #60 where seriesColors option was not working. + + +0.9.2: + +* Fixed bug #45 where a plot could crash if series had different numbers of points. +* Fixed issue #50, added option to turn off sorting of series data. +* Fixed issue #31, implemented a better axis autoscaling algorithm and added an autoscale option. + +0.9.1: + +* Fixed bug #40, when axis pad, padMax, padMin set to 0, graph would fail to render. +* Fixed bug #41 where pie and bar charts not rendered correctly on redraw(). +* Fixed bug #11, filled stacked line plots not rendering correctly in IE. +* Fixed bug #42 where stacked charts not rendering with string date axis ticks. +* Fixed bug in redraw() method where axes ticks were not reset. +* Fixed "jqplotPreRedrawEvent" that should have been named "jqplotPostRedraw" event. + +0.9.0: + +* Added Open Hi Low Close charts, Candlestick charts and Hi Low Close charts. +* Added support for arbitrary labels on the data points. +* Enhanced highlighter plugin to allow custom formatting control of entire tooltip. +* Enhanced highlighter to support multiple y values in a data point. +* Fixed bug #38 where series with a single point with a negative value would fail. +* Improvements to examples to show what plugins to include. +* Expanded documentation for some of the plugins. + +0.8.5: + +* Added zooming ability with double click or single click options to reset zoom. +* Modified default tick spacing algorithm for date axes to give more space to ticks. +* Fixed bug #2 where tickInterval wasn't working properly. +* Added neighborThreshold option to control how close mouse must be to + point to trigger neighbor detection. +* Added double click event handler on plot. + +0.8.0: + +* Support for up to 9 y axes. +* Added option to control padding at max/min bounds of axes separately. +* Closed issue #21, added options to control grid line color and width. +* Closed issue #20, added options to filled line charts to stoke above + fill and customize fill color and transparency. +* Improved structure of on line documentation to make usage and options + docs default. +* Added much documentation on options and css styling. + +0.7.1: + +* Bug fix release +* Fixed bug #6, missing semi-colons messing up some javascript compressors. +* Fixed bug #13 where 2D ticks array of [values, labels] would fail to + renderer with DateAxisRenderer. +* Fixes bug #16 where pie renderer overwriting options for all plot types + and crashing non pie plots. +* Fixes bug #17 constrainTo dragable option mispelled as "contstrainTo". + Fixed dragable color issue when used with trend lines. + +0.7.0: + +* Pie chart support +* Enabled tooltipLocation option in highlighter. +* Highlighter Tooltip will account for mark size and highlight size when + positioning itself. +* Added ability to show just x, y or both axes in highlighter tooltip. +* Added customization of separator between axes values in highlighter tooltip. +* Modified how shadows are drawn for lines, bars and markers. Now drawn first, + so they are always behind the object. +* Adjustments to shadow parameters on lines to account for new shadow positioning. +* Added a ColorGenerator class to robustly return next available color + for a plot with wrap around to first color at end. +* Udates to docs about css file. +* Fixed bug with String x values in series and IE error on sorting (Category Axis). +* Added cursor changes in dragable plugin when cursor near dragable point. + +0.6.6b: + +* Added excanvas.js and excanvas.min.js to compressed distributions. +* Added example/test html pages I had locally into repository and to + compressed distributions. + +0.6.6a: + +* Removed absolute positioning from dom element and put back into css file. +* Duplicate of 0.6.6 with a suffix to unambiguously differentiate between + previously posted 0.6.6 release. + +0.6.6: + +* Fixed bug #5, trend line plugin failing when no trend line options specified. +* Added absolute position css spec to axis tick dom element. +* Enhancement to category axes, more intuitive handling of series with + missing data values. + +0.6.5: + +* Fixed bug #4, series of unequal data length not rendering correctly. + This is a bugfix release only. + +0.6.4: + +* Fixed bug (issue #1 in tracker) where flat line data series (all x and/or y + values are euqal) or single value data series would crash. + +0.6.3: + +* Support for stacked line (a.k.a. area) and stacked bar (horizontal and + vertical) charts. +* Refactored barRenderer to use default shape and shadow renderers. +* Added info (contacts & support information) page to web site. + +0.6.2: + +* This is a minor upgrade to docs and build only. No functionality has changed. +* Ant build script generates entire site, examples, tests and distribution. +* Improvements to documentation. + +0.6.1: + +* New sprintf implementation from Ash Searle that implements %g. +* Fix to sprintf e/f formats. +* Created new format specifier, %p and %P to preserve significance. +* Modified p/P format to better display larger numbers. +* Fixed and simplified significant digits calculation for sprintf. +* Added option to have cursor tooltip follow the mouse or not. +* Added options to change size of highlight. +* Updates to handle dates like '6-May-09'. +* Mods to improve look of web site. +* Updates to documentation. +* Added license and copyright statement to source files. + +0.6.0: + +* Added rotated text support. Uses native canvas text functionality in + browsers that support it or draws text on canvas with Hershey font +* metrics for non-supporting browsers. +* Removed lots of lint in js code. +* Moved tick css from js code into css file. +* Fix to tick positioning css. y axis ticks were positioned to wrong side of axis div. +* Re-factored axis tick renderer instantiation into the axes renderers themselves. + + +For changes prior to 0.6.0 release, please see change log at http://bitbucket.org/cleonello/jqplot/changesets/ diff --git a/wp-content/plugins/wp-piwik/js/jqplot/copyright.txt b/wp-content/plugins/wp-piwik/js/jqplot/copyright.txt new file mode 100644 index 0000000..86d4c40 --- /dev/null +++ b/wp-content/plugins/wp-piwik/js/jqplot/copyright.txt @@ -0,0 +1,56 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: @VERSION + * + * Copyright (c) 2009-2013 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + * included jsDate library by Chris Leonello: + * + * Copyright (c) 2010-2013 Chris Leonello + * + * jsDate is currently available for use in all personal or commercial projects + * under both the MIT and GPL version 2.0 licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * jsDate borrows many concepts and ideas from the Date Instance + * Methods by Ken Snyder along with some parts of Ken's actual code. + * + * Ken's origianl Date Instance Methods and copyright notice: + * + * Ken Snyder (ken d snyder at gmail dot com) + * 2008-09-10 + * version 2.0.2 (http://kendsnyder.com/sandbox/date/) + * Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/) + * + * jqplotToImage function based on Larry Siden's export-jqplot-to-png.js. + * Larry has generously given permission to adapt his code for inclusion + * into jqPlot. + * + * Larry's original code can be found here: + * + * https://github.com/lsiden/export-jqplot-to-png + * + * + */ diff --git a/wp-content/plugins/wp-piwik/js/jqplot/excanvas.min.js b/wp-content/plugins/wp-piwik/js/jqplot/excanvas.min.js new file mode 100644 index 0000000..83373a5 --- /dev/null +++ b/wp-content/plugins/wp-piwik/js/jqplot/excanvas.min.js @@ -0,0 +1,3 @@ +/* jqPlot @VERSION | (c) 2009-2013 Chris Leonello | jplot.com + jsDate | (c) 2010-2013 Chris Leonello + */if(!document.createElement("canvas").getContext){(function(){var ab=Math;var n=ab.round;var l=ab.sin;var A=ab.cos;var H=ab.abs;var N=ab.sqrt;var d=10;var f=d/2;var z=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1];function y(){return this.context_||(this.context_=new D(this))}var t=Array.prototype.slice;function g(j,m,p){var i=t.call(arguments,2);return function(){return j.apply(m,i.concat(t.call(arguments)))}}function af(i){return String(i).replace(/&/g,"&").replace(/"/g,""")}function Y(m,j,i){if(!m.namespaces[j]){m.namespaces.add(j,i,"#default#VML")}}function R(j){Y(j,"g_vml_","urn:schemas-microsoft-com:vml");Y(j,"g_o_","urn:schemas-microsoft-com:office:office");if(!j.styleSheets.ex_canvas_){var i=j.createStyleSheet();i.owningElement.id="ex_canvas_";i.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}R(document);var e={init:function(i){var j=i||document;j.createElement("canvas");j.attachEvent("onreadystatechange",g(this.init_,this,j))},init_:function(p){var m=p.getElementsByTagName("canvas");for(var j=0;j1){m--}if(6*m<1){return j+(i-j)*6*m}else{if(2*m<1){return i}else{if(3*m<2){return j+(i-j)*(2/3-m)*6}else{return j}}}}var C={};function F(j){if(j in C){return C[j]}var ag,Z=1;j=String(j);if(j.charAt(0)=="#"){ag=j}else{if(/^rgb/.test(j)){var p=M(j);var ag="#",ah;for(var m=0;m<3;m++){if(p[m].indexOf("%")!=-1){ah=Math.floor(c(p[m])*255)}else{ah=+p[m]}ag+=k[r(ah,0,255)]}Z=+p[3]}else{if(/^hsl/.test(j)){var p=M(j);ag=I(p);Z=p[3]}else{ag=b[j]||j}}}return C[j]={color:ag,alpha:Z}}var o={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"};var L={};function E(i){if(L[i]){return L[i]}var p=document.createElement("div");var m=p.style;try{m.font=i}catch(j){}return L[i]={style:m.fontStyle||o.style,variant:m.fontVariant||o.variant,weight:m.fontWeight||o.weight,size:m.fontSize||o.size,family:m.fontFamily||o.family}}function u(m,j){var i={};for(var ah in m){i[ah]=m[ah]}var ag=parseFloat(j.currentStyle.fontSize),Z=parseFloat(m.size);if(typeof m.size=="number"){i.size=m.size}else{if(m.size.indexOf("px")!=-1){i.size=Z}else{if(m.size.indexOf("em")!=-1){i.size=ag*Z}else{if(m.size.indexOf("%")!=-1){i.size=(ag/100)*Z}else{if(m.size.indexOf("pt")!=-1){i.size=Z/0.75}else{i.size=ag}}}}}i.size*=0.981;i.family="'"+i.family.replace(/(\'|\")/g,"").replace(/\s*,\s*/g,"', '")+"'";return i}function ac(i){return i.style+" "+i.variant+" "+i.weight+" "+i.size+"px "+i.family}var s={butt:"flat",round:"round"};function S(i){return s[i]||"square"}function D(i){this.m_=B();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=d*1;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=i;var m="width:"+i.clientWidth+"px;height:"+i.clientHeight+"px;overflow:hidden;position:absolute";var j=i.ownerDocument.createElement("div");j.style.cssText=m;i.appendChild(j);var p=j.cloneNode(false);p.style.backgroundColor="red";p.style.filter="alpha(opacity=0)";i.appendChild(p);this.element_=j;this.arcScaleX_=1;this.arcScaleY_=1;this.lineScale_=1}var q=D.prototype;q.clearRect=function(){if(this.textMeasureEl_){this.textMeasureEl_.removeNode(true);this.textMeasureEl_=null}this.element_.innerHTML=""};q.beginPath=function(){this.currentPath_=[]};q.moveTo=function(j,i){var m=V(this,j,i);this.currentPath_.push({type:"moveTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};q.lineTo=function(j,i){var m=V(this,j,i);this.currentPath_.push({type:"lineTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};q.bezierCurveTo=function(m,j,ak,aj,ai,ag){var i=V(this,ai,ag);var ah=V(this,m,j);var Z=V(this,ak,aj);K(this,ah,Z,i)};function K(i,Z,m,j){i.currentPath_.push({type:"bezierCurveTo",cp1x:Z.x,cp1y:Z.y,cp2x:m.x,cp2y:m.y,x:j.x,y:j.y});i.currentX_=j.x;i.currentY_=j.y}q.quadraticCurveTo=function(ai,m,j,i){var ah=V(this,ai,m);var ag=V(this,j,i);var aj={x:this.currentX_+2/3*(ah.x-this.currentX_),y:this.currentY_+2/3*(ah.y-this.currentY_)};var Z={x:aj.x+(ag.x-this.currentX_)/3,y:aj.y+(ag.y-this.currentY_)/3};K(this,aj,Z,ag)};q.arc=function(al,aj,ak,ag,j,m){ak*=d;var ap=m?"at":"wa";var am=al+A(ag)*ak-f;var ao=aj+l(ag)*ak-f;var i=al+A(j)*ak-f;var an=aj+l(j)*ak-f;if(am==i&&!m){am+=0.125}var Z=V(this,al,aj);var ai=V(this,am,ao);var ah=V(this,i,an);this.currentPath_.push({type:ap,x:Z.x,y:Z.y,radius:ak,xStart:ai.x,yStart:ai.y,xEnd:ah.x,yEnd:ah.y})};q.rect=function(m,j,i,p){this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath()};q.strokeRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.stroke();this.currentPath_=Z};q.fillRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.fill();this.currentPath_=Z};q.createLinearGradient=function(j,p,i,m){var Z=new U("gradient");Z.x0_=j;Z.y0_=p;Z.x1_=i;Z.y1_=m;return Z};q.createRadialGradient=function(p,ag,m,j,Z,i){var ah=new U("gradientradial");ah.x0_=p;ah.y0_=ag;ah.r0_=m;ah.x1_=j;ah.y1_=Z;ah.r1_=i;return ah};q.drawImage=function(aq,m){var aj,ah,al,ay,ao,am,at,aA;var ak=aq.runtimeStyle.width;var ap=aq.runtimeStyle.height;aq.runtimeStyle.width="auto";aq.runtimeStyle.height="auto";var ai=aq.width;var aw=aq.height;aq.runtimeStyle.width=ak;aq.runtimeStyle.height=ap;if(arguments.length==3){aj=arguments[1];ah=arguments[2];ao=am=0;at=al=ai;aA=ay=aw}else{if(arguments.length==5){aj=arguments[1];ah=arguments[2];al=arguments[3];ay=arguments[4];ao=am=0;at=ai;aA=aw}else{if(arguments.length==9){ao=arguments[1];am=arguments[2];at=arguments[3];aA=arguments[4];aj=arguments[5];ah=arguments[6];al=arguments[7];ay=arguments[8]}else{throw Error("Invalid number of arguments")}}}var az=V(this,aj,ah);var p=at/2;var j=aA/2;var ax=[];var i=10;var ag=10;ax.push(" ','","");this.element_.insertAdjacentHTML("BeforeEnd",ax.join(""))};q.stroke=function(al){var aj=[];var Z=false;var m=10;var am=10;aj.push("ak.x){ak.x=j.x}if(ag.y==null||j.yak.y){ak.y=j.y}}}aj.push(' ">');if(!al){w(this,aj)}else{G(this,aj,ag,ak)}aj.push("");this.element_.insertAdjacentHTML("beforeEnd",aj.join(""))};function w(m,ag){var j=F(m.strokeStyle);var p=j.color;var Z=j.alpha*m.globalAlpha;var i=m.lineScale_*m.lineWidth;if(i<1){Z*=i}ag.push("')}function G(aq,ai,aK,ar){var aj=aq.fillStyle;var aB=aq.arcScaleX_;var aA=aq.arcScaleY_;var j=ar.x-aK.x;var p=ar.y-aK.y;if(aj instanceof U){var an=0;var aF={x:0,y:0};var ax=0;var am=1;if(aj.type_=="gradient"){var al=aj.x0_/aB;var m=aj.y0_/aA;var ak=aj.x1_/aB;var aM=aj.y1_/aA;var aJ=V(aq,al,m);var aI=V(aq,ak,aM);var ag=aI.x-aJ.x;var Z=aI.y-aJ.y;an=Math.atan2(ag,Z)*180/Math.PI;if(an<0){an+=360}if(an<0.000001){an=0}}else{var aJ=V(aq,aj.x0_,aj.y0_);aF={x:(aJ.x-aK.x)/j,y:(aJ.y-aK.y)/p};j/=aB*d;p/=aA*d;var aD=ab.max(j,p);ax=2*aj.r0_/aD;am=2*aj.r1_/aD-ax}var av=aj.colors_;av.sort(function(aN,i){return aN.offset-i.offset});var ap=av.length;var au=av[0].color;var at=av[ap-1].color;var az=av[0].alpha*aq.globalAlpha;var ay=av[ap-1].alpha*aq.globalAlpha;var aE=[];for(var aH=0;aH')}else{if(aj instanceof T){if(j&&p){var ah=-aK.x;var aC=-aK.y;ai.push("')}}else{var aL=F(aq.fillStyle);var aw=aL.color;var aG=aL.alpha*aq.globalAlpha;ai.push('')}}}q.fill=function(){this.stroke(true)};q.closePath=function(){this.currentPath_.push({type:"close"})};function V(j,Z,p){var i=j.m_;return{x:d*(Z*i[0][0]+p*i[1][0]+i[2][0])-f,y:d*(Z*i[0][1]+p*i[1][1]+i[2][1])-f}}q.save=function(){var i={};v(this,i);this.aStack_.push(i);this.mStack_.push(this.m_);this.m_=J(B(),this.m_)};q.restore=function(){if(this.aStack_.length){v(this.aStack_.pop(),this);this.m_=this.mStack_.pop()}};function h(i){return isFinite(i[0][0])&&isFinite(i[0][1])&&isFinite(i[1][0])&&isFinite(i[1][1])&&isFinite(i[2][0])&&isFinite(i[2][1])}function aa(j,i,p){if(!h(i)){return}j.m_=i;if(p){var Z=i[0][0]*i[1][1]-i[0][1]*i[1][0];j.lineScale_=N(H(Z))}}q.translate=function(m,j){var i=[[1,0,0],[0,1,0],[m,j,1]];aa(this,J(i,this.m_),false)};q.rotate=function(j){var p=A(j);var m=l(j);var i=[[p,m,0],[-m,p,0],[0,0,1]];aa(this,J(i,this.m_),false)};q.scale=function(m,j){this.arcScaleX_*=m;this.arcScaleY_*=j;var i=[[m,0,0],[0,j,0],[0,0,1]];aa(this,J(i,this.m_),true)};q.transform=function(Z,p,ah,ag,j,i){var m=[[Z,p,0],[ah,ag,0],[j,i,1]];aa(this,J(m,this.m_),true)};q.setTransform=function(ag,Z,ai,ah,p,j){var i=[[ag,Z,0],[ai,ah,0],[p,j,1]];aa(this,i,true)};q.drawText_=function(am,ak,aj,ap,ai){var ao=this.m_,at=1000,j=0,ar=at,ah={x:0,y:0},ag=[];var i=u(E(this.font),this.element_);var p=ac(i);var au=this.element_.currentStyle;var Z=this.textAlign.toLowerCase();switch(Z){case"left":case"center":case"right":break;case"end":Z=au.direction=="ltr"?"right":"left";break;case"start":Z=au.direction=="rtl"?"right":"left";break;default:Z="left"}switch(this.textBaseline){case"hanging":case"top":ah.y=i.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":ah.y=-i.size/2.25;break}switch(Z){case"right":j=at;ar=0.05;break;case"center":j=ar=at/2;break}var aq=V(this,ak+ah.x,aj+ah.y);ag.push('');if(ai){w(this,ag)}else{G(this,ag,{x:-j,y:0},{x:ar,y:i.size})}var an=ao[0][0].toFixed(3)+","+ao[1][0].toFixed(3)+","+ao[0][1].toFixed(3)+","+ao[1][1].toFixed(3)+",0,0";var al=n(aq.x/d+1-ao[0][0])+","+n(aq.y/d-2*ao[1][0]);ag.push('','','');this.element_.insertAdjacentHTML("beforeEnd",ag.join(""))};q.fillText=function(m,i,p,j){this.drawText_(m,i,p,j,false)};q.strokeText=function(m,i,p,j){this.drawText_(m,i,p,j,true)};q.measureText=function(m){if(!this.textMeasureEl_){var i='';this.element_.insertAdjacentHTML("beforeEnd",i);this.textMeasureEl_=this.element_.lastChild}var j=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(j.createTextNode(m));return{width:this.textMeasureEl_.offsetWidth}};q.clip=function(){};q.arcTo=function(){};q.createPattern=function(j,i){return new T(j,i)};function U(i){this.type_=i;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]}U.prototype.addColorStop=function(j,i){i=F(i);this.colors_.push({offset:j,color:i.color,alpha:i.alpha})};function T(j,i){Q(j);switch(i){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=i;break;default:O("SYNTAX_ERR")}this.src_=j.src;this.width_=j.width;this.height_=j.height}function O(i){throw new P(i)}function Q(i){if(!i||i.nodeType!=1||i.tagName!="IMG"){O("TYPE_MISMATCH_ERR")}if(i.readyState!="complete"){O("INVALID_STATE_ERR")}}function P(i){this.code=this[i];this.message=i+": DOM Exception "+this.code}var X=P.prototype=new Error;X.INDEX_SIZE_ERR=1;X.DOMSTRING_SIZE_ERR=2;X.HIERARCHY_REQUEST_ERR=3;X.WRONG_DOCUMENT_ERR=4;X.INVALID_CHARACTER_ERR=5;X.NO_DATA_ALLOWED_ERR=6;X.NO_MODIFICATION_ALLOWED_ERR=7;X.NOT_FOUND_ERR=8;X.NOT_SUPPORTED_ERR=9;X.INUSE_ATTRIBUTE_ERR=10;X.INVALID_STATE_ERR=11;X.SYNTAX_ERR=12;X.INVALID_MODIFICATION_ERR=13;X.NAMESPACE_ERR=14;X.INVALID_ACCESS_ERR=15;X.VALIDATION_ERR=16;X.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=e;CanvasRenderingContext2D=D;CanvasGradient=U;CanvasPattern=T;DOMException=P;G_vmlCanvasManager._version=888})()}; \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/js/jqplot/gpl-2.0.txt b/wp-content/plugins/wp-piwik/js/jqplot/gpl-2.0.txt new file mode 100644 index 0000000..864c6b8 --- /dev/null +++ b/wp-content/plugins/wp-piwik/js/jqplot/gpl-2.0.txt @@ -0,0 +1,280 @@ +Title: GPL Version 2 + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) 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 +this service 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 make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. 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. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +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 +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE 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. \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/js/jqplot/index.php b/wp-content/plugins/wp-piwik/js/jqplot/index.php new file mode 100644 index 0000000..9b3347d --- /dev/null +++ b/wp-content/plugins/wp-piwik/js/jqplot/index.php @@ -0,0 +1,2 @@ +'+ao+"");L("#"+an).addClass("jqplot-error");document.getElementById(an).style.background=L.jqplot.config.errorBackground;document.getElementById(an).style.border=L.jqplot.config.errorBorder;document.getElementById(an).style.fontFamily=L.jqplot.config.errorFontFamily;document.getElementById(an).style.fontSize=L.jqplot.config.errorFontSize;document.getElementById(an).style.fontStyle=L.jqplot.config.errorFontStyle;document.getElementById(an).style.fontWeight=L.jqplot.config.errorFontWeight}}else{am.init(an,aj,ah);am.draw();am.themeEngine.init.call(am);return am}};L.jqplot.version="1.0.8";L.jqplot.revision="1250";L.jqplot.targetCounter=1;L.jqplot.CanvasManager=function(){if(typeof L.jqplot.CanvasManager.canvases=="undefined"){L.jqplot.CanvasManager.canvases=[];L.jqplot.CanvasManager.free=[]}var ah=[];this.getCanvas=function(){var ak;var aj=true;if(!L.jqplot.use_excanvas){for(var al=0,ai=L.jqplot.CanvasManager.canvases.length;al887){L.jqplot.support_canvas_text.result=true}else{L.jqplot.support_canvas_text.result=!!(document.createElement("canvas").getContext&&typeof document.createElement("canvas").getContext("2d").fillText=="function")}}return L.jqplot.support_canvas_text.result};L.jqplot.use_excanvas=((!L.support.boxModel||!L.support.objectAll||!$support.leadingWhitespace)&&!L.jqplot.support_canvas())?true:false;L.jqplot.preInitHooks=[];L.jqplot.postInitHooks=[];L.jqplot.preParseOptionsHooks=[];L.jqplot.postParseOptionsHooks=[];L.jqplot.preDrawHooks=[];L.jqplot.postDrawHooks=[];L.jqplot.preDrawSeriesHooks=[];L.jqplot.postDrawSeriesHooks=[];L.jqplot.preDrawLegendHooks=[];L.jqplot.addLegendRowHooks=[];L.jqplot.preSeriesInitHooks=[];L.jqplot.postSeriesInitHooks=[];L.jqplot.preParseSeriesOptionsHooks=[];L.jqplot.postParseSeriesOptionsHooks=[];L.jqplot.eventListenerHooks=[];L.jqplot.preDrawSeriesShadowHooks=[];L.jqplot.postDrawSeriesShadowHooks=[];L.jqplot.ElemContainer=function(){this._elem;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null}};L.jqplot.ElemContainer.prototype.createElement=function(ak,am,ai,aj,an){this._offsets=am;var ah=ai||"jqplot";var al=document.createElement(ak);this._elem=L(al);this._elem.addClass(ah);this._elem.css(aj);this._elem.attr(an);al=null;return this._elem};L.jqplot.ElemContainer.prototype.getWidth=function(){if(this._elem){return this._elem.outerWidth(true)}else{return null}};L.jqplot.ElemContainer.prototype.getHeight=function(){if(this._elem){return this._elem.outerHeight(true)}else{return null}};L.jqplot.ElemContainer.prototype.getPosition=function(){if(this._elem){return this._elem.position()}else{return{top:null,left:null,bottom:null,right:null}}};L.jqplot.ElemContainer.prototype.getTop=function(){return this.getPosition().top};L.jqplot.ElemContainer.prototype.getLeft=function(){return this.getPosition().left};L.jqplot.ElemContainer.prototype.getBottom=function(){return this._elem.css("bottom")};L.jqplot.ElemContainer.prototype.getRight=function(){return this._elem.css("right")};function w(ah){L.jqplot.ElemContainer.call(this);this.name=ah;this._series=[];this.show=false;this.tickRenderer=L.jqplot.AxisTickRenderer;this.tickOptions={};this.labelRenderer=L.jqplot.AxisLabelRenderer;this.labelOptions={};this.label=null;this.showLabel=true;this.min=null;this.max=null;this.autoscale=false;this.pad=1.2;this.padMax=null;this.padMin=null;this.ticks=[];this.numberTicks;this.tickInterval;this.renderer=L.jqplot.LinearAxisRenderer;this.rendererOptions={};this.showTicks=true;this.showTickMarks=true;this.showMinorTicks=true;this.drawMajorGridlines=true;this.drawMinorGridlines=false;this.drawMajorTickMarks=true;this.drawMinorTickMarks=true;this.useSeriesColor=false;this.borderWidth=null;this.borderColor=null;this.scaleToHiddenSeries=false;this._dataBounds={min:null,max:null};this._intervalStats=[];this._offsets={min:null,max:null};this._ticks=[];this._label=null;this.syncTicks=null;this.tickSpacing=75;this._min=null;this._max=null;this._tickInterval=null;this._numberTicks=null;this.__ticks=null;this._options={}}w.prototype=new L.jqplot.ElemContainer();w.prototype.constructor=w;w.prototype.init=function(){if(L.isFunction(this.renderer)){this.renderer=new this.renderer()}this.tickOptions.axis=this.name;if(this.tickOptions.showMark==null){this.tickOptions.showMark=this.showTicks}if(this.tickOptions.showMark==null){this.tickOptions.showMark=this.showTickMarks}if(this.tickOptions.showLabel==null){this.tickOptions.showLabel=this.showTicks}if(this.label==null||this.label==""){this.showLabel=false}else{this.labelOptions.label=this.label}if(this.showLabel==false){this.labelOptions.show=false}if(this.pad==0){this.pad=1}if(this.padMax==0){this.padMax=1}if(this.padMin==0){this.padMin=1}if(this.padMax==null){this.padMax=(this.pad-1)/2+1}if(this.padMin==null){this.padMin=(this.pad-1)/2+1}this.pad=this.padMax+this.padMin-1;if(this.min!=null||this.max!=null){this.autoscale=false}if(this.syncTicks==null&&this.name.indexOf("y")>-1){this.syncTicks=true}else{if(this.syncTicks==null){this.syncTicks=false}}this.renderer.init.call(this,this.rendererOptions)};w.prototype.draw=function(ah,ai){if(this.__ticks){this.__ticks=null}return this.renderer.draw.call(this,ah,ai)};w.prototype.set=function(){this.renderer.set.call(this)};w.prototype.pack=function(ai,ah){if(this.show){this.renderer.pack.call(this,ai,ah)}if(this._min==null){this._min=this.min;this._max=this.max;this._tickInterval=this.tickInterval;this._numberTicks=this.numberTicks;this.__ticks=this._ticks}};w.prototype.reset=function(){this.renderer.reset.call(this)};w.prototype.resetScale=function(ah){L.extend(true,this,{min:null,max:null,numberTicks:null,tickInterval:null,_ticks:[],ticks:[]},ah);this.resetDataBounds()};w.prototype.resetDataBounds=function(){var ao=this._dataBounds;ao.min=null;ao.max=null;var ai,ap,am;var aj=(this.show)?true:false;for(var al=0;alao.max)||ao.max==null){ao.max=am[ak][0]}}else{if((am[ak][ah]!=null&&am[ak][ah]ao.max)||ao.max==null){ao.max=am[ak][an]}}}if(aj&&ap.renderer.constructor!==L.jqplot.BarRenderer){aj=false}else{if(aj&&this._options.hasOwnProperty("forceTickAt0")&&this._options.forceTickAt0==false){aj=false}else{if(aj&&ap.renderer.constructor===L.jqplot.BarRenderer){if(ap.barDirection=="vertical"&&this.name!="xaxis"&&this.name!="x2axis"){if(this._options.pad!=null||this._options.padMin!=null){aj=false}}else{if(ap.barDirection=="horizontal"&&(this.name=="xaxis"||this.name=="x2axis")){if(this._options.pad!=null||this._options.padMin!=null){aj=false}}}}}}}}if(aj&&this.renderer.constructor===L.jqplot.LinearAxisRenderer&&ao.min>=0){this.padMin=1;this.forceTickAt0=true}};function q(ah){L.jqplot.ElemContainer.call(this);this.show=false;this.location="ne";this.labels=[];this.showLabels=true;this.showSwatches=true;this.placement="insideGrid";this.xoffset=0;this.yoffset=0;this.border;this.background;this.textColor;this.fontFamily;this.fontSize;this.rowSpacing="0.5em";this.renderer=L.jqplot.TableLegendRenderer;this.rendererOptions={};this.preDraw=false;this.marginTop=null;this.marginRight=null;this.marginBottom=null;this.marginLeft=null;this.escapeHtml=false;this._series=[];L.extend(true,this,ah)}q.prototype=new L.jqplot.ElemContainer();q.prototype.constructor=q;q.prototype.setOptions=function(ah){L.extend(true,this,ah);if(this.placement=="inside"){this.placement="insideGrid"}if(this.xoffset>0){if(this.placement=="insideGrid"){switch(this.location){case"nw":case"w":case"sw":if(this.marginLeft==null){this.marginLeft=this.xoffset+"px"}this.marginRight="0px";break;case"ne":case"e":case"se":default:if(this.marginRight==null){this.marginRight=this.xoffset+"px"}this.marginLeft="0px";break}}else{if(this.placement=="outside"){switch(this.location){case"nw":case"w":case"sw":if(this.marginRight==null){this.marginRight=this.xoffset+"px"}this.marginLeft="0px";break;case"ne":case"e":case"se":default:if(this.marginLeft==null){this.marginLeft=this.xoffset+"px"}this.marginRight="0px";break}}}this.xoffset=0}if(this.yoffset>0){if(this.placement=="outside"){switch(this.location){case"sw":case"s":case"se":if(this.marginTop==null){this.marginTop=this.yoffset+"px"}this.marginBottom="0px";break;case"ne":case"n":case"nw":default:if(this.marginBottom==null){this.marginBottom=this.yoffset+"px"}this.marginTop="0px";break}}else{if(this.placement=="insideGrid"){switch(this.location){case"sw":case"s":case"se":if(this.marginBottom==null){this.marginBottom=this.yoffset+"px"}this.marginTop="0px";break;case"ne":case"n":case"nw":default:if(this.marginTop==null){this.marginTop=this.yoffset+"px"}this.marginBottom="0px";break}}}this.yoffset=0}};q.prototype.init=function(){if(L.isFunction(this.renderer)){this.renderer=new this.renderer()}this.renderer.init.call(this,this.rendererOptions)};q.prototype.draw=function(ai,aj){for(var ah=0;ah');this.target.append(az);az.height(aD);az.width(aA);az.css("top",this.eventCanvas._offsets.top);az.css("left",this.eventCanvas._offsets.left);var aC=L('
        ');az.append(aC);aC.html(this.noDataIndicator.indicator);var aB=aC.height();var ax=aC.width();aC.height(aB);aC.width(ax);aC.css("top",(aD-aB)/2+"px")})}}this.data=L.extend(true,[],ar);this.parseOptions(ay);if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(this.fontSize){this.target.css("font-size",this.fontSize)}this.title.init();this.legend.init();this._sumy=0;this._sumx=0;this.computePlotData();for(var at=0;at0){for(var aq=au;aq--;){var an=this._plotData[aq][ap][av];if(aw*an>=0){this._plotData[au][ap][av]+=an;this._stackData[au][ap][av]+=an;break}}}}}else{for(var ar=0;ar0){at._prevPlotData=this.series[au-1]._plotData}at._sumy=0;at._sumx=0;for(ar=at.data.length-1;ar>-1;ar--){at._sumy+=at.data[ar][1];at._sumx+=at.data[ar][0]}}};this.populatePlotData=function(au,av){this._plotData=[];this._stackData=[];au._stackData=[];au._plotData=[];var ay={x:[],y:[]};if(this.stackSeries&&!au.disableStack){au._stack=true;var ax=(au._stackAxis==="x")?0:1;var az=L.extend(true,[],au.data);var aA=L.extend(true,[],au.data);var an,am,ao,aw,al;for(var ar=0;ar=0){aA[aq][ax]+=aw}}}for(var at=0;at0){au._prevPlotData=this.series[av-1]._plotData}au._sumy=0;au._sumx=0;for(at=au.data.length-1;at>-1;at--){au._sumy+=au.data[at][1];au._sumx+=au.data[at][0]}};this.getNextSeriesColor=(function(am){var al=0;var an=am.seriesColors;return function(){if(al=0&&an>=0){al.top+=aK;al.bottom+=aK;al.left+=an;al.right+=an}}var am=["top","bottom","left","right"];for(var aB in am){if(this._gridPadding[am[aB]]==null&&al[am[aB]]>0){this._gridPadding[am[aB]]=al[am[aB]]}else{if(this._gridPadding[am[aB]]==null){this._gridPadding[am[aB]]=this._defaultGridPadding[am[aB]]}}}var aA=this._gridPadding;if(this.legend.placement==="outsideGrid"){aA={top:this.title.getHeight(),left:0,right:0,bottom:0};if(this.legend.location==="s"){aA.left=this._gridPadding.left;aA.right=this._gridPadding.right}}ar.xaxis.pack({position:"absolute",bottom:this._gridPadding.bottom-ar.xaxis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});ar.yaxis.pack({position:"absolute",top:0,left:this._gridPadding.left-ar.yaxis.getWidth(),height:this._height},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});ar.x2axis.pack({position:"absolute",top:this._gridPadding.top-ar.x2axis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});for(aH=8;aH>0;aH--){ar[aG[aH-1]].pack({position:"absolute",top:0,right:this._gridPadding.right-az[aH-1]},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top})}var au=(this._width-this._gridPadding.left-this._gridPadding.right)/2+this._gridPadding.left-ar.yMidAxis.getWidth()/2;ar.yMidAxis.pack({position:"absolute",top:0,left:au,zIndex:9,textAlign:"center"},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});this.target.append(this.grid.createElement(this._gridPadding,this));this.grid.draw();var aq=this.series;var aJ=aq.length;for(aH=0,aE=aJ;aHax)?av:ax;var ar=this.series[aw];var aq=this.series[au];if(aq.renderer.smooth){var ap=aq.renderer._smoothedData.slice(0).reverse()}else{var ap=aq.gridData.slice(0).reverse()}if(ar.renderer.smooth){var at=ar.renderer._smoothedData.concat(ap)}else{var at=ar.gridData.concat(ap)}var ao=(an.color!==null)?an.color:this.series[ax].fillColor;var ay=(an.baseSeries!==null)?an.baseSeries:aw;var am=this.series[ay].renderer.shapeRenderer;var al={fillStyle:ao,fill:true,closePath:true};am.draw(ar.shadowCanvas._ctx,at,al)};this.bindCustomEvents=function(){this.eventCanvas._elem.bind("click",{plot:this},this.onClick);this.eventCanvas._elem.bind("dblclick",{plot:this},this.onDblClick);this.eventCanvas._elem.bind("mousedown",{plot:this},this.onMouseDown);this.eventCanvas._elem.bind("mousemove",{plot:this},this.onMouseMove);this.eventCanvas._elem.bind("mouseenter",{plot:this},this.onMouseEnter);this.eventCanvas._elem.bind("mouseleave",{plot:this},this.onMouseLeave);if(this.captureRightClick){this.eventCanvas._elem.bind("mouseup",{plot:this},this.onRightClick);this.eventCanvas._elem.get(0).oncontextmenu=function(){return false}}else{this.eventCanvas._elem.bind("mouseup",{plot:this},this.onMouseUp)}};function ai(av){var au=av.data.plot;var ap=au.eventCanvas._elem.offset();var at={x:av.pageX-ap.left,y:av.pageY-ap.top};var aq={xaxis:null,yaxis:null,x2axis:null,y2axis:null,y3axis:null,y4axis:null,y5axis:null,y6axis:null,y7axis:null,y8axis:null,y9axis:null,yMidAxis:null};var ar=["xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"];var al=au.axes;var am,ao;for(am=11;am>0;am--){ao=ar[am-1];if(al[ao].show){aq[ao]=al[ao].series_p2u(at[ao.charAt(0)])}}return{offsets:ap,gridPos:at,dataPos:aq}}function ak(al,am){var aq=am.series;var aW,aU,aT,aO,aP,aJ,aI,aw,au,az,aA,aK;var aS,aX,aQ,ar,aH,aM,aV;var an,aN;for(aT=am.seriesStack.length-1;aT>=0;aT--){aW=am.seriesStack[aT];aO=aq[aW];aV=aO._highlightThreshold;switch(aO.renderer.constructor){case L.jqplot.BarRenderer:aJ=al.x;aI=al.y;for(aU=0;aUaH[0][0]&&aJaH[2][1]&&aIaH[0][0]+aV[0][0]&&aJaH[2][1]&&aI0&&-aI>=0){aw=2*Math.PI-Math.atan(-aI/aJ)}else{if(aJ>0&&-aI<0){aw=-Math.atan(-aI/aJ)}else{if(aJ<0){aw=Math.PI-Math.atan(-aI/aJ)}else{if(aJ==0&&-aI>0){aw=3*Math.PI/2}else{if(aJ==0&&-aI<0){aw=Math.PI/2}else{if(aJ==0&&aI==0){aw=0}}}}}}if(az){aw-=az;if(aw<0){aw+=2*Math.PI}else{if(aw>2*Math.PI){aw-=2*Math.PI}}}au=aO.sliceMargin/180*Math.PI;if(aPaO._innerRadius){for(aU=0;aU0)?aO.gridData[aU-1][1]+au:au;aK=aO.gridData[aU][1];if(aw>aA&&aw0&&-aI>=0){aw=2*Math.PI-Math.atan(-aI/aJ)}else{if(aJ>0&&-aI<0){aw=-Math.atan(-aI/aJ)}else{if(aJ<0){aw=Math.PI-Math.atan(-aI/aJ)}else{if(aJ==0&&-aI>0){aw=3*Math.PI/2}else{if(aJ==0&&-aI<0){aw=Math.PI/2}else{if(aJ==0&&aI==0){aw=0}}}}}}if(az){aw-=az;if(aw<0){aw+=2*Math.PI}else{if(aw>2*Math.PI){aw-=2*Math.PI}}}au=aO.sliceMargin/180*Math.PI;if(aP0)?aO.gridData[aU-1][1]+au:au;aK=aO.gridData[aU][1];if(aw>aA&&aw=ay[0][1]&&aI<=ay[3][1]&&aJ>=at[0]&&aJ<=aE[0]){return{seriesIndex:aO.index,pointIndex:aU,gridData:null,data:aO.data[aU]}}}break;case L.jqplot.LineRenderer:aJ=al.x;aI=al.y;aP=aO.renderer;if(aO.show){if((aO.fill||(aO.renderer.bands.show&&aO.renderer.bands.fill))&&(!am.plugins.highlighter||!am.plugins.highlighter.show)){var ax=false;if(aJ>aO._boundingBox[0][0]&&aJaO._boundingBox[1][1]&&aI=aI||aB[1]=aI){if(aC[0]+(aI-aC[1])/(aB[1]-aC[1])*(aB[0]-aC[0])0)?aN:0;for(var aU=0;aU=aQ[0]-aP._bodyWidth/2&&aJ<=aQ[0]+aP._bodyWidth/2&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{if(!aP.hlc){var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][1])&&aI<=av(aO.data[aU][2])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}else{if(aQ[0]!=null&&aQ[1]!=null){aX=Math.sqrt((aJ-aQ[0])*(aJ-aQ[0])+(aI-aQ[1])*(aI-aQ[1]));if(aX<=an&&(aX<=aS||aS==null)){aS=aX;return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}}}break;default:aJ=al.x;aI=al.y;aP=aO.renderer;if(aO.show){aN=aO.markerRenderer.size/2+aO.neighborThreshold;an=(aN>0)?aN:0;for(var aU=0;aU=aQ[0]-aP._bodyWidth/2&&aJ<=aQ[0]+aP._bodyWidth/2&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{if(!aP.hlc){var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][1])&&aI<=av(aO.data[aU][2])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}else{aX=Math.sqrt((aJ-aQ[0])*(aJ-aQ[0])+(aI-aQ[1])*(aI-aQ[1]));if(aX<=an&&(aX<=aS||aS==null)){aS=aX;return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}break}}return null}this.onClick=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotClick");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onDblClick=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotDblClick");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onMouseDown=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotMouseDown");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onMouseUp=function(an){var am=ai(an);var al=L.Event("jqplotMouseUp");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,null,an.data.plot])};this.onRightClick=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);if(ap.captureRightClick){if(an.which==3){var al=L.Event("jqplotRightClick");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])}else{var al=L.Event("jqplotMouseUp");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])}}};this.onMouseMove=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotMouseMove");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onMouseEnter=function(an){var am=ai(an);var ao=an.data.plot;var al=L.Event("jqplotMouseEnter");al.pageX=an.pageX;al.pageY=an.pageY;al.relatedTarget=an.relatedTarget;L(this).trigger(al,[am.gridPos,am.dataPos,null,ao])};this.onMouseLeave=function(an){var am=ai(an);var ao=an.data.plot;var al=L.Event("jqplotMouseLeave");al.pageX=an.pageX;al.pageY=an.pageY;al.relatedTarget=an.relatedTarget;L(this).trigger(al,[am.gridPos,am.dataPos,null,ao])};this.drawSeries=function(an,al){var ap,ao,am;al=(typeof(an)==="number"&&al==null)?an:al;an=(typeof(an)==="object")?an:{};if(al!=u){ao=this.series[al];am=ao.shadowCanvas._ctx;am.clearRect(0,0,am.canvas.width,am.canvas.height);ao.drawShadow(am,an,this);am=ao.canvas._ctx;am.clearRect(0,0,am.canvas.width,am.canvas.height);ao.draw(am,an,this);if(ao.renderer.constructor==L.jqplot.BezierCurveRenderer){if(al660)?ah[aj]*0.85:0.73*ah[aj]+90;ah[aj]=parseInt(ah[aj],10);(ah[aj]>255)?255:ah[aj]}ah[3]=0.3+0.35*al[3];ak.push("rgba("+ah[0]+","+ah[1]+","+ah[2]+","+ah[3]+")")}}else{var al=L.jqplot.getColorComponents(ai);var ah=[al[0],al[1],al[2]];var an=ah[0]+ah[1]+ah[2];for(var aj=0;aj<3;aj++){ah[aj]=(an>660)?ah[aj]*0.85:0.73*ah[aj]+90;ah[aj]=parseInt(ah[aj],10);(ah[aj]>255)?255:ah[aj]}ah[3]=0.3+0.35*al[3];ak="rgba("+ah[0]+","+ah[1]+","+ah[2]+","+ah[3]+")"}return ak};L.jqplot.ColorGenerator=function(ai){ai=ai||L.jqplot.config.defaultColors;var ah=0;this.next=function(){if(ah0){return ai[ah--]}else{ah=ai.length-1;return ai[ah]}};this.get=function(ak){var aj=ak-ai.length*Math.floor(ak/ai.length);return ai[aj]};this.setColors=function(aj){ai=aj};this.reset=function(){ah=0};this.getIndex=function(){return ah};this.setIndex=function(aj){ah=aj}};L.jqplot.hex2rgb=function(aj,ah){aj=aj.replace("#","");if(aj.length==3){aj=aj.charAt(0)+aj.charAt(0)+aj.charAt(1)+aj.charAt(1)+aj.charAt(2)+aj.charAt(2)}var ai;ai="rgba("+parseInt(aj.slice(0,2),16)+", "+parseInt(aj.slice(2,4),16)+", "+parseInt(aj.slice(4,6),16);if(ah){ai+=", "+ah}ai+=")";return ai};L.jqplot.rgb2hex=function(am){var aj=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/;var ah=am.match(aj);var al="#";for(var ak=1;ak<4;ak++){var ai;if(ah[ak].search(/%/)!=-1){ai=parseInt(255*ah[ak]/100,10).toString(16);if(ai.length==1){ai="0"+ai}}else{ai=parseInt(ah[ak],10).toString(16);if(ai.length==1){ai="0"+ai}}al+=ai}return al};L.jqplot.normalize2rgb=function(ai,ah){if(ai.search(/^ *rgba?\(/)!=-1){return ai}else{if(ai.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/)!=-1){return L.jqplot.hex2rgb(ai,ah)}else{throw new Error("Invalid color spec")}}};L.jqplot.getColorComponents=function(am){am=L.jqplot.colorKeywordMap[am]||am;var ak=L.jqplot.normalize2rgb(am);var aj=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/;var ah=ak.match(aj);var ai=[];for(var al=1;al<4;al++){if(ah[al].search(/%/)!=-1){ai[al-1]=parseInt(255*ah[al]/100,10)}else{ai[al-1]=parseInt(ah[al],10)}}ai[3]=parseFloat(ah[4])?parseFloat(ah[4]):1;return ai};L.jqplot.colorKeywordMap={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",aqua:"rgb( 0, 255, 255)",aquamarine:"rgb(127, 255, 212)",azure:"rgb(240, 255, 255)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",black:"rgb( 0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb( 0, 0, 255)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",burlywood:"rgb(222, 184, 135)",cadetblue:"rgb( 95, 158, 160)",chartreuse:"rgb(127, 255, 0)",chocolate:"rgb(210, 105, 30)",coral:"rgb(255, 127, 80)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",crimson:"rgb(220, 20, 60)",cyan:"rgb( 0, 255, 255)",darkblue:"rgb( 0, 0, 139)",darkcyan:"rgb( 0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgray:"rgb(169, 169, 169)",darkgreen:"rgb( 0, 100, 0)",darkgrey:"rgb(169, 169, 169)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb( 85, 107, 47)",darkorange:"rgb(255, 140, 0)",darkorchid:"rgb(153, 50, 204)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkslateblue:"rgb( 72, 61, 139)",darkslategray:"rgb( 47, 79, 79)",darkslategrey:"rgb( 47, 79, 79)",darkturquoise:"rgb( 0, 206, 209)",darkviolet:"rgb(148, 0, 211)",deeppink:"rgb(255, 20, 147)",deepskyblue:"rgb( 0, 191, 255)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb( 30, 144, 255)",firebrick:"rgb(178, 34, 34)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb( 34, 139, 34)",fuchsia:"rgb(255, 0, 255)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",goldenrod:"rgb(218, 165, 32)",gray:"rgb(128, 128, 128)",grey:"rgb(128, 128, 128)",green:"rgb( 0, 128, 0)",greenyellow:"rgb(173, 255, 47)",honeydew:"rgb(240, 255, 240)",hotpink:"rgb(255, 105, 180)",indianred:"rgb(205, 92, 92)",indigo:"rgb( 75, 0, 130)",ivory:"rgb(255, 255, 240)",khaki:"rgb(240, 230, 140)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lightblue:"rgb(173, 216, 230)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgray:"rgb(211, 211, 211)",lightgreen:"rgb(144, 238, 144)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightsalmon:"rgb(255, 160, 122)",lightseagreen:"rgb( 32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightyellow:"rgb(255, 255, 224)",lime:"rgb( 0, 255, 0)",limegreen:"rgb( 50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",maroon:"rgb(128, 0, 0)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb( 0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumpurple:"rgb(147, 112, 219)",mediumseagreen:"rgb( 60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb( 0, 250, 154)",mediumturquoise:"rgb( 72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb( 25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navy:"rgb( 0, 0, 128)",oldlace:"rgb(253, 245, 230)",olive:"rgb(128, 128, 0)",olivedrab:"rgb(107, 142, 35)",orange:"rgb(255, 165, 0)",orangered:"rgb(255, 69, 0)",orchid:"rgb(218, 112, 214)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",paleturquoise:"rgb(175, 238, 238)",palevioletred:"rgb(219, 112, 147)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",plum:"rgb(221, 160, 221)",powderblue:"rgb(176, 224, 230)",purple:"rgb(128, 0, 128)",red:"rgb(255, 0, 0)",rosybrown:"rgb(188, 143, 143)",royalblue:"rgb( 65, 105, 225)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb( 46, 139, 87)",seashell:"rgb(255, 245, 238)",sienna:"rgb(160, 82, 45)",silver:"rgb(192, 192, 192)",skyblue:"rgb(135, 206, 235)",slateblue:"rgb(106, 90, 205)",slategray:"rgb(112, 128, 144)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",springgreen:"rgb( 0, 255, 127)",steelblue:"rgb( 70, 130, 180)",tan:"rgb(210, 180, 140)",teal:"rgb( 0, 128, 128)",thistle:"rgb(216, 191, 216)",tomato:"rgb(255, 99, 71)",turquoise:"rgb( 64, 224, 208)",violet:"rgb(238, 130, 238)",wheat:"rgb(245, 222, 179)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellowgreen:"rgb(154, 205, 50)"};L.jqplot.AxisLabelRenderer=function(ah){L.jqplot.ElemContainer.call(this);this.axis;this.show=true;this.label="";this.fontFamily=null;this.fontSize=null;this.textColor=null;this._elem;this.escapeHTML=false;L.extend(true,this,ah)};L.jqplot.AxisLabelRenderer.prototype=new L.jqplot.ElemContainer();L.jqplot.AxisLabelRenderer.prototype.constructor=L.jqplot.AxisLabelRenderer;L.jqplot.AxisLabelRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.AxisLabelRenderer.prototype.draw=function(ah,ai){if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=L('
        ');if(Number(this.label)){this._elem.css("white-space","nowrap")}if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}return this._elem};L.jqplot.AxisLabelRenderer.prototype.pack=function(){};L.jqplot.AxisTickRenderer=function(ah){L.jqplot.ElemContainer.call(this);this.mark="outside";this.axis;this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.size=4;this.markSize=6;this.show=true;this.showLabel=true;this.label=null;this.value=null;this._styles={};this.formatter=L.jqplot.DefaultTickFormatter;this.prefix="";this.suffix="";this.formatString="";this.fontFamily;this.fontSize;this.textColor;this.escapeHTML=false;this._elem;this._breakTick=false;L.extend(true,this,ah)};L.jqplot.AxisTickRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.AxisTickRenderer.prototype=new L.jqplot.ElemContainer();L.jqplot.AxisTickRenderer.prototype.constructor=L.jqplot.AxisTickRenderer;L.jqplot.AxisTickRenderer.prototype.setTick=function(ah,aj,ai){this.value=ah;this.axis=aj;if(ai){this.isMinorTick=true}return this};L.jqplot.AxisTickRenderer.prototype.draw=function(){if(this.label===null){this.label=this.prefix+this.formatter(this.formatString,this.value)+this.suffix}var ai={position:"absolute"};if(Number(this.label)){ai.whitSpace="nowrap"}if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=L(document.createElement("div"));this._elem.addClass("jqplot-"+this.axis+"-tick");if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}this._elem.css(ai);for(var ah in this._styles){this._elem.css(ah,this._styles[ah])}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}if(this._breakTick){this._elem.addClass("jqplot-breakTick")}return this._elem};L.jqplot.DefaultTickFormatter=function(ah,ai){if(typeof ai=="number"){if(!ah){ah=L.jqplot.config.defaultTickFormatString}return L.jqplot.sprintf(ah,ai)}else{return String(ai)}};L.jqplot.PercentTickFormatter=function(ah,ai){if(typeof ai=="number"){ai=100*ai;if(!ah){ah=L.jqplot.config.defaultTickFormatString}return L.jqplot.sprintf(ah,ai)}else{return String(ai)}};L.jqplot.AxisTickRenderer.prototype.pack=function(){};L.jqplot.CanvasGridRenderer=function(){this.shadowRenderer=new L.jqplot.ShadowRenderer()};L.jqplot.CanvasGridRenderer.prototype.init=function(ai){this._ctx;L.extend(true,this,ai);var ah={lineJoin:"miter",lineCap:"round",fill:false,isarc:false,angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.shadowWidth,closePath:false,strokeStyle:this.shadowColor};this.renderer.shadowRenderer.init(ah)};L.jqplot.CanvasGridRenderer.prototype.createElement=function(ak){var aj;if(this._elem){if(L.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==u){aj=this._elem.get(0);window.G_vmlCanvasManager.uninitElement(aj);aj=null}this._elem.emptyForce();this._elem=null}aj=ak.canvasManager.getCanvas();var ah=this._plotDimensions.width;var ai=this._plotDimensions.height;aj.width=ah;aj.height=ai;this._elem=L(aj);this._elem.addClass("jqplot-grid-canvas");this._elem.css({position:"absolute",left:0,top:0});aj=ak.canvasManager.initCanvas(aj);this._top=this._offsets.top;this._bottom=ai-this._offsets.bottom;this._left=this._offsets.left;this._right=ah-this._offsets.right;this._width=this._right-this._left;this._height=this._bottom-this._top;aj=null;return this._elem};L.jqplot.CanvasGridRenderer.prototype.draw=function(){this._ctx=this._elem.get(0).getContext("2d");var at=this._ctx;var aw=this._axes;at.save();at.clearRect(0,0,this._plotDimensions.width,this._plotDimensions.height);at.fillStyle=this.backgroundColor||this.background;at.fillRect(this._left,this._top,this._width,this._height);at.save();at.lineJoin="miter";at.lineCap="butt";at.lineWidth=this.gridLineWidth;at.strokeStyle=this.gridLineColor;var aA,az,ap,aq;var am=["xaxis","yaxis","x2axis","y2axis"];for(var ay=4;ay>0;ay--){var aD=am[ay-1];var ah=aw[aD];var aB=ah._ticks;var ar=aB.length;if(ah.show){if(ah.drawBaseline){var aC={};if(ah.baselineWidth!==null){aC.lineWidth=ah.baselineWidth}if(ah.baselineColor!==null){aC.strokeStyle=ah.baselineColor}switch(aD){case"xaxis":ao(this._left,this._bottom,this._right,this._bottom,aC);break;case"yaxis":ao(this._left,this._bottom,this._left,this._top,aC);break;case"x2axis":ao(this._left,this._bottom,this._right,this._bottom,aC);break;case"y2axis":ao(this._right,this._bottom,this._right,this._top,aC);break}}for(var au=ar;au>0;au--){var an=aB[au-1];if(an.show){var ak=Math.round(ah.u2p(an.value))+0.5;switch(aD){case"xaxis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(ak,this._top,ak,this._bottom)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._bottom;az=this._bottom+ap;break;case"inside":aA=this._bottom-ap;az=this._bottom;break;case"cross":aA=this._bottom-ap;az=this._bottom+ap;break;default:aA=this._bottom;az=this._bottom+ap;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[ak,aA],[ak,az]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}ao(ak,aA,ak,az)}break;case"yaxis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(this._right,ak,this._left,ak)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._left-ap;az=this._left;break;case"inside":aA=this._left;az=this._left+ap;break;case"cross":aA=this._left-ap;az=this._left+ap;break;default:aA=this._left-ap;az=this._left;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[aA,ak],[az,ak]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ao(aA,ak,az,ak,{strokeStyle:ah.borderColor})}break;case"x2axis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(ak,this._bottom,ak,this._top)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._top-ap;az=this._top;break;case"inside":aA=this._top;az=this._top+ap;break;case"cross":aA=this._top-ap;az=this._top+ap;break;default:aA=this._top-ap;az=this._top;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[ak,aA],[ak,az]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}ao(ak,aA,ak,az)}break;case"y2axis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(this._left,ak,this._right,ak)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._right;az=this._right+ap;break;case"inside":aA=this._right-ap;az=this._right;break;case"cross":aA=this._right-ap;az=this._right+ap;break;default:aA=this._right;az=this._right+ap;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[aA,ak],[az,ak]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ao(aA,ak,az,ak,{strokeStyle:ah.borderColor})}break;default:break}}}an=null}ah=null;aB=null}am=["y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"];for(var ay=7;ay>0;ay--){var ah=aw[am[ay-1]];var aB=ah._ticks;if(ah.show){var ai=aB[ah.numberTicks-1];var al=aB[0];var aj=ah.getLeft();var av=[[aj,ai.getTop()+ai.getHeight()/2],[aj,al.getTop()+al.getHeight()/2+1]];if(this.shadow){this.renderer.shadowRenderer.draw(at,av,{lineCap:"butt",fill:false,closePath:false})}ao(av[0][0],av[0][1],av[1][0],av[1][1],{lineCap:"butt",strokeStyle:ah.borderColor,lineWidth:ah.borderWidth});for(var au=aB.length;au>0;au--){var an=aB[au-1];ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;if(an.showMark&&an.mark){switch(aq){case"outside":aA=aj;az=aj+ap;break;case"inside":aA=aj-ap;az=aj;break;case"cross":aA=aj-ap;az=aj+ap;break;default:aA=aj;az=aj+ap;break}av=[[aA,ak],[az,ak]];if(this.shadow){this.renderer.shadowRenderer.draw(at,av,{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ao(aA,ak,az,ak,{strokeStyle:ah.borderColor})}an=null}al=null}ah=null;aB=null}at.restore();function ao(aH,aG,aE,ax,aF){at.save();aF=aF||{};if(aF.lineWidth==null||aF.lineWidth!=0){L.extend(true,at,aF);at.beginPath();at.moveTo(aH,aG);at.lineTo(aE,ax);at.stroke();at.restore()}}if(this.shadow){var av=[[this._left,this._bottom],[this._right,this._bottom],[this._right,this._top]];this.renderer.shadowRenderer.draw(at,av)}if(this.borderWidth!=0&&this.drawBorder){ao(this._left,this._top,this._right,this._top,{lineCap:"round",strokeStyle:aw.x2axis.borderColor,lineWidth:aw.x2axis.borderWidth});ao(this._right,this._top,this._right,this._bottom,{lineCap:"round",strokeStyle:aw.y2axis.borderColor,lineWidth:aw.y2axis.borderWidth});ao(this._right,this._bottom,this._left,this._bottom,{lineCap:"round",strokeStyle:aw.xaxis.borderColor,lineWidth:aw.xaxis.borderWidth});ao(this._left,this._bottom,this._left,this._top,{lineCap:"round",strokeStyle:aw.yaxis.borderColor,lineWidth:aw.yaxis.borderWidth})}at.restore();at=null;aw=null};L.jqplot.DivTitleRenderer=function(){};L.jqplot.DivTitleRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.DivTitleRenderer.prototype.draw=function(){if(this._elem){this._elem.emptyForce();this._elem=null}var ak=this.renderer;var aj=document.createElement("div");this._elem=L(aj);this._elem.addClass("jqplot-title");if(!this.text){this.show=false;this._elem.height(0);this._elem.width(0)}else{if(this.text){var ah;if(this.color){ah=this.color}else{if(this.textColor){ah=this.textColor}}var ai={position:"absolute",top:"0px",left:"0px"};if(this._plotWidth){ai.width=this._plotWidth+"px"}if(this.fontSize){ai.fontSize=this.fontSize}if(typeof this.textAlign==="string"){ai.textAlign=this.textAlign}else{ai.textAlign="center"}if(ah){ai.color=ah}if(this.paddingBottom){ai.paddingBottom=this.paddingBottom}if(this.fontFamily){ai.fontFamily=this.fontFamily}this._elem.css(ai);if(this.escapeHtml){this._elem.text(this.text)}else{this._elem.html(this.text)}}}aj=null;return this._elem};L.jqplot.DivTitleRenderer.prototype.pack=function(){};var r=0.1;L.jqplot.LinePattern=function(aw,aq){var ap={dotted:[r,L.jqplot.config.dotGapLength],dashed:[L.jqplot.config.dashLength,L.jqplot.config.gapLength],solid:null};if(typeof aq==="string"){if(aq[0]==="."||aq[0]==="-"){var ax=aq;aq=[];for(var ao=0,al=ax.length;ao0)&&(aC>0)){aA/=aB;az/=aB;while(true){var aD=aC*ar;if(aD=aq.length){ak=0}ar=aq[ak]}else{au=ay;at=aE;if((ak&1)==0){aw.lineTo(au,at)}else{aw.moveTo(au,at)}ar-=aB/aC;break}}}};var ai=function(){aw.beginPath()};var am=function(){aj(an,ah)};return{moveTo:av,lineTo:aj,beginPath:ai,closePath:am}};L.jqplot.LineRenderer=function(){this.shapeRenderer=new L.jqplot.ShapeRenderer();this.shadowRenderer=new L.jqplot.ShadowRenderer()};L.jqplot.LineRenderer.prototype.init=function(ai,an){ai=ai||{};this._type="line";this.renderer.animation={show:false,direction:"left",speed:2500,_supported:true};this.renderer.smooth=false;this.renderer.tension=null;this.renderer.constrainSmoothing=true;this.renderer._smoothedData=[];this.renderer._smoothedPlotData=[];this.renderer._hiBandGridData=[];this.renderer._lowBandGridData=[];this.renderer._hiBandSmoothedData=[];this.renderer._lowBandSmoothedData=[];this.renderer.bandData=[];this.renderer.bands={show:false,hiData:[],lowData:[],color:this.color,showLines:false,fill:true,fillColor:null,_min:null,_max:null,interval:"3%"};var al={highlightMouseOver:ai.highlightMouseOver,highlightMouseDown:ai.highlightMouseDown,highlightColor:ai.highlightColor};delete (ai.highlightMouseOver);delete (ai.highlightMouseDown);delete (ai.highlightColor);L.extend(true,this.renderer,ai);this.renderer.options=ai;if(this.renderer.bandData.length>1&&(!ai.bands||ai.bands.show==null)){this.renderer.bands.show=true}else{if(ai.bands&&ai.bands.show==null&&ai.bands.interval!=null){this.renderer.bands.show=true}}if(this.fill){this.renderer.bands.show=false}if(this.renderer.bands.show){this.renderer.initBands.call(this,this.renderer.options,an)}if(this._stack){this.renderer.smooth=false}var am={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:false,strokeStyle:this.color,fillStyle:this.fillColor,lineWidth:this.lineWidth,linePattern:this.linePattern,closePath:this.fill};this.renderer.shapeRenderer.init(am);var aj=ai.shadowOffset;if(aj==null){if(this.lineWidth>2.5){aj=1.25*(1+(Math.atan((this.lineWidth/2.5))/0.785398163-1)*0.6)}else{aj=1.25*Math.atan((this.lineWidth/2.5))/0.785398163}}var ah={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:false,angle:this.shadowAngle,offset:aj,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.lineWidth,linePattern:this.linePattern,closePath:this.fill};this.renderer.shadowRenderer.init(ah);this._areaPoints=[];this._boundingBox=[[],[]];if(!this.isTrendline&&this.fill||this.renderer.bands.show){this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColor=null;if(al.highlightMouseDown&&al.highlightMouseOver==null){al.highlightMouseOver=false}L.extend(true,this,{highlightMouseOver:al.highlightMouseOver,highlightMouseDown:al.highlightMouseDown,highlightColor:al.highlightColor});if(!this.highlightColor){var ak=(this.renderer.bands.show)?this.renderer.bands.fillColor:this.fillColor;this.highlightColor=L.jqplot.computeHighlightColors(ak)}if(this.highlighter){this.highlighter.show=false}}if(!this.isTrendline&&an){an.plugins.lineRenderer={};an.postInitHooks.addOnce(z);an.postDrawHooks.addOnce(af);an.eventListenerHooks.addOnce("jqplotMouseMove",h);an.eventListenerHooks.addOnce("jqplotMouseDown",e);an.eventListenerHooks.addOnce("jqplotMouseUp",ad);an.eventListenerHooks.addOnce("jqplotClick",g);an.eventListenerHooks.addOnce("jqplotRightClick",s)}};L.jqplot.LineRenderer.prototype.initBands=function(ak,av){var al=ak.bandData||[];var an=this.renderer.bands;an.hiData=[];an.lowData=[];var aB=this.data;an._max=null;an._min=null;if(al.length==2){if(L.isArray(al[0][0])){var ao;var ah=0,ar=0;for(var aw=0,at=al[0].length;awan._max)||an._max==null){an._max=ao[1]}if((ao[1]!=null&&ao[1]an._max)||an._max==null){an._max=ao[1];ar=1}if((ao[1]!=null&&ao[1]al[1][0])?0:1;var aC=(aj)?0:1;for(var aw=0,at=aB.length;aw2&&!L.isArray(al[0][0])){var aj=(al[0][0]>al[0][1])?0:1;var aC=(aj)?0:1;for(var aw=0,at=al.length;awan._max)||an._max==null){an._max=am[aw][1]}}for(var aw=0,at=ap.length;aw0){aR=Math.abs((ap[aQ][1]-ap[aQ-1][1])/(ap[aQ][0]-ap[aQ-1][0]))}am=aR/aG+aE;aM=aF*A(am)-aF*A(aE)+aS;aT=(aO+aM)/2}else{aT=aU}for(aK=0;aK2){var ao;if(this.renderer.constrainSmoothing){ao=J.call(this,this.gridData);this.renderer._smoothedData=ao[0];this.renderer._smoothedPlotData=ao[1];if(ak.show){ao=J.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ao[0];ao=J.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ao[0]}ao=null}else{ao=F.call(this,this.gridData);this.renderer._smoothedData=ao[0];this.renderer._smoothedPlotData=ao[1];if(ak.show){ao=F.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ao[0];ao=F.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ao[0]}ao=null}}};L.jqplot.LineRenderer.prototype.makeGridData=function(ao,aq){var am=this._xaxis.series_u2p;var ah=this._yaxis.series_u2p;var ar=[];var aj=[];this.renderer._smoothedData=[];this.renderer._smoothedPlotData=[];this.renderer._hiBandGridData=[];this.renderer._lowBandGridData=[];this.renderer._hiBandSmoothedData=[];this.renderer._lowBandSmoothedData=[];var al=this.renderer.bands;var ai=false;for(var an=0;an2){var ap;if(this.renderer.constrainSmoothing){ap=J.call(this,ar);this.renderer._smoothedData=ap[0];this.renderer._smoothedPlotData=ap[1];if(al.show){ap=J.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ap[0];ap=J.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ap[0]}ap=null}else{ap=F.call(this,ar);this.renderer._smoothedData=ap[0];this.renderer._smoothedPlotData=ap[1];if(al.show){ap=F.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ap[0];ap=F.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ap[0]}ap=null}}return ar};L.jqplot.LineRenderer.prototype.draw=function(ax,aI,ai,aB){var aC;var aq=L.extend(true,{},ai);var ak=(aq.shadow!=u)?aq.shadow:this.shadow;var aJ=(aq.showLine!=u)?aq.showLine:this.showLine;var aA=(aq.fill!=u)?aq.fill:this.fill;var ah=(aq.fillAndStroke!=u)?aq.fillAndStroke:this.fillAndStroke;var ar,ay,av,aE;ax.save();if(aI.length){if(aJ){if(aA){if(this.fillToZero){var aF=this.negativeColor;if(!this.useNegativeColors){aF=aq.fillStyle}var ao=false;var ap=aq.fillStyle;if(ah){var aH=aI.slice(0)}if(this.index==0||!this._stack){var aw=[];var aL=(this.renderer.smooth)?this.renderer._smoothedPlotData:this._plotData;this._areaPoints=[];var aG=this._yaxis.series_u2p(this.fillToValue);var aj=this._xaxis.series_u2p(this.fillToValue);aq.closePath=true;if(this.fillAxis=="y"){aw.push([aI[0][0],aG]);this._areaPoints.push([aI[0][0],aG]);for(var aC=0;aC0;aC--){aI.push(au[aC-1])}if(ak){this.renderer.shadowRenderer.draw(ax,aI,aq)}this._areaPoints=aI;this.renderer.shapeRenderer.draw(ax,aI,aq)}}else{if(ah){var aH=aI.slice(0)}if(this.index==0||!this._stack){var al=ax.canvas.height;aI.unshift([aI[0][0],al]);var aD=aI.length;aI.push([aI[aD-1][0],al])}else{var au=this._prevGridData;for(var aC=au.length;aC>0;aC--){aI.push(au[aC-1])}}this._areaPoints=aI;if(ak){this.renderer.shadowRenderer.draw(ax,aI,aq)}this.renderer.shapeRenderer.draw(ax,aI,aq)}if(ah){var az=L.extend(true,{},aq,{fill:false,closePath:false});this.renderer.shapeRenderer.draw(ax,aH,az);if(this.markerRenderer.show){if(this.renderer.smooth){aH=this.gridData}for(aC=0;aCat[0]||ar==null){ar=at[0]}if(aEat[1]||ay==null){ay=at[1]}}if(this.type==="line"&&this.renderer.bands.show){aE=this._yaxis.series_u2p(this.renderer.bands._min);ay=this._yaxis.series_u2p(this.renderer.bands._max)}this._boundingBox=[[ar,aE],[av,ay]];if(this.markerRenderer.show&&!aA){if(this.renderer.smooth){aI=this.gridData}for(aC=0;aCao){ao=aj}}}al=null;am=null;if(ah){ai=this._label._elem.outerWidth(true);an=this._label._elem.outerHeight(true)}if(this.name=="xaxis"){ao=ao+an;this._elem.css({height:ao+"px",left:"0px",bottom:"0px"})}else{if(this.name=="x2axis"){ao=ao+an;this._elem.css({height:ao+"px",left:"0px",top:"0px"})}else{if(this.name=="yaxis"){ao=ao+ai;this._elem.css({width:ao+"px",left:"0px",top:"0px"});if(ah&&this._label.constructor==L.jqplot.AxisLabelRenderer){this._label._elem.css("width",ai+"px")}}else{ao=ao+ai;this._elem.css({width:ao+"px",right:"0px",top:"0px"});if(ah&&this._label.constructor==L.jqplot.AxisLabelRenderer){this._label._elem.css("width",ai+"px")}}}}}};L.jqplot.LinearAxisRenderer.prototype.createTicks=function(aj){var aT=this._ticks;var aK=this.ticks;var az=this.name;var aB=this._dataBounds;var ah=(this.name.charAt(0)==="x")?this._plotDimensions.width:this._plotDimensions.height;var an;var a6,aI;var ap,ao;var a4,a0;var aH=this.min;var a5=this.max;var aW=this.numberTicks;var ba=this.tickInterval;var am=30;this._scalefact=(Math.max(ah,am+1)-am)/300;if(aK.length){for(a0=0;a0this.breakPoints[0]&&aO[0]<=this.breakPoints[1]){aU.show=false;aU.showGridline=false;aU.label=aO[1]}else{aU.label=aO[1]}}}else{aU.label=aO[1]}aU.setTick(aO[0],this.name);this._ticks.push(aU)}else{if(L.isPlainObject(aO)){L.extend(true,aU,aO);aU.axis=this.name;this._ticks.push(aU)}else{aU.value=aO;if(this.breakPoints){if(aO==this.breakPoints[0]){aU.label=this.breakTickLabel;aU._breakTick=true;aU.showGridline=false;aU.showMark=false}else{if(aO>this.breakPoints[0]&&aO<=this.breakPoints[1]){aU.show=false;aU.showGridline=false}}}aU.setTick(aO,this.name);this._ticks.push(aU)}}}this.numberTicks=aK.length;this.min=this._ticks[0].value;this.max=this._ticks[this.numberTicks-1].value;this.tickInterval=(this.max-this.min)/(this.numberTicks-1)}else{if(az=="xaxis"||az=="x2axis"){ah=this._plotDimensions.width}else{ah=this._plotDimensions.height}var ax=this.numberTicks;if(this.alignTicks){if(this.name==="x2axis"&&aj.axes.xaxis.show){ax=aj.axes.xaxis.numberTicks}else{if(this.name.charAt(0)==="y"&&this.name!=="yaxis"&&this.name!=="yMidAxis"&&aj.axes.yaxis.show){ax=aj.axes.yaxis.numberTicks}}}a6=((this.min!=null)?this.min:aB.min);aI=((this.max!=null)?this.max:aB.max);var av=aI-a6;var aS,ay;var at;if(this.tickOptions==null||!this.tickOptions.formatString){this._overrideFormatString=true}if(this.min==null||this.max==null&&this.tickInterval==null&&!this.autoscale){if(this.forceTickAt0){if(a6>0){a6=0}if(aI<0){aI=0}}if(this.forceTickAt100){if(a6>100){a6=100}if(aI<100){aI=100}}var aE=false,a1=false;if(this.min!=null){aE=true}else{if(this.max!=null){a1=true}}var aP=L.jqplot.LinearTickGenerator(a6,aI,this._scalefact,ax,aE,a1);var aw=(this.min!=null)?a6:a6+av*(this.padMin-1);var aQ=(this.max!=null)?aI:aI-av*(this.padMax-1);if(a6aQ){aw=(this.min!=null)?a6:a6-av*(this.padMin-1);aQ=(this.max!=null)?aI:aI+av*(this.padMax-1);aP=L.jqplot.LinearTickGenerator(aw,aQ,this._scalefact,ax,aE,a1)}this.min=aP[0];this.max=aP[1];this.numberTicks=aP[2];this._autoFormatString=aP[3];this.tickInterval=aP[4]}else{if(a6==aI){var ai=0.05;if(a6>0){ai=Math.max(Math.log(a6)/Math.LN10,0.05)}a6-=ai;aI+=ai}if(this.autoscale&&this.min==null&&this.max==null){var ak,al,ar;var aC=false;var aN=false;var aA={min:null,max:null,average:null,stddev:null};for(var a0=0;a0a2){a2=aR[aZ]}}}var au=(a2-aG)/a2;if(aV.renderer.constructor==L.jqplot.BarRenderer){if(aG>=0&&(aV.fillToZero||au>0.1)){aC=true}else{aC=false;if(aV.fill&&aV.fillToZero&&aG<0&&a2>0){aN=true}else{aN=false}}}else{if(aV.fill){if(aG>=0&&(aV.fillToZero||au>0.1)){aC=true}else{if(aG<0&&a2>0&&aV.fillToZero){aC=false;aN=true}else{aC=false;aN=false}}}else{if(aG<0){aC=false}}}}}if(aC){this.numberTicks=2+Math.ceil((ah-(this.tickSpacing-1))/this.tickSpacing);this.min=0;aH=0;al=aI/(this.numberTicks-1);at=Math.pow(10,Math.abs(Math.floor(Math.log(al)/Math.LN10)));if(al/at==parseInt(al/at,10)){al+=at}this.tickInterval=Math.ceil(al/at)*at;this.max=this.tickInterval*(this.numberTicks-1)}else{if(aN){this.numberTicks=2+Math.ceil((ah-(this.tickSpacing-1))/this.tickSpacing);var aJ=Math.ceil(Math.abs(a6)/av*(this.numberTicks-1));var a9=this.numberTicks-1-aJ;al=Math.max(Math.abs(a6/aJ),Math.abs(aI/a9));at=Math.pow(10,Math.abs(Math.floor(Math.log(al)/Math.LN10)));this.tickInterval=Math.ceil(al/at)*at;this.max=this.tickInterval*a9;this.min=-this.tickInterval*aJ}else{if(this.numberTicks==null){if(this.tickInterval){this.numberTicks=3+Math.ceil(av/this.tickInterval)}else{this.numberTicks=2+Math.ceil((ah-(this.tickSpacing-1))/this.tickSpacing)}}if(this.tickInterval==null){al=av/(this.numberTicks-1);if(al<1){at=Math.pow(10,Math.abs(Math.floor(Math.log(al)/Math.LN10)))}else{at=1}this.tickInterval=Math.ceil(al*at*this.pad)/at}else{at=1/this.tickInterval}ak=this.tickInterval*(this.numberTicks-1);ar=(ak-av)/2;if(this.min==null){this.min=Math.floor(at*(a6-ar))/at}if(this.max==null){this.max=this.min+ak}}}var aF=L.jqplot.getSignificantFigures(this.tickInterval);var aM;if(aF.digitsLeft>=aF.significantDigits){aM="%d"}else{var at=Math.max(0,5-aF.digitsLeft);at=Math.min(at,aF.digitsRight);aM="%."+at+"f"}this._autoFormatString=aM}else{aS=(this.min!=null)?this.min:a6-av*(this.padMin-1);ay=(this.max!=null)?this.max:aI+av*(this.padMax-1);av=ay-aS;if(this.numberTicks==null){if(this.tickInterval!=null){this.numberTicks=Math.ceil((ay-aS)/this.tickInterval)+1}else{if(ah>100){this.numberTicks=parseInt(3+(ah-100)/75,10)}else{this.numberTicks=2}}}if(this.tickInterval==null){this.tickInterval=av/(this.numberTicks-1)}if(this.max==null){ay=aS+this.tickInterval*(this.numberTicks-1)}if(this.min==null){aS=ay-this.tickInterval*(this.numberTicks-1)}var aF=L.jqplot.getSignificantFigures(this.tickInterval);var aM;if(aF.digitsLeft>=aF.significantDigits){aM="%d"}else{var at=Math.max(0,5-aF.digitsLeft);at=Math.min(at,aF.digitsRight);aM="%."+at+"f"}this._autoFormatString=aM;this.min=aS;this.max=ay}if(this.renderer.constructor==L.jqplot.LinearAxisRenderer&&this._autoFormatString==""){av=this.max-this.min;var a7=new this.tickRenderer(this.tickOptions);var aL=a7.formatString||L.jqplot.config.defaultTickFormatString;var aL=aL.match(L.jqplot.sprintf.regex)[0];var a3=0;if(aL){if(aL.search(/[fFeEgGpP]/)>-1){var aY=aL.match(/\%\.(\d{0,})?[eEfFgGpP]/);if(aY){a3=parseInt(aY[1],10)}else{a3=6}}else{if(aL.search(/[di]/)>-1){a3=0}}var aq=Math.pow(10,-a3);if(this.tickIntervalthis.breakPoints[0]&&aAthis.breakPoints[0]&&aAthis.breakPoints[0]&&aA=this.breakPoints[1]){return(aA-au)*ak/al}else{return(aA+this.breakPoints[1]-this.breakPoints[0]-au)*ak/al}};this.series_p2u=function(aA){return aA*al/ak+au}}}else{this.p2u=function(aA){return(aA-am)*al/ak+at};this.u2p=function(aA){return(aA-at)*ak/al+am};if(this.name=="xaxis"||this.name=="x2axis"){this.series_u2p=function(aA){return(aA-at)*ak/al};this.series_p2u=function(aA){return aA*al/ak+at}}else{this.series_u2p=function(aA){return(aA-au)*ak/al};this.series_p2u=function(aA){return aA*al/ak+au}}}if(this.show){if(this.name=="xaxis"||this.name=="x2axis"){for(var av=0;av0){ah=-ap._textRenderer.height*Math.cos(-ap._textRenderer.angle)/2}else{ah=-ap.getHeight()+ap._textRenderer.height*Math.cos(ap._textRenderer.angle)/2}break;case"middle":ah=-ap.getHeight()/2;break;default:ah=-ap.getHeight()/2;break}}else{ah=-ap.getHeight()/2}var az=this.u2p(ap.value)+ah+"px";ap._elem.css("top",az);ap.pack()}}if(aq){var aw=this._label._elem.outerHeight(true);this._label._elem.css("top",ao-ak/2-aw/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px")}else{this._label._elem.css("right","0px")}this._label.pack()}}}ay=null};function i(ai){var ah;ai=Math.abs(ai);if(ai>=10){ah="%d"}else{if(ai>1){if(ai===parseInt(ai,10)){ah="%d"}else{ah="%.1f"}}else{var aj=-Math.floor(Math.log(ai)/Math.LN10);ah="%."+aj+"f"}}return ah}var b=[0.1,0.2,0.3,0.4,0.5,0.8,1,2,3,4,5];var c=function(ai){var ah=b.indexOf(ai);if(ah>0){return b[ah-1]}else{return b[b.length-1]/100}};var k=function(ai){var ah=b.indexOf(ai);if(ah5){ah=10*aj}else{if(am>2){ah=5*aj}else{if(am>1){ah=2*aj}else{ah=aj}}}}else{if(am>5){ah=10*aj}else{if(am>4){ah=5*aj}else{if(am>3){ah=4*aj}else{if(am>2){ah=3*aj}else{if(am>1){ah=2*aj}else{ah=aj}}}}}}return ah}function Q(ai,ah){ah=ah||1;var ak=Math.floor(Math.log(ai)/Math.LN10);var am=Math.pow(10,ak);var al=ai/am;var aj;al=al/ah;if(al<=0.38){aj=0.1}else{if(al<=1.6){aj=0.2}else{if(al<=4){aj=0.5}else{if(al<=8){aj=1}else{if(al<=16){aj=2}else{aj=5}}}}}return aj*am}function x(aj,ai){var al=Math.floor(Math.log(aj)/Math.LN10);var an=Math.pow(10,al);var am=aj/an;var ah;var ak;am=am/ai;if(am<=0.38){ak=0.1}else{if(am<=1.6){ak=0.2}else{if(am<=4){ak=0.5}else{if(am<=8){ak=1}else{if(am<=16){ak=2}else{ak=5}}}}}ah=ak*an;return[ah,ak,an]}L.jqplot.LinearTickGenerator=function(an,aq,aj,ak,ao,ar){ao=(ao===null)?false:ao;ar=(ar===null||ao)?false:ar;if(an===aq){aq=(aq)?0:1}aj=aj||1;if(aqat){at=aB}if(ai>aA){aA=ai}})}an.width=at+Number(av);an.height=aA+Number(ax);var ak=an.getContext("2d");ak.save();ak.fillStyle=al;ak.fillRect(0,0,an.width,an.height);ak.restore();ak.translate(au,ar);ak.textAlign="left";ak.textBaseline="top";function aC(aE){var aF=parseInt(L(aE).css("line-height"),10);if(isNaN(aF)){aF=parseInt(L(aE).css("font-size"),10)*1.2}return aF}function aD(aF,aE,aS,aG,aO,aH){var aQ=aC(aF);var aK=L(aF).innerWidth();var aL=L(aF).innerHeight();var aN=aS.split(/\s+/);var aR=aN.length;var aP="";var aM=[];var aU=aO;var aT=aG;for(var aJ=0;aJaK){aM.push(aJ);aP="";aJ--}}if(aM.length===0){if(L(aF).css("textAlign")==="center"){aT=aG+(aH-aE.measureText(aP).width)/2-au}aE.fillText(aS,aT,aO)}else{aP=aN.slice(0,aM[0]).join(" ");if(L(aF).css("textAlign")==="center"){aT=aG+(aH-aE.measureText(aP).width)/2-au}aE.fillText(aP,aT,aU);aU+=aQ;for(var aJ=1,aI=aM.length;aJ0){ak.strokeRect(aI,aL,L(aG).innerWidth(),L(aG).innerHeight())}L(aG).find("div.jqplot-table-legend-swatch-outline").each(function(){var aU=L(this);ak.strokeStyle=aU.css("border-top-color");var aQ=aI+aU.position().left;var aR=aL+aU.position().top;ak.strokeRect(aQ,aR,aU.innerWidth(),aU.innerHeight());aQ+=parseInt(aU.css("padding-left"),10);aR+=parseInt(aU.css("padding-top"),10);var aT=aU.innerHeight()-2*parseInt(aU.css("padding-top"),10);var aP=aU.innerWidth()-2*parseInt(aU.css("padding-left"),10);var aS=aU.children("div.jqplot-table-legend-swatch");ak.fillStyle=aS.css("background-color");ak.fillRect(aQ,aR,aP,aT)});L(aG).find("td.jqplot-table-legend-label").each(function(){var aR=L(this);var aP=aI+aR.position().left;var aQ=aL+aR.position().top+parseInt(aR.css("padding-top"),10);ak.font=aR.jqplotGetComputedFontStyle();ak.fillStyle=aR.css("color");aD(aR,ak,aR.text(),aP,aQ,aM)});var aH=null}else{if(aN=="canvas"){ak.drawImage(aG,aI,aL)}}}}L(this).children().each(function(){aw(this,av,ax)});return an};L.fn.jqplotToImageStr=function(ai){var ah=L(this).jqplotToImageCanvas(ai);if(ah){return ah.toDataURL("image/png")}else{return null}};L.fn.jqplotToImageElem=function(ah){var ai=document.createElement("img");var aj=L(this).jqplotToImageStr(ah);ai.src=aj;return ai};L.fn.jqplotToImageElemStr=function(ah){var ai="";return ai};L.fn.jqplotSaveImage=function(){var ah=L(this).jqplotToImageStr({});if(ah){window.location.href=ah.replace("image/png","image/octet-stream")}};L.fn.jqplotViewImage=function(){var ai=L(this).jqplotToImageElemStr({});var aj=L(this).jqplotToImageStr({});if(ai){var ah=window.open("");ah.document.open("image/png");ah.document.write(ai);ah.document.close();ah=null}};var ag=function(){this.syntax=ag.config.syntax;this._type="jsDate";this.proxy=new Date();this.options={};this.locale=ag.regional.getLocale();this.formatString="";this.defaultCentury=ag.config.defaultCentury;switch(arguments.length){case 0:break;case 1:if(l(arguments[0])=="[object Object]"&&arguments[0]._type!="jsDate"){var aj=this.options=arguments[0];this.syntax=aj.syntax||this.syntax;this.defaultCentury=aj.defaultCentury||this.defaultCentury;this.proxy=ag.createDate(aj.date)}else{this.proxy=ag.createDate(arguments[0])}break;default:var ah=[];for(var ai=0;ai0?"floor":"ceil"](ak))};ag.prototype.getAbbrDayName=function(){return ag.regional[this.locale]["dayNamesShort"][this.proxy.getDay()]};ag.prototype.getAbbrMonthName=function(){return ag.regional[this.locale]["monthNamesShort"][this.proxy.getMonth()]};ag.prototype.getAMPM=function(){return this.proxy.getHours()>=12?"PM":"AM"};ag.prototype.getAmPm=function(){return this.proxy.getHours()>=12?"pm":"am"};ag.prototype.getCentury=function(){return parseInt(this.proxy.getFullYear()/100,10)};ag.prototype.getDate=function(){return this.proxy.getDate()};ag.prototype.getDay=function(){return this.proxy.getDay()};ag.prototype.getDayOfWeek=function(){var ah=this.proxy.getDay();return ah===0?7:ah};ag.prototype.getDayOfYear=function(){var ai=this.proxy;var ah=ai-new Date(""+ai.getFullYear()+"/1/1 GMT");ah+=ai.getTimezoneOffset()*60000;ai=null;return parseInt(ah/60000/60/24,10)+1};ag.prototype.getDayName=function(){return ag.regional[this.locale]["dayNames"][this.proxy.getDay()]};ag.prototype.getFullWeekOfYear=function(){var ak=this.proxy;var ah=this.getDayOfYear();var aj=6-ak.getDay();var ai=parseInt((ah+aj)/7,10);return ai};ag.prototype.getFullYear=function(){return this.proxy.getFullYear()};ag.prototype.getGmtOffset=function(){var ah=this.proxy.getTimezoneOffset()/60;var ai=ah<0?"+":"-";ah=Math.abs(ah);return ai+N(Math.floor(ah),2)+":"+N((ah%1)*60,2)};ag.prototype.getHours=function(){return this.proxy.getHours()};ag.prototype.getHours12=function(){var ah=this.proxy.getHours();return ah>12?ah-12:(ah==0?12:ah)};ag.prototype.getIsoWeek=function(){var ak=this.proxy;var aj=this.getWeekOfYear();var ah=(new Date(""+ak.getFullYear()+"/1/1")).getDay();var ai=aj+(ah>4||ah<=1?0:1);if(ai==53&&(new Date(""+ak.getFullYear()+"/12/31")).getDay()<4){ai=1}else{if(ai===0){ak=new ag(new Date(""+(ak.getFullYear()-1)+"/12/31"));ai=ak.getIsoWeek()}}ak=null;return ai};ag.prototype.getMilliseconds=function(){return this.proxy.getMilliseconds()};ag.prototype.getMinutes=function(){return this.proxy.getMinutes()};ag.prototype.getMonth=function(){return this.proxy.getMonth()};ag.prototype.getMonthName=function(){return ag.regional[this.locale]["monthNames"][this.proxy.getMonth()]};ag.prototype.getMonthNumber=function(){return this.proxy.getMonth()+1};ag.prototype.getSeconds=function(){return this.proxy.getSeconds()};ag.prototype.getShortYear=function(){return this.proxy.getYear()%100};ag.prototype.getTime=function(){return this.proxy.getTime()};ag.prototype.getTimezoneAbbr=function(){return this.proxy.toString().replace(/^.*\(([^)]+)\)$/,"$1")};ag.prototype.getTimezoneName=function(){var ah=/(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());return ah[1]||ah[2]||"GMT"+this.getGmtOffset()};ag.prototype.getTimezoneOffset=function(){return this.proxy.getTimezoneOffset()};ag.prototype.getWeekOfYear=function(){var ah=this.getDayOfYear();var aj=7-this.getDayOfWeek();var ai=parseInt((ah+aj)/7,10);return ai};ag.prototype.getUnix=function(){return Math.round(this.proxy.getTime()/1000,0)};ag.prototype.getYear=function(){return this.proxy.getYear()};ag.prototype.next=function(ah){ah=ah||"day";return this.clone().add(1,ah)};ag.prototype.set=function(){switch(arguments.length){case 0:this.proxy=new Date();break;case 1:if(l(arguments[0])=="[object Object]"&&arguments[0]._type!="jsDate"){var aj=this.options=arguments[0];this.syntax=aj.syntax||this.syntax;this.defaultCentury=aj.defaultCentury||this.defaultCentury;this.proxy=ag.createDate(aj.date)}else{this.proxy=ag.createDate(arguments[0])}break;default:var ah=[];for(var ai=0;ai0?"floor":"ceil"](ah/12));var ai=aj.getMonth()+(ah%12);if(ai==12){ai=0;aj.setYear(aj.getFullYear()+1)}else{if(ai==-1){ai=11;aj.setYear(aj.getFullYear()-1)}}aj.setMonth(ai)},diff:function(al,aj){var ah=al.getFullYear()-aj.getFullYear();var ai=al.getMonth()-aj.getMonth()+(ah*12);var ak=al.getDate()-aj.getDate();return ai+(ak/30)}},year:{add:function(ai,ah){ai.setYear(ai.getFullYear()+Math[ah>0?"floor":"ceil"](ah))},diff:function(ai,ah){return E.month.diff(ai,ah)/12}}};for(var Y in E){if(Y.substring(Y.length-1)!="s"){E[Y+"s"]=E[Y]}}var H=function(al,ak,ai){if(ag.formats[ai]["shortcuts"][ak]){return ag.strftime(al,ag.formats[ai]["shortcuts"][ak],ai)}else{var ah=(ag.formats[ai]["codes"][ak]||"").split(".");var aj=al["get"+ah[0]]?al["get"+ah[0]]():"";if(ah[1]){aj=N(aj,ah[1])}return aj}};ag.strftime=function(an,ak,aj,ao){var ai="perl";var am=ag.regional.getLocale();if(aj&&ag.formats.hasOwnProperty(aj)){ai=aj}else{if(aj&&ag.regional.hasOwnProperty(aj)){am=aj}}if(ao&&ag.formats.hasOwnProperty(ao)){ai=ao}else{if(ao&&ag.regional.hasOwnProperty(ao)){am=ao}}if(l(an)!="[object Object]"||an._type!="jsDate"){an=new ag(an);an.locale=am}if(!ak){ak=an.formatString||ag.regional[am]["formatString"]}var ah=ak||"%Y-%m-%d",ap="",al;while(ah.length>0){if(al=ah.match(ag.formats[ai].codes.matcher)){ap+=ah.slice(0,al.index);ap+=(al[1]||"")+H(an,al[2],ai);ah=ah.slice(al.index+al[0].length)}else{ap+=ah;ah=""}}return ap};ag.formats={ISO:"%Y-%m-%dT%H:%M:%S.%N%G",SQL:"%Y-%m-%d %H:%M:%S"};ag.formats.perl={codes:{matcher:/()%(#?(%|[a-z]))/i,Y:"FullYear",y:"ShortYear.2",m:"MonthNumber.2","#m":"MonthNumber",B:"MonthName",b:"AbbrMonthName",d:"Date.2","#d":"Date",e:"Date",A:"DayName",a:"AbbrDayName",w:"Day",H:"Hours.2","#H":"Hours",I:"Hours12.2","#I":"Hours12",p:"AMPM",M:"Minutes.2","#M":"Minutes",S:"Seconds.2","#S":"Seconds",s:"Unix",N:"Milliseconds.3","#N":"Milliseconds",O:"TimezoneOffset",Z:"TimezoneName",G:"GmtOffset"},shortcuts:{F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",D:"%m/%d/%y","#c":"%a %b %e %H:%M:%S %Y",v:"%e-%b-%Y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"}};ag.formats.php={codes:{matcher:/()%((%|[a-z]))/i,a:"AbbrDayName",A:"DayName",d:"Date.2",e:"Date",j:"DayOfYear.3",u:"DayOfWeek",w:"Day",U:"FullWeekOfYear.2",V:"IsoWeek.2",W:"WeekOfYear.2",b:"AbbrMonthName",B:"MonthName",m:"MonthNumber.2",h:"AbbrMonthName",C:"Century.2",y:"ShortYear.2",Y:"FullYear",H:"Hours.2",I:"Hours12.2",l:"Hours12",p:"AMPM",P:"AmPm",M:"Minutes.2",S:"Seconds.2",s:"Unix",O:"TimezoneOffset",z:"GmtOffset",Z:"TimezoneAbbr"},shortcuts:{D:"%m/%d/%y",F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"}};ag.createDate=function(aj){if(aj==null){return new Date()}if(aj instanceof Date){return aj}if(typeof aj=="number"){return new Date(aj)}var ao=String(aj).replace(/^\s*(.+)\s*$/g,"$1");ao=ao.replace(/^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,4})/,"$1/$2/$3");ao=ao.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{4})/i,"$1 $2 $3");var an=ao.match(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i);if(an&&an.length>3){var at=parseFloat(an[3]);var am=ag.config.defaultCentury+at;am=String(am);ao=ao.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i,an[1]+" "+an[2]+" "+am)}an=ao.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})[^0-9]/);function ar(ax,aw){var aC=parseFloat(aw[1]);var aB=parseFloat(aw[2]);var aA=parseFloat(aw[3]);var az=ag.config.defaultCentury;var av,au,aD,ay;if(aC>31){au=aA;aD=aB;av=az+aC}else{au=aB;aD=aC;av=az+aA}ay=aD+"/"+au+"/"+av;return ax.replace(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})/,ay)}if(an&&an.length>3){ao=ar(ao,an)}var an=ao.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})$/);if(an&&an.length>3){ao=ar(ao,an)}var al=0;var ai=ag.matchers.length;var aq,ah,ap=ao,ak;while(al31){ah=an;ai=am+ao}else{ah=ao;ai=am+an}var ap=ab(aj[2],ag.regional[ag.regional.getLocale()]["monthNamesShort"]);if(ap==-1){ap=ab(aj[2],ag.regional[ag.regional.getLocale()]["monthNames"])}ak.setFullYear(ai,ap,ah);ak.setHours(0,0,0,0);return ak}else{return al}}];function ab(aj,ak){if(ak.indexOf){return ak.indexOf(aj)}for(var ah=0,ai=ak.length;ah=ap)?"":Array(1+ap-au.length>>>0).join(aq);return at?au+ar:ar+au}function ak(ar){var aq=new String(ar);for(var ap=10;ap>0;ap--){if(aq==(aq=aq.replace(/^(\d+)(\d{3})/,"$1"+L.jqplot.sprintf.thousandsSeparator+"$2"))){break}}return aq}function aj(av,au,ax,ar,at,aq){var aw=ar-av.length;if(aw>0){var ap=" ";if(aq){ap=" "}if(ax||!at){av=an(av,ar,ap,ax)}else{av=av.slice(0,au.length)+an("",aw,"0",true)+av.slice(au.length)}}return av}function ao(ay,aq,aw,ar,ap,av,ax,au){var at=ay>>>0;aw=aw&&at&&{"2":"0b","8":"0","16":"0x"}[aq]||"";ay=aw+an(at.toString(aq),av||0,"0",false);return aj(ay,aw,ar,ap,ax,au)}function ah(au,av,ar,ap,at,aq){if(ap!=null){au=au.slice(0,ap)}return aj(au,"",av,ar,at,aq)}var ai=arguments,al=0,am=ai[al++];return am.replace(L.jqplot.sprintf.regex,function(aM,ax,ay,aB,aO,aJ,av){if(aM=="%%"){return"%"}var aD=false,az="",aA=false,aL=false,aw=false,au=false;for(var aI=0;ay&&aI-1?6:(av=="d")?0:void (0)}else{if(aJ=="*"){aJ=+ai[al++]}else{if(aJ.charAt(0)=="*"){aJ=+ai[aJ.slice(1,-1)]}else{aJ=+aJ}}}var aF=ax?ai[ax.slice(0,-1)]:ai[al++];switch(av){case"s":if(aF==null){return""}return ah(String(aF),aD,aB,aJ,aA,aw);case"c":return ah(String.fromCharCode(+aF),aD,aB,aJ,aA,aw);case"b":return ao(aF,2,aL,aD,aB,aJ,aA,aw);case"o":return ao(aF,8,aL,aD,aB,aJ,aA,aw);case"x":return ao(aF,16,aL,aD,aB,aJ,aA,aw);case"X":return ao(aF,16,aL,aD,aB,aJ,aA,aw).toUpperCase();case"u":return ao(aF,10,aL,aD,aB,aJ,aA,aw);case"i":var ar=parseInt(+aF,10);if(isNaN(ar)){return""}var aH=ar<0?"-":az;var aK=au?ak(String(Math.abs(ar))):String(Math.abs(ar));aF=aH+an(aK,aJ,"0",false);return aj(aF,aH,aD,aB,aA,aw);case"d":var ar=Math.round(+aF);if(isNaN(ar)){return""}var aH=ar<0?"-":az;var aK=au?ak(String(Math.abs(ar))):String(Math.abs(ar));aF=aH+an(aK,aJ,"0",false);return aj(aF,aH,aD,aB,aA,aw);case"e":case"E":case"f":case"F":case"g":case"G":var ar=+aF;if(isNaN(ar)){return""}var aH=ar<0?"-":az;var at=["toExponential","toFixed","toPrecision"]["efg".indexOf(av.toLowerCase())];var aN=["toString","toUpperCase"]["eEfFgG".indexOf(av)%2];var aK=Math.abs(ar)[at](aJ);var aE=aK.toString().split(".");aE[0]=au?ak(aE[0]):aE[0];aK=aE.join(L.jqplot.sprintf.decimalMark);aF=aH+aK;var aC=aj(aF,aH,aD,aB,aA,aw)[aN]();return aC;case"p":case"P":var ar=+aF;if(isNaN(ar)){return""}var aH=ar<0?"-":az;var aE=String(Number(Math.abs(ar)).toExponential()).split(/e|E/);var aq=(aE[0].indexOf(".")!=-1)?aE[0].length-1:String(ar).length;var aG=(aE[1]<0)?-aE[1]-1:0;if(Math.abs(ar)<1){if(aq+aG<=aJ){aF=aH+Math.abs(ar).toPrecision(aq)}else{if(aq<=aJ-1){aF=aH+Math.abs(ar).toExponential(aq-1)}else{aF=aH+Math.abs(ar).toExponential(aJ-1)}}}else{var ap=(aq<=aJ)?aq:aJ;aF=aH+Math.abs(ar).toPrecision(ap)}var aN=["toString","toUpperCase"]["pP".indexOf(av)%2];return aj(aF,aH,aD,aB,aA,aw)[aN]();case"n":return"";default:return aM}})};L.jqplot.sprintf.thousandsSeparator=",";L.jqplot.sprintf.decimalMark=".";L.jqplot.sprintf.regex=/%%|%(\d+\$)?([-+#0&\' ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g;L.jqplot.getSignificantFigures=function(al){var an=String(Number(Math.abs(al)).toExponential()).split(/e|E/);var am=(an[0].indexOf(".")!=-1)?an[0].length-1:an[0].length;var ai=(an[1]<0)?-an[1]-1:0;var ah=parseInt(an[1],10);var aj=(ah+1>0)?ah+1:0;var ak=(am<=aj)?0:am-ah-1;return{significantDigits:am,digitsLeft:aj,digitsRight:ak,zeros:ai,exponent:ah}};L.jqplot.getPrecision=function(ah){return L.jqplot.getSignificantFigures(ah).digitsRight};var X=L.uiBackCompat!==false;L.jqplot.effects={effect:{}};var m="jqplot.storage.";L.extend(L.jqplot.effects,{version:"1.9pre",save:function(ai,aj){for(var ah=0;ah").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),ah={width:ai.width(),height:ai.height()},ak=document.activeElement;ai.wrap(al);if(ai[0]===ak||L.contains(ai[0],ak)){L(ak).focus()}al=ai.parent();if(ai.css("position")==="static"){al.css({position:"relative"});ai.css({position:"relative"})}else{L.extend(aj,{position:ai.css("position"),zIndex:ai.css("z-index")});L.each(["top","left","bottom","right"],function(am,an){aj[an]=ai.css(an);if(isNaN(parseInt(aj[an],10))){aj[an]="auto"}});ai.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}ai.css(ah);return al.css(aj).show()},removeWrapper:function(ah){var ai=document.activeElement;if(ah.parent().is(".ui-effects-wrapper")){ah.parent().replaceWith(ah);if(ah[0]===ai||L.contains(ah[0],ai)){L(ai).focus()}}return ah}});function j(ai,ah,aj,ak){if(L.isPlainObject(ai)){return ai}ai={effect:ai};if(ah===u){ah={}}if(L.isFunction(ah)){ak=ah;aj=null;ah={}}if(L.type(ah)==="number"||L.fx.speeds[ah]){ak=aj;aj=ah;ah={}}if(L.isFunction(aj)){ak=aj;aj=null}if(ah){L.extend(ai,ah)}aj=aj||ah.duration;ai.duration=L.fx.off?0:typeof aj==="number"?aj:aj in L.fx.speeds?L.fx.speeds[aj]:L.fx.speeds._default;ai.complete=ak||ah.complete;return ai}function ae(ah){if(!ah||typeof ah==="number"||L.fx.speeds[ah]){return true}if(typeof ah==="string"&&!L.jqplot.effects.effect[ah]){if(X&&L.jqplot.effects[ah]){return false}return true}return false}L.fn.extend({jqplotEffect:function(ap,aq,ai,ao){var an=j.apply(this,arguments),ak=an.mode,al=an.queue,am=L.jqplot.effects.effect[an.effect],ah=!am&&X&&L.jqplot.effects[an.effect];if(L.fx.off||!(am||ah)){if(ak){return this[ak](an.duration,an.complete)}else{return this.each(function(){if(an.complete){an.complete.call(this)}})}}function aj(au){var av=L(this),at=an.complete,aw=an.mode;function ar(){if(L.isFunction(at)){at.call(av[0])}if(L.isFunction(au)){au()}}if(av.is(":hidden")?aw==="hide":aw==="show"){ar()}else{am.call(av[0],an,ar)}}if(am){return al===false?this.each(aj):this.queue(al||"fx",aj)}else{return ah.call(this,{options:an,duration:an.duration,callback:an.complete,mode:an.mode})}}});var a=/up|down|vertical/,v=/up|left|vertical|horizontal/;L.jqplot.effects.effect.blind=function(aj,ao){var ak=L(this),ar=["position","top","bottom","left","right","height","width"],ap=L.jqplot.effects.setMode(ak,aj.mode||"hide"),au=aj.direction||"up",am=a.test(au),al=am?"height":"width",aq=am?"top":"left",aw=v.test(au),an={},av=ap==="show",ai,ah,at;if(ak.parent().is(".ui-effects-wrapper")){L.jqplot.effects.save(ak.parent(),ar)}else{L.jqplot.effects.save(ak,ar)}ak.show();at=parseInt(ak.css("top"),10);ai=L.jqplot.effects.createWrapper(ak).css({overflow:"hidden"});ah=am?ai[al]()+at:ai[al]();an[al]=av?String(ah):"0";if(!aw){ak.css(am?"bottom":"right",0).css(am?"top":"left","").css({position:"absolute"});an[aq]=av?"0":String(ah)}if(av){ai.css(al,0);if(!aw){ai.css(aq,ah)}}ai.animate(an,{duration:aj.duration,easing:aj.easing,queue:false,complete:function(){if(ap==="hide"){ak.hide()}L.jqplot.effects.restore(ak,ar);L.jqplot.effects.removeWrapper(ak);ao()}})}})(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/wp-piwik/js/jqplot/plugins/jqplot.pieRenderer.min.js b/wp-content/plugins/wp-piwik/js/jqplot/plugins/jqplot.pieRenderer.min.js new file mode 100644 index 0000000..a09f8f1 --- /dev/null +++ b/wp-content/plugins/wp-piwik/js/jqplot/plugins/jqplot.pieRenderer.min.js @@ -0,0 +1,3 @@ +/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com + jsDate | (c) 2010-2013 Chris Leonello + */(function(e){e.jqplot.PieRenderer=function(){e.jqplot.LineRenderer.call(this)};e.jqplot.PieRenderer.prototype=new e.jqplot.LineRenderer();e.jqplot.PieRenderer.prototype.constructor=e.jqplot.PieRenderer;e.jqplot.PieRenderer.prototype.init=function(q,u){this.diameter=null;this.padding=20;this.sliceMargin=0;this.fill=true;this.shadowOffset=2;this.shadowAlpha=0.07;this.shadowDepth=5;this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColors=[];this.dataLabels="percent";this.showDataLabels=false;this.dataLabelFormatString=null;this.dataLabelThreshold=3;this.dataLabelPositionFactor=0.52;this.dataLabelNudge=2;this.dataLabelCenterOn=true;this.startAngle=0;this.tickRenderer=e.jqplot.PieTickRenderer;this._drawData=true;this._type="pie";if(q.highlightMouseDown&&q.highlightMouseOver==null){q.highlightMouseOver=false}e.extend(true,this,q);if(this.sliceMargin<0){this.sliceMargin=0}this._diameter=null;this._radius=null;this._sliceAngles=[];this._highlightedPoint=null;if(this.highlightColors.length==0){for(var s=0;s570)?o[p]*0.8:o[p]+0.3*(255-o[p]);o[p]=parseInt(o[p],10)}this.highlightColors.push("rgb("+o[0]+","+o[1]+","+o[2]+")")}}this.highlightColorGenerator=new e.jqplot.ColorGenerator(this.highlightColors);u.postParseOptionsHooks.addOnce(m);u.postInitHooks.addOnce(g);u.eventListenerHooks.addOnce("jqplotMouseMove",b);u.eventListenerHooks.addOnce("jqplotMouseDown",a);u.eventListenerHooks.addOnce("jqplotMouseUp",l);u.eventListenerHooks.addOnce("jqplotClick",f);u.eventListenerHooks.addOnce("jqplotRightClick",n);u.postDrawHooks.addOnce(i)};e.jqplot.PieRenderer.prototype.setGridData=function(t){var p=[];var u=[];var o=this.startAngle/180*Math.PI;var s=0;this._drawData=false;for(var r=0;r0){p[r]+=p[r-1]}s+=this.data[r][1]}var q=Math.PI*2/p[p.length-1];for(var r=0;r0){p[r]+=p[r-1]}s+=t[r][1]}var q=Math.PI*2/p[p.length-1];for(var r=0;r0&&s>0.01&&s<6.282){w=parseFloat(p)/2/h(q)}return w}e.jqplot.PieRenderer.prototype.drawSlice=function(B,z,y,u,w){if(this._drawData){var p=this._radius;var A=this.fill;var x=this.lineWidth;var s=this.sliceMargin;if(this.fill==false){s+=this.lineWidth}B.save();B.translate(this._center[0],this._center[1]);var D=j(z,y,this.sliceMargin,this.fill,this.lineWidth);var o=D*Math.cos((z+y)/2);var C=D*Math.sin((z+y)/2);if((y-z)<=Math.PI){p-=D}else{p+=D}B.translate(o,C);if(w){for(var v=0,t=this.shadowDepth;v6.282+this.startAngle){y=6.282+this.startAngle;if(z>y){z=6.281+this.startAngle}}if(z>=y){return}B.beginPath();B.fillStyle=u;B.strokeStyle=u;B.lineWidth=x;B.arc(0,0,r,z,y,false);B.lineTo(0,0);B.closePath();if(A){B.fill()}else{B.stroke()}}};e.jqplot.PieRenderer.prototype.draw=function(B,z,E,o){var W;var H=(E!=undefined)?E:{};var t=0;var s=0;var N=1;var L=new e.jqplot.ColorGenerator(this.seriesColors);if(E.legendInfo&&E.legendInfo.placement=="insideGrid"){var J=E.legendInfo;switch(J.location){case"nw":t=J.width+J.xoffset;break;case"w":t=J.width+J.xoffset;break;case"sw":t=J.width+J.xoffset;break;case"ne":t=J.width+J.xoffset;N=-1;break;case"e":t=J.width+J.xoffset;N=-1;break;case"se":t=J.width+J.xoffset;N=-1;break;case"n":s=J.height+J.yoffset;break;case"s":s=J.height+J.yoffset;N=-1;break;default:break}}var K=(H.shadow!=undefined)?H.shadow:this.shadow;var A=(H.fill!=undefined)?H.fill:this.fill;var C=B.canvas.width;var I=B.canvas.height;var Q=C-t-2*this.padding;var X=I-s-2*this.padding;var M=Math.min(Q,X);var Y=M;this._sliceAngles=[];var v=this.sliceMargin;if(this.fill==false){v+=this.lineWidth}var q;var G=0;var R,aa,Z,ab;var D=this.startAngle/180*Math.PI;for(var W=0,V=z.length;WMath.PI){G=Math.max(q,G)}}if(this.diameter!=null&&this.diameter>0){this._diameter=this.diameter-2*G}else{this._diameter=Y-2*G}if(this._diameter<6){e.jqplot.log("Diameter of pie too small, not rendering.");return}var S=this._radius=this._diameter/2;this._center=[(C-N*t)/2+N*t+G*Math.cos(D),(I-N*s)/2+N*s+G*Math.sin(D)];if(this.shadow){for(var W=0,V=z.length;W=this.dataLabelThreshold){var F,U=(this._sliceAngles[W][0]+this._sliceAngles[W][1])/2,T;if(this.dataLabels=="label"){F=this.dataLabelFormatString||"%s";T=e.jqplot.sprintf(F,z[W][0])}else{if(this.dataLabels=="value"){F=this.dataLabelFormatString||"%d";T=e.jqplot.sprintf(F,this.data[W][1])}else{if(this.dataLabels=="percent"){F=this.dataLabelFormatString||"%d%%";T=e.jqplot.sprintf(F,z[W][2]*100)}else{if(this.dataLabels.constructor==Array){F=this.dataLabelFormatString||"%s";T=e.jqplot.sprintf(F,this.dataLabels[W])}}}}var p=(this._radius)*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge;var P=this._center[0]+Math.cos(U)*p+this.canvas._offsets.left;var O=this._center[1]+Math.sin(U)*p+this.canvas._offsets.top;var u=e('
        '+T+"
        ").insertBefore(o.eventCanvas._elem);if(this.dataLabelCenterOn){P-=u.width()/2;O-=u.height()/2}else{P-=u.width()*Math.sin(U/2);O-=u.height()/2}P=Math.round(P);O=Math.round(O);u.css({left:P,top:O})}}};e.jqplot.PieAxisRenderer=function(){e.jqplot.LinearAxisRenderer.call(this)};e.jqplot.PieAxisRenderer.prototype=new e.jqplot.LinearAxisRenderer();e.jqplot.PieAxisRenderer.prototype.constructor=e.jqplot.PieAxisRenderer;e.jqplot.PieAxisRenderer.prototype.init=function(o){this.tickRenderer=e.jqplot.PieTickRenderer;e.extend(true,this,o);this._dataBounds={min:0,max:100};this.min=0;this.max=100;this.showTicks=false;this.ticks=[];this.showMark=false;this.show=false};e.jqplot.PieLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)};e.jqplot.PieLegendRenderer.prototype=new e.jqplot.TableLegendRenderer();e.jqplot.PieLegendRenderer.prototype.constructor=e.jqplot.PieLegendRenderer;e.jqplot.PieLegendRenderer.prototype.init=function(o){this.numberRows=null;this.numberColumns=null;e.extend(true,this,o)};e.jqplot.PieLegendRenderer.prototype.draw=function(){var r=this;if(this.show){var B=this._series;this._elem=e(document.createElement("table"));this._elem.addClass("jqplot-table-legend");var E={position:"absolute"};if(this.background){E.background=this.background}if(this.border){E.border=this.border}if(this.fontSize){E.fontSize=this.fontSize}if(this.fontFamily){E.fontFamily=this.fontFamily}if(this.textColor){E.textColor=this.textColor}if(this.marginTop!=null){E.marginTop=this.marginTop}if(this.marginBottom!=null){E.marginBottom=this.marginBottom}if(this.marginLeft!=null){E.marginLeft=this.marginLeft}if(this.marginRight!=null){E.marginRight=this.marginRight}this._elem.css(E);var I=false,A=false,o,y;var C=B[0];var p=new e.jqplot.ColorGenerator(C.seriesColors);if(C.show){var J=C.data;if(this.numberRows){o=this.numberRows;if(!this.numberColumns){y=Math.ceil(J.length/o)}else{y=this.numberColumns}}else{if(this.numberColumns){y=this.numberColumns;o=Math.ceil(J.length/this.numberColumns)}else{o=J.length;y=1}}var H,G;var q,w,v;var x,z,F;var D=0;var u,t;for(H=0;H0){I=true}else{I=false}}else{if(H==o-1){I=false}else{I=true}}z=(I)?this.rowSpacing:"0";w=e(document.createElement("td"));w.addClass("jqplot-table-legend jqplot-table-legend-swatch");w.css({textAlign:"center",paddingTop:z});u=e(document.createElement("div"));u.addClass("jqplot-table-legend-swatch-outline");t=e(document.createElement("div"));t.addClass("jqplot-table-legend-swatch");t.css({backgroundColor:F,borderColor:F});w.append(u.append(t));v=e(document.createElement("td"));v.addClass("jqplot-table-legend jqplot-table-legend-label");v.css("paddingTop",z);if(this.escapeHtml){v.text(x)}else{v.html(x)}if(A){v.prependTo(q);w.prependTo(q)}else{w.appendTo(q);v.appendTo(q)}I=true}D++}}}}return this._elem};e.jqplot.PieRenderer.prototype.handleMove=function(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];r.target.trigger("jqplotDataMouseOver",o);if(r.series[o[0]].highlightMouseOver&&!(o[0]==r.plugins.pieRenderer.highlightedSeriesIndex&&o[1]==r.series[o[0]]._highlightedPoint)){r.target.trigger("jqplotDataHighlight",o);d(r,o[0],o[1])}}else{if(s==null){k(r)}}};function c(s,r,p){p=p||{};p.axesDefaults=p.axesDefaults||{};p.legend=p.legend||{};p.seriesDefaults=p.seriesDefaults||{};var o=false;if(p.seriesDefaults.renderer==e.jqplot.PieRenderer){o=true}else{if(p.series){for(var q=0;q. + +The project page and downloads are at . + +Below are a few examples to demonstrate jqPlot usage. These plots are shown as static images. +Many more examples of dynamically rendered plots can be seen on the test and examples pages here: <../../tests/>. + +Include the Files: + +jqPlot requires jQuery (1.4+ required for certain features). jQuery is included in the distribution. +To use jqPlot include jquery, the jqPlot jQuery plugin, jqPlot css file and optionally the excanvas +script for IE support in your web page. Note, excanvas is required only for IE versions below 9. IE 9 includes +native support for the canvas element and does not require excanvas: + +> +> +> +> + +Add a plot container: + +Add a container (target) to your web page where you want your plot to show up. +Be sure to give your target a width and a height: + +>
        + +Create a plot: + +Then, create the actual plot by calling the +$.jqplot plugin with the id of your target and some data: + +> $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]]); + +Which will produce a +chart like: + +(see images/basicline.png) + +Plot Options: + +You can customize the plot by passing options to the $.jqplot function. Options are described in + in the jqPlotOptions.txt file. An example of options usage: + +> $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]], +> { title:'Exponential Line', +> axes:{yaxis:{min:-10, max:240}}, +> series:[{color:'#5FAB78'}] +> }); + +Which will produce +a plot like: + +(see images/basicoptions.png) + +Using Plugins: + +You can use jqPlot plugins (that is, plugins to the jqPlot plugin) by including them in your html +after you include the jqPlot plugin. Here is how to include the log axis plugin: + +> +> +> +> +> + +Important note: For jqplot builds r529 and above (0.9.7r529 and higher), you must explicitly +enable plugins via either the { show: true } plugin option to the plot or by using +the $.jqplot.config.enablePlugins = true; config options set on the page before plot creation. +Only plugins that can be immediately active upon loading are affected. This includes +non-renderer plugins like cursor, dragable, highlighter, and trendline. + +Here is the same $.jqplot call +but with a log y axis: + +> $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]], +> { title:'Exponential Line', +> axes:{yaxis:{renderer: $.jqplot.LogAxisRenderer}}, +> series:[{color:'#5FAB78'}] +> }); + +Which produces +a plot like: + +(see images/basiclogaxis.png) + +You can further customize with options specific +to the log axis plugin: + +> $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]], +> { title:'Exponential Line', +> axes:{yaxis:{renderer: $.jqplot.LogAxisRenderer, tickDistribution:'power'}}, +> series:[{color:'#5FAB78'}] +> }); + +Which makes a +plot like: + +(see images/basiclogoptions.png) + +For a full list of options, see in the jqPlotOptions.txt file. + +You can add as many plugins as you wish. Order is generally not important. +Some plugins, like the highlighter plugin which highlights data points near the +mouse, don't need any extra options or setup to function. Highlighter does have +additional options which the user can set. + +Other plugins, the barRenderer for example, provide functionality that must be specified +in the chart options object. To render a series as a bar graph with the bar renderer, +you would first include the plugin after jqPlot: + +> + +Then you would create +a chart like: + +> $.jqplot('chartdiv', [[34.53, 56.32, 25.1, 18.6]], {series:[{renderer:$.jqplot.BarRenderer}]}); + +Here the default LineRenderer is replaced by a BarRenderer to generate a bar graph for the first (and only) series. diff --git a/wp-content/plugins/wp-piwik/js/jqplot/wp-piwik.jqplot.js b/wp-content/plugins/wp-piwik/js/jqplot/wp-piwik.jqplot.js new file mode 100644 index 0000000..25b05ed --- /dev/null +++ b/wp-content/plugins/wp-piwik/js/jqplot/wp-piwik.jqplot.js @@ -0,0 +1,10 @@ +/* Files combined for WP-Piwik. Get jqPlot at http://www.jqplot.com/ */ +/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com + jsDate | (c) 2010-2013 Chris Leonello +*/(function(L){var u;L.fn.emptyForce=function(){for(var ah=0,ai;(ai=L(this)[ah])!=null;ah++){if(ai.nodeType===1){L.cleanData(ai.getElementsByTagName("*"))}if(L.jqplot.use_excanvas){ai.outerHTML=""}else{while(ai.firstChild){ai.removeChild(ai.firstChild)}}ai=null}return L(this)};L.fn.removeChildForce=function(ah){while(ah.firstChild){this.removeChildForce(ah.firstChild);ah.removeChild(ah.firstChild)}};L.fn.jqplot=function(){var ah=[];var aj=[];for(var ak=0,ai=arguments.length;ak'+ao+"");L("#"+an).addClass("jqplot-error");document.getElementById(an).style.background=L.jqplot.config.errorBackground;document.getElementById(an).style.border=L.jqplot.config.errorBorder;document.getElementById(an).style.fontFamily=L.jqplot.config.errorFontFamily;document.getElementById(an).style.fontSize=L.jqplot.config.errorFontSize;document.getElementById(an).style.fontStyle=L.jqplot.config.errorFontStyle;document.getElementById(an).style.fontWeight=L.jqplot.config.errorFontWeight}}else{am.init(an,aj,ah);am.draw();am.themeEngine.init.call(am);return am}};L.jqplot.version="1.0.8";L.jqplot.revision="1250";L.jqplot.targetCounter=1;L.jqplot.CanvasManager=function(){if(typeof L.jqplot.CanvasManager.canvases=="undefined"){L.jqplot.CanvasManager.canvases=[];L.jqplot.CanvasManager.free=[]}var ah=[];this.getCanvas=function(){var ak;var aj=true;if(!L.jqplot.use_excanvas){for(var al=0,ai=L.jqplot.CanvasManager.canvases.length;al887){L.jqplot.support_canvas_text.result=true}else{L.jqplot.support_canvas_text.result=!!(document.createElement("canvas").getContext&&typeof document.createElement("canvas").getContext("2d").fillText=="function")}}return L.jqplot.support_canvas_text.result};L.jqplot.use_excanvas=((!L.support.boxModel||!L.support.objectAll||!$support.leadingWhitespace)&&!L.jqplot.support_canvas())?true:false;L.jqplot.preInitHooks=[];L.jqplot.postInitHooks=[];L.jqplot.preParseOptionsHooks=[];L.jqplot.postParseOptionsHooks=[];L.jqplot.preDrawHooks=[];L.jqplot.postDrawHooks=[];L.jqplot.preDrawSeriesHooks=[];L.jqplot.postDrawSeriesHooks=[];L.jqplot.preDrawLegendHooks=[];L.jqplot.addLegendRowHooks=[];L.jqplot.preSeriesInitHooks=[];L.jqplot.postSeriesInitHooks=[];L.jqplot.preParseSeriesOptionsHooks=[];L.jqplot.postParseSeriesOptionsHooks=[];L.jqplot.eventListenerHooks=[];L.jqplot.preDrawSeriesShadowHooks=[];L.jqplot.postDrawSeriesShadowHooks=[];L.jqplot.ElemContainer=function(){this._elem;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null}};L.jqplot.ElemContainer.prototype.createElement=function(ak,am,ai,aj,an){this._offsets=am;var ah=ai||"jqplot";var al=document.createElement(ak);this._elem=L(al);this._elem.addClass(ah);this._elem.css(aj);this._elem.attr(an);al=null;return this._elem};L.jqplot.ElemContainer.prototype.getWidth=function(){if(this._elem){return this._elem.outerWidth(true)}else{return null}};L.jqplot.ElemContainer.prototype.getHeight=function(){if(this._elem){return this._elem.outerHeight(true)}else{return null}};L.jqplot.ElemContainer.prototype.getPosition=function(){if(this._elem){return this._elem.position()}else{return{top:null,left:null,bottom:null,right:null}}};L.jqplot.ElemContainer.prototype.getTop=function(){return this.getPosition().top};L.jqplot.ElemContainer.prototype.getLeft=function(){return this.getPosition().left};L.jqplot.ElemContainer.prototype.getBottom=function(){return this._elem.css("bottom")};L.jqplot.ElemContainer.prototype.getRight=function(){return this._elem.css("right")};function w(ah){L.jqplot.ElemContainer.call(this);this.name=ah;this._series=[];this.show=false;this.tickRenderer=L.jqplot.AxisTickRenderer;this.tickOptions={};this.labelRenderer=L.jqplot.AxisLabelRenderer;this.labelOptions={};this.label=null;this.showLabel=true;this.min=null;this.max=null;this.autoscale=false;this.pad=1.2;this.padMax=null;this.padMin=null;this.ticks=[];this.numberTicks;this.tickInterval;this.renderer=L.jqplot.LinearAxisRenderer;this.rendererOptions={};this.showTicks=true;this.showTickMarks=true;this.showMinorTicks=true;this.drawMajorGridlines=true;this.drawMinorGridlines=false;this.drawMajorTickMarks=true;this.drawMinorTickMarks=true;this.useSeriesColor=false;this.borderWidth=null;this.borderColor=null;this.scaleToHiddenSeries=false;this._dataBounds={min:null,max:null};this._intervalStats=[];this._offsets={min:null,max:null};this._ticks=[];this._label=null;this.syncTicks=null;this.tickSpacing=75;this._min=null;this._max=null;this._tickInterval=null;this._numberTicks=null;this.__ticks=null;this._options={}}w.prototype=new L.jqplot.ElemContainer();w.prototype.constructor=w;w.prototype.init=function(){if(L.isFunction(this.renderer)){this.renderer=new this.renderer()}this.tickOptions.axis=this.name;if(this.tickOptions.showMark==null){this.tickOptions.showMark=this.showTicks}if(this.tickOptions.showMark==null){this.tickOptions.showMark=this.showTickMarks}if(this.tickOptions.showLabel==null){this.tickOptions.showLabel=this.showTicks}if(this.label==null||this.label==""){this.showLabel=false}else{this.labelOptions.label=this.label}if(this.showLabel==false){this.labelOptions.show=false}if(this.pad==0){this.pad=1}if(this.padMax==0){this.padMax=1}if(this.padMin==0){this.padMin=1}if(this.padMax==null){this.padMax=(this.pad-1)/2+1}if(this.padMin==null){this.padMin=(this.pad-1)/2+1}this.pad=this.padMax+this.padMin-1;if(this.min!=null||this.max!=null){this.autoscale=false}if(this.syncTicks==null&&this.name.indexOf("y")>-1){this.syncTicks=true}else{if(this.syncTicks==null){this.syncTicks=false}}this.renderer.init.call(this,this.rendererOptions)};w.prototype.draw=function(ah,ai){if(this.__ticks){this.__ticks=null}return this.renderer.draw.call(this,ah,ai)};w.prototype.set=function(){this.renderer.set.call(this)};w.prototype.pack=function(ai,ah){if(this.show){this.renderer.pack.call(this,ai,ah)}if(this._min==null){this._min=this.min;this._max=this.max;this._tickInterval=this.tickInterval;this._numberTicks=this.numberTicks;this.__ticks=this._ticks}};w.prototype.reset=function(){this.renderer.reset.call(this)};w.prototype.resetScale=function(ah){L.extend(true,this,{min:null,max:null,numberTicks:null,tickInterval:null,_ticks:[],ticks:[]},ah);this.resetDataBounds()};w.prototype.resetDataBounds=function(){var ao=this._dataBounds;ao.min=null;ao.max=null;var ai,ap,am;var aj=(this.show)?true:false;for(var al=0;alao.max)||ao.max==null){ao.max=am[ak][0]}}else{if((am[ak][ah]!=null&&am[ak][ah]ao.max)||ao.max==null){ao.max=am[ak][an]}}}if(aj&&ap.renderer.constructor!==L.jqplot.BarRenderer){aj=false}else{if(aj&&this._options.hasOwnProperty("forceTickAt0")&&this._options.forceTickAt0==false){aj=false}else{if(aj&&ap.renderer.constructor===L.jqplot.BarRenderer){if(ap.barDirection=="vertical"&&this.name!="xaxis"&&this.name!="x2axis"){if(this._options.pad!=null||this._options.padMin!=null){aj=false}}else{if(ap.barDirection=="horizontal"&&(this.name=="xaxis"||this.name=="x2axis")){if(this._options.pad!=null||this._options.padMin!=null){aj=false}}}}}}}}if(aj&&this.renderer.constructor===L.jqplot.LinearAxisRenderer&&ao.min>=0){this.padMin=1;this.forceTickAt0=true}};function q(ah){L.jqplot.ElemContainer.call(this);this.show=false;this.location="ne";this.labels=[];this.showLabels=true;this.showSwatches=true;this.placement="insideGrid";this.xoffset=0;this.yoffset=0;this.border;this.background;this.textColor;this.fontFamily;this.fontSize;this.rowSpacing="0.5em";this.renderer=L.jqplot.TableLegendRenderer;this.rendererOptions={};this.preDraw=false;this.marginTop=null;this.marginRight=null;this.marginBottom=null;this.marginLeft=null;this.escapeHtml=false;this._series=[];L.extend(true,this,ah)}q.prototype=new L.jqplot.ElemContainer();q.prototype.constructor=q;q.prototype.setOptions=function(ah){L.extend(true,this,ah);if(this.placement=="inside"){this.placement="insideGrid"}if(this.xoffset>0){if(this.placement=="insideGrid"){switch(this.location){case"nw":case"w":case"sw":if(this.marginLeft==null){this.marginLeft=this.xoffset+"px"}this.marginRight="0px";break;case"ne":case"e":case"se":default:if(this.marginRight==null){this.marginRight=this.xoffset+"px"}this.marginLeft="0px";break}}else{if(this.placement=="outside"){switch(this.location){case"nw":case"w":case"sw":if(this.marginRight==null){this.marginRight=this.xoffset+"px"}this.marginLeft="0px";break;case"ne":case"e":case"se":default:if(this.marginLeft==null){this.marginLeft=this.xoffset+"px"}this.marginRight="0px";break}}}this.xoffset=0}if(this.yoffset>0){if(this.placement=="outside"){switch(this.location){case"sw":case"s":case"se":if(this.marginTop==null){this.marginTop=this.yoffset+"px"}this.marginBottom="0px";break;case"ne":case"n":case"nw":default:if(this.marginBottom==null){this.marginBottom=this.yoffset+"px"}this.marginTop="0px";break}}else{if(this.placement=="insideGrid"){switch(this.location){case"sw":case"s":case"se":if(this.marginBottom==null){this.marginBottom=this.yoffset+"px"}this.marginTop="0px";break;case"ne":case"n":case"nw":default:if(this.marginTop==null){this.marginTop=this.yoffset+"px"}this.marginBottom="0px";break}}}this.yoffset=0}};q.prototype.init=function(){if(L.isFunction(this.renderer)){this.renderer=new this.renderer()}this.renderer.init.call(this,this.rendererOptions)};q.prototype.draw=function(ai,aj){for(var ah=0;ah');this.target.append(az);az.height(aD);az.width(aA);az.css("top",this.eventCanvas._offsets.top);az.css("left",this.eventCanvas._offsets.left);var aC=L('
        ');az.append(aC);aC.html(this.noDataIndicator.indicator);var aB=aC.height();var ax=aC.width();aC.height(aB);aC.width(ax);aC.css("top",(aD-aB)/2+"px")})}}this.data=L.extend(true,[],ar);this.parseOptions(ay);if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(this.fontSize){this.target.css("font-size",this.fontSize)}this.title.init();this.legend.init();this._sumy=0;this._sumx=0;this.computePlotData();for(var at=0;at0){for(var aq=au;aq--;){var an=this._plotData[aq][ap][av];if(aw*an>=0){this._plotData[au][ap][av]+=an;this._stackData[au][ap][av]+=an;break}}}}}else{for(var ar=0;ar0){at._prevPlotData=this.series[au-1]._plotData}at._sumy=0;at._sumx=0;for(ar=at.data.length-1;ar>-1;ar--){at._sumy+=at.data[ar][1];at._sumx+=at.data[ar][0]}}};this.populatePlotData=function(au,av){this._plotData=[];this._stackData=[];au._stackData=[];au._plotData=[];var ay={x:[],y:[]};if(this.stackSeries&&!au.disableStack){au._stack=true;var ax=(au._stackAxis==="x")?0:1;var az=L.extend(true,[],au.data);var aA=L.extend(true,[],au.data);var an,am,ao,aw,al;for(var ar=0;ar=0){aA[aq][ax]+=aw}}}for(var at=0;at0){au._prevPlotData=this.series[av-1]._plotData}au._sumy=0;au._sumx=0;for(at=au.data.length-1;at>-1;at--){au._sumy+=au.data[at][1];au._sumx+=au.data[at][0]}};this.getNextSeriesColor=(function(am){var al=0;var an=am.seriesColors;return function(){if(al=0&&an>=0){al.top+=aK;al.bottom+=aK;al.left+=an;al.right+=an}}var am=["top","bottom","left","right"];for(var aB in am){if(this._gridPadding[am[aB]]==null&&al[am[aB]]>0){this._gridPadding[am[aB]]=al[am[aB]]}else{if(this._gridPadding[am[aB]]==null){this._gridPadding[am[aB]]=this._defaultGridPadding[am[aB]]}}}var aA=this._gridPadding;if(this.legend.placement==="outsideGrid"){aA={top:this.title.getHeight(),left:0,right:0,bottom:0};if(this.legend.location==="s"){aA.left=this._gridPadding.left;aA.right=this._gridPadding.right}}ar.xaxis.pack({position:"absolute",bottom:this._gridPadding.bottom-ar.xaxis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});ar.yaxis.pack({position:"absolute",top:0,left:this._gridPadding.left-ar.yaxis.getWidth(),height:this._height},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});ar.x2axis.pack({position:"absolute",top:this._gridPadding.top-ar.x2axis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});for(aH=8;aH>0;aH--){ar[aG[aH-1]].pack({position:"absolute",top:0,right:this._gridPadding.right-az[aH-1]},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top})}var au=(this._width-this._gridPadding.left-this._gridPadding.right)/2+this._gridPadding.left-ar.yMidAxis.getWidth()/2;ar.yMidAxis.pack({position:"absolute",top:0,left:au,zIndex:9,textAlign:"center"},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});this.target.append(this.grid.createElement(this._gridPadding,this));this.grid.draw();var aq=this.series;var aJ=aq.length;for(aH=0,aE=aJ;aHax)?av:ax;var ar=this.series[aw];var aq=this.series[au];if(aq.renderer.smooth){var ap=aq.renderer._smoothedData.slice(0).reverse()}else{var ap=aq.gridData.slice(0).reverse()}if(ar.renderer.smooth){var at=ar.renderer._smoothedData.concat(ap)}else{var at=ar.gridData.concat(ap)}var ao=(an.color!==null)?an.color:this.series[ax].fillColor;var ay=(an.baseSeries!==null)?an.baseSeries:aw;var am=this.series[ay].renderer.shapeRenderer;var al={fillStyle:ao,fill:true,closePath:true};am.draw(ar.shadowCanvas._ctx,at,al)};this.bindCustomEvents=function(){this.eventCanvas._elem.bind("click",{plot:this},this.onClick);this.eventCanvas._elem.bind("dblclick",{plot:this},this.onDblClick);this.eventCanvas._elem.bind("mousedown",{plot:this},this.onMouseDown);this.eventCanvas._elem.bind("mousemove",{plot:this},this.onMouseMove);this.eventCanvas._elem.bind("mouseenter",{plot:this},this.onMouseEnter);this.eventCanvas._elem.bind("mouseleave",{plot:this},this.onMouseLeave);if(this.captureRightClick){this.eventCanvas._elem.bind("mouseup",{plot:this},this.onRightClick);this.eventCanvas._elem.get(0).oncontextmenu=function(){return false}}else{this.eventCanvas._elem.bind("mouseup",{plot:this},this.onMouseUp)}};function ai(av){var au=av.data.plot;var ap=au.eventCanvas._elem.offset();var at={x:av.pageX-ap.left,y:av.pageY-ap.top};var aq={xaxis:null,yaxis:null,x2axis:null,y2axis:null,y3axis:null,y4axis:null,y5axis:null,y6axis:null,y7axis:null,y8axis:null,y9axis:null,yMidAxis:null};var ar=["xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"];var al=au.axes;var am,ao;for(am=11;am>0;am--){ao=ar[am-1];if(al[ao].show){aq[ao]=al[ao].series_p2u(at[ao.charAt(0)])}}return{offsets:ap,gridPos:at,dataPos:aq}}function ak(al,am){var aq=am.series;var aW,aU,aT,aO,aP,aJ,aI,aw,au,az,aA,aK;var aS,aX,aQ,ar,aH,aM,aV;var an,aN;for(aT=am.seriesStack.length-1;aT>=0;aT--){aW=am.seriesStack[aT];aO=aq[aW];aV=aO._highlightThreshold;switch(aO.renderer.constructor){case L.jqplot.BarRenderer:aJ=al.x;aI=al.y;for(aU=0;aUaH[0][0]&&aJaH[2][1]&&aIaH[0][0]+aV[0][0]&&aJaH[2][1]&&aI0&&-aI>=0){aw=2*Math.PI-Math.atan(-aI/aJ)}else{if(aJ>0&&-aI<0){aw=-Math.atan(-aI/aJ)}else{if(aJ<0){aw=Math.PI-Math.atan(-aI/aJ)}else{if(aJ==0&&-aI>0){aw=3*Math.PI/2}else{if(aJ==0&&-aI<0){aw=Math.PI/2}else{if(aJ==0&&aI==0){aw=0}}}}}}if(az){aw-=az;if(aw<0){aw+=2*Math.PI}else{if(aw>2*Math.PI){aw-=2*Math.PI}}}au=aO.sliceMargin/180*Math.PI;if(aPaO._innerRadius){for(aU=0;aU0)?aO.gridData[aU-1][1]+au:au;aK=aO.gridData[aU][1];if(aw>aA&&aw0&&-aI>=0){aw=2*Math.PI-Math.atan(-aI/aJ)}else{if(aJ>0&&-aI<0){aw=-Math.atan(-aI/aJ)}else{if(aJ<0){aw=Math.PI-Math.atan(-aI/aJ)}else{if(aJ==0&&-aI>0){aw=3*Math.PI/2}else{if(aJ==0&&-aI<0){aw=Math.PI/2}else{if(aJ==0&&aI==0){aw=0}}}}}}if(az){aw-=az;if(aw<0){aw+=2*Math.PI}else{if(aw>2*Math.PI){aw-=2*Math.PI}}}au=aO.sliceMargin/180*Math.PI;if(aP0)?aO.gridData[aU-1][1]+au:au;aK=aO.gridData[aU][1];if(aw>aA&&aw=ay[0][1]&&aI<=ay[3][1]&&aJ>=at[0]&&aJ<=aE[0]){return{seriesIndex:aO.index,pointIndex:aU,gridData:null,data:aO.data[aU]}}}break;case L.jqplot.LineRenderer:aJ=al.x;aI=al.y;aP=aO.renderer;if(aO.show){if((aO.fill||(aO.renderer.bands.show&&aO.renderer.bands.fill))&&(!am.plugins.highlighter||!am.plugins.highlighter.show)){var ax=false;if(aJ>aO._boundingBox[0][0]&&aJaO._boundingBox[1][1]&&aI=aI||aB[1]=aI){if(aC[0]+(aI-aC[1])/(aB[1]-aC[1])*(aB[0]-aC[0])0)?aN:0;for(var aU=0;aU=aQ[0]-aP._bodyWidth/2&&aJ<=aQ[0]+aP._bodyWidth/2&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{if(!aP.hlc){var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][1])&&aI<=av(aO.data[aU][2])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}else{if(aQ[0]!=null&&aQ[1]!=null){aX=Math.sqrt((aJ-aQ[0])*(aJ-aQ[0])+(aI-aQ[1])*(aI-aQ[1]));if(aX<=an&&(aX<=aS||aS==null)){aS=aX;return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}}}break;default:aJ=al.x;aI=al.y;aP=aO.renderer;if(aO.show){aN=aO.markerRenderer.size/2+aO.neighborThreshold;an=(aN>0)?aN:0;for(var aU=0;aU=aQ[0]-aP._bodyWidth/2&&aJ<=aQ[0]+aP._bodyWidth/2&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{if(!aP.hlc){var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][1])&&aI<=av(aO.data[aU][2])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}else{aX=Math.sqrt((aJ-aQ[0])*(aJ-aQ[0])+(aI-aQ[1])*(aI-aQ[1]));if(aX<=an&&(aX<=aS||aS==null)){aS=aX;return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}break}}return null}this.onClick=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotClick");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onDblClick=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotDblClick");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onMouseDown=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotMouseDown");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onMouseUp=function(an){var am=ai(an);var al=L.Event("jqplotMouseUp");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,null,an.data.plot])};this.onRightClick=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);if(ap.captureRightClick){if(an.which==3){var al=L.Event("jqplotRightClick");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])}else{var al=L.Event("jqplotMouseUp");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])}}};this.onMouseMove=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotMouseMove");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onMouseEnter=function(an){var am=ai(an);var ao=an.data.plot;var al=L.Event("jqplotMouseEnter");al.pageX=an.pageX;al.pageY=an.pageY;al.relatedTarget=an.relatedTarget;L(this).trigger(al,[am.gridPos,am.dataPos,null,ao])};this.onMouseLeave=function(an){var am=ai(an);var ao=an.data.plot;var al=L.Event("jqplotMouseLeave");al.pageX=an.pageX;al.pageY=an.pageY;al.relatedTarget=an.relatedTarget;L(this).trigger(al,[am.gridPos,am.dataPos,null,ao])};this.drawSeries=function(an,al){var ap,ao,am;al=(typeof(an)==="number"&&al==null)?an:al;an=(typeof(an)==="object")?an:{};if(al!=u){ao=this.series[al];am=ao.shadowCanvas._ctx;am.clearRect(0,0,am.canvas.width,am.canvas.height);ao.drawShadow(am,an,this);am=ao.canvas._ctx;am.clearRect(0,0,am.canvas.width,am.canvas.height);ao.draw(am,an,this);if(ao.renderer.constructor==L.jqplot.BezierCurveRenderer){if(al660)?ah[aj]*0.85:0.73*ah[aj]+90;ah[aj]=parseInt(ah[aj],10);(ah[aj]>255)?255:ah[aj]}ah[3]=0.3+0.35*al[3];ak.push("rgba("+ah[0]+","+ah[1]+","+ah[2]+","+ah[3]+")")}}else{var al=L.jqplot.getColorComponents(ai);var ah=[al[0],al[1],al[2]];var an=ah[0]+ah[1]+ah[2];for(var aj=0;aj<3;aj++){ah[aj]=(an>660)?ah[aj]*0.85:0.73*ah[aj]+90;ah[aj]=parseInt(ah[aj],10);(ah[aj]>255)?255:ah[aj]}ah[3]=0.3+0.35*al[3];ak="rgba("+ah[0]+","+ah[1]+","+ah[2]+","+ah[3]+")"}return ak};L.jqplot.ColorGenerator=function(ai){ai=ai||L.jqplot.config.defaultColors;var ah=0;this.next=function(){if(ah0){return ai[ah--]}else{ah=ai.length-1;return ai[ah]}};this.get=function(ak){var aj=ak-ai.length*Math.floor(ak/ai.length);return ai[aj]};this.setColors=function(aj){ai=aj};this.reset=function(){ah=0};this.getIndex=function(){return ah};this.setIndex=function(aj){ah=aj}};L.jqplot.hex2rgb=function(aj,ah){aj=aj.replace("#","");if(aj.length==3){aj=aj.charAt(0)+aj.charAt(0)+aj.charAt(1)+aj.charAt(1)+aj.charAt(2)+aj.charAt(2)}var ai;ai="rgba("+parseInt(aj.slice(0,2),16)+", "+parseInt(aj.slice(2,4),16)+", "+parseInt(aj.slice(4,6),16);if(ah){ai+=", "+ah}ai+=")";return ai};L.jqplot.rgb2hex=function(am){var aj=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/;var ah=am.match(aj);var al="#";for(var ak=1;ak<4;ak++){var ai;if(ah[ak].search(/%/)!=-1){ai=parseInt(255*ah[ak]/100,10).toString(16);if(ai.length==1){ai="0"+ai}}else{ai=parseInt(ah[ak],10).toString(16);if(ai.length==1){ai="0"+ai}}al+=ai}return al};L.jqplot.normalize2rgb=function(ai,ah){if(ai.search(/^ *rgba?\(/)!=-1){return ai}else{if(ai.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/)!=-1){return L.jqplot.hex2rgb(ai,ah)}else{throw new Error("Invalid color spec")}}};L.jqplot.getColorComponents=function(am){am=L.jqplot.colorKeywordMap[am]||am;var ak=L.jqplot.normalize2rgb(am);var aj=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/;var ah=ak.match(aj);var ai=[];for(var al=1;al<4;al++){if(ah[al].search(/%/)!=-1){ai[al-1]=parseInt(255*ah[al]/100,10)}else{ai[al-1]=parseInt(ah[al],10)}}ai[3]=parseFloat(ah[4])?parseFloat(ah[4]):1;return ai};L.jqplot.colorKeywordMap={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",aqua:"rgb( 0, 255, 255)",aquamarine:"rgb(127, 255, 212)",azure:"rgb(240, 255, 255)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",black:"rgb( 0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb( 0, 0, 255)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",burlywood:"rgb(222, 184, 135)",cadetblue:"rgb( 95, 158, 160)",chartreuse:"rgb(127, 255, 0)",chocolate:"rgb(210, 105, 30)",coral:"rgb(255, 127, 80)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",crimson:"rgb(220, 20, 60)",cyan:"rgb( 0, 255, 255)",darkblue:"rgb( 0, 0, 139)",darkcyan:"rgb( 0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgray:"rgb(169, 169, 169)",darkgreen:"rgb( 0, 100, 0)",darkgrey:"rgb(169, 169, 169)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb( 85, 107, 47)",darkorange:"rgb(255, 140, 0)",darkorchid:"rgb(153, 50, 204)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkslateblue:"rgb( 72, 61, 139)",darkslategray:"rgb( 47, 79, 79)",darkslategrey:"rgb( 47, 79, 79)",darkturquoise:"rgb( 0, 206, 209)",darkviolet:"rgb(148, 0, 211)",deeppink:"rgb(255, 20, 147)",deepskyblue:"rgb( 0, 191, 255)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb( 30, 144, 255)",firebrick:"rgb(178, 34, 34)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb( 34, 139, 34)",fuchsia:"rgb(255, 0, 255)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",goldenrod:"rgb(218, 165, 32)",gray:"rgb(128, 128, 128)",grey:"rgb(128, 128, 128)",green:"rgb( 0, 128, 0)",greenyellow:"rgb(173, 255, 47)",honeydew:"rgb(240, 255, 240)",hotpink:"rgb(255, 105, 180)",indianred:"rgb(205, 92, 92)",indigo:"rgb( 75, 0, 130)",ivory:"rgb(255, 255, 240)",khaki:"rgb(240, 230, 140)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lightblue:"rgb(173, 216, 230)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgray:"rgb(211, 211, 211)",lightgreen:"rgb(144, 238, 144)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightsalmon:"rgb(255, 160, 122)",lightseagreen:"rgb( 32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightyellow:"rgb(255, 255, 224)",lime:"rgb( 0, 255, 0)",limegreen:"rgb( 50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",maroon:"rgb(128, 0, 0)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb( 0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumpurple:"rgb(147, 112, 219)",mediumseagreen:"rgb( 60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb( 0, 250, 154)",mediumturquoise:"rgb( 72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb( 25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navy:"rgb( 0, 0, 128)",oldlace:"rgb(253, 245, 230)",olive:"rgb(128, 128, 0)",olivedrab:"rgb(107, 142, 35)",orange:"rgb(255, 165, 0)",orangered:"rgb(255, 69, 0)",orchid:"rgb(218, 112, 214)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",paleturquoise:"rgb(175, 238, 238)",palevioletred:"rgb(219, 112, 147)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",plum:"rgb(221, 160, 221)",powderblue:"rgb(176, 224, 230)",purple:"rgb(128, 0, 128)",red:"rgb(255, 0, 0)",rosybrown:"rgb(188, 143, 143)",royalblue:"rgb( 65, 105, 225)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb( 46, 139, 87)",seashell:"rgb(255, 245, 238)",sienna:"rgb(160, 82, 45)",silver:"rgb(192, 192, 192)",skyblue:"rgb(135, 206, 235)",slateblue:"rgb(106, 90, 205)",slategray:"rgb(112, 128, 144)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",springgreen:"rgb( 0, 255, 127)",steelblue:"rgb( 70, 130, 180)",tan:"rgb(210, 180, 140)",teal:"rgb( 0, 128, 128)",thistle:"rgb(216, 191, 216)",tomato:"rgb(255, 99, 71)",turquoise:"rgb( 64, 224, 208)",violet:"rgb(238, 130, 238)",wheat:"rgb(245, 222, 179)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellowgreen:"rgb(154, 205, 50)"};L.jqplot.AxisLabelRenderer=function(ah){L.jqplot.ElemContainer.call(this);this.axis;this.show=true;this.label="";this.fontFamily=null;this.fontSize=null;this.textColor=null;this._elem;this.escapeHTML=false;L.extend(true,this,ah)};L.jqplot.AxisLabelRenderer.prototype=new L.jqplot.ElemContainer();L.jqplot.AxisLabelRenderer.prototype.constructor=L.jqplot.AxisLabelRenderer;L.jqplot.AxisLabelRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.AxisLabelRenderer.prototype.draw=function(ah,ai){if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=L('
        ');if(Number(this.label)){this._elem.css("white-space","nowrap")}if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}return this._elem};L.jqplot.AxisLabelRenderer.prototype.pack=function(){};L.jqplot.AxisTickRenderer=function(ah){L.jqplot.ElemContainer.call(this);this.mark="outside";this.axis;this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.size=4;this.markSize=6;this.show=true;this.showLabel=true;this.label=null;this.value=null;this._styles={};this.formatter=L.jqplot.DefaultTickFormatter;this.prefix="";this.suffix="";this.formatString="";this.fontFamily;this.fontSize;this.textColor;this.escapeHTML=false;this._elem;this._breakTick=false;L.extend(true,this,ah)};L.jqplot.AxisTickRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.AxisTickRenderer.prototype=new L.jqplot.ElemContainer();L.jqplot.AxisTickRenderer.prototype.constructor=L.jqplot.AxisTickRenderer;L.jqplot.AxisTickRenderer.prototype.setTick=function(ah,aj,ai){this.value=ah;this.axis=aj;if(ai){this.isMinorTick=true}return this};L.jqplot.AxisTickRenderer.prototype.draw=function(){if(this.label===null){this.label=this.prefix+this.formatter(this.formatString,this.value)+this.suffix}var ai={position:"absolute"};if(Number(this.label)){ai.whitSpace="nowrap"}if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=L(document.createElement("div"));this._elem.addClass("jqplot-"+this.axis+"-tick");if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}this._elem.css(ai);for(var ah in this._styles){this._elem.css(ah,this._styles[ah])}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}if(this._breakTick){this._elem.addClass("jqplot-breakTick")}return this._elem};L.jqplot.DefaultTickFormatter=function(ah,ai){if(typeof ai=="number"){if(!ah){ah=L.jqplot.config.defaultTickFormatString}return L.jqplot.sprintf(ah,ai)}else{return String(ai)}};L.jqplot.PercentTickFormatter=function(ah,ai){if(typeof ai=="number"){ai=100*ai;if(!ah){ah=L.jqplot.config.defaultTickFormatString}return L.jqplot.sprintf(ah,ai)}else{return String(ai)}};L.jqplot.AxisTickRenderer.prototype.pack=function(){};L.jqplot.CanvasGridRenderer=function(){this.shadowRenderer=new L.jqplot.ShadowRenderer()};L.jqplot.CanvasGridRenderer.prototype.init=function(ai){this._ctx;L.extend(true,this,ai);var ah={lineJoin:"miter",lineCap:"round",fill:false,isarc:false,angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.shadowWidth,closePath:false,strokeStyle:this.shadowColor};this.renderer.shadowRenderer.init(ah)};L.jqplot.CanvasGridRenderer.prototype.createElement=function(ak){var aj;if(this._elem){if(L.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==u){aj=this._elem.get(0);window.G_vmlCanvasManager.uninitElement(aj);aj=null}this._elem.emptyForce();this._elem=null}aj=ak.canvasManager.getCanvas();var ah=this._plotDimensions.width;var ai=this._plotDimensions.height;aj.width=ah;aj.height=ai;this._elem=L(aj);this._elem.addClass("jqplot-grid-canvas");this._elem.css({position:"absolute",left:0,top:0});aj=ak.canvasManager.initCanvas(aj);this._top=this._offsets.top;this._bottom=ai-this._offsets.bottom;this._left=this._offsets.left;this._right=ah-this._offsets.right;this._width=this._right-this._left;this._height=this._bottom-this._top;aj=null;return this._elem};L.jqplot.CanvasGridRenderer.prototype.draw=function(){this._ctx=this._elem.get(0).getContext("2d");var at=this._ctx;var aw=this._axes;at.save();at.clearRect(0,0,this._plotDimensions.width,this._plotDimensions.height);at.fillStyle=this.backgroundColor||this.background;at.fillRect(this._left,this._top,this._width,this._height);at.save();at.lineJoin="miter";at.lineCap="butt";at.lineWidth=this.gridLineWidth;at.strokeStyle=this.gridLineColor;var aA,az,ap,aq;var am=["xaxis","yaxis","x2axis","y2axis"];for(var ay=4;ay>0;ay--){var aD=am[ay-1];var ah=aw[aD];var aB=ah._ticks;var ar=aB.length;if(ah.show){if(ah.drawBaseline){var aC={};if(ah.baselineWidth!==null){aC.lineWidth=ah.baselineWidth}if(ah.baselineColor!==null){aC.strokeStyle=ah.baselineColor}switch(aD){case"xaxis":ao(this._left,this._bottom,this._right,this._bottom,aC);break;case"yaxis":ao(this._left,this._bottom,this._left,this._top,aC);break;case"x2axis":ao(this._left,this._bottom,this._right,this._bottom,aC);break;case"y2axis":ao(this._right,this._bottom,this._right,this._top,aC);break}}for(var au=ar;au>0;au--){var an=aB[au-1];if(an.show){var ak=Math.round(ah.u2p(an.value))+0.5;switch(aD){case"xaxis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(ak,this._top,ak,this._bottom)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._bottom;az=this._bottom+ap;break;case"inside":aA=this._bottom-ap;az=this._bottom;break;case"cross":aA=this._bottom-ap;az=this._bottom+ap;break;default:aA=this._bottom;az=this._bottom+ap;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[ak,aA],[ak,az]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}ao(ak,aA,ak,az)}break;case"yaxis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(this._right,ak,this._left,ak)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._left-ap;az=this._left;break;case"inside":aA=this._left;az=this._left+ap;break;case"cross":aA=this._left-ap;az=this._left+ap;break;default:aA=this._left-ap;az=this._left;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[aA,ak],[az,ak]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ao(aA,ak,az,ak,{strokeStyle:ah.borderColor})}break;case"x2axis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(ak,this._bottom,ak,this._top)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._top-ap;az=this._top;break;case"inside":aA=this._top;az=this._top+ap;break;case"cross":aA=this._top-ap;az=this._top+ap;break;default:aA=this._top-ap;az=this._top;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[ak,aA],[ak,az]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}ao(ak,aA,ak,az)}break;case"y2axis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(this._left,ak,this._right,ak)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._right;az=this._right+ap;break;case"inside":aA=this._right-ap;az=this._right;break;case"cross":aA=this._right-ap;az=this._right+ap;break;default:aA=this._right;az=this._right+ap;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[aA,ak],[az,ak]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ao(aA,ak,az,ak,{strokeStyle:ah.borderColor})}break;default:break}}}an=null}ah=null;aB=null}am=["y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"];for(var ay=7;ay>0;ay--){var ah=aw[am[ay-1]];var aB=ah._ticks;if(ah.show){var ai=aB[ah.numberTicks-1];var al=aB[0];var aj=ah.getLeft();var av=[[aj,ai.getTop()+ai.getHeight()/2],[aj,al.getTop()+al.getHeight()/2+1]];if(this.shadow){this.renderer.shadowRenderer.draw(at,av,{lineCap:"butt",fill:false,closePath:false})}ao(av[0][0],av[0][1],av[1][0],av[1][1],{lineCap:"butt",strokeStyle:ah.borderColor,lineWidth:ah.borderWidth});for(var au=aB.length;au>0;au--){var an=aB[au-1];ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;if(an.showMark&&an.mark){switch(aq){case"outside":aA=aj;az=aj+ap;break;case"inside":aA=aj-ap;az=aj;break;case"cross":aA=aj-ap;az=aj+ap;break;default:aA=aj;az=aj+ap;break}av=[[aA,ak],[az,ak]];if(this.shadow){this.renderer.shadowRenderer.draw(at,av,{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ao(aA,ak,az,ak,{strokeStyle:ah.borderColor})}an=null}al=null}ah=null;aB=null}at.restore();function ao(aH,aG,aE,ax,aF){at.save();aF=aF||{};if(aF.lineWidth==null||aF.lineWidth!=0){L.extend(true,at,aF);at.beginPath();at.moveTo(aH,aG);at.lineTo(aE,ax);at.stroke();at.restore()}}if(this.shadow){var av=[[this._left,this._bottom],[this._right,this._bottom],[this._right,this._top]];this.renderer.shadowRenderer.draw(at,av)}if(this.borderWidth!=0&&this.drawBorder){ao(this._left,this._top,this._right,this._top,{lineCap:"round",strokeStyle:aw.x2axis.borderColor,lineWidth:aw.x2axis.borderWidth});ao(this._right,this._top,this._right,this._bottom,{lineCap:"round",strokeStyle:aw.y2axis.borderColor,lineWidth:aw.y2axis.borderWidth});ao(this._right,this._bottom,this._left,this._bottom,{lineCap:"round",strokeStyle:aw.xaxis.borderColor,lineWidth:aw.xaxis.borderWidth});ao(this._left,this._bottom,this._left,this._top,{lineCap:"round",strokeStyle:aw.yaxis.borderColor,lineWidth:aw.yaxis.borderWidth})}at.restore();at=null;aw=null};L.jqplot.DivTitleRenderer=function(){};L.jqplot.DivTitleRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.DivTitleRenderer.prototype.draw=function(){if(this._elem){this._elem.emptyForce();this._elem=null}var ak=this.renderer;var aj=document.createElement("div");this._elem=L(aj);this._elem.addClass("jqplot-title");if(!this.text){this.show=false;this._elem.height(0);this._elem.width(0)}else{if(this.text){var ah;if(this.color){ah=this.color}else{if(this.textColor){ah=this.textColor}}var ai={position:"absolute",top:"0px",left:"0px"};if(this._plotWidth){ai.width=this._plotWidth+"px"}if(this.fontSize){ai.fontSize=this.fontSize}if(typeof this.textAlign==="string"){ai.textAlign=this.textAlign}else{ai.textAlign="center"}if(ah){ai.color=ah}if(this.paddingBottom){ai.paddingBottom=this.paddingBottom}if(this.fontFamily){ai.fontFamily=this.fontFamily}this._elem.css(ai);if(this.escapeHtml){this._elem.text(this.text)}else{this._elem.html(this.text)}}}aj=null;return this._elem};L.jqplot.DivTitleRenderer.prototype.pack=function(){};var r=0.1;L.jqplot.LinePattern=function(aw,aq){var ap={dotted:[r,L.jqplot.config.dotGapLength],dashed:[L.jqplot.config.dashLength,L.jqplot.config.gapLength],solid:null};if(typeof aq==="string"){if(aq[0]==="."||aq[0]==="-"){var ax=aq;aq=[];for(var ao=0,al=ax.length;ao0)&&(aC>0)){aA/=aB;az/=aB;while(true){var aD=aC*ar;if(aD=aq.length){ak=0}ar=aq[ak]}else{au=ay;at=aE;if((ak&1)==0){aw.lineTo(au,at)}else{aw.moveTo(au,at)}ar-=aB/aC;break}}}};var ai=function(){aw.beginPath()};var am=function(){aj(an,ah)};return{moveTo:av,lineTo:aj,beginPath:ai,closePath:am}};L.jqplot.LineRenderer=function(){this.shapeRenderer=new L.jqplot.ShapeRenderer();this.shadowRenderer=new L.jqplot.ShadowRenderer()};L.jqplot.LineRenderer.prototype.init=function(ai,an){ai=ai||{};this._type="line";this.renderer.animation={show:false,direction:"left",speed:2500,_supported:true};this.renderer.smooth=false;this.renderer.tension=null;this.renderer.constrainSmoothing=true;this.renderer._smoothedData=[];this.renderer._smoothedPlotData=[];this.renderer._hiBandGridData=[];this.renderer._lowBandGridData=[];this.renderer._hiBandSmoothedData=[];this.renderer._lowBandSmoothedData=[];this.renderer.bandData=[];this.renderer.bands={show:false,hiData:[],lowData:[],color:this.color,showLines:false,fill:true,fillColor:null,_min:null,_max:null,interval:"3%"};var al={highlightMouseOver:ai.highlightMouseOver,highlightMouseDown:ai.highlightMouseDown,highlightColor:ai.highlightColor};delete (ai.highlightMouseOver);delete (ai.highlightMouseDown);delete (ai.highlightColor);L.extend(true,this.renderer,ai);this.renderer.options=ai;if(this.renderer.bandData.length>1&&(!ai.bands||ai.bands.show==null)){this.renderer.bands.show=true}else{if(ai.bands&&ai.bands.show==null&&ai.bands.interval!=null){this.renderer.bands.show=true}}if(this.fill){this.renderer.bands.show=false}if(this.renderer.bands.show){this.renderer.initBands.call(this,this.renderer.options,an)}if(this._stack){this.renderer.smooth=false}var am={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:false,strokeStyle:this.color,fillStyle:this.fillColor,lineWidth:this.lineWidth,linePattern:this.linePattern,closePath:this.fill};this.renderer.shapeRenderer.init(am);var aj=ai.shadowOffset;if(aj==null){if(this.lineWidth>2.5){aj=1.25*(1+(Math.atan((this.lineWidth/2.5))/0.785398163-1)*0.6)}else{aj=1.25*Math.atan((this.lineWidth/2.5))/0.785398163}}var ah={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:false,angle:this.shadowAngle,offset:aj,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.lineWidth,linePattern:this.linePattern,closePath:this.fill};this.renderer.shadowRenderer.init(ah);this._areaPoints=[];this._boundingBox=[[],[]];if(!this.isTrendline&&this.fill||this.renderer.bands.show){this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColor=null;if(al.highlightMouseDown&&al.highlightMouseOver==null){al.highlightMouseOver=false}L.extend(true,this,{highlightMouseOver:al.highlightMouseOver,highlightMouseDown:al.highlightMouseDown,highlightColor:al.highlightColor});if(!this.highlightColor){var ak=(this.renderer.bands.show)?this.renderer.bands.fillColor:this.fillColor;this.highlightColor=L.jqplot.computeHighlightColors(ak)}if(this.highlighter){this.highlighter.show=false}}if(!this.isTrendline&&an){an.plugins.lineRenderer={};an.postInitHooks.addOnce(z);an.postDrawHooks.addOnce(af);an.eventListenerHooks.addOnce("jqplotMouseMove",h);an.eventListenerHooks.addOnce("jqplotMouseDown",e);an.eventListenerHooks.addOnce("jqplotMouseUp",ad);an.eventListenerHooks.addOnce("jqplotClick",g);an.eventListenerHooks.addOnce("jqplotRightClick",s)}};L.jqplot.LineRenderer.prototype.initBands=function(ak,av){var al=ak.bandData||[];var an=this.renderer.bands;an.hiData=[];an.lowData=[];var aB=this.data;an._max=null;an._min=null;if(al.length==2){if(L.isArray(al[0][0])){var ao;var ah=0,ar=0;for(var aw=0,at=al[0].length;awan._max)||an._max==null){an._max=ao[1]}if((ao[1]!=null&&ao[1]an._max)||an._max==null){an._max=ao[1];ar=1}if((ao[1]!=null&&ao[1]al[1][0])?0:1;var aC=(aj)?0:1;for(var aw=0,at=aB.length;aw2&&!L.isArray(al[0][0])){var aj=(al[0][0]>al[0][1])?0:1;var aC=(aj)?0:1;for(var aw=0,at=al.length;awan._max)||an._max==null){an._max=am[aw][1]}}for(var aw=0,at=ap.length;aw0){aR=Math.abs((ap[aQ][1]-ap[aQ-1][1])/(ap[aQ][0]-ap[aQ-1][0]))}am=aR/aG+aE;aM=aF*A(am)-aF*A(aE)+aS;aT=(aO+aM)/2}else{aT=aU}for(aK=0;aK2){var ao;if(this.renderer.constrainSmoothing){ao=J.call(this,this.gridData);this.renderer._smoothedData=ao[0];this.renderer._smoothedPlotData=ao[1];if(ak.show){ao=J.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ao[0];ao=J.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ao[0]}ao=null}else{ao=F.call(this,this.gridData);this.renderer._smoothedData=ao[0];this.renderer._smoothedPlotData=ao[1];if(ak.show){ao=F.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ao[0];ao=F.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ao[0]}ao=null}}};L.jqplot.LineRenderer.prototype.makeGridData=function(ao,aq){var am=this._xaxis.series_u2p;var ah=this._yaxis.series_u2p;var ar=[];var aj=[];this.renderer._smoothedData=[];this.renderer._smoothedPlotData=[];this.renderer._hiBandGridData=[];this.renderer._lowBandGridData=[];this.renderer._hiBandSmoothedData=[];this.renderer._lowBandSmoothedData=[];var al=this.renderer.bands;var ai=false;for(var an=0;an2){var ap;if(this.renderer.constrainSmoothing){ap=J.call(this,ar);this.renderer._smoothedData=ap[0];this.renderer._smoothedPlotData=ap[1];if(al.show){ap=J.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ap[0];ap=J.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ap[0]}ap=null}else{ap=F.call(this,ar);this.renderer._smoothedData=ap[0];this.renderer._smoothedPlotData=ap[1];if(al.show){ap=F.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ap[0];ap=F.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ap[0]}ap=null}}return ar};L.jqplot.LineRenderer.prototype.draw=function(ax,aI,ai,aB){var aC;var aq=L.extend(true,{},ai);var ak=(aq.shadow!=u)?aq.shadow:this.shadow;var aJ=(aq.showLine!=u)?aq.showLine:this.showLine;var aA=(aq.fill!=u)?aq.fill:this.fill;var ah=(aq.fillAndStroke!=u)?aq.fillAndStroke:this.fillAndStroke;var ar,ay,av,aE;ax.save();if(aI.length){if(aJ){if(aA){if(this.fillToZero){var aF=this.negativeColor;if(!this.useNegativeColors){aF=aq.fillStyle}var ao=false;var ap=aq.fillStyle;if(ah){var aH=aI.slice(0)}if(this.index==0||!this._stack){var aw=[];var aL=(this.renderer.smooth)?this.renderer._smoothedPlotData:this._plotData;this._areaPoints=[];var aG=this._yaxis.series_u2p(this.fillToValue);var aj=this._xaxis.series_u2p(this.fillToValue);aq.closePath=true;if(this.fillAxis=="y"){aw.push([aI[0][0],aG]);this._areaPoints.push([aI[0][0],aG]);for(var aC=0;aC0;aC--){aI.push(au[aC-1])}if(ak){this.renderer.shadowRenderer.draw(ax,aI,aq)}this._areaPoints=aI;this.renderer.shapeRenderer.draw(ax,aI,aq)}}else{if(ah){var aH=aI.slice(0)}if(this.index==0||!this._stack){var al=ax.canvas.height;aI.unshift([aI[0][0],al]);var aD=aI.length;aI.push([aI[aD-1][0],al])}else{var au=this._prevGridData;for(var aC=au.length;aC>0;aC--){aI.push(au[aC-1])}}this._areaPoints=aI;if(ak){this.renderer.shadowRenderer.draw(ax,aI,aq)}this.renderer.shapeRenderer.draw(ax,aI,aq)}if(ah){var az=L.extend(true,{},aq,{fill:false,closePath:false});this.renderer.shapeRenderer.draw(ax,aH,az);if(this.markerRenderer.show){if(this.renderer.smooth){aH=this.gridData}for(aC=0;aCat[0]||ar==null){ar=at[0]}if(aEat[1]||ay==null){ay=at[1]}}if(this.type==="line"&&this.renderer.bands.show){aE=this._yaxis.series_u2p(this.renderer.bands._min);ay=this._yaxis.series_u2p(this.renderer.bands._max)}this._boundingBox=[[ar,aE],[av,ay]];if(this.markerRenderer.show&&!aA){if(this.renderer.smooth){aI=this.gridData}for(aC=0;aCao){ao=aj}}}al=null;am=null;if(ah){ai=this._label._elem.outerWidth(true);an=this._label._elem.outerHeight(true)}if(this.name=="xaxis"){ao=ao+an;this._elem.css({height:ao+"px",left:"0px",bottom:"0px"})}else{if(this.name=="x2axis"){ao=ao+an;this._elem.css({height:ao+"px",left:"0px",top:"0px"})}else{if(this.name=="yaxis"){ao=ao+ai;this._elem.css({width:ao+"px",left:"0px",top:"0px"});if(ah&&this._label.constructor==L.jqplot.AxisLabelRenderer){this._label._elem.css("width",ai+"px")}}else{ao=ao+ai;this._elem.css({width:ao+"px",right:"0px",top:"0px"});if(ah&&this._label.constructor==L.jqplot.AxisLabelRenderer){this._label._elem.css("width",ai+"px")}}}}}};L.jqplot.LinearAxisRenderer.prototype.createTicks=function(aj){var aT=this._ticks;var aK=this.ticks;var az=this.name;var aB=this._dataBounds;var ah=(this.name.charAt(0)==="x")?this._plotDimensions.width:this._plotDimensions.height;var an;var a6,aI;var ap,ao;var a4,a0;var aH=this.min;var a5=this.max;var aW=this.numberTicks;var ba=this.tickInterval;var am=30;this._scalefact=(Math.max(ah,am+1)-am)/300;if(aK.length){for(a0=0;a0this.breakPoints[0]&&aO[0]<=this.breakPoints[1]){aU.show=false;aU.showGridline=false;aU.label=aO[1]}else{aU.label=aO[1]}}}else{aU.label=aO[1]}aU.setTick(aO[0],this.name);this._ticks.push(aU)}else{if(L.isPlainObject(aO)){L.extend(true,aU,aO);aU.axis=this.name;this._ticks.push(aU)}else{aU.value=aO;if(this.breakPoints){if(aO==this.breakPoints[0]){aU.label=this.breakTickLabel;aU._breakTick=true;aU.showGridline=false;aU.showMark=false}else{if(aO>this.breakPoints[0]&&aO<=this.breakPoints[1]){aU.show=false;aU.showGridline=false}}}aU.setTick(aO,this.name);this._ticks.push(aU)}}}this.numberTicks=aK.length;this.min=this._ticks[0].value;this.max=this._ticks[this.numberTicks-1].value;this.tickInterval=(this.max-this.min)/(this.numberTicks-1)}else{if(az=="xaxis"||az=="x2axis"){ah=this._plotDimensions.width}else{ah=this._plotDimensions.height}var ax=this.numberTicks;if(this.alignTicks){if(this.name==="x2axis"&&aj.axes.xaxis.show){ax=aj.axes.xaxis.numberTicks}else{if(this.name.charAt(0)==="y"&&this.name!=="yaxis"&&this.name!=="yMidAxis"&&aj.axes.yaxis.show){ax=aj.axes.yaxis.numberTicks}}}a6=((this.min!=null)?this.min:aB.min);aI=((this.max!=null)?this.max:aB.max);var av=aI-a6;var aS,ay;var at;if(this.tickOptions==null||!this.tickOptions.formatString){this._overrideFormatString=true}if(this.min==null||this.max==null&&this.tickInterval==null&&!this.autoscale){if(this.forceTickAt0){if(a6>0){a6=0}if(aI<0){aI=0}}if(this.forceTickAt100){if(a6>100){a6=100}if(aI<100){aI=100}}var aE=false,a1=false;if(this.min!=null){aE=true}else{if(this.max!=null){a1=true}}var aP=L.jqplot.LinearTickGenerator(a6,aI,this._scalefact,ax,aE,a1);var aw=(this.min!=null)?a6:a6+av*(this.padMin-1);var aQ=(this.max!=null)?aI:aI-av*(this.padMax-1);if(a6aQ){aw=(this.min!=null)?a6:a6-av*(this.padMin-1);aQ=(this.max!=null)?aI:aI+av*(this.padMax-1);aP=L.jqplot.LinearTickGenerator(aw,aQ,this._scalefact,ax,aE,a1)}this.min=aP[0];this.max=aP[1];this.numberTicks=aP[2];this._autoFormatString=aP[3];this.tickInterval=aP[4]}else{if(a6==aI){var ai=0.05;if(a6>0){ai=Math.max(Math.log(a6)/Math.LN10,0.05)}a6-=ai;aI+=ai}if(this.autoscale&&this.min==null&&this.max==null){var ak,al,ar;var aC=false;var aN=false;var aA={min:null,max:null,average:null,stddev:null};for(var a0=0;a0a2){a2=aR[aZ]}}}var au=(a2-aG)/a2;if(aV.renderer.constructor==L.jqplot.BarRenderer){if(aG>=0&&(aV.fillToZero||au>0.1)){aC=true}else{aC=false;if(aV.fill&&aV.fillToZero&&aG<0&&a2>0){aN=true}else{aN=false}}}else{if(aV.fill){if(aG>=0&&(aV.fillToZero||au>0.1)){aC=true}else{if(aG<0&&a2>0&&aV.fillToZero){aC=false;aN=true}else{aC=false;aN=false}}}else{if(aG<0){aC=false}}}}}if(aC){this.numberTicks=2+Math.ceil((ah-(this.tickSpacing-1))/this.tickSpacing);this.min=0;aH=0;al=aI/(this.numberTicks-1);at=Math.pow(10,Math.abs(Math.floor(Math.log(al)/Math.LN10)));if(al/at==parseInt(al/at,10)){al+=at}this.tickInterval=Math.ceil(al/at)*at;this.max=this.tickInterval*(this.numberTicks-1)}else{if(aN){this.numberTicks=2+Math.ceil((ah-(this.tickSpacing-1))/this.tickSpacing);var aJ=Math.ceil(Math.abs(a6)/av*(this.numberTicks-1));var a9=this.numberTicks-1-aJ;al=Math.max(Math.abs(a6/aJ),Math.abs(aI/a9));at=Math.pow(10,Math.abs(Math.floor(Math.log(al)/Math.LN10)));this.tickInterval=Math.ceil(al/at)*at;this.max=this.tickInterval*a9;this.min=-this.tickInterval*aJ}else{if(this.numberTicks==null){if(this.tickInterval){this.numberTicks=3+Math.ceil(av/this.tickInterval)}else{this.numberTicks=2+Math.ceil((ah-(this.tickSpacing-1))/this.tickSpacing)}}if(this.tickInterval==null){al=av/(this.numberTicks-1);if(al<1){at=Math.pow(10,Math.abs(Math.floor(Math.log(al)/Math.LN10)))}else{at=1}this.tickInterval=Math.ceil(al*at*this.pad)/at}else{at=1/this.tickInterval}ak=this.tickInterval*(this.numberTicks-1);ar=(ak-av)/2;if(this.min==null){this.min=Math.floor(at*(a6-ar))/at}if(this.max==null){this.max=this.min+ak}}}var aF=L.jqplot.getSignificantFigures(this.tickInterval);var aM;if(aF.digitsLeft>=aF.significantDigits){aM="%d"}else{var at=Math.max(0,5-aF.digitsLeft);at=Math.min(at,aF.digitsRight);aM="%."+at+"f"}this._autoFormatString=aM}else{aS=(this.min!=null)?this.min:a6-av*(this.padMin-1);ay=(this.max!=null)?this.max:aI+av*(this.padMax-1);av=ay-aS;if(this.numberTicks==null){if(this.tickInterval!=null){this.numberTicks=Math.ceil((ay-aS)/this.tickInterval)+1}else{if(ah>100){this.numberTicks=parseInt(3+(ah-100)/75,10)}else{this.numberTicks=2}}}if(this.tickInterval==null){this.tickInterval=av/(this.numberTicks-1)}if(this.max==null){ay=aS+this.tickInterval*(this.numberTicks-1)}if(this.min==null){aS=ay-this.tickInterval*(this.numberTicks-1)}var aF=L.jqplot.getSignificantFigures(this.tickInterval);var aM;if(aF.digitsLeft>=aF.significantDigits){aM="%d"}else{var at=Math.max(0,5-aF.digitsLeft);at=Math.min(at,aF.digitsRight);aM="%."+at+"f"}this._autoFormatString=aM;this.min=aS;this.max=ay}if(this.renderer.constructor==L.jqplot.LinearAxisRenderer&&this._autoFormatString==""){av=this.max-this.min;var a7=new this.tickRenderer(this.tickOptions);var aL=a7.formatString||L.jqplot.config.defaultTickFormatString;var aL=aL.match(L.jqplot.sprintf.regex)[0];var a3=0;if(aL){if(aL.search(/[fFeEgGpP]/)>-1){var aY=aL.match(/\%\.(\d{0,})?[eEfFgGpP]/);if(aY){a3=parseInt(aY[1],10)}else{a3=6}}else{if(aL.search(/[di]/)>-1){a3=0}}var aq=Math.pow(10,-a3);if(this.tickIntervalthis.breakPoints[0]&&aAthis.breakPoints[0]&&aAthis.breakPoints[0]&&aA=this.breakPoints[1]){return(aA-au)*ak/al}else{return(aA+this.breakPoints[1]-this.breakPoints[0]-au)*ak/al}};this.series_p2u=function(aA){return aA*al/ak+au}}}else{this.p2u=function(aA){return(aA-am)*al/ak+at};this.u2p=function(aA){return(aA-at)*ak/al+am};if(this.name=="xaxis"||this.name=="x2axis"){this.series_u2p=function(aA){return(aA-at)*ak/al};this.series_p2u=function(aA){return aA*al/ak+at}}else{this.series_u2p=function(aA){return(aA-au)*ak/al};this.series_p2u=function(aA){return aA*al/ak+au}}}if(this.show){if(this.name=="xaxis"||this.name=="x2axis"){for(var av=0;av0){ah=-ap._textRenderer.height*Math.cos(-ap._textRenderer.angle)/2}else{ah=-ap.getHeight()+ap._textRenderer.height*Math.cos(ap._textRenderer.angle)/2}break;case"middle":ah=-ap.getHeight()/2;break;default:ah=-ap.getHeight()/2;break}}else{ah=-ap.getHeight()/2}var az=this.u2p(ap.value)+ah+"px";ap._elem.css("top",az);ap.pack()}}if(aq){var aw=this._label._elem.outerHeight(true);this._label._elem.css("top",ao-ak/2-aw/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px")}else{this._label._elem.css("right","0px")}this._label.pack()}}}ay=null};function i(ai){var ah;ai=Math.abs(ai);if(ai>=10){ah="%d"}else{if(ai>1){if(ai===parseInt(ai,10)){ah="%d"}else{ah="%.1f"}}else{var aj=-Math.floor(Math.log(ai)/Math.LN10);ah="%."+aj+"f"}}return ah}var b=[0.1,0.2,0.3,0.4,0.5,0.8,1,2,3,4,5];var c=function(ai){var ah=b.indexOf(ai);if(ah>0){return b[ah-1]}else{return b[b.length-1]/100}};var k=function(ai){var ah=b.indexOf(ai);if(ah5){ah=10*aj}else{if(am>2){ah=5*aj}else{if(am>1){ah=2*aj}else{ah=aj}}}}else{if(am>5){ah=10*aj}else{if(am>4){ah=5*aj}else{if(am>3){ah=4*aj}else{if(am>2){ah=3*aj}else{if(am>1){ah=2*aj}else{ah=aj}}}}}}return ah}function Q(ai,ah){ah=ah||1;var ak=Math.floor(Math.log(ai)/Math.LN10);var am=Math.pow(10,ak);var al=ai/am;var aj;al=al/ah;if(al<=0.38){aj=0.1}else{if(al<=1.6){aj=0.2}else{if(al<=4){aj=0.5}else{if(al<=8){aj=1}else{if(al<=16){aj=2}else{aj=5}}}}}return aj*am}function x(aj,ai){var al=Math.floor(Math.log(aj)/Math.LN10);var an=Math.pow(10,al);var am=aj/an;var ah;var ak;am=am/ai;if(am<=0.38){ak=0.1}else{if(am<=1.6){ak=0.2}else{if(am<=4){ak=0.5}else{if(am<=8){ak=1}else{if(am<=16){ak=2}else{ak=5}}}}}ah=ak*an;return[ah,ak,an]}L.jqplot.LinearTickGenerator=function(an,aq,aj,ak,ao,ar){ao=(ao===null)?false:ao;ar=(ar===null||ao)?false:ar;if(an===aq){aq=(aq)?0:1}aj=aj||1;if(aqat){at=aB}if(ai>aA){aA=ai}})}an.width=at+Number(av);an.height=aA+Number(ax);var ak=an.getContext("2d");ak.save();ak.fillStyle=al;ak.fillRect(0,0,an.width,an.height);ak.restore();ak.translate(au,ar);ak.textAlign="left";ak.textBaseline="top";function aC(aE){var aF=parseInt(L(aE).css("line-height"),10);if(isNaN(aF)){aF=parseInt(L(aE).css("font-size"),10)*1.2}return aF}function aD(aF,aE,aS,aG,aO,aH){var aQ=aC(aF);var aK=L(aF).innerWidth();var aL=L(aF).innerHeight();var aN=aS.split(/\s+/);var aR=aN.length;var aP="";var aM=[];var aU=aO;var aT=aG;for(var aJ=0;aJaK){aM.push(aJ);aP="";aJ--}}if(aM.length===0){if(L(aF).css("textAlign")==="center"){aT=aG+(aH-aE.measureText(aP).width)/2-au}aE.fillText(aS,aT,aO)}else{aP=aN.slice(0,aM[0]).join(" ");if(L(aF).css("textAlign")==="center"){aT=aG+(aH-aE.measureText(aP).width)/2-au}aE.fillText(aP,aT,aU);aU+=aQ;for(var aJ=1,aI=aM.length;aJ0){ak.strokeRect(aI,aL,L(aG).innerWidth(),L(aG).innerHeight())}L(aG).find("div.jqplot-table-legend-swatch-outline").each(function(){var aU=L(this);ak.strokeStyle=aU.css("border-top-color");var aQ=aI+aU.position().left;var aR=aL+aU.position().top;ak.strokeRect(aQ,aR,aU.innerWidth(),aU.innerHeight());aQ+=parseInt(aU.css("padding-left"),10);aR+=parseInt(aU.css("padding-top"),10);var aT=aU.innerHeight()-2*parseInt(aU.css("padding-top"),10);var aP=aU.innerWidth()-2*parseInt(aU.css("padding-left"),10);var aS=aU.children("div.jqplot-table-legend-swatch");ak.fillStyle=aS.css("background-color");ak.fillRect(aQ,aR,aP,aT)});L(aG).find("td.jqplot-table-legend-label").each(function(){var aR=L(this);var aP=aI+aR.position().left;var aQ=aL+aR.position().top+parseInt(aR.css("padding-top"),10);ak.font=aR.jqplotGetComputedFontStyle();ak.fillStyle=aR.css("color");aD(aR,ak,aR.text(),aP,aQ,aM)});var aH=null}else{if(aN=="canvas"){ak.drawImage(aG,aI,aL)}}}}L(this).children().each(function(){aw(this,av,ax)});return an};L.fn.jqplotToImageStr=function(ai){var ah=L(this).jqplotToImageCanvas(ai);if(ah){return ah.toDataURL("image/png")}else{return null}};L.fn.jqplotToImageElem=function(ah){var ai=document.createElement("img");var aj=L(this).jqplotToImageStr(ah);ai.src=aj;return ai};L.fn.jqplotToImageElemStr=function(ah){var ai="";return ai};L.fn.jqplotSaveImage=function(){var ah=L(this).jqplotToImageStr({});if(ah){window.location.href=ah.replace("image/png","image/octet-stream")}};L.fn.jqplotViewImage=function(){var ai=L(this).jqplotToImageElemStr({});var aj=L(this).jqplotToImageStr({});if(ai){var ah=window.open("");ah.document.open("image/png");ah.document.write(ai);ah.document.close();ah=null}};var ag=function(){this.syntax=ag.config.syntax;this._type="jsDate";this.proxy=new Date();this.options={};this.locale=ag.regional.getLocale();this.formatString="";this.defaultCentury=ag.config.defaultCentury;switch(arguments.length){case 0:break;case 1:if(l(arguments[0])=="[object Object]"&&arguments[0]._type!="jsDate"){var aj=this.options=arguments[0];this.syntax=aj.syntax||this.syntax;this.defaultCentury=aj.defaultCentury||this.defaultCentury;this.proxy=ag.createDate(aj.date)}else{this.proxy=ag.createDate(arguments[0])}break;default:var ah=[];for(var ai=0;ai0?"floor":"ceil"](ak))};ag.prototype.getAbbrDayName=function(){return ag.regional[this.locale]["dayNamesShort"][this.proxy.getDay()]};ag.prototype.getAbbrMonthName=function(){return ag.regional[this.locale]["monthNamesShort"][this.proxy.getMonth()]};ag.prototype.getAMPM=function(){return this.proxy.getHours()>=12?"PM":"AM"};ag.prototype.getAmPm=function(){return this.proxy.getHours()>=12?"pm":"am"};ag.prototype.getCentury=function(){return parseInt(this.proxy.getFullYear()/100,10)};ag.prototype.getDate=function(){return this.proxy.getDate()};ag.prototype.getDay=function(){return this.proxy.getDay()};ag.prototype.getDayOfWeek=function(){var ah=this.proxy.getDay();return ah===0?7:ah};ag.prototype.getDayOfYear=function(){var ai=this.proxy;var ah=ai-new Date(""+ai.getFullYear()+"/1/1 GMT");ah+=ai.getTimezoneOffset()*60000;ai=null;return parseInt(ah/60000/60/24,10)+1};ag.prototype.getDayName=function(){return ag.regional[this.locale]["dayNames"][this.proxy.getDay()]};ag.prototype.getFullWeekOfYear=function(){var ak=this.proxy;var ah=this.getDayOfYear();var aj=6-ak.getDay();var ai=parseInt((ah+aj)/7,10);return ai};ag.prototype.getFullYear=function(){return this.proxy.getFullYear()};ag.prototype.getGmtOffset=function(){var ah=this.proxy.getTimezoneOffset()/60;var ai=ah<0?"+":"-";ah=Math.abs(ah);return ai+N(Math.floor(ah),2)+":"+N((ah%1)*60,2)};ag.prototype.getHours=function(){return this.proxy.getHours()};ag.prototype.getHours12=function(){var ah=this.proxy.getHours();return ah>12?ah-12:(ah==0?12:ah)};ag.prototype.getIsoWeek=function(){var ak=this.proxy;var aj=this.getWeekOfYear();var ah=(new Date(""+ak.getFullYear()+"/1/1")).getDay();var ai=aj+(ah>4||ah<=1?0:1);if(ai==53&&(new Date(""+ak.getFullYear()+"/12/31")).getDay()<4){ai=1}else{if(ai===0){ak=new ag(new Date(""+(ak.getFullYear()-1)+"/12/31"));ai=ak.getIsoWeek()}}ak=null;return ai};ag.prototype.getMilliseconds=function(){return this.proxy.getMilliseconds()};ag.prototype.getMinutes=function(){return this.proxy.getMinutes()};ag.prototype.getMonth=function(){return this.proxy.getMonth()};ag.prototype.getMonthName=function(){return ag.regional[this.locale]["monthNames"][this.proxy.getMonth()]};ag.prototype.getMonthNumber=function(){return this.proxy.getMonth()+1};ag.prototype.getSeconds=function(){return this.proxy.getSeconds()};ag.prototype.getShortYear=function(){return this.proxy.getYear()%100};ag.prototype.getTime=function(){return this.proxy.getTime()};ag.prototype.getTimezoneAbbr=function(){return this.proxy.toString().replace(/^.*\(([^)]+)\)$/,"$1")};ag.prototype.getTimezoneName=function(){var ah=/(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());return ah[1]||ah[2]||"GMT"+this.getGmtOffset()};ag.prototype.getTimezoneOffset=function(){return this.proxy.getTimezoneOffset()};ag.prototype.getWeekOfYear=function(){var ah=this.getDayOfYear();var aj=7-this.getDayOfWeek();var ai=parseInt((ah+aj)/7,10);return ai};ag.prototype.getUnix=function(){return Math.round(this.proxy.getTime()/1000,0)};ag.prototype.getYear=function(){return this.proxy.getYear()};ag.prototype.next=function(ah){ah=ah||"day";return this.clone().add(1,ah)};ag.prototype.set=function(){switch(arguments.length){case 0:this.proxy=new Date();break;case 1:if(l(arguments[0])=="[object Object]"&&arguments[0]._type!="jsDate"){var aj=this.options=arguments[0];this.syntax=aj.syntax||this.syntax;this.defaultCentury=aj.defaultCentury||this.defaultCentury;this.proxy=ag.createDate(aj.date)}else{this.proxy=ag.createDate(arguments[0])}break;default:var ah=[];for(var ai=0;ai0?"floor":"ceil"](ah/12));var ai=aj.getMonth()+(ah%12);if(ai==12){ai=0;aj.setYear(aj.getFullYear()+1)}else{if(ai==-1){ai=11;aj.setYear(aj.getFullYear()-1)}}aj.setMonth(ai)},diff:function(al,aj){var ah=al.getFullYear()-aj.getFullYear();var ai=al.getMonth()-aj.getMonth()+(ah*12);var ak=al.getDate()-aj.getDate();return ai+(ak/30)}},year:{add:function(ai,ah){ai.setYear(ai.getFullYear()+Math[ah>0?"floor":"ceil"](ah))},diff:function(ai,ah){return E.month.diff(ai,ah)/12}}};for(var Y in E){if(Y.substring(Y.length-1)!="s"){E[Y+"s"]=E[Y]}}var H=function(al,ak,ai){if(ag.formats[ai]["shortcuts"][ak]){return ag.strftime(al,ag.formats[ai]["shortcuts"][ak],ai)}else{var ah=(ag.formats[ai]["codes"][ak]||"").split(".");var aj=al["get"+ah[0]]?al["get"+ah[0]]():"";if(ah[1]){aj=N(aj,ah[1])}return aj}};ag.strftime=function(an,ak,aj,ao){var ai="perl";var am=ag.regional.getLocale();if(aj&&ag.formats.hasOwnProperty(aj)){ai=aj}else{if(aj&&ag.regional.hasOwnProperty(aj)){am=aj}}if(ao&&ag.formats.hasOwnProperty(ao)){ai=ao}else{if(ao&&ag.regional.hasOwnProperty(ao)){am=ao}}if(l(an)!="[object Object]"||an._type!="jsDate"){an=new ag(an);an.locale=am}if(!ak){ak=an.formatString||ag.regional[am]["formatString"]}var ah=ak||"%Y-%m-%d",ap="",al;while(ah.length>0){if(al=ah.match(ag.formats[ai].codes.matcher)){ap+=ah.slice(0,al.index);ap+=(al[1]||"")+H(an,al[2],ai);ah=ah.slice(al.index+al[0].length)}else{ap+=ah;ah=""}}return ap};ag.formats={ISO:"%Y-%m-%dT%H:%M:%S.%N%G",SQL:"%Y-%m-%d %H:%M:%S"};ag.formats.perl={codes:{matcher:/()%(#?(%|[a-z]))/i,Y:"FullYear",y:"ShortYear.2",m:"MonthNumber.2","#m":"MonthNumber",B:"MonthName",b:"AbbrMonthName",d:"Date.2","#d":"Date",e:"Date",A:"DayName",a:"AbbrDayName",w:"Day",H:"Hours.2","#H":"Hours",I:"Hours12.2","#I":"Hours12",p:"AMPM",M:"Minutes.2","#M":"Minutes",S:"Seconds.2","#S":"Seconds",s:"Unix",N:"Milliseconds.3","#N":"Milliseconds",O:"TimezoneOffset",Z:"TimezoneName",G:"GmtOffset"},shortcuts:{F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",D:"%m/%d/%y","#c":"%a %b %e %H:%M:%S %Y",v:"%e-%b-%Y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"}};ag.formats.php={codes:{matcher:/()%((%|[a-z]))/i,a:"AbbrDayName",A:"DayName",d:"Date.2",e:"Date",j:"DayOfYear.3",u:"DayOfWeek",w:"Day",U:"FullWeekOfYear.2",V:"IsoWeek.2",W:"WeekOfYear.2",b:"AbbrMonthName",B:"MonthName",m:"MonthNumber.2",h:"AbbrMonthName",C:"Century.2",y:"ShortYear.2",Y:"FullYear",H:"Hours.2",I:"Hours12.2",l:"Hours12",p:"AMPM",P:"AmPm",M:"Minutes.2",S:"Seconds.2",s:"Unix",O:"TimezoneOffset",z:"GmtOffset",Z:"TimezoneAbbr"},shortcuts:{D:"%m/%d/%y",F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"}};ag.createDate=function(aj){if(aj==null){return new Date()}if(aj instanceof Date){return aj}if(typeof aj=="number"){return new Date(aj)}var ao=String(aj).replace(/^\s*(.+)\s*$/g,"$1");ao=ao.replace(/^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,4})/,"$1/$2/$3");ao=ao.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{4})/i,"$1 $2 $3");var an=ao.match(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i);if(an&&an.length>3){var at=parseFloat(an[3]);var am=ag.config.defaultCentury+at;am=String(am);ao=ao.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i,an[1]+" "+an[2]+" "+am)}an=ao.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})[^0-9]/);function ar(ax,aw){var aC=parseFloat(aw[1]);var aB=parseFloat(aw[2]);var aA=parseFloat(aw[3]);var az=ag.config.defaultCentury;var av,au,aD,ay;if(aC>31){au=aA;aD=aB;av=az+aC}else{au=aB;aD=aC;av=az+aA}ay=aD+"/"+au+"/"+av;return ax.replace(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})/,ay)}if(an&&an.length>3){ao=ar(ao,an)}var an=ao.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})$/);if(an&&an.length>3){ao=ar(ao,an)}var al=0;var ai=ag.matchers.length;var aq,ah,ap=ao,ak;while(al31){ah=an;ai=am+ao}else{ah=ao;ai=am+an}var ap=ab(aj[2],ag.regional[ag.regional.getLocale()]["monthNamesShort"]);if(ap==-1){ap=ab(aj[2],ag.regional[ag.regional.getLocale()]["monthNames"])}ak.setFullYear(ai,ap,ah);ak.setHours(0,0,0,0);return ak}else{return al}}];function ab(aj,ak){if(ak.indexOf){return ak.indexOf(aj)}for(var ah=0,ai=ak.length;ah=ap)?"":Array(1+ap-au.length>>>0).join(aq);return at?au+ar:ar+au}function ak(ar){var aq=new String(ar);for(var ap=10;ap>0;ap--){if(aq==(aq=aq.replace(/^(\d+)(\d{3})/,"$1"+L.jqplot.sprintf.thousandsSeparator+"$2"))){break}}return aq}function aj(av,au,ax,ar,at,aq){var aw=ar-av.length;if(aw>0){var ap=" ";if(aq){ap=" "}if(ax||!at){av=an(av,ar,ap,ax)}else{av=av.slice(0,au.length)+an("",aw,"0",true)+av.slice(au.length)}}return av}function ao(ay,aq,aw,ar,ap,av,ax,au){var at=ay>>>0;aw=aw&&at&&{"2":"0b","8":"0","16":"0x"}[aq]||"";ay=aw+an(at.toString(aq),av||0,"0",false);return aj(ay,aw,ar,ap,ax,au)}function ah(au,av,ar,ap,at,aq){if(ap!=null){au=au.slice(0,ap)}return aj(au,"",av,ar,at,aq)}var ai=arguments,al=0,am=ai[al++];return am.replace(L.jqplot.sprintf.regex,function(aM,ax,ay,aB,aO,aJ,av){if(aM=="%%"){return"%"}var aD=false,az="",aA=false,aL=false,aw=false,au=false;for(var aI=0;ay&&aI-1?6:(av=="d")?0:void (0)}else{if(aJ=="*"){aJ=+ai[al++]}else{if(aJ.charAt(0)=="*"){aJ=+ai[aJ.slice(1,-1)]}else{aJ=+aJ}}}var aF=ax?ai[ax.slice(0,-1)]:ai[al++];switch(av){case"s":if(aF==null){return""}return ah(String(aF),aD,aB,aJ,aA,aw);case"c":return ah(String.fromCharCode(+aF),aD,aB,aJ,aA,aw);case"b":return ao(aF,2,aL,aD,aB,aJ,aA,aw);case"o":return ao(aF,8,aL,aD,aB,aJ,aA,aw);case"x":return ao(aF,16,aL,aD,aB,aJ,aA,aw);case"X":return ao(aF,16,aL,aD,aB,aJ,aA,aw).toUpperCase();case"u":return ao(aF,10,aL,aD,aB,aJ,aA,aw);case"i":var ar=parseInt(+aF,10);if(isNaN(ar)){return""}var aH=ar<0?"-":az;var aK=au?ak(String(Math.abs(ar))):String(Math.abs(ar));aF=aH+an(aK,aJ,"0",false);return aj(aF,aH,aD,aB,aA,aw);case"d":var ar=Math.round(+aF);if(isNaN(ar)){return""}var aH=ar<0?"-":az;var aK=au?ak(String(Math.abs(ar))):String(Math.abs(ar));aF=aH+an(aK,aJ,"0",false);return aj(aF,aH,aD,aB,aA,aw);case"e":case"E":case"f":case"F":case"g":case"G":var ar=+aF;if(isNaN(ar)){return""}var aH=ar<0?"-":az;var at=["toExponential","toFixed","toPrecision"]["efg".indexOf(av.toLowerCase())];var aN=["toString","toUpperCase"]["eEfFgG".indexOf(av)%2];var aK=Math.abs(ar)[at](aJ);var aE=aK.toString().split(".");aE[0]=au?ak(aE[0]):aE[0];aK=aE.join(L.jqplot.sprintf.decimalMark);aF=aH+aK;var aC=aj(aF,aH,aD,aB,aA,aw)[aN]();return aC;case"p":case"P":var ar=+aF;if(isNaN(ar)){return""}var aH=ar<0?"-":az;var aE=String(Number(Math.abs(ar)).toExponential()).split(/e|E/);var aq=(aE[0].indexOf(".")!=-1)?aE[0].length-1:String(ar).length;var aG=(aE[1]<0)?-aE[1]-1:0;if(Math.abs(ar)<1){if(aq+aG<=aJ){aF=aH+Math.abs(ar).toPrecision(aq)}else{if(aq<=aJ-1){aF=aH+Math.abs(ar).toExponential(aq-1)}else{aF=aH+Math.abs(ar).toExponential(aJ-1)}}}else{var ap=(aq<=aJ)?aq:aJ;aF=aH+Math.abs(ar).toPrecision(ap)}var aN=["toString","toUpperCase"]["pP".indexOf(av)%2];return aj(aF,aH,aD,aB,aA,aw)[aN]();case"n":return"";default:return aM}})};L.jqplot.sprintf.thousandsSeparator=",";L.jqplot.sprintf.decimalMark=".";L.jqplot.sprintf.regex=/%%|%(\d+\$)?([-+#0&\' ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g;L.jqplot.getSignificantFigures=function(al){var an=String(Number(Math.abs(al)).toExponential()).split(/e|E/);var am=(an[0].indexOf(".")!=-1)?an[0].length-1:an[0].length;var ai=(an[1]<0)?-an[1]-1:0;var ah=parseInt(an[1],10);var aj=(ah+1>0)?ah+1:0;var ak=(am<=aj)?0:am-ah-1;return{significantDigits:am,digitsLeft:aj,digitsRight:ak,zeros:ai,exponent:ah}};L.jqplot.getPrecision=function(ah){return L.jqplot.getSignificantFigures(ah).digitsRight};var X=L.uiBackCompat!==false;L.jqplot.effects={effect:{}};var m="jqplot.storage.";L.extend(L.jqplot.effects,{version:"1.9pre",save:function(ai,aj){for(var ah=0;ah").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),ah={width:ai.width(),height:ai.height()},ak=document.activeElement;ai.wrap(al);if(ai[0]===ak||L.contains(ai[0],ak)){L(ak).focus()}al=ai.parent();if(ai.css("position")==="static"){al.css({position:"relative"});ai.css({position:"relative"})}else{L.extend(aj,{position:ai.css("position"),zIndex:ai.css("z-index")});L.each(["top","left","bottom","right"],function(am,an){aj[an]=ai.css(an);if(isNaN(parseInt(aj[an],10))){aj[an]="auto"}});ai.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}ai.css(ah);return al.css(aj).show()},removeWrapper:function(ah){var ai=document.activeElement;if(ah.parent().is(".ui-effects-wrapper")){ah.parent().replaceWith(ah);if(ah[0]===ai||L.contains(ah[0],ai)){L(ai).focus()}}return ah}});function j(ai,ah,aj,ak){if(L.isPlainObject(ai)){return ai}ai={effect:ai};if(ah===u){ah={}}if(L.isFunction(ah)){ak=ah;aj=null;ah={}}if(L.type(ah)==="number"||L.fx.speeds[ah]){ak=aj;aj=ah;ah={}}if(L.isFunction(aj)){ak=aj;aj=null}if(ah){L.extend(ai,ah)}aj=aj||ah.duration;ai.duration=L.fx.off?0:typeof aj==="number"?aj:aj in L.fx.speeds?L.fx.speeds[aj]:L.fx.speeds._default;ai.complete=ak||ah.complete;return ai}function ae(ah){if(!ah||typeof ah==="number"||L.fx.speeds[ah]){return true}if(typeof ah==="string"&&!L.jqplot.effects.effect[ah]){if(X&&L.jqplot.effects[ah]){return false}return true}return false}L.fn.extend({jqplotEffect:function(ap,aq,ai,ao){var an=j.apply(this,arguments),ak=an.mode,al=an.queue,am=L.jqplot.effects.effect[an.effect],ah=!am&&X&&L.jqplot.effects[an.effect];if(L.fx.off||!(am||ah)){if(ak){return this[ak](an.duration,an.complete)}else{return this.each(function(){if(an.complete){an.complete.call(this)}})}}function aj(au){var av=L(this),at=an.complete,aw=an.mode;function ar(){if(L.isFunction(at)){at.call(av[0])}if(L.isFunction(au)){au()}}if(av.is(":hidden")?aw==="hide":aw==="show"){ar()}else{am.call(av[0],an,ar)}}if(am){return al===false?this.each(aj):this.queue(al||"fx",aj)}else{return ah.call(this,{options:an,duration:an.duration,callback:an.complete,mode:an.mode})}}});var a=/up|down|vertical/,v=/up|left|vertical|horizontal/;L.jqplot.effects.effect.blind=function(aj,ao){var ak=L(this),ar=["position","top","bottom","left","right","height","width"],ap=L.jqplot.effects.setMode(ak,aj.mode||"hide"),au=aj.direction||"up",am=a.test(au),al=am?"height":"width",aq=am?"top":"left",aw=v.test(au),an={},av=ap==="show",ai,ah,at;if(ak.parent().is(".ui-effects-wrapper")){L.jqplot.effects.save(ak.parent(),ar)}else{L.jqplot.effects.save(ak,ar)}ak.show();at=parseInt(ak.css("top"),10);ai=L.jqplot.effects.createWrapper(ak).css({overflow:"hidden"});ah=am?ai[al]()+at:ai[al]();an[al]=av?String(ah):"0";if(!aw){ak.css(am?"bottom":"right",0).css(am?"top":"left","").css({position:"absolute"});an[aq]=av?"0":String(ah)}if(av){ai.css(al,0);if(!aw){ai.css(aq,ah)}}ai.animate(an,{duration:aj.duration,easing:aj.easing,queue:false,complete:function(){if(ap==="hide"){ak.hide()}L.jqplot.effects.restore(ak,ar);L.jqplot.effects.removeWrapper(ak);ao()}})}})(jQuery); +/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com + jsDate | (c) 2010-2013 Chris Leonello +*/(function(f){f.jqplot.Trendline=function(){this.show=f.jqplot.config.enablePlugins;this.color="#666666";this.renderer=new f.jqplot.LineRenderer();this.rendererOptions={marker:{show:false}};this.label="";this.type="linear";this.shadow=true;this.markerRenderer={show:false};this.lineWidth=1.5;this.shadowAngle=45;this.shadowOffset=1;this.shadowAlpha=0.07;this.shadowDepth=3;this.isTrendline=true};f.jqplot.postSeriesInitHooks.push(e);f.jqplot.postDrawSeriesHooks.push(g);f.jqplot.addLegendRowHooks.push(a);function a(k){var j=null;if(k.trendline&&k.trendline.show){var i=k.trendline.label.toString();if(i){j={label:i,color:k.trendline.color}}}return j}function e(m,k,j,i,l){if(this._type&&(this._type==="line"||this._type=="bar")){this.trendline=new f.jqplot.Trendline();i=i||{};f.extend(true,this.trendline,{color:this.color},j.trendline,i.trendline);this.trendline.renderer.init.call(this.trendline,null)}}function g(m,i){i=f.extend(true,{},this.trendline,i);if(this.trendline&&i.show){var k;var l=i.data||this.data;k=c(l,this.trendline.type);var j=i.gridData||this.renderer.makeGridData.call(this,k.data);this.trendline.renderer.draw.call(this.trendline,m,j,{showLine:true,shadow:this.trendline.shadow})}}function b(w,v,n){var u=(n==null)?"linear":n;var s=w.length;var t;var z;var o=0;var m=0;var r=0;var q=0;var l=0;var j=[];var k=[];if(u=="linear"){k=w;j=v}else{if(u=="exp"||u=="exponential"){for(var p=0;p570)?o[p]*0.8:o[p]+0.3*(255-o[p]);o[p]=parseInt(o[p],10)}this.highlightColors.push("rgb("+o[0]+","+o[1]+","+o[2]+")")}}this.highlightColorGenerator=new e.jqplot.ColorGenerator(this.highlightColors);u.postParseOptionsHooks.addOnce(m);u.postInitHooks.addOnce(g);u.eventListenerHooks.addOnce("jqplotMouseMove",b);u.eventListenerHooks.addOnce("jqplotMouseDown",a);u.eventListenerHooks.addOnce("jqplotMouseUp",l);u.eventListenerHooks.addOnce("jqplotClick",f);u.eventListenerHooks.addOnce("jqplotRightClick",n);u.postDrawHooks.addOnce(i)};e.jqplot.PieRenderer.prototype.setGridData=function(t){var p=[];var u=[];var o=this.startAngle/180*Math.PI;var s=0;this._drawData=false;for(var r=0;r0){p[r]+=p[r-1]}s+=this.data[r][1]}var q=Math.PI*2/p[p.length-1];for(var r=0;r0){p[r]+=p[r-1]}s+=t[r][1]}var q=Math.PI*2/p[p.length-1];for(var r=0;r0&&s>0.01&&s<6.282){w=parseFloat(p)/2/h(q)}return w}e.jqplot.PieRenderer.prototype.drawSlice=function(B,z,y,u,w){if(this._drawData){var p=this._radius;var A=this.fill;var x=this.lineWidth;var s=this.sliceMargin;if(this.fill==false){s+=this.lineWidth}B.save();B.translate(this._center[0],this._center[1]);var D=j(z,y,this.sliceMargin,this.fill,this.lineWidth);var o=D*Math.cos((z+y)/2);var C=D*Math.sin((z+y)/2);if((y-z)<=Math.PI){p-=D}else{p+=D}B.translate(o,C);if(w){for(var v=0,t=this.shadowDepth;v6.282+this.startAngle){y=6.282+this.startAngle;if(z>y){z=6.281+this.startAngle}}if(z>=y){return}B.beginPath();B.fillStyle=u;B.strokeStyle=u;B.lineWidth=x;B.arc(0,0,r,z,y,false);B.lineTo(0,0);B.closePath();if(A){B.fill()}else{B.stroke()}}};e.jqplot.PieRenderer.prototype.draw=function(B,z,E,o){var W;var H=(E!=undefined)?E:{};var t=0;var s=0;var N=1;var L=new e.jqplot.ColorGenerator(this.seriesColors);if(E.legendInfo&&E.legendInfo.placement=="insideGrid"){var J=E.legendInfo;switch(J.location){case"nw":t=J.width+J.xoffset;break;case"w":t=J.width+J.xoffset;break;case"sw":t=J.width+J.xoffset;break;case"ne":t=J.width+J.xoffset;N=-1;break;case"e":t=J.width+J.xoffset;N=-1;break;case"se":t=J.width+J.xoffset;N=-1;break;case"n":s=J.height+J.yoffset;break;case"s":s=J.height+J.yoffset;N=-1;break;default:break}}var K=(H.shadow!=undefined)?H.shadow:this.shadow;var A=(H.fill!=undefined)?H.fill:this.fill;var C=B.canvas.width;var I=B.canvas.height;var Q=C-t-2*this.padding;var X=I-s-2*this.padding;var M=Math.min(Q,X);var Y=M;this._sliceAngles=[];var v=this.sliceMargin;if(this.fill==false){v+=this.lineWidth}var q;var G=0;var R,aa,Z,ab;var D=this.startAngle/180*Math.PI;for(var W=0,V=z.length;WMath.PI){G=Math.max(q,G)}}if(this.diameter!=null&&this.diameter>0){this._diameter=this.diameter-2*G}else{this._diameter=Y-2*G}if(this._diameter<6){e.jqplot.log("Diameter of pie too small, not rendering.");return}var S=this._radius=this._diameter/2;this._center=[(C-N*t)/2+N*t+G*Math.cos(D),(I-N*s)/2+N*s+G*Math.sin(D)];if(this.shadow){for(var W=0,V=z.length;W=this.dataLabelThreshold){var F,U=(this._sliceAngles[W][0]+this._sliceAngles[W][1])/2,T;if(this.dataLabels=="label"){F=this.dataLabelFormatString||"%s";T=e.jqplot.sprintf(F,z[W][0])}else{if(this.dataLabels=="value"){F=this.dataLabelFormatString||"%d";T=e.jqplot.sprintf(F,this.data[W][1])}else{if(this.dataLabels=="percent"){F=this.dataLabelFormatString||"%d%%";T=e.jqplot.sprintf(F,z[W][2]*100)}else{if(this.dataLabels.constructor==Array){F=this.dataLabelFormatString||"%s";T=e.jqplot.sprintf(F,this.dataLabels[W])}}}}var p=(this._radius)*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge;var P=this._center[0]+Math.cos(U)*p+this.canvas._offsets.left;var O=this._center[1]+Math.sin(U)*p+this.canvas._offsets.top;var u=e('
        '+T+"
        ").insertBefore(o.eventCanvas._elem);if(this.dataLabelCenterOn){P-=u.width()/2;O-=u.height()/2}else{P-=u.width()*Math.sin(U/2);O-=u.height()/2}P=Math.round(P);O=Math.round(O);u.css({left:P,top:O})}}};e.jqplot.PieAxisRenderer=function(){e.jqplot.LinearAxisRenderer.call(this)};e.jqplot.PieAxisRenderer.prototype=new e.jqplot.LinearAxisRenderer();e.jqplot.PieAxisRenderer.prototype.constructor=e.jqplot.PieAxisRenderer;e.jqplot.PieAxisRenderer.prototype.init=function(o){this.tickRenderer=e.jqplot.PieTickRenderer;e.extend(true,this,o);this._dataBounds={min:0,max:100};this.min=0;this.max=100;this.showTicks=false;this.ticks=[];this.showMark=false;this.show=false};e.jqplot.PieLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)};e.jqplot.PieLegendRenderer.prototype=new e.jqplot.TableLegendRenderer();e.jqplot.PieLegendRenderer.prototype.constructor=e.jqplot.PieLegendRenderer;e.jqplot.PieLegendRenderer.prototype.init=function(o){this.numberRows=null;this.numberColumns=null;e.extend(true,this,o)};e.jqplot.PieLegendRenderer.prototype.draw=function(){var r=this;if(this.show){var B=this._series;this._elem=e(document.createElement("table"));this._elem.addClass("jqplot-table-legend");var E={position:"absolute"};if(this.background){E.background=this.background}if(this.border){E.border=this.border}if(this.fontSize){E.fontSize=this.fontSize}if(this.fontFamily){E.fontFamily=this.fontFamily}if(this.textColor){E.textColor=this.textColor}if(this.marginTop!=null){E.marginTop=this.marginTop}if(this.marginBottom!=null){E.marginBottom=this.marginBottom}if(this.marginLeft!=null){E.marginLeft=this.marginLeft}if(this.marginRight!=null){E.marginRight=this.marginRight}this._elem.css(E);var I=false,A=false,o,y;var C=B[0];var p=new e.jqplot.ColorGenerator(C.seriesColors);if(C.show){var J=C.data;if(this.numberRows){o=this.numberRows;if(!this.numberColumns){y=Math.ceil(J.length/o)}else{y=this.numberColumns}}else{if(this.numberColumns){y=this.numberColumns;o=Math.ceil(J.length/this.numberColumns)}else{o=J.length;y=1}}var H,G;var q,w,v;var x,z,F;var D=0;var u,t;for(H=0;H0){I=true}else{I=false}}else{if(H==o-1){I=false}else{I=true}}z=(I)?this.rowSpacing:"0";w=e(document.createElement("td"));w.addClass("jqplot-table-legend jqplot-table-legend-swatch");w.css({textAlign:"center",paddingTop:z});u=e(document.createElement("div"));u.addClass("jqplot-table-legend-swatch-outline");t=e(document.createElement("div"));t.addClass("jqplot-table-legend-swatch");t.css({backgroundColor:F,borderColor:F});w.append(u.append(t));v=e(document.createElement("td"));v.addClass("jqplot-table-legend jqplot-table-legend-label");v.css("paddingTop",z);if(this.escapeHtml){v.text(x)}else{v.html(x)}if(A){v.prependTo(q);w.prependTo(q)}else{w.appendTo(q);v.appendTo(q)}I=true}D++}}}}return this._elem};e.jqplot.PieRenderer.prototype.handleMove=function(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];r.target.trigger("jqplotDataMouseOver",o);if(r.series[o[0]].highlightMouseOver&&!(o[0]==r.plugins.pieRenderer.highlightedSeriesIndex&&o[1]==r.series[o[0]]._highlightedPoint)){r.target.trigger("jqplotDataHighlight",o);d(r,o[0],o[1])}}else{if(s==null){k(r)}}};function c(s,r,p){p=p||{};p.axesDefaults=p.axesDefaults||{};p.legend=p.legend||{};p.seriesDefaults=p.seriesDefaults||{};var o=false;if(p.seriesDefaults.renderer==e.jqplot.PieRenderer){o=true}else{if(p.series){for(var q=0;qSparkline: 1,4,6,6,8,5,3,5

        +* $('.sparkline').sparkline(); +* There must be no spaces in the enclosed data set +* +* Otherwise values must be an array of numbers or null values +*

        Sparkline: This text replaced if the browser is compatible

        +* $('#sparkline1').sparkline([1,4,6,6,8,5,3,5]) +* $('#sparkline2').sparkline([1,4,6,null,null,5,3,5]) +* +* Values can also be specified in an HTML comment, or as a values attribute: +*

        Sparkline:

        +*

        Sparkline:

        +* $('.sparkline').sparkline(); +* +* For line charts, x values can also be specified: +*

        Sparkline: 1:1,2.7:4,3.4:6,5:6,6:8,8.7:5,9:3,10:5

        +* $('#sparkline1').sparkline([ [1,1], [2.7,4], [3.4,6], [5,6], [6,8], [8.7,5], [9,3], [10,5] ]) +* +* By default, options should be passed in as teh second argument to the sparkline function: +* $('.sparkline').sparkline([1,2,3,4], {type: 'bar'}) +* +* Options can also be set by passing them on the tag itself. This feature is disabled by default though +* as there's a slight performance overhead: +* $('.sparkline').sparkline([1,2,3,4], {enableTagOptions: true}) +*

        Sparkline: loading

        +* Prefix all options supplied as tag attribute with "spark" (configurable by setting tagOptionPrefix) +* +* Supported options: +* lineColor - Color of the line used for the chart +* fillColor - Color used to fill in the chart - Set to '' or false for a transparent chart +* width - Width of the chart - Defaults to 3 times the number of values in pixels +* height - Height of the chart - Defaults to the height of the containing element +* chartRangeMin - Specify the minimum value to use for the Y range of the chart - Defaults to the minimum value supplied +* chartRangeMax - Specify the maximum value to use for the Y range of the chart - Defaults to the maximum value supplied +* chartRangeClip - Clip out of range values to the max/min specified by chartRangeMin and chartRangeMax +* chartRangeMinX - Specify the minimum value to use for the X range of the chart - Defaults to the minimum value supplied +* chartRangeMaxX - Specify the maximum value to use for the X range of the chart - Defaults to the maximum value supplied +* composite - If true then don't erase any existing chart attached to the tag, but draw +* another chart over the top - Note that width and height are ignored if an +* existing chart is detected. +* tagValuesAttribute - Name of tag attribute to check for data values - Defaults to 'values' +* enableTagOptions - Whether to check tags for sparkline options +* tagOptionPrefix - Prefix used for options supplied as tag attributes - Defaults to 'spark' +* disableHiddenCheck - If set to true, then the plugin will assume that charts will never be drawn into a +* hidden dom element, avoding a browser reflow +* disableInteraction - If set to true then all mouseover/click interaction behaviour will be disabled, +* making the plugin perform much like it did in 1.x +* disableTooltips - If set to true then tooltips will be disabled - Defaults to false (tooltips enabled) +* disableHighlight - If set to true then highlighting of selected chart elements on mouseover will be disabled +* defaults to false (highlights enabled) +* highlightLighten - Factor to lighten/darken highlighted chart values by - Defaults to 1.4 for a 40% increase +* tooltipContainer - Specify which DOM element the tooltip should be rendered into - defaults to document.body +* tooltipClassname - Optional CSS classname to apply to tooltips - If not specified then a default style will be applied +* tooltipOffsetX - How many pixels away from the mouse pointer to render the tooltip on the X axis +* tooltipOffsetY - How many pixels away from the mouse pointer to render the tooltip on the r axis +* tooltipFormatter - Optional callback that allows you to override the HTML displayed in the tooltip +* callback is given arguments of (sparkline, options, fields) +* tooltipChartTitle - If specified then the tooltip uses the string specified by this setting as a title +* tooltipFormat - A format string or SPFormat object (or an array thereof for multiple entries) +* to control the format of the tooltip +* tooltipPrefix - A string to prepend to each field displayed in a tooltip +* tooltipSuffix - A string to append to each field displayed in a tooltip +* tooltipSkipNull - If true then null values will not have a tooltip displayed (defaults to true) +* tooltipValueLookups - An object or range map to map field values to tooltip strings +* (eg. to map -1 to "Lost", 0 to "Draw", and 1 to "Win") +* numberFormatter - Optional callback for formatting numbers in tooltips +* numberDigitGroupSep - Character to use for group separator in numbers "1,234" - Defaults to "," +* numberDecimalMark - Character to use for the decimal point when formatting numbers - Defaults to "." +* numberDigitGroupCount - Number of digits between group separator - Defaults to 3 +* +* There are 7 types of sparkline, selected by supplying a "type" option of 'line' (default), +* 'bar', 'tristate', 'bullet', 'discrete', 'pie' or 'box' +* line - Line chart. Options: +* spotColor - Set to '' to not end each line in a circular spot +* minSpotColor - If set, color of spot at minimum value +* maxSpotColor - If set, color of spot at maximum value +* spotRadius - Radius in pixels +* lineWidth - Width of line in pixels +* normalRangeMin +* normalRangeMax - If set draws a filled horizontal bar between these two values marking the "normal" +* or expected range of values +* normalRangeColor - Color to use for the above bar +* drawNormalOnTop - Draw the normal range above the chart fill color if true +* defaultPixelsPerValue - Defaults to 3 pixels of width for each value in the chart +* highlightSpotColor - The color to use for drawing a highlight spot on mouseover - Set to null to disable +* highlightLineColor - The color to use for drawing a highlight line on mouseover - Set to null to disable +* valueSpots - Specify which points to draw spots on, and in which color. Accepts a range map +* +* bar - Bar chart. Options: +* barColor - Color of bars for postive values +* negBarColor - Color of bars for negative values +* zeroColor - Color of bars with zero values +* nullColor - Color of bars with null values - Defaults to omitting the bar entirely +* barWidth - Width of bars in pixels +* colorMap - Optional mappnig of values to colors to override the *BarColor values above +* can be an Array of values to control the color of individual bars or a range map +* to specify colors for individual ranges of values +* barSpacing - Gap between bars in pixels +* zeroAxis - Centers the y-axis around zero if true +* +* tristate - Charts values of win (>0), lose (<0) or draw (=0) +* posBarColor - Color of win values +* negBarColor - Color of lose values +* zeroBarColor - Color of draw values +* barWidth - Width of bars in pixels +* barSpacing - Gap between bars in pixels +* colorMap - Optional mappnig of values to colors to override the *BarColor values above +* can be an Array of values to control the color of individual bars or a range map +* to specify colors for individual ranges of values +* +* discrete - Options: +* lineHeight - Height of each line in pixels - Defaults to 30% of the graph height +* thesholdValue - Values less than this value will be drawn using thresholdColor instead of lineColor +* thresholdColor +* +* bullet - Values for bullet graphs msut be in the order: target, performance, range1, range2, range3, ... +* options: +* targetColor - The color of the vertical target marker +* targetWidth - The width of the target marker in pixels +* performanceColor - The color of the performance measure horizontal bar +* rangeColors - Colors to use for each qualitative range background color +* +* pie - Pie chart. Options: +* sliceColors - An array of colors to use for pie slices +* offset - Angle in degrees to offset the first slice - Try -90 or +90 +* borderWidth - Width of border to draw around the pie chart, in pixels - Defaults to 0 (no border) +* borderColor - Color to use for the pie chart border - Defaults to #000 +* +* box - Box plot. Options: +* raw - Set to true to supply pre-computed plot points as values +* values should be: low_outlier, low_whisker, q1, median, q3, high_whisker, high_outlier +* When set to false you can supply any number of values and the box plot will +* be computed for you. Default is false. +* showOutliers - Set to true (default) to display outliers as circles +* outlierIQR - Interquartile range used to determine outliers. Default 1.5 +* boxLineColor - Outline color of the box +* boxFillColor - Fill color for the box +* whiskerColor - Line color used for whiskers +* outlierLineColor - Outline color of outlier circles +* outlierFillColor - Fill color of the outlier circles +* spotRadius - Radius of outlier circles +* medianColor - Line color of the median line +* target - Draw a target cross hair at the supplied value (default undefined) +* +* +* +* Examples: +* $('#sparkline1').sparkline(myvalues, { lineColor: '#f00', fillColor: false }); +* $('.barsparks').sparkline('html', { type:'bar', height:'40px', barWidth:5 }); +* $('#tristate').sparkline([1,1,-1,1,0,0,-1], { type:'tristate' }): +* $('#discrete').sparkline([1,3,4,5,5,3,4,5], { type:'discrete' }); +* $('#bullet').sparkline([10,12,12,9,7], { type:'bullet' }); +* $('#pie').sparkline([1,1,2], { type:'pie' }); +*/ + +/*jslint regexp: true, browser: true, jquery: true, white: true, nomen: false, plusplus: false, maxerr: 500, indent: 4 */ + +(function(document, Math, undefined) { // performance/minified-size optimization +(function(factory) { + if(typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else if (jQuery && !jQuery.fn.sparkline) { + factory(jQuery); + } +}; +(function($) { + 'use strict'; + + var UNSET_OPTION = {}, + getDefaults, createClass, SPFormat, clipval, quartile, normalizeValue, normalizeValues, + remove, isNumber, all, sum, addCSS, ensureArray, formatNumber, RangeMap, + MouseHandler, Tooltip, barHighlightMixin, + line, bar, tristate, discrete, bullet, pie, box, defaultStyles, initStyles, + VShape, VCanvas_base, VCanvas_canvas, VCanvas_vml, pending, shapeCount = 0; + + /** + * Default configuration settings + */ + getDefaults = function () { + return { + // Settings common to most/all chart types + common: { + type: 'line', + lineColor: '#00f', + fillColor: '#cdf', + defaultPixelsPerValue: 3, + width: 'auto', + height: 'auto', + composite: false, + tagValuesAttribute: 'values', + tagOptionsPrefix: 'spark', + enableTagOptions: false, + enableHighlight: true, + highlightLighten: 1.4, + tooltipSkipNull: true, + tooltipPrefix: '', + tooltipSuffix: '', + disableHiddenCheck: false, + numberFormatter: false, + numberDigitGroupCount: 3, + numberDigitGroupSep: ',', + numberDecimalMark: '.', + disableTooltips: false, + disableInteraction: false + }, + // Defaults for line charts + line: { + spotColor: '#f80', + highlightSpotColor: '#5f5', + highlightLineColor: '#f22', + spotRadius: 1.5, + minSpotColor: '#f80', + maxSpotColor: '#f80', + lineWidth: 1, + normalRangeMin: undefined, + normalRangeMax: undefined, + normalRangeColor: '#ccc', + drawNormalOnTop: false, + chartRangeMin: undefined, + chartRangeMax: undefined, + chartRangeMinX: undefined, + chartRangeMaxX: undefined, + tooltipFormat: new SPFormat(' {{prefix}}{{y}}{{suffix}}') + }, + // Defaults for bar charts + bar: { + barColor: '#3366cc', + negBarColor: '#f44', + stackedBarColor: ['#3366cc', '#dc3912', '#ff9900', '#109618', '#66aa00', + '#dd4477', '#0099c6', '#990099'], + zeroColor: undefined, + nullColor: undefined, + zeroAxis: true, + barWidth: 4, + barSpacing: 1, + chartRangeMax: undefined, + chartRangeMin: undefined, + chartRangeClip: false, + colorMap: undefined, + tooltipFormat: new SPFormat(' {{prefix}}{{value}}{{suffix}}') + }, + // Defaults for tristate charts + tristate: { + barWidth: 4, + barSpacing: 1, + posBarColor: '#6f6', + negBarColor: '#f44', + zeroBarColor: '#999', + colorMap: {}, + tooltipFormat: new SPFormat(' {{value:map}}'), + tooltipValueLookups: { map: { '-1': 'Loss', '0': 'Draw', '1': 'Win' } } + }, + // Defaults for discrete charts + discrete: { + lineHeight: 'auto', + thresholdColor: undefined, + thresholdValue: 0, + chartRangeMax: undefined, + chartRangeMin: undefined, + chartRangeClip: false, + tooltipFormat: new SPFormat('{{prefix}}{{value}}{{suffix}}') + }, + // Defaults for bullet charts + bullet: { + targetColor: '#f33', + targetWidth: 3, // width of the target bar in pixels + performanceColor: '#33f', + rangeColors: ['#d3dafe', '#a8b6ff', '#7f94ff'], + base: undefined, // set this to a number to change the base start number + tooltipFormat: new SPFormat('{{fieldkey:fields}} - {{value}}'), + tooltipValueLookups: { fields: {r: 'Range', p: 'Performance', t: 'Target'} } + }, + // Defaults for pie charts + pie: { + offset: 0, + sliceColors: ['#3366cc', '#dc3912', '#ff9900', '#109618', '#66aa00', + '#dd4477', '#0099c6', '#990099'], + borderWidth: 0, + borderColor: '#000', + tooltipFormat: new SPFormat(' {{value}} ({{percent.1}}%)') + }, + // Defaults for box plots + box: { + raw: false, + boxLineColor: '#000', + boxFillColor: '#cdf', + whiskerColor: '#000', + outlierLineColor: '#333', + outlierFillColor: '#fff', + medianColor: '#f00', + showOutliers: true, + outlierIQR: 1.5, + spotRadius: 1.5, + target: undefined, + targetColor: '#4a2', + chartRangeMax: undefined, + chartRangeMin: undefined, + tooltipFormat: new SPFormat('{{field:fields}}: {{value}}'), + tooltipFormatFieldlistKey: 'field', + tooltipValueLookups: { fields: { lq: 'Lower Quartile', med: 'Median', + uq: 'Upper Quartile', lo: 'Left Outlier', ro: 'Right Outlier', + lw: 'Left Whisker', rw: 'Right Whisker'} } + } + }; + }; + + // You can have tooltips use a css class other than jqstooltip by specifying tooltipClassname + defaultStyles = '.jqstooltip { ' + + 'position: absolute;' + + 'left: 0px;' + + 'top: 0px;' + + 'visibility: hidden;' + + 'background: rgb(0, 0, 0) transparent;' + + 'background-color: rgba(0,0,0,0.6);' + + 'filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);' + + '-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";' + + 'color: white;' + + 'font: 10px arial, san serif;' + + 'text-align: left;' + + 'white-space: nowrap;' + + 'padding: 5px;' + + 'border: 1px solid white;' + + 'z-index: 10000;' + + '}' + + '.jqsfield { ' + + 'color: white;' + + 'font: 10px arial, san serif;' + + 'text-align: left;' + + '}'; + + /** + * Utilities + */ + + createClass = function (/* [baseclass, [mixin, ...]], definition */) { + var Class, args; + Class = function () { + this.init.apply(this, arguments); + }; + if (arguments.length > 1) { + if (arguments[0]) { + Class.prototype = $.extend(new arguments[0](), arguments[arguments.length - 1]); + Class._super = arguments[0].prototype; + } else { + Class.prototype = arguments[arguments.length - 1]; + } + if (arguments.length > 2) { + args = Array.prototype.slice.call(arguments, 1, -1); + args.unshift(Class.prototype); + $.extend.apply($, args); + } + } else { + Class.prototype = arguments[0]; + } + Class.prototype.cls = Class; + return Class; + }; + + /** + * Wraps a format string for tooltips + * {{x}} + * {{x.2} + * {{x:months}} + */ + $.SPFormatClass = SPFormat = createClass({ + fre: /\{\{([\w.]+?)(:(.+?))?\}\}/g, + precre: /(\w+)\.(\d+)/, + + init: function (format, fclass) { + this.format = format; + this.fclass = fclass; + }, + + render: function (fieldset, lookups, options) { + var self = this, + fields = fieldset, + match, token, lookupkey, fieldvalue, prec; + return this.format.replace(this.fre, function () { + var lookup; + token = arguments[1]; + lookupkey = arguments[3]; + match = self.precre.exec(token); + if (match) { + prec = match[2]; + token = match[1]; + } else { + prec = false; + } + fieldvalue = fields[token]; + if (fieldvalue === undefined) { + return ''; + } + if (lookupkey && lookups && lookups[lookupkey]) { + lookup = lookups[lookupkey]; + if (lookup.get) { // RangeMap + return lookups[lookupkey].get(fieldvalue) || fieldvalue; + } else { + return lookups[lookupkey][fieldvalue] || fieldvalue; + } + } + if (isNumber(fieldvalue)) { + if (options.get('numberFormatter')) { + fieldvalue = options.get('numberFormatter')(fieldvalue); + } else { + fieldvalue = formatNumber(fieldvalue, prec, + options.get('numberDigitGroupCount'), + options.get('numberDigitGroupSep'), + options.get('numberDecimalMark')); + } + } + return fieldvalue; + }); + } + }); + + // convience method to avoid needing the new operator + $.spformat = function(format, fclass) { + return new SPFormat(format, fclass); + }; + + clipval = function (val, min, max) { + if (val < min) { + return min; + } + if (val > max) { + return max; + } + return val; + }; + + quartile = function (values, q) { + var vl; + if (q === 2) { + vl = Math.floor(values.length / 2); + return values.length % 2 ? values[vl] : (values[vl-1] + values[vl]) / 2; + } else { + if (values.length % 2 ) { // odd + vl = (values.length * q + q) / 4; + return vl % 1 ? (values[Math.floor(vl)] + values[Math.floor(vl) - 1]) / 2 : values[vl-1]; + } else { //even + vl = (values.length * q + 2) / 4; + return vl % 1 ? (values[Math.floor(vl)] + values[Math.floor(vl) - 1]) / 2 : values[vl-1]; + + } + } + }; + + normalizeValue = function (val) { + var nf; + switch (val) { + case 'undefined': + val = undefined; + break; + case 'null': + val = null; + break; + case 'true': + val = true; + break; + case 'false': + val = false; + break; + default: + nf = parseFloat(val); + if (val == nf) { + val = nf; + } + } + return val; + }; + + normalizeValues = function (vals) { + var i, result = []; + for (i = vals.length; i--;) { + result[i] = normalizeValue(vals[i]); + } + return result; + }; + + remove = function (vals, filter) { + var i, vl, result = []; + for (i = 0, vl = vals.length; i < vl; i++) { + if (vals[i] !== filter) { + result.push(vals[i]); + } + } + return result; + }; + + isNumber = function (num) { + return !isNaN(parseFloat(num)) && isFinite(num); + }; + + formatNumber = function (num, prec, groupsize, groupsep, decsep) { + var p, i; + num = (prec === false ? parseFloat(num).toString() : num.toFixed(prec)).split(''); + p = (p = $.inArray('.', num)) < 0 ? num.length : p; + if (p < num.length) { + num[p] = decsep; + } + for (i = p - groupsize; i > 0; i -= groupsize) { + num.splice(i, 0, groupsep); + } + return num.join(''); + }; + + // determine if all values of an array match a value + // returns true if the array is empty + all = function (val, arr, ignoreNull) { + var i; + for (i = arr.length; i--; ) { + if (ignoreNull && arr[i] === null) continue; + if (arr[i] !== val) { + return false; + } + } + return true; + }; + + // sums the numeric values in an array, ignoring other values + sum = function (vals) { + var total = 0, i; + for (i = vals.length; i--;) { + total += typeof vals[i] === 'number' ? vals[i] : 0; + } + return total; + }; + + ensureArray = function (val) { + return $.isArray(val) ? val : [val]; + }; + + // http://paulirish.com/2008/bookmarklet-inject-new-css-rules/ + addCSS = function(css) { + var tag; + //if ('\v' == 'v') /* ie only */ { + if (document.createStyleSheet) { + document.createStyleSheet().cssText = css; + } else { + tag = document.createElement('style'); + tag.type = 'text/css'; + document.getElementsByTagName('head')[0].appendChild(tag); + tag[(typeof document.body.style.WebkitAppearance == 'string') /* webkit only */ ? 'innerText' : 'innerHTML'] = css; + } + }; + + // Provide a cross-browser interface to a few simple drawing primitives + $.fn.simpledraw = function (width, height, useExisting, interact) { + var target, mhandler; + if (useExisting && (target = this.data('_jqs_vcanvas'))) { + return target; + } + + if ($.fn.sparkline.canvas === false) { + // We've already determined that neither Canvas nor VML are available + return false; + + } else if ($.fn.sparkline.canvas === undefined) { + // No function defined yet -- need to see if we support Canvas or VML + var el = document.createElement('canvas'); + if (!!(el.getContext && el.getContext('2d'))) { + // Canvas is available + $.fn.sparkline.canvas = function(width, height, target, interact) { + return new VCanvas_canvas(width, height, target, interact); + }; + } else if (document.namespaces && !document.namespaces.v) { + // VML is available + document.namespaces.add('v', 'urn:schemas-microsoft-com:vml', '#default#VML'); + $.fn.sparkline.canvas = function(width, height, target, interact) { + return new VCanvas_vml(width, height, target); + }; + } else { + // Neither Canvas nor VML are available + $.fn.sparkline.canvas = false; + return false; + } + } + + if (width === undefined) { + width = $(this).innerWidth(); + } + if (height === undefined) { + height = $(this).innerHeight(); + } + + target = $.fn.sparkline.canvas(width, height, this, interact); + + mhandler = $(this).data('_jqs_mhandler'); + if (mhandler) { + mhandler.registerCanvas(target); + } + return target; + }; + + $.fn.cleardraw = function () { + var target = this.data('_jqs_vcanvas'); + if (target) { + target.reset(); + } + }; + + $.RangeMapClass = RangeMap = createClass({ + init: function (map) { + var key, range, rangelist = []; + for (key in map) { + if (map.hasOwnProperty(key) && typeof key === 'string' && key.indexOf(':') > -1) { + range = key.split(':'); + range[0] = range[0].length === 0 ? -Infinity : parseFloat(range[0]); + range[1] = range[1].length === 0 ? Infinity : parseFloat(range[1]); + range[2] = map[key]; + rangelist.push(range); + } + } + this.map = map; + this.rangelist = rangelist || false; + }, + + get: function (value) { + var rangelist = this.rangelist, + i, range, result; + if ((result = this.map[value]) !== undefined) { + return result; + } + if (rangelist) { + for (i = rangelist.length; i--;) { + range = rangelist[i]; + if (range[0] <= value && range[1] >= value) { + return range[2]; + } + } + } + return undefined; + } + }); + + // Convenience function + $.range_map = function(map) { + return new RangeMap(map); + }; + + MouseHandler = createClass({ + init: function (el, options) { + var $el = $(el); + this.$el = $el; + this.options = options; + this.currentPageX = 0; + this.currentPageY = 0; + this.el = el; + this.splist = []; + this.tooltip = null; + this.over = false; + this.displayTooltips = !options.get('disableTooltips'); + this.highlightEnabled = !options.get('disableHighlight'); + }, + + registerSparkline: function (sp) { + this.splist.push(sp); + if (this.over) { + this.updateDisplay(); + } + }, + + registerCanvas: function (canvas) { + var $canvas = $(canvas.canvas); + this.canvas = canvas; + this.$canvas = $canvas; + $canvas.mouseenter($.proxy(this.mouseenter, this)); + $canvas.mouseleave($.proxy(this.mouseleave, this)); + $canvas.click($.proxy(this.mouseclick, this)); + }, + + reset: function (removeTooltip) { + this.splist = []; + if (this.tooltip && removeTooltip) { + this.tooltip.remove(); + this.tooltip = undefined; + } + }, + + mouseclick: function (e) { + var clickEvent = $.Event('sparklineClick'); + clickEvent.originalEvent = e; + clickEvent.sparklines = this.splist; + this.$el.trigger(clickEvent); + }, + + mouseenter: function (e) { + $(document.body).unbind('mousemove.jqs'); + $(document.body).bind('mousemove.jqs', $.proxy(this.mousemove, this)); + this.over = true; + this.currentPageX = e.pageX; + this.currentPageY = e.pageY; + this.currentEl = e.target; + if (!this.tooltip && this.displayTooltips) { + this.tooltip = new Tooltip(this.options); + this.tooltip.updatePosition(e.pageX, e.pageY); + } + this.updateDisplay(); + }, + + mouseleave: function () { + $(document.body).unbind('mousemove.jqs'); + var splist = this.splist, + spcount = splist.length, + needsRefresh = false, + sp, i; + this.over = false; + this.currentEl = null; + + if (this.tooltip) { + this.tooltip.remove(); + this.tooltip = null; + } + + for (i = 0; i < spcount; i++) { + sp = splist[i]; + if (sp.clearRegionHighlight()) { + needsRefresh = true; + } + } + + if (needsRefresh) { + this.canvas.render(); + } + }, + + mousemove: function (e) { + this.currentPageX = e.pageX; + this.currentPageY = e.pageY; + this.currentEl = e.target; + if (this.tooltip) { + this.tooltip.updatePosition(e.pageX, e.pageY); + } + this.updateDisplay(); + }, + + updateDisplay: function () { + var splist = this.splist, + spcount = splist.length, + needsRefresh = false, + offset = this.$canvas.offset(), + localX = this.currentPageX - offset.left, + localY = this.currentPageY - offset.top, + tooltiphtml, sp, i, result, changeEvent; + if (!this.over) { + return; + } + for (i = 0; i < spcount; i++) { + sp = splist[i]; + result = sp.setRegionHighlight(this.currentEl, localX, localY); + if (result) { + needsRefresh = true; + } + } + if (needsRefresh) { + changeEvent = $.Event('sparklineRegionChange'); + changeEvent.sparklines = this.splist; + this.$el.trigger(changeEvent); + if (this.tooltip) { + tooltiphtml = ''; + for (i = 0; i < spcount; i++) { + sp = splist[i]; + tooltiphtml += sp.getCurrentRegionTooltip(); + } + this.tooltip.setContent(tooltiphtml); + } + if (!this.disableHighlight) { + this.canvas.render(); + } + } + if (result === null) { + this.mouseleave(); + } + } + }); + + + Tooltip = createClass({ + sizeStyle: 'position: static !important;' + + 'display: block !important;' + + 'visibility: hidden !important;' + + 'float: left !important;', + + init: function (options) { + var tooltipClassname = options.get('tooltipClassname', 'jqstooltip'), + sizetipStyle = this.sizeStyle, + offset; + this.container = options.get('tooltipContainer') || document.body; + this.tooltipOffsetX = options.get('tooltipOffsetX', 10); + this.tooltipOffsetY = options.get('tooltipOffsetY', 12); + // remove any previous lingering tooltip + $('#jqssizetip').remove(); + $('#jqstooltip').remove(); + this.sizetip = $('
        ', { + id: 'jqssizetip', + style: sizetipStyle, + 'class': tooltipClassname + }); + this.tooltip = $('
        ', { + id: 'jqstooltip', + 'class': tooltipClassname + }).appendTo(this.container); + // account for the container's location + offset = this.tooltip.offset(); + this.offsetLeft = offset.left; + this.offsetTop = offset.top; + this.hidden = true; + $(window).unbind('resize.jqs scroll.jqs'); + $(window).bind('resize.jqs scroll.jqs', $.proxy(this.updateWindowDims, this)); + this.updateWindowDims(); + }, + + updateWindowDims: function () { + this.scrollTop = $(window).scrollTop(); + this.scrollLeft = $(window).scrollLeft(); + this.scrollRight = this.scrollLeft + $(window).width(); + this.updatePosition(); + }, + + getSize: function (content) { + this.sizetip.html(content).appendTo(this.container); + this.width = this.sizetip.width() + 1; + this.height = this.sizetip.height(); + this.sizetip.remove(); + }, + + setContent: function (content) { + if (!content) { + this.tooltip.css('visibility', 'hidden'); + this.hidden = true; + return; + } + this.getSize(content); + this.tooltip.html(content) + .css({ + 'width': this.width, + 'height': this.height, + 'visibility': 'visible' + }); + if (this.hidden) { + this.hidden = false; + this.updatePosition(); + } + }, + + updatePosition: function (x, y) { + if (x === undefined) { + if (this.mousex === undefined) { + return; + } + x = this.mousex - this.offsetLeft; + y = this.mousey - this.offsetTop; + + } else { + this.mousex = x = x - this.offsetLeft; + this.mousey = y = y - this.offsetTop; + } + if (!this.height || !this.width || this.hidden) { + return; + } + + y -= this.height + this.tooltipOffsetY; + x += this.tooltipOffsetX; + + if (y < this.scrollTop) { + y = this.scrollTop; + } + if (x < this.scrollLeft) { + x = this.scrollLeft; + } else if (x + this.width > this.scrollRight) { + x = this.scrollRight - this.width; + } + + this.tooltip.css({ + 'left': x, + 'top': y + }); + }, + + remove: function () { + this.tooltip.remove(); + this.sizetip.remove(); + this.sizetip = this.tooltip = undefined; + $(window).unbind('resize.jqs scroll.jqs'); + } + }); + + initStyles = function() { + addCSS(defaultStyles); + }; + + $(initStyles); + + pending = []; + $.fn.sparkline = function (userValues, userOptions) { + return this.each(function () { + var options = new $.fn.sparkline.options(this, userOptions), + $this = $(this), + render, i; + render = function () { + var values, width, height, tmp, mhandler, sp, vals; + if (userValues === 'html' || userValues === undefined) { + vals = this.getAttribute(options.get('tagValuesAttribute')); + if (vals === undefined || vals === null) { + vals = $this.html(); + } + values = vals.replace(/(^\s*\s*$)|\s+/g, '').split(','); + } else { + values = userValues; + } + + width = options.get('width') === 'auto' ? values.length * options.get('defaultPixelsPerValue') : options.get('width'); + if (options.get('height') === 'auto') { + if (!options.get('composite') || !$.data(this, '_jqs_vcanvas')) { + // must be a better way to get the line height + tmp = document.createElement('span'); + tmp.innerHTML = 'a'; + $this.html(tmp); + height = $(tmp).innerHeight() || $(tmp).height(); + $(tmp).remove(); + tmp = null; + } + } else { + height = options.get('height'); + } + + if (!options.get('disableInteraction')) { + mhandler = $.data(this, '_jqs_mhandler'); + if (!mhandler) { + mhandler = new MouseHandler(this, options); + $.data(this, '_jqs_mhandler', mhandler); + } else if (!options.get('composite')) { + mhandler.reset(); + } + } else { + mhandler = false; + } + + if (options.get('composite') && !$.data(this, '_jqs_vcanvas')) { + if (!$.data(this, '_jqs_errnotify')) { + alert('Attempted to attach a composite sparkline to an element with no existing sparkline'); + $.data(this, '_jqs_errnotify', true); + } + return; + } + + sp = new $.fn.sparkline[options.get('type')](this, values, options, width, height); + + sp.render(); + + if (mhandler) { + mhandler.registerSparkline(sp); + } + }; + if (($(this).html() && !options.get('disableHiddenCheck') && $(this).is(':hidden')) || !$(this).parents('body').length) { + if (!options.get('composite') && $.data(this, '_jqs_pending')) { + // remove any existing references to the element + for (i = pending.length; i; i--) { + if (pending[i - 1][0] == this) { + pending.splice(i - 1, 1); + } + } + } + pending.push([this, render]); + $.data(this, '_jqs_pending', true); + } else { + render.call(this); + } + }); + }; + + $.fn.sparkline.defaults = getDefaults(); + + + $.sparkline_display_visible = function () { + var el, i, pl; + var done = []; + for (i = 0, pl = pending.length; i < pl; i++) { + el = pending[i][0]; + if ($(el).is(':visible') && !$(el).parents().is(':hidden')) { + pending[i][1].call(el); + $.data(pending[i][0], '_jqs_pending', false); + done.push(i); + } else if (!$(el).closest('html').length && !$.data(el, '_jqs_pending')) { + // element has been inserted and removed from the DOM + // If it was not yet inserted into the dom then the .data request + // will return true. + // removing from the dom causes the data to be removed. + $.data(pending[i][0], '_jqs_pending', false); + done.push(i); + } + } + for (i = done.length; i; i--) { + pending.splice(done[i - 1], 1); + } + }; + + + /** + * User option handler + */ + $.fn.sparkline.options = createClass({ + init: function (tag, userOptions) { + var extendedOptions, defaults, base, tagOptionType; + this.userOptions = userOptions = userOptions || {}; + this.tag = tag; + this.tagValCache = {}; + defaults = $.fn.sparkline.defaults; + base = defaults.common; + this.tagOptionsPrefix = userOptions.enableTagOptions && (userOptions.tagOptionsPrefix || base.tagOptionsPrefix); + + tagOptionType = this.getTagSetting('type'); + if (tagOptionType === UNSET_OPTION) { + extendedOptions = defaults[userOptions.type || base.type]; + } else { + extendedOptions = defaults[tagOptionType]; + } + this.mergedOptions = $.extend({}, base, extendedOptions, userOptions); + }, + + + getTagSetting: function (key) { + var prefix = this.tagOptionsPrefix, + val, i, pairs, keyval; + if (prefix === false || prefix === undefined) { + return UNSET_OPTION; + } + if (this.tagValCache.hasOwnProperty(key)) { + val = this.tagValCache.key; + } else { + val = this.tag.getAttribute(prefix + key); + if (val === undefined || val === null) { + val = UNSET_OPTION; + } else if (val.substr(0, 1) === '[') { + val = val.substr(1, val.length - 2).split(','); + for (i = val.length; i--;) { + val[i] = normalizeValue(val[i].replace(/(^\s*)|(\s*$)/g, '')); + } + } else if (val.substr(0, 1) === '{') { + pairs = val.substr(1, val.length - 2).split(','); + val = {}; + for (i = pairs.length; i--;) { + keyval = pairs[i].split(':', 2); + val[keyval[0].replace(/(^\s*)|(\s*$)/g, '')] = normalizeValue(keyval[1].replace(/(^\s*)|(\s*$)/g, '')); + } + } else { + val = normalizeValue(val); + } + this.tagValCache.key = val; + } + return val; + }, + + get: function (key, defaultval) { + var tagOption = this.getTagSetting(key), + result; + if (tagOption !== UNSET_OPTION) { + return tagOption; + } + return (result = this.mergedOptions[key]) === undefined ? defaultval : result; + } + }); + + + $.fn.sparkline._base = createClass({ + disabled: false, + + init: function (el, values, options, width, height) { + this.el = el; + this.$el = $(el); + this.values = values; + this.options = options; + this.width = width; + this.height = height; + this.currentRegion = undefined; + }, + + /** + * Setup the canvas + */ + initTarget: function () { + var interactive = !this.options.get('disableInteraction'); + if (!(this.target = this.$el.simpledraw(this.width, this.height, this.options.get('composite'), interactive))) { + this.disabled = true; + } else { + this.canvasWidth = this.target.pixelWidth; + this.canvasHeight = this.target.pixelHeight; + } + }, + + /** + * Actually render the chart to the canvas + */ + render: function () { + if (this.disabled) { + this.el.innerHTML = ''; + return false; + } + return true; + }, + + /** + * Return a region id for a given x/y co-ordinate + */ + getRegion: function (x, y) { + }, + + /** + * Highlight an item based on the moused-over x,y co-ordinate + */ + setRegionHighlight: function (el, x, y) { + var currentRegion = this.currentRegion, + highlightEnabled = !this.options.get('disableHighlight'), + newRegion; + if (x > this.canvasWidth || y > this.canvasHeight || x < 0 || y < 0) { + return null; + } + newRegion = this.getRegion(el, x, y); + if (currentRegion !== newRegion) { + if (currentRegion !== undefined && highlightEnabled) { + this.removeHighlight(); + } + this.currentRegion = newRegion; + if (newRegion !== undefined && highlightEnabled) { + this.renderHighlight(); + } + return true; + } + return false; + }, + + /** + * Reset any currently highlighted item + */ + clearRegionHighlight: function () { + if (this.currentRegion !== undefined) { + this.removeHighlight(); + this.currentRegion = undefined; + return true; + } + return false; + }, + + renderHighlight: function () { + this.changeHighlight(true); + }, + + removeHighlight: function () { + this.changeHighlight(false); + }, + + changeHighlight: function (highlight) {}, + + /** + * Fetch the HTML to display as a tooltip + */ + getCurrentRegionTooltip: function () { + var options = this.options, + header = '', + entries = [], + fields, formats, formatlen, fclass, text, i, + showFields, showFieldsKey, newFields, fv, + formatter, format, fieldlen, j; + if (this.currentRegion === undefined) { + return ''; + } + fields = this.getCurrentRegionFields(); + formatter = options.get('tooltipFormatter'); + if (formatter) { + return formatter(this, options, fields); + } + if (options.get('tooltipChartTitle')) { + header += '
        ' + options.get('tooltipChartTitle') + '
        \n'; + } + formats = this.options.get('tooltipFormat'); + if (!formats) { + return ''; + } + if (!$.isArray(formats)) { + formats = [formats]; + } + if (!$.isArray(fields)) { + fields = [fields]; + } + showFields = this.options.get('tooltipFormatFieldlist'); + showFieldsKey = this.options.get('tooltipFormatFieldlistKey'); + if (showFields && showFieldsKey) { + // user-selected ordering of fields + newFields = []; + for (i = fields.length; i--;) { + fv = fields[i][showFieldsKey]; + if ((j = $.inArray(fv, showFields)) != -1) { + newFields[j] = fields[i]; + } + } + fields = newFields; + } + formatlen = formats.length; + fieldlen = fields.length; + for (i = 0; i < formatlen; i++) { + format = formats[i]; + if (typeof format === 'string') { + format = new SPFormat(format); + } + fclass = format.fclass || 'jqsfield'; + for (j = 0; j < fieldlen; j++) { + if (!fields[j].isNull || !options.get('tooltipSkipNull')) { + $.extend(fields[j], { + prefix: options.get('tooltipPrefix'), + suffix: options.get('tooltipSuffix') + }); + text = format.render(fields[j], options.get('tooltipValueLookups'), options); + entries.push('
        ' + text + '
        '); + } + } + } + if (entries.length) { + return header + entries.join('\n'); + } + return ''; + }, + + getCurrentRegionFields: function () {}, + + calcHighlightColor: function (color, options) { + var highlightColor = options.get('highlightColor'), + lighten = options.get('highlightLighten'), + parse, mult, rgbnew, i; + if (highlightColor) { + return highlightColor; + } + if (lighten) { + // extract RGB values + parse = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(color) || /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color); + if (parse) { + rgbnew = []; + mult = color.length === 4 ? 16 : 1; + for (i = 0; i < 3; i++) { + rgbnew[i] = clipval(Math.round(parseInt(parse[i + 1], 16) * mult * lighten), 0, 255); + } + return 'rgb(' + rgbnew.join(',') + ')'; + } + + } + return color; + } + + }); + + barHighlightMixin = { + changeHighlight: function (highlight) { + var currentRegion = this.currentRegion, + target = this.target, + shapeids = this.regionShapes[currentRegion], + newShapes; + // will be null if the region value was null + if (shapeids) { + newShapes = this.renderRegion(currentRegion, highlight); + if ($.isArray(newShapes) || $.isArray(shapeids)) { + target.replaceWithShapes(shapeids, newShapes); + this.regionShapes[currentRegion] = $.map(newShapes, function (newShape) { + return newShape.id; + }); + } else { + target.replaceWithShape(shapeids, newShapes); + this.regionShapes[currentRegion] = newShapes.id; + } + } + }, + + render: function () { + var values = this.values, + target = this.target, + regionShapes = this.regionShapes, + shapes, ids, i, j; + + if (!this.cls._super.render.call(this)) { + return; + } + for (i = values.length; i--;) { + shapes = this.renderRegion(i); + if (shapes) { + if ($.isArray(shapes)) { + ids = []; + for (j = shapes.length; j--;) { + shapes[j].append(); + ids.push(shapes[j].id); + } + regionShapes[i] = ids; + } else { + shapes.append(); + regionShapes[i] = shapes.id; // store just the shapeid + } + } else { + // null value + regionShapes[i] = null; + } + } + target.render(); + } + }; + + /** + * Line charts + */ + $.fn.sparkline.line = line = createClass($.fn.sparkline._base, { + type: 'line', + + init: function (el, values, options, width, height) { + line._super.init.call(this, el, values, options, width, height); + this.vertices = []; + this.regionMap = []; + this.xvalues = []; + this.yvalues = []; + this.yminmax = []; + this.hightlightSpotId = null; + this.lastShapeId = null; + this.initTarget(); + }, + + getRegion: function (el, x, y) { + var i, + regionMap = this.regionMap; // maps regions to value positions + for (i = regionMap.length; i--;) { + if (regionMap[i] !== null && x >= regionMap[i][0] && x <= regionMap[i][1]) { + return regionMap[i][2]; + } + } + return undefined; + }, + + getCurrentRegionFields: function () { + var currentRegion = this.currentRegion; + return { + isNull: this.yvalues[currentRegion] === null, + x: this.xvalues[currentRegion], + y: this.yvalues[currentRegion], + color: this.options.get('lineColor'), + fillColor: this.options.get('fillColor'), + offset: currentRegion + }; + }, + + renderHighlight: function () { + var currentRegion = this.currentRegion, + target = this.target, + vertex = this.vertices[currentRegion], + options = this.options, + spotRadius = options.get('spotRadius'), + highlightSpotColor = options.get('highlightSpotColor'), + highlightLineColor = options.get('highlightLineColor'), + highlightSpot, highlightLine; + + if (!vertex) { + return; + } + if (spotRadius && highlightSpotColor) { + highlightSpot = target.drawCircle(vertex[0], vertex[1], + spotRadius, undefined, highlightSpotColor); + this.highlightSpotId = highlightSpot.id; + target.insertAfterShape(this.lastShapeId, highlightSpot); + } + if (highlightLineColor) { + highlightLine = target.drawLine(vertex[0], this.canvasTop, vertex[0], + this.canvasTop + this.canvasHeight, highlightLineColor); + this.highlightLineId = highlightLine.id; + target.insertAfterShape(this.lastShapeId, highlightLine); + } + }, + + removeHighlight: function () { + var target = this.target; + if (this.highlightSpotId) { + target.removeShapeId(this.highlightSpotId); + this.highlightSpotId = null; + } + if (this.highlightLineId) { + target.removeShapeId(this.highlightLineId); + this.highlightLineId = null; + } + }, + + scanValues: function () { + var values = this.values, + valcount = values.length, + xvalues = this.xvalues, + yvalues = this.yvalues, + yminmax = this.yminmax, + i, val, isStr, isArray, sp; + for (i = 0; i < valcount; i++) { + val = values[i]; + isStr = typeof(values[i]) === 'string'; + isArray = typeof(values[i]) === 'object' && values[i] instanceof Array; + sp = isStr && values[i].split(':'); + if (isStr && sp.length === 2) { // x:y + xvalues.push(Number(sp[0])); + yvalues.push(Number(sp[1])); + yminmax.push(Number(sp[1])); + } else if (isArray) { + xvalues.push(val[0]); + yvalues.push(val[1]); + yminmax.push(val[1]); + } else { + xvalues.push(i); + if (values[i] === null || values[i] === 'null') { + yvalues.push(null); + } else { + yvalues.push(Number(val)); + yminmax.push(Number(val)); + } + } + } + if (this.options.get('xvalues')) { + xvalues = this.options.get('xvalues'); + } + + this.maxy = this.maxyorg = Math.max.apply(Math, yminmax); + this.miny = this.minyorg = Math.min.apply(Math, yminmax); + + this.maxx = Math.max.apply(Math, xvalues); + this.minx = Math.min.apply(Math, xvalues); + + this.xvalues = xvalues; + this.yvalues = yvalues; + this.yminmax = yminmax; + + }, + + processRangeOptions: function () { + var options = this.options, + normalRangeMin = options.get('normalRangeMin'), + normalRangeMax = options.get('normalRangeMax'); + + if (normalRangeMin !== undefined) { + if (normalRangeMin < this.miny) { + this.miny = normalRangeMin; + } + if (normalRangeMax > this.maxy) { + this.maxy = normalRangeMax; + } + } + if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < this.miny)) { + this.miny = options.get('chartRangeMin'); + } + if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > this.maxy)) { + this.maxy = options.get('chartRangeMax'); + } + if (options.get('chartRangeMinX') !== undefined && (options.get('chartRangeClipX') || options.get('chartRangeMinX') < this.minx)) { + this.minx = options.get('chartRangeMinX'); + } + if (options.get('chartRangeMaxX') !== undefined && (options.get('chartRangeClipX') || options.get('chartRangeMaxX') > this.maxx)) { + this.maxx = options.get('chartRangeMaxX'); + } + + }, + + drawNormalRange: function (canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey) { + var normalRangeMin = this.options.get('normalRangeMin'), + normalRangeMax = this.options.get('normalRangeMax'), + ytop = canvasTop + Math.round(canvasHeight - (canvasHeight * ((normalRangeMax - this.miny) / rangey))), + height = Math.round((canvasHeight * (normalRangeMax - normalRangeMin)) / rangey); + this.target.drawRect(canvasLeft, ytop, canvasWidth, height, undefined, this.options.get('normalRangeColor')).append(); + }, + + render: function () { + var options = this.options, + target = this.target, + canvasWidth = this.canvasWidth, + canvasHeight = this.canvasHeight, + vertices = this.vertices, + spotRadius = options.get('spotRadius'), + regionMap = this.regionMap, + rangex, rangey, yvallast, + canvasTop, canvasLeft, + vertex, path, paths, x, y, xnext, xpos, xposnext, + last, next, yvalcount, lineShapes, fillShapes, plen, + valueSpots, hlSpotsEnabled, color, xvalues, yvalues, i; + + if (!line._super.render.call(this)) { + return; + } + + this.scanValues(); + this.processRangeOptions(); + + xvalues = this.xvalues; + yvalues = this.yvalues; + + if (!this.yminmax.length || this.yvalues.length < 2) { + // empty or all null valuess + return; + } + + canvasTop = canvasLeft = 0; + + rangex = this.maxx - this.minx === 0 ? 1 : this.maxx - this.minx; + rangey = this.maxy - this.miny === 0 ? 1 : this.maxy - this.miny; + yvallast = this.yvalues.length - 1; + + if (spotRadius && (canvasWidth < (spotRadius * 4) || canvasHeight < (spotRadius * 4))) { + spotRadius = 0; + } + if (spotRadius) { + // adjust the canvas size as required so that spots will fit + hlSpotsEnabled = options.get('highlightSpotColor') && !options.get('disableInteraction'); + if (hlSpotsEnabled || options.get('minSpotColor') || (options.get('spotColor') && yvalues[yvallast] === this.miny)) { + canvasHeight -= Math.ceil(spotRadius); + } + if (hlSpotsEnabled || options.get('maxSpotColor') || (options.get('spotColor') && yvalues[yvallast] === this.maxy)) { + canvasHeight -= Math.ceil(spotRadius); + canvasTop += Math.ceil(spotRadius); + } + if (hlSpotsEnabled || + ((options.get('minSpotColor') || options.get('maxSpotColor')) && (yvalues[0] === this.miny || yvalues[0] === this.maxy))) { + canvasLeft += Math.ceil(spotRadius); + canvasWidth -= Math.ceil(spotRadius); + } + if (hlSpotsEnabled || options.get('spotColor') || + (options.get('minSpotColor') || options.get('maxSpotColor') && + (yvalues[yvallast] === this.miny || yvalues[yvallast] === this.maxy))) { + canvasWidth -= Math.ceil(spotRadius); + } + } + + + canvasHeight--; + + if (options.get('normalRangeMin') !== undefined && !options.get('drawNormalOnTop')) { + this.drawNormalRange(canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey); + } + + path = []; + paths = [path]; + last = next = null; + yvalcount = yvalues.length; + for (i = 0; i < yvalcount; i++) { + x = xvalues[i]; + xnext = xvalues[i + 1]; + y = yvalues[i]; + xpos = canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)); + xposnext = i < yvalcount - 1 ? canvasLeft + Math.round((xnext - this.minx) * (canvasWidth / rangex)) : canvasWidth; + next = xpos + ((xposnext - xpos) / 2); + regionMap[i] = [last || 0, next, i]; + last = next; + if (y === null) { + if (i) { + if (yvalues[i - 1] !== null) { + path = []; + paths.push(path); + } + vertices.push(null); + } + } else { + if (y < this.miny) { + y = this.miny; + } + if (y > this.maxy) { + y = this.maxy; + } + if (!path.length) { + // previous value was null + path.push([xpos, canvasTop + canvasHeight]); + } + vertex = [xpos, canvasTop + Math.round(canvasHeight - (canvasHeight * ((y - this.miny) / rangey)))]; + path.push(vertex); + vertices.push(vertex); + } + } + + lineShapes = []; + fillShapes = []; + plen = paths.length; + for (i = 0; i < plen; i++) { + path = paths[i]; + if (path.length) { + if (options.get('fillColor')) { + path.push([path[path.length - 1][0], (canvasTop + canvasHeight)]); + fillShapes.push(path.slice(0)); + path.pop(); + } + // if there's only a single point in this path, then we want to display it + // as a vertical line which means we keep path[0] as is + if (path.length > 2) { + // else we want the first value + path[0] = [path[0][0], path[1][1]]; + } + lineShapes.push(path); + } + } + + // draw the fill first, then optionally the normal range, then the line on top of that + plen = fillShapes.length; + for (i = 0; i < plen; i++) { + target.drawShape(fillShapes[i], + options.get('fillColor'), options.get('fillColor')).append(); + } + + if (options.get('normalRangeMin') !== undefined && options.get('drawNormalOnTop')) { + this.drawNormalRange(canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey); + } + + plen = lineShapes.length; + for (i = 0; i < plen; i++) { + target.drawShape(lineShapes[i], options.get('lineColor'), undefined, + options.get('lineWidth')).append(); + } + + if (spotRadius && options.get('valueSpots')) { + valueSpots = options.get('valueSpots'); + if (valueSpots.get === undefined) { + valueSpots = new RangeMap(valueSpots); + } + for (i = 0; i < yvalcount; i++) { + color = valueSpots.get(yvalues[i]); + if (color) { + target.drawCircle(canvasLeft + Math.round((xvalues[i] - this.minx) * (canvasWidth / rangex)), + canvasTop + Math.round(canvasHeight - (canvasHeight * ((yvalues[i] - this.miny) / rangey))), + spotRadius, undefined, + color).append(); + } + } + + } + if (spotRadius && options.get('spotColor') && yvalues[yvallast] !== null) { + target.drawCircle(canvasLeft + Math.round((xvalues[xvalues.length - 1] - this.minx) * (canvasWidth / rangex)), + canvasTop + Math.round(canvasHeight - (canvasHeight * ((yvalues[yvallast] - this.miny) / rangey))), + spotRadius, undefined, + options.get('spotColor')).append(); + } + if (this.maxy !== this.minyorg) { + if (spotRadius && options.get('minSpotColor')) { + x = xvalues[$.inArray(this.minyorg, yvalues)]; + target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)), + canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.minyorg - this.miny) / rangey))), + spotRadius, undefined, + options.get('minSpotColor')).append(); + } + if (spotRadius && options.get('maxSpotColor')) { + x = xvalues[$.inArray(this.maxyorg, yvalues)]; + target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)), + canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.maxyorg - this.miny) / rangey))), + spotRadius, undefined, + options.get('maxSpotColor')).append(); + } + } + + this.lastShapeId = target.getLastShapeId(); + this.canvasTop = canvasTop; + target.render(); + } + }); + + /** + * Bar charts + */ + $.fn.sparkline.bar = bar = createClass($.fn.sparkline._base, barHighlightMixin, { + type: 'bar', + + init: function (el, values, options, width, height) { + var barWidth = parseInt(options.get('barWidth'), 10), + barSpacing = parseInt(options.get('barSpacing'), 10), + chartRangeMin = options.get('chartRangeMin'), + chartRangeMax = options.get('chartRangeMax'), + chartRangeClip = options.get('chartRangeClip'), + stackMin = Infinity, + stackMax = -Infinity, + isStackString, groupMin, groupMax, stackRanges, + numValues, i, vlen, range, zeroAxis, xaxisOffset, min, max, clipMin, clipMax, + stacked, vlist, j, slen, svals, val, yoffset, yMaxCalc, canvasHeightEf; + bar._super.init.call(this, el, values, options, width, height); + + // scan values to determine whether to stack bars + for (i = 0, vlen = values.length; i < vlen; i++) { + val = values[i]; + isStackString = typeof(val) === 'string' && val.indexOf(':') > -1; + if (isStackString || $.isArray(val)) { + stacked = true; + if (isStackString) { + val = values[i] = normalizeValues(val.split(':')); + } + val = remove(val, null); // min/max will treat null as zero + groupMin = Math.min.apply(Math, val); + groupMax = Math.max.apply(Math, val); + if (groupMin < stackMin) { + stackMin = groupMin; + } + if (groupMax > stackMax) { + stackMax = groupMax; + } + } + } + + this.stacked = stacked; + this.regionShapes = {}; + this.barWidth = barWidth; + this.barSpacing = barSpacing; + this.totalBarWidth = barWidth + barSpacing; + this.width = width = (values.length * barWidth) + ((values.length - 1) * barSpacing); + + this.initTarget(); + + if (chartRangeClip) { + clipMin = chartRangeMin === undefined ? -Infinity : chartRangeMin; + clipMax = chartRangeMax === undefined ? Infinity : chartRangeMax; + } + + numValues = []; + stackRanges = stacked ? [] : numValues; + var stackTotals = []; + var stackRangesNeg = []; + for (i = 0, vlen = values.length; i < vlen; i++) { + if (stacked) { + vlist = values[i]; + values[i] = svals = []; + stackTotals[i] = 0; + stackRanges[i] = stackRangesNeg[i] = 0; + for (j = 0, slen = vlist.length; j < slen; j++) { + val = svals[j] = chartRangeClip ? clipval(vlist[j], clipMin, clipMax) : vlist[j]; + if (val !== null) { + if (val > 0) { + stackTotals[i] += val; + } + if (stackMin < 0 && stackMax > 0) { + if (val < 0) { + stackRangesNeg[i] += Math.abs(val); + } else { + stackRanges[i] += val; + } + } else { + stackRanges[i] += Math.abs(val - (val < 0 ? stackMax : stackMin)); + } + numValues.push(val); + } + } + } else { + val = chartRangeClip ? clipval(values[i], clipMin, clipMax) : values[i]; + val = values[i] = normalizeValue(val); + if (val !== null) { + numValues.push(val); + } + } + } + this.max = max = Math.max.apply(Math, numValues); + this.min = min = Math.min.apply(Math, numValues); + this.stackMax = stackMax = stacked ? Math.max.apply(Math, stackTotals) : max; + this.stackMin = stackMin = stacked ? Math.min.apply(Math, numValues) : min; + + if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < min)) { + min = options.get('chartRangeMin'); + } + if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > max)) { + max = options.get('chartRangeMax'); + } + + this.zeroAxis = zeroAxis = options.get('zeroAxis', true); + if (min <= 0 && max >= 0 && zeroAxis) { + xaxisOffset = 0; + } else if (zeroAxis == false) { + xaxisOffset = min; + } else if (min > 0) { + xaxisOffset = min; + } else { + xaxisOffset = max; + } + this.xaxisOffset = xaxisOffset; + + range = stacked ? (Math.max.apply(Math, stackRanges) + Math.max.apply(Math, stackRangesNeg)) : max - min; + + // as we plot zero/min values a single pixel line, we add a pixel to all other + // values - Reduce the effective canvas size to suit + this.canvasHeightEf = (zeroAxis && min < 0) ? this.canvasHeight - 2 : this.canvasHeight - 1; + + if (min < xaxisOffset) { + yMaxCalc = (stacked && max >= 0) ? stackMax : max; + yoffset = (yMaxCalc - xaxisOffset) / range * this.canvasHeight; + if (yoffset !== Math.ceil(yoffset)) { + this.canvasHeightEf -= 2; + yoffset = Math.ceil(yoffset); + } + } else { + yoffset = this.canvasHeight; + } + this.yoffset = yoffset; + + if ($.isArray(options.get('colorMap'))) { + this.colorMapByIndex = options.get('colorMap'); + this.colorMapByValue = null; + } else { + this.colorMapByIndex = null; + this.colorMapByValue = options.get('colorMap'); + if (this.colorMapByValue && this.colorMapByValue.get === undefined) { + this.colorMapByValue = new RangeMap(this.colorMapByValue); + } + } + + this.range = range; + }, + + getRegion: function (el, x, y) { + var result = Math.floor(x / this.totalBarWidth); + return (result < 0 || result >= this.values.length) ? undefined : result; + }, + + getCurrentRegionFields: function () { + var currentRegion = this.currentRegion, + values = ensureArray(this.values[currentRegion]), + result = [], + value, i; + for (i = values.length; i--;) { + value = values[i]; + result.push({ + isNull: value === null, + value: value, + color: this.calcColor(i, value, currentRegion), + offset: currentRegion + }); + } + return result; + }, + + calcColor: function (stacknum, value, valuenum) { + var colorMapByIndex = this.colorMapByIndex, + colorMapByValue = this.colorMapByValue, + options = this.options, + color, newColor; + if (this.stacked) { + color = options.get('stackedBarColor'); + } else { + color = (value < 0) ? options.get('negBarColor') : options.get('barColor'); + } + if (value === 0 && options.get('zeroColor') !== undefined) { + color = options.get('zeroColor'); + } + if (colorMapByValue && (newColor = colorMapByValue.get(value))) { + color = newColor; + } else if (colorMapByIndex && colorMapByIndex.length > valuenum) { + color = colorMapByIndex[valuenum]; + } + return $.isArray(color) ? color[stacknum % color.length] : color; + }, + + /** + * Render bar(s) for a region + */ + renderRegion: function (valuenum, highlight) { + var vals = this.values[valuenum], + options = this.options, + xaxisOffset = this.xaxisOffset, + result = [], + range = this.range, + stacked = this.stacked, + target = this.target, + x = valuenum * this.totalBarWidth, + canvasHeightEf = this.canvasHeightEf, + yoffset = this.yoffset, + y, height, color, isNull, yoffsetNeg, i, valcount, val, minPlotted, allMin; + + vals = $.isArray(vals) ? vals : [vals]; + valcount = vals.length; + val = vals[0]; + isNull = all(null, vals); + allMin = all(xaxisOffset, vals, true); + + if (isNull) { + if (options.get('nullColor')) { + color = highlight ? options.get('nullColor') : this.calcHighlightColor(options.get('nullColor'), options); + y = (yoffset > 0) ? yoffset - 1 : yoffset; + return target.drawRect(x, y, this.barWidth - 1, 0, color, color); + } else { + return undefined; + } + } + yoffsetNeg = yoffset; + for (i = 0; i < valcount; i++) { + val = vals[i]; + + if (stacked && val === xaxisOffset) { + if (!allMin || minPlotted) { + continue; + } + minPlotted = true; + } + + if (range > 0) { + height = Math.floor(canvasHeightEf * ((Math.abs(val - xaxisOffset) / range))) + 1; + } else { + height = 1; + } + if (val < xaxisOffset || (val === xaxisOffset && yoffset === 0)) { + y = yoffsetNeg; + yoffsetNeg += height; + } else { + y = yoffset - height; + yoffset -= height; + } + color = this.calcColor(i, val, valuenum); + if (highlight) { + color = this.calcHighlightColor(color, options); + } + result.push(target.drawRect(x, y, this.barWidth - 1, height - 1, color, color)); + } + if (result.length === 1) { + return result[0]; + } + return result; + } + }); + + /** + * Tristate charts + */ + $.fn.sparkline.tristate = tristate = createClass($.fn.sparkline._base, barHighlightMixin, { + type: 'tristate', + + init: function (el, values, options, width, height) { + var barWidth = parseInt(options.get('barWidth'), 10), + barSpacing = parseInt(options.get('barSpacing'), 10); + tristate._super.init.call(this, el, values, options, width, height); + + this.regionShapes = {}; + this.barWidth = barWidth; + this.barSpacing = barSpacing; + this.totalBarWidth = barWidth + barSpacing; + this.values = $.map(values, Number); + this.width = width = (values.length * barWidth) + ((values.length - 1) * barSpacing); + + if ($.isArray(options.get('colorMap'))) { + this.colorMapByIndex = options.get('colorMap'); + this.colorMapByValue = null; + } else { + this.colorMapByIndex = null; + this.colorMapByValue = options.get('colorMap'); + if (this.colorMapByValue && this.colorMapByValue.get === undefined) { + this.colorMapByValue = new RangeMap(this.colorMapByValue); + } + } + this.initTarget(); + }, + + getRegion: function (el, x, y) { + return Math.floor(x / this.totalBarWidth); + }, + + getCurrentRegionFields: function () { + var currentRegion = this.currentRegion; + return { + isNull: this.values[currentRegion] === undefined, + value: this.values[currentRegion], + color: this.calcColor(this.values[currentRegion], currentRegion), + offset: currentRegion + }; + }, + + calcColor: function (value, valuenum) { + var values = this.values, + options = this.options, + colorMapByIndex = this.colorMapByIndex, + colorMapByValue = this.colorMapByValue, + color, newColor; + + if (colorMapByValue && (newColor = colorMapByValue.get(value))) { + color = newColor; + } else if (colorMapByIndex && colorMapByIndex.length > valuenum) { + color = colorMapByIndex[valuenum]; + } else if (values[valuenum] < 0) { + color = options.get('negBarColor'); + } else if (values[valuenum] > 0) { + color = options.get('posBarColor'); + } else { + color = options.get('zeroBarColor'); + } + return color; + }, + + renderRegion: function (valuenum, highlight) { + var values = this.values, + options = this.options, + target = this.target, + canvasHeight, height, halfHeight, + x, y, color; + + canvasHeight = target.pixelHeight; + halfHeight = Math.round(canvasHeight / 2); + + x = valuenum * this.totalBarWidth; + if (values[valuenum] < 0) { + y = halfHeight; + height = halfHeight - 1; + } else if (values[valuenum] > 0) { + y = 0; + height = halfHeight - 1; + } else { + y = halfHeight - 1; + height = 2; + } + color = this.calcColor(values[valuenum], valuenum); + if (color === null) { + return; + } + if (highlight) { + color = this.calcHighlightColor(color, options); + } + return target.drawRect(x, y, this.barWidth - 1, height - 1, color, color); + } + }); + + /** + * Discrete charts + */ + $.fn.sparkline.discrete = discrete = createClass($.fn.sparkline._base, barHighlightMixin, { + type: 'discrete', + + init: function (el, values, options, width, height) { + discrete._super.init.call(this, el, values, options, width, height); + + this.regionShapes = {}; + this.values = values = $.map(values, Number); + this.min = Math.min.apply(Math, values); + this.max = Math.max.apply(Math, values); + this.range = this.max - this.min; + this.width = width = options.get('width') === 'auto' ? values.length * 2 : this.width; + this.interval = Math.floor(width / values.length); + this.itemWidth = width / values.length; + if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < this.min)) { + this.min = options.get('chartRangeMin'); + } + if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > this.max)) { + this.max = options.get('chartRangeMax'); + } + this.initTarget(); + if (this.target) { + this.lineHeight = options.get('lineHeight') === 'auto' ? Math.round(this.canvasHeight * 0.3) : options.get('lineHeight'); + } + }, + + getRegion: function (el, x, y) { + return Math.floor(x / this.itemWidth); + }, + + getCurrentRegionFields: function () { + var currentRegion = this.currentRegion; + return { + isNull: this.values[currentRegion] === undefined, + value: this.values[currentRegion], + offset: currentRegion + }; + }, + + renderRegion: function (valuenum, highlight) { + var values = this.values, + options = this.options, + min = this.min, + max = this.max, + range = this.range, + interval = this.interval, + target = this.target, + canvasHeight = this.canvasHeight, + lineHeight = this.lineHeight, + pheight = canvasHeight - lineHeight, + ytop, val, color, x; + + val = clipval(values[valuenum], min, max); + x = valuenum * interval; + ytop = Math.round(pheight - pheight * ((val - min) / range)); + color = (options.get('thresholdColor') && val < options.get('thresholdValue')) ? options.get('thresholdColor') : options.get('lineColor'); + if (highlight) { + color = this.calcHighlightColor(color, options); + } + return target.drawLine(x, ytop, x, ytop + lineHeight, color); + } + }); + + /** + * Bullet charts + */ + $.fn.sparkline.bullet = bullet = createClass($.fn.sparkline._base, { + type: 'bullet', + + init: function (el, values, options, width, height) { + var min, max, vals; + bullet._super.init.call(this, el, values, options, width, height); + + // values: target, performance, range1, range2, range3 + this.values = values = normalizeValues(values); + // target or performance could be null + vals = values.slice(); + vals[0] = vals[0] === null ? vals[2] : vals[0]; + vals[1] = values[1] === null ? vals[2] : vals[1]; + min = Math.min.apply(Math, values); + max = Math.max.apply(Math, values); + if (options.get('base') === undefined) { + min = min < 0 ? min : 0; + } else { + min = options.get('base'); + } + this.min = min; + this.max = max; + this.range = max - min; + this.shapes = {}; + this.valueShapes = {}; + this.regiondata = {}; + this.width = width = options.get('width') === 'auto' ? '4.0em' : width; + this.target = this.$el.simpledraw(width, height, options.get('composite')); + if (!values.length) { + this.disabled = true; + } + this.initTarget(); + }, + + getRegion: function (el, x, y) { + var shapeid = this.target.getShapeAt(el, x, y); + return (shapeid !== undefined && this.shapes[shapeid] !== undefined) ? this.shapes[shapeid] : undefined; + }, + + getCurrentRegionFields: function () { + var currentRegion = this.currentRegion; + return { + fieldkey: currentRegion.substr(0, 1), + value: this.values[currentRegion.substr(1)], + region: currentRegion + }; + }, + + changeHighlight: function (highlight) { + var currentRegion = this.currentRegion, + shapeid = this.valueShapes[currentRegion], + shape; + delete this.shapes[shapeid]; + switch (currentRegion.substr(0, 1)) { + case 'r': + shape = this.renderRange(currentRegion.substr(1), highlight); + break; + case 'p': + shape = this.renderPerformance(highlight); + break; + case 't': + shape = this.renderTarget(highlight); + break; + } + this.valueShapes[currentRegion] = shape.id; + this.shapes[shape.id] = currentRegion; + this.target.replaceWithShape(shapeid, shape); + }, + + renderRange: function (rn, highlight) { + var rangeval = this.values[rn], + rangewidth = Math.round(this.canvasWidth * ((rangeval - this.min) / this.range)), + color = this.options.get('rangeColors')[rn - 2]; + if (highlight) { + color = this.calcHighlightColor(color, this.options); + } + return this.target.drawRect(0, 0, rangewidth - 1, this.canvasHeight - 1, color, color); + }, + + renderPerformance: function (highlight) { + var perfval = this.values[1], + perfwidth = Math.round(this.canvasWidth * ((perfval - this.min) / this.range)), + color = this.options.get('performanceColor'); + if (highlight) { + color = this.calcHighlightColor(color, this.options); + } + return this.target.drawRect(0, Math.round(this.canvasHeight * 0.3), perfwidth - 1, + Math.round(this.canvasHeight * 0.4) - 1, color, color); + }, + + renderTarget: function (highlight) { + var targetval = this.values[0], + x = Math.round(this.canvasWidth * ((targetval - this.min) / this.range) - (this.options.get('targetWidth') / 2)), + targettop = Math.round(this.canvasHeight * 0.10), + targetheight = this.canvasHeight - (targettop * 2), + color = this.options.get('targetColor'); + if (highlight) { + color = this.calcHighlightColor(color, this.options); + } + return this.target.drawRect(x, targettop, this.options.get('targetWidth') - 1, targetheight - 1, color, color); + }, + + render: function () { + var vlen = this.values.length, + target = this.target, + i, shape; + if (!bullet._super.render.call(this)) { + return; + } + for (i = 2; i < vlen; i++) { + shape = this.renderRange(i).append(); + this.shapes[shape.id] = 'r' + i; + this.valueShapes['r' + i] = shape.id; + } + if (this.values[1] !== null) { + shape = this.renderPerformance().append(); + this.shapes[shape.id] = 'p1'; + this.valueShapes.p1 = shape.id; + } + if (this.values[0] !== null) { + shape = this.renderTarget().append(); + this.shapes[shape.id] = 't0'; + this.valueShapes.t0 = shape.id; + } + target.render(); + } + }); + + /** + * Pie charts + */ + $.fn.sparkline.pie = pie = createClass($.fn.sparkline._base, { + type: 'pie', + + init: function (el, values, options, width, height) { + var total = 0, i; + + pie._super.init.call(this, el, values, options, width, height); + + this.shapes = {}; // map shape ids to value offsets + this.valueShapes = {}; // maps value offsets to shape ids + this.values = values = $.map(values, Number); + + if (options.get('width') === 'auto') { + this.width = this.height; + } + + if (values.length > 0) { + for (i = values.length; i--;) { + total += values[i]; + } + } + this.total = total; + this.initTarget(); + this.radius = Math.floor(Math.min(this.canvasWidth, this.canvasHeight) / 2); + }, + + getRegion: function (el, x, y) { + var shapeid = this.target.getShapeAt(el, x, y); + return (shapeid !== undefined && this.shapes[shapeid] !== undefined) ? this.shapes[shapeid] : undefined; + }, + + getCurrentRegionFields: function () { + var currentRegion = this.currentRegion; + return { + isNull: this.values[currentRegion] === undefined, + value: this.values[currentRegion], + percent: this.values[currentRegion] / this.total * 100, + color: this.options.get('sliceColors')[currentRegion % this.options.get('sliceColors').length], + offset: currentRegion + }; + }, + + changeHighlight: function (highlight) { + var currentRegion = this.currentRegion, + newslice = this.renderSlice(currentRegion, highlight), + shapeid = this.valueShapes[currentRegion]; + delete this.shapes[shapeid]; + this.target.replaceWithShape(shapeid, newslice); + this.valueShapes[currentRegion] = newslice.id; + this.shapes[newslice.id] = currentRegion; + }, + + renderSlice: function (valuenum, highlight) { + var target = this.target, + options = this.options, + radius = this.radius, + borderWidth = options.get('borderWidth'), + offset = options.get('offset'), + circle = 2 * Math.PI, + values = this.values, + total = this.total, + next = offset ? (2*Math.PI)*(offset/360) : 0, + start, end, i, vlen, color; + + vlen = values.length; + for (i = 0; i < vlen; i++) { + start = next; + end = next; + if (total > 0) { // avoid divide by zero + end = next + (circle * (values[i] / total)); + } + if (valuenum === i) { + color = options.get('sliceColors')[i % options.get('sliceColors').length]; + if (highlight) { + color = this.calcHighlightColor(color, options); + } + + return target.drawPieSlice(radius, radius, radius - borderWidth, start, end, undefined, color); + } + next = end; + } + }, + + render: function () { + var target = this.target, + values = this.values, + options = this.options, + radius = this.radius, + borderWidth = options.get('borderWidth'), + shape, i; + + if (!pie._super.render.call(this)) { + return; + } + if (borderWidth) { + target.drawCircle(radius, radius, Math.floor(radius - (borderWidth / 2)), + options.get('borderColor'), undefined, borderWidth).append(); + } + for (i = values.length; i--;) { + if (values[i]) { // don't render zero values + shape = this.renderSlice(i).append(); + this.valueShapes[i] = shape.id; // store just the shapeid + this.shapes[shape.id] = i; + } + } + target.render(); + } + }); + + /** + * Box plots + */ + $.fn.sparkline.box = box = createClass($.fn.sparkline._base, { + type: 'box', + + init: function (el, values, options, width, height) { + box._super.init.call(this, el, values, options, width, height); + this.values = $.map(values, Number); + this.width = options.get('width') === 'auto' ? '4.0em' : width; + this.initTarget(); + if (!this.values.length) { + this.disabled = 1; + } + }, + + /** + * Simulate a single region + */ + getRegion: function () { + return 1; + }, + + getCurrentRegionFields: function () { + var result = [ + { field: 'lq', value: this.quartiles[0] }, + { field: 'med', value: this.quartiles[1] }, + { field: 'uq', value: this.quartiles[2] } + ]; + if (this.loutlier !== undefined) { + result.push({ field: 'lo', value: this.loutlier}); + } + if (this.routlier !== undefined) { + result.push({ field: 'ro', value: this.routlier}); + } + if (this.lwhisker !== undefined) { + result.push({ field: 'lw', value: this.lwhisker}); + } + if (this.rwhisker !== undefined) { + result.push({ field: 'rw', value: this.rwhisker}); + } + return result; + }, + + render: function () { + var target = this.target, + values = this.values, + vlen = values.length, + options = this.options, + canvasWidth = this.canvasWidth, + canvasHeight = this.canvasHeight, + minValue = options.get('chartRangeMin') === undefined ? Math.min.apply(Math, values) : options.get('chartRangeMin'), + maxValue = options.get('chartRangeMax') === undefined ? Math.max.apply(Math, values) : options.get('chartRangeMax'), + canvasLeft = 0, + lwhisker, loutlier, iqr, q1, q2, q3, rwhisker, routlier, i, + size, unitSize; + + if (!box._super.render.call(this)) { + return; + } + + if (options.get('raw')) { + if (options.get('showOutliers') && values.length > 5) { + loutlier = values[0]; + lwhisker = values[1]; + q1 = values[2]; + q2 = values[3]; + q3 = values[4]; + rwhisker = values[5]; + routlier = values[6]; + } else { + lwhisker = values[0]; + q1 = values[1]; + q2 = values[2]; + q3 = values[3]; + rwhisker = values[4]; + } + } else { + values.sort(function (a, b) { return a - b; }); + q1 = quartile(values, 1); + q2 = quartile(values, 2); + q3 = quartile(values, 3); + iqr = q3 - q1; + if (options.get('showOutliers')) { + lwhisker = rwhisker = undefined; + for (i = 0; i < vlen; i++) { + if (lwhisker === undefined && values[i] > q1 - (iqr * options.get('outlierIQR'))) { + lwhisker = values[i]; + } + if (values[i] < q3 + (iqr * options.get('outlierIQR'))) { + rwhisker = values[i]; + } + } + loutlier = values[0]; + routlier = values[vlen - 1]; + } else { + lwhisker = values[0]; + rwhisker = values[vlen - 1]; + } + } + this.quartiles = [q1, q2, q3]; + this.lwhisker = lwhisker; + this.rwhisker = rwhisker; + this.loutlier = loutlier; + this.routlier = routlier; + + unitSize = canvasWidth / (maxValue - minValue + 1); + if (options.get('showOutliers')) { + canvasLeft = Math.ceil(options.get('spotRadius')); + canvasWidth -= 2 * Math.ceil(options.get('spotRadius')); + unitSize = canvasWidth / (maxValue - minValue + 1); + if (loutlier < lwhisker) { + target.drawCircle((loutlier - minValue) * unitSize + canvasLeft, + canvasHeight / 2, + options.get('spotRadius'), + options.get('outlierLineColor'), + options.get('outlierFillColor')).append(); + } + if (routlier > rwhisker) { + target.drawCircle((routlier - minValue) * unitSize + canvasLeft, + canvasHeight / 2, + options.get('spotRadius'), + options.get('outlierLineColor'), + options.get('outlierFillColor')).append(); + } + } + + // box + target.drawRect( + Math.round((q1 - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight * 0.1), + Math.round((q3 - q1) * unitSize), + Math.round(canvasHeight * 0.8), + options.get('boxLineColor'), + options.get('boxFillColor')).append(); + // left whisker + target.drawLine( + Math.round((lwhisker - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight / 2), + Math.round((q1 - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight / 2), + options.get('lineColor')).append(); + target.drawLine( + Math.round((lwhisker - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight / 4), + Math.round((lwhisker - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight - canvasHeight / 4), + options.get('whiskerColor')).append(); + // right whisker + target.drawLine(Math.round((rwhisker - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight / 2), + Math.round((q3 - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight / 2), + options.get('lineColor')).append(); + target.drawLine( + Math.round((rwhisker - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight / 4), + Math.round((rwhisker - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight - canvasHeight / 4), + options.get('whiskerColor')).append(); + // median line + target.drawLine( + Math.round((q2 - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight * 0.1), + Math.round((q2 - minValue) * unitSize + canvasLeft), + Math.round(canvasHeight * 0.9), + options.get('medianColor')).append(); + if (options.get('target')) { + size = Math.ceil(options.get('spotRadius')); + target.drawLine( + Math.round((options.get('target') - minValue) * unitSize + canvasLeft), + Math.round((canvasHeight / 2) - size), + Math.round((options.get('target') - minValue) * unitSize + canvasLeft), + Math.round((canvasHeight / 2) + size), + options.get('targetColor')).append(); + target.drawLine( + Math.round((options.get('target') - minValue) * unitSize + canvasLeft - size), + Math.round(canvasHeight / 2), + Math.round((options.get('target') - minValue) * unitSize + canvasLeft + size), + Math.round(canvasHeight / 2), + options.get('targetColor')).append(); + } + target.render(); + } + }); + + // Setup a very simple "virtual canvas" to make drawing the few shapes we need easier + // This is accessible as $(foo).simpledraw() + + VShape = createClass({ + init: function (target, id, type, args) { + this.target = target; + this.id = id; + this.type = type; + this.args = args; + }, + append: function () { + this.target.appendShape(this); + return this; + } + }); + + VCanvas_base = createClass({ + _pxregex: /(\d+)(px)?\s*$/i, + + init: function (width, height, target) { + if (!width) { + return; + } + this.width = width; + this.height = height; + this.target = target; + this.lastShapeId = null; + if (target[0]) { + target = target[0]; + } + $.data(target, '_jqs_vcanvas', this); + }, + + drawLine: function (x1, y1, x2, y2, lineColor, lineWidth) { + return this.drawShape([[x1, y1], [x2, y2]], lineColor, lineWidth); + }, + + drawShape: function (path, lineColor, fillColor, lineWidth) { + return this._genShape('Shape', [path, lineColor, fillColor, lineWidth]); + }, + + drawCircle: function (x, y, radius, lineColor, fillColor, lineWidth) { + return this._genShape('Circle', [x, y, radius, lineColor, fillColor, lineWidth]); + }, + + drawPieSlice: function (x, y, radius, startAngle, endAngle, lineColor, fillColor) { + return this._genShape('PieSlice', [x, y, radius, startAngle, endAngle, lineColor, fillColor]); + }, + + drawRect: function (x, y, width, height, lineColor, fillColor) { + return this._genShape('Rect', [x, y, width, height, lineColor, fillColor]); + }, + + getElement: function () { + return this.canvas; + }, + + /** + * Return the most recently inserted shape id + */ + getLastShapeId: function () { + return this.lastShapeId; + }, + + /** + * Clear and reset the canvas + */ + reset: function () { + alert('reset not implemented'); + }, + + _insert: function (el, target) { + $(target).html(el); + }, + + /** + * Calculate the pixel dimensions of the canvas + */ + _calculatePixelDims: function (width, height, canvas) { + // XXX This should probably be a configurable option + var match; + match = this._pxregex.exec(height); + if (match) { + this.pixelHeight = match[1]; + } else { + this.pixelHeight = $(canvas).height(); + } + match = this._pxregex.exec(width); + if (match) { + this.pixelWidth = match[1]; + } else { + this.pixelWidth = $(canvas).width(); + } + }, + + /** + * Generate a shape object and id for later rendering + */ + _genShape: function (shapetype, shapeargs) { + var id = shapeCount++; + shapeargs.unshift(id); + return new VShape(this, id, shapetype, shapeargs); + }, + + /** + * Add a shape to the end of the render queue + */ + appendShape: function (shape) { + alert('appendShape not implemented'); + }, + + /** + * Replace one shape with another + */ + replaceWithShape: function (shapeid, shape) { + alert('replaceWithShape not implemented'); + }, + + /** + * Insert one shape after another in the render queue + */ + insertAfterShape: function (shapeid, shape) { + alert('insertAfterShape not implemented'); + }, + + /** + * Remove a shape from the queue + */ + removeShapeId: function (shapeid) { + alert('removeShapeId not implemented'); + }, + + /** + * Find a shape at the specified x/y co-ordinates + */ + getShapeAt: function (el, x, y) { + alert('getShapeAt not implemented'); + }, + + /** + * Render all queued shapes onto the canvas + */ + render: function () { + alert('render not implemented'); + } + }); + + VCanvas_canvas = createClass(VCanvas_base, { + init: function (width, height, target, interact) { + VCanvas_canvas._super.init.call(this, width, height, target); + this.canvas = document.createElement('canvas'); + if (target[0]) { + target = target[0]; + } + $.data(target, '_jqs_vcanvas', this); + $(this.canvas).css({ display: 'inline-block', width: width, height: height, verticalAlign: 'top' }); + this._insert(this.canvas, target); + this._calculatePixelDims(width, height, this.canvas); + this.canvas.width = this.pixelWidth; + this.canvas.height = this.pixelHeight; + this.interact = interact; + this.shapes = {}; + this.shapeseq = []; + this.currentTargetShapeId = undefined; + $(this.canvas).css({width: this.pixelWidth, height: this.pixelHeight}); + }, + + _getContext: function (lineColor, fillColor, lineWidth) { + var context = this.canvas.getContext('2d'); + if (lineColor !== undefined) { + context.strokeStyle = lineColor; + } + context.lineWidth = lineWidth === undefined ? 1 : lineWidth; + if (fillColor !== undefined) { + context.fillStyle = fillColor; + } + return context; + }, + + reset: function () { + var context = this._getContext(); + context.clearRect(0, 0, this.pixelWidth, this.pixelHeight); + this.shapes = {}; + this.shapeseq = []; + this.currentTargetShapeId = undefined; + }, + + _drawShape: function (shapeid, path, lineColor, fillColor, lineWidth) { + var context = this._getContext(lineColor, fillColor, lineWidth), + i, plen; + context.beginPath(); + context.moveTo(path[0][0] + 0.5, path[0][1] + 0.5); + for (i = 1, plen = path.length; i < plen; i++) { + context.lineTo(path[i][0] + 0.5, path[i][1] + 0.5); // the 0.5 offset gives us crisp pixel-width lines + } + if (lineColor !== undefined) { + context.stroke(); + } + if (fillColor !== undefined) { + context.fill(); + } + if (this.targetX !== undefined && this.targetY !== undefined && + context.isPointInPath(this.targetX, this.targetY)) { + this.currentTargetShapeId = shapeid; + } + }, + + _drawCircle: function (shapeid, x, y, radius, lineColor, fillColor, lineWidth) { + var context = this._getContext(lineColor, fillColor, lineWidth); + context.beginPath(); + context.arc(x, y, radius, 0, 2 * Math.PI, false); + if (this.targetX !== undefined && this.targetY !== undefined && + context.isPointInPath(this.targetX, this.targetY)) { + this.currentTargetShapeId = shapeid; + } + if (lineColor !== undefined) { + context.stroke(); + } + if (fillColor !== undefined) { + context.fill(); + } + }, + + _drawPieSlice: function (shapeid, x, y, radius, startAngle, endAngle, lineColor, fillColor) { + var context = this._getContext(lineColor, fillColor); + context.beginPath(); + context.moveTo(x, y); + context.arc(x, y, radius, startAngle, endAngle, false); + context.lineTo(x, y); + context.closePath(); + if (lineColor !== undefined) { + context.stroke(); + } + if (fillColor) { + context.fill(); + } + if (this.targetX !== undefined && this.targetY !== undefined && + context.isPointInPath(this.targetX, this.targetY)) { + this.currentTargetShapeId = shapeid; + } + }, + + _drawRect: function (shapeid, x, y, width, height, lineColor, fillColor) { + return this._drawShape(shapeid, [[x, y], [x + width, y], [x + width, y + height], [x, y + height], [x, y]], lineColor, fillColor); + }, + + appendShape: function (shape) { + this.shapes[shape.id] = shape; + this.shapeseq.push(shape.id); + this.lastShapeId = shape.id; + return shape.id; + }, + + replaceWithShape: function (shapeid, shape) { + var shapeseq = this.shapeseq, + i; + this.shapes[shape.id] = shape; + for (i = shapeseq.length; i--;) { + if (shapeseq[i] == shapeid) { + shapeseq[i] = shape.id; + } + } + delete this.shapes[shapeid]; + }, + + replaceWithShapes: function (shapeids, shapes) { + var shapeseq = this.shapeseq, + shapemap = {}, + sid, i, first; + + for (i = shapeids.length; i--;) { + shapemap[shapeids[i]] = true; + } + for (i = shapeseq.length; i--;) { + sid = shapeseq[i]; + if (shapemap[sid]) { + shapeseq.splice(i, 1); + delete this.shapes[sid]; + first = i; + } + } + for (i = shapes.length; i--;) { + shapeseq.splice(first, 0, shapes[i].id); + this.shapes[shapes[i].id] = shapes[i]; + } + + }, + + insertAfterShape: function (shapeid, shape) { + var shapeseq = this.shapeseq, + i; + for (i = shapeseq.length; i--;) { + if (shapeseq[i] === shapeid) { + shapeseq.splice(i + 1, 0, shape.id); + this.shapes[shape.id] = shape; + return; + } + } + }, + + removeShapeId: function (shapeid) { + var shapeseq = this.shapeseq, + i; + for (i = shapeseq.length; i--;) { + if (shapeseq[i] === shapeid) { + shapeseq.splice(i, 1); + break; + } + } + delete this.shapes[shapeid]; + }, + + getShapeAt: function (el, x, y) { + this.targetX = x; + this.targetY = y; + this.render(); + return this.currentTargetShapeId; + }, + + render: function () { + var shapeseq = this.shapeseq, + shapes = this.shapes, + shapeCount = shapeseq.length, + context = this._getContext(), + shapeid, shape, i; + context.clearRect(0, 0, this.pixelWidth, this.pixelHeight); + for (i = 0; i < shapeCount; i++) { + shapeid = shapeseq[i]; + shape = shapes[shapeid]; + this['_draw' + shape.type].apply(this, shape.args); + } + if (!this.interact) { + // not interactive so no need to keep the shapes array + this.shapes = {}; + this.shapeseq = []; + } + } + + }); + + VCanvas_vml = createClass(VCanvas_base, { + init: function (width, height, target) { + var groupel; + VCanvas_vml._super.init.call(this, width, height, target); + if (target[0]) { + target = target[0]; + } + $.data(target, '_jqs_vcanvas', this); + this.canvas = document.createElement('span'); + $(this.canvas).css({ display: 'inline-block', position: 'relative', overflow: 'hidden', width: width, height: height, margin: '0px', padding: '0px', verticalAlign: 'top'}); + this._insert(this.canvas, target); + this._calculatePixelDims(width, height, this.canvas); + this.canvas.width = this.pixelWidth; + this.canvas.height = this.pixelHeight; + groupel = ''; + this.canvas.insertAdjacentHTML('beforeEnd', groupel); + this.group = $(this.canvas).children()[0]; + this.rendered = false; + this.prerender = ''; + }, + + _drawShape: function (shapeid, path, lineColor, fillColor, lineWidth) { + var vpath = [], + initial, stroke, fill, closed, vel, plen, i; + for (i = 0, plen = path.length; i < plen; i++) { + vpath[i] = '' + (path[i][0]) + ',' + (path[i][1]); + } + initial = vpath.splice(0, 1); + lineWidth = lineWidth === undefined ? 1 : lineWidth; + stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="' + lineWidth + 'px" strokeColor="' + lineColor + '" '; + fill = fillColor === undefined ? ' filled="false"' : ' fillColor="' + fillColor + '" filled="true" '; + closed = vpath[0] === vpath[vpath.length - 1] ? 'x ' : ''; + vel = '' + + ' '; + return vel; + }, + + _drawCircle: function (shapeid, x, y, radius, lineColor, fillColor, lineWidth) { + var stroke, fill, vel; + x -= radius; + y -= radius; + stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="' + lineWidth + 'px" strokeColor="' + lineColor + '" '; + fill = fillColor === undefined ? ' filled="false"' : ' fillColor="' + fillColor + '" filled="true" '; + vel = ''; + return vel; + + }, + + _drawPieSlice: function (shapeid, x, y, radius, startAngle, endAngle, lineColor, fillColor) { + var vpath, startx, starty, endx, endy, stroke, fill, vel; + if (startAngle === endAngle) { + return ''; // VML seems to have problem when start angle equals end angle. + } + if ((endAngle - startAngle) === (2 * Math.PI)) { + startAngle = 0.0; // VML seems to have a problem when drawing a full circle that doesn't start 0 + endAngle = (2 * Math.PI); + } + + startx = x + Math.round(Math.cos(startAngle) * radius); + starty = y + Math.round(Math.sin(startAngle) * radius); + endx = x + Math.round(Math.cos(endAngle) * radius); + endy = y + Math.round(Math.sin(endAngle) * radius); + + if (startx === endx && starty === endy) { + if ((endAngle - startAngle) < Math.PI) { + // Prevent very small slices from being mistaken as a whole pie + return ''; + } + // essentially going to be the entire circle, so ignore startAngle + startx = endx = x + radius; + starty = endy = y; + } + + if (startx === endx && starty === endy && (endAngle - startAngle) < Math.PI) { + return ''; + } + + vpath = [x - radius, y - radius, x + radius, y + radius, startx, starty, endx, endy]; + stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="1px" strokeColor="' + lineColor + '" '; + fill = fillColor === undefined ? ' filled="false"' : ' fillColor="' + fillColor + '" filled="true" '; + vel = '' + + ' '; + return vel; + }, + + _drawRect: function (shapeid, x, y, width, height, lineColor, fillColor) { + return this._drawShape(shapeid, [[x, y], [x, y + height], [x + width, y + height], [x + width, y], [x, y]], lineColor, fillColor); + }, + + reset: function () { + this.group.innerHTML = ''; + }, + + appendShape: function (shape) { + var vel = this['_draw' + shape.type].apply(this, shape.args); + if (this.rendered) { + this.group.insertAdjacentHTML('beforeEnd', vel); + } else { + this.prerender += vel; + } + this.lastShapeId = shape.id; + return shape.id; + }, + + replaceWithShape: function (shapeid, shape) { + var existing = $('#jqsshape' + shapeid), + vel = this['_draw' + shape.type].apply(this, shape.args); + existing[0].outerHTML = vel; + }, + + replaceWithShapes: function (shapeids, shapes) { + // replace the first shapeid with all the new shapes then toast the remaining old shapes + var existing = $('#jqsshape' + shapeids[0]), + replace = '', + slen = shapes.length, + i; + for (i = 0; i < slen; i++) { + replace += this['_draw' + shapes[i].type].apply(this, shapes[i].args); + } + existing[0].outerHTML = replace; + for (i = 1; i < shapeids.length; i++) { + $('#jqsshape' + shapeids[i]).remove(); + } + }, + + insertAfterShape: function (shapeid, shape) { + var existing = $('#jqsshape' + shapeid), + vel = this['_draw' + shape.type].apply(this, shape.args); + existing[0].insertAdjacentHTML('afterEnd', vel); + }, + + removeShapeId: function (shapeid) { + var existing = $('#jqsshape' + shapeid); + this.group.removeChild(existing[0]); + }, + + getShapeAt: function (el, x, y) { + var shapeid = el.id.substr(8); + return shapeid; + }, + + render: function () { + if (!this.rendered) { + // batch the intial render into a single repaint + this.group.innerHTML = this.prerender; + this.rendered = true; + } + } + }); + +}))}(document, Math));;; diff --git a/wp-content/plugins/wp-piwik/js/sparkline/jquery.sparkline.min.js b/wp-content/plugins/wp-piwik/js/sparkline/jquery.sparkline.min.js new file mode 100644 index 0000000..fa616bf --- /dev/null +++ b/wp-content/plugins/wp-piwik/js/sparkline/jquery.sparkline.min.js @@ -0,0 +1,5 @@ +/* jquery.sparkline 2.1.2 - http://omnipotent.net/jquery.sparkline/ +** Licensed under the New BSD License - see above site for details */ + +(function(a,b,c){(function(a){typeof define=="function"&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.sparkline&&a(jQuery)})(function(d){"use strict";var e={},f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L=0;f=function(){return{common:{type:"line",lineColor:"#00f",fillColor:"#cdf",defaultPixelsPerValue:3,width:"auto",height:"auto",composite:!1,tagValuesAttribute:"values",tagOptionsPrefix:"spark",enableTagOptions:!1,enableHighlight:!0,highlightLighten:1.4,tooltipSkipNull:!0,tooltipPrefix:"",tooltipSuffix:"",disableHiddenCheck:!1,numberFormatter:!1,numberDigitGroupCount:3,numberDigitGroupSep:",",numberDecimalMark:".",disableTooltips:!1,disableInteraction:!1},line:{spotColor:"#f80",highlightSpotColor:"#5f5",highlightLineColor:"#f22",spotRadius:1.5,minSpotColor:"#f80",maxSpotColor:"#f80",lineWidth:1,normalRangeMin:c,normalRangeMax:c,normalRangeColor:"#ccc",drawNormalOnTop:!1,chartRangeMin:c,chartRangeMax:c,chartRangeMinX:c,chartRangeMaxX:c,tooltipFormat:new h(' {{prefix}}{{y}}{{suffix}}')},bar:{barColor:"#3366cc",negBarColor:"#f44",stackedBarColor:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],zeroColor:c,nullColor:c,zeroAxis:!0,barWidth:4,barSpacing:1,chartRangeMax:c,chartRangeMin:c,chartRangeClip:!1,colorMap:c,tooltipFormat:new h(' {{prefix}}{{value}}{{suffix}}')},tristate:{barWidth:4,barSpacing:1,posBarColor:"#6f6",negBarColor:"#f44",zeroBarColor:"#999",colorMap:{},tooltipFormat:new h(' {{value:map}}'),tooltipValueLookups:{map:{"-1":"Loss",0:"Draw",1:"Win"}}},discrete:{lineHeight:"auto",thresholdColor:c,thresholdValue:0,chartRangeMax:c,chartRangeMin:c,chartRangeClip:!1,tooltipFormat:new h("{{prefix}}{{value}}{{suffix}}")},bullet:{targetColor:"#f33",targetWidth:3,performanceColor:"#33f",rangeColors:["#d3dafe","#a8b6ff","#7f94ff"],base:c,tooltipFormat:new h("{{fieldkey:fields}} - {{value}}"),tooltipValueLookups:{fields:{r:"Range",p:"Performance",t:"Target"}}},pie:{offset:0,sliceColors:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],borderWidth:0,borderColor:"#000",tooltipFormat:new h(' {{value}} ({{percent.1}}%)')},box:{raw:!1,boxLineColor:"#000",boxFillColor:"#cdf",whiskerColor:"#000",outlierLineColor:"#333",outlierFillColor:"#fff",medianColor:"#f00",showOutliers:!0,outlierIQR:1.5,spotRadius:1.5,target:c,targetColor:"#4a2",chartRangeMax:c,chartRangeMin:c,tooltipFormat:new h("{{field:fields}}: {{value}}"),tooltipFormatFieldlistKey:"field",tooltipValueLookups:{fields:{lq:"Lower Quartile",med:"Median",uq:"Upper Quartile",lo:"Left Outlier",ro:"Right Outlier",lw:"Left Whisker",rw:"Right Whisker"}}}}},E='.jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}',g=function(){var a,b;return a=function(){this.init.apply(this,arguments)},arguments.length>1?(arguments[0]?(a.prototype=d.extend(new arguments[0],arguments[arguments.length-1]),a._super=arguments[0].prototype):a.prototype=arguments[arguments.length-1],arguments.length>2&&(b=Array.prototype.slice.call(arguments,1,-1),b.unshift(a.prototype),d.extend.apply(d,b))):a.prototype=arguments[0],a.prototype.cls=a,a},d.SPFormatClass=h=g({fre:/\{\{([\w.]+?)(:(.+?))?\}\}/g,precre:/(\w+)\.(\d+)/,init:function(a,b){this.format=a,this.fclass=b},render:function(a,b,d){var e=this,f=a,g,h,i,j,k;return this.format.replace(this.fre,function(){var a;return h=arguments[1],i=arguments[3],g=e.precre.exec(h),g?(k=g[2],h=g[1]):k=!1,j=f[h],j===c?"":i&&b&&b[i]?(a=b[i],a.get?b[i].get(j)||j:b[i][j]||j):(n(j)&&(d.get("numberFormatter")?j=d.get("numberFormatter")(j):j=s(j,k,d.get("numberDigitGroupCount"),d.get("numberDigitGroupSep"),d.get("numberDecimalMark"))),j)})}}),d.spformat=function(a,b){return new h(a,b)},i=function(a,b,c){return ac?c:a},j=function(a,c){var d;return c===2?(d=b.floor(a.length/2),a.length%2?a[d]:(a[d-1]+a[d])/2):a.length%2?(d=(a.length*c+c)/4,d%1?(a[b.floor(d)]+a[b.floor(d)-1])/2:a[d-1]):(d=(a.length*c+2)/4,d%1?(a[b.floor(d)]+a[b.floor(d)-1])/2:a[d-1])},k=function(a){var b;switch(a){case"undefined":a=c;break;case"null":a=null;break;case"true":a=!0;break;case"false":a=!1;break;default:b=parseFloat(a),a==b&&(a=b)}return a},l=function(a){var b,c=[];for(b=a.length;b--;)c[b]=k(a[b]);return c},m=function(a,b){var c,d,e=[];for(c=0,d=a.length;c0;h-=c)a.splice(h,0,e);return a.join("")},o=function(a,b,c){var d;for(d=b.length;d--;){if(c&&b[d]===null)continue;if(b[d]!==a)return!1}return!0},p=function(a){var b=0,c;for(c=a.length;c--;)b+=typeof a[c]=="number"?a[c]:0;return b},r=function(a){return d.isArray(a)?a:[a]},q=function(b){var c;a.createStyleSheet?a.createStyleSheet().cssText=b:(c=a.createElement("style"),c.type="text/css",a.getElementsByTagName("head")[0].appendChild(c),c[typeof a.body.style.WebkitAppearance=="string"?"innerText":"innerHTML"]=b)},d.fn.simpledraw=function(b,e,f,g){var h,i;if(f&&(h=this.data("_jqs_vcanvas")))return h;if(d.fn.sparkline.canvas===!1)return!1;if(d.fn.sparkline.canvas===c){var j=a.createElement("canvas");if(!j.getContext||!j.getContext("2d")){if(!a.namespaces||!!a.namespaces.v)return d.fn.sparkline.canvas=!1,!1;a.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML"),d.fn.sparkline.canvas=function(a,b,c,d){return new J(a,b,c)}}else d.fn.sparkline.canvas=function(a,b,c,d){return new I(a,b,c,d)}}return b===c&&(b=d(this).innerWidth()),e===c&&(e=d(this).innerHeight()),h=d.fn.sparkline.canvas(b,e,this,g),i=d(this).data("_jqs_mhandler"),i&&i.registerCanvas(h),h},d.fn.cleardraw=function(){var a=this.data("_jqs_vcanvas");a&&a.reset()},d.RangeMapClass=t=g({init:function(a){var b,c,d=[];for(b in a)a.hasOwnProperty(b)&&typeof b=="string"&&b.indexOf(":")>-1&&(c=b.split(":"),c[0]=c[0].length===0?-Infinity:parseFloat(c[0]),c[1]=c[1].length===0?Infinity:parseFloat(c[1]),c[2]=a[b],d.push(c));this.map=a,this.rangelist=d||!1},get:function(a){var b=this.rangelist,d,e,f;if((f=this.map[a])!==c)return f;if(b)for(d=b.length;d--;){e=b[d];if(e[0]<=a&&e[1]>=a)return e[2]}return c}}),d.range_map=function(a){return new t(a)},u=g({init:function(a,b){var c=d(a);this.$el=c,this.options=b,this.currentPageX=0,this.currentPageY=0,this.el=a,this.splist=[],this.tooltip=null,this.over=!1,this.displayTooltips=!b.get("disableTooltips"),this.highlightEnabled=!b.get("disableHighlight")},registerSparkline:function(a){this.splist.push(a),this.over&&this.updateDisplay()},registerCanvas:function(a){var b=d(a.canvas);this.canvas=a,this.$canvas=b,b.mouseenter(d.proxy(this.mouseenter,this)),b.mouseleave(d.proxy(this.mouseleave,this)),b.click(d.proxy(this.mouseclick,this))},reset:function(a){this.splist=[],this.tooltip&&a&&(this.tooltip.remove(),this.tooltip=c)},mouseclick:function(a){var b=d.Event("sparklineClick");b.originalEvent=a,b.sparklines=this.splist,this.$el.trigger(b)},mouseenter:function(b){d(a.body).unbind("mousemove.jqs"),d(a.body).bind("mousemove.jqs",d.proxy(this.mousemove,this)),this.over=!0,this.currentPageX=b.pageX,this.currentPageY=b.pageY,this.currentEl=b.target,!this.tooltip&&this.displayTooltips&&(this.tooltip=new v(this.options),this.tooltip.updatePosition(b.pageX,b.pageY)),this.updateDisplay()},mouseleave:function(){d(a.body).unbind("mousemove.jqs");var b=this.splist,c=b.length,e=!1,f,g;this.over=!1,this.currentEl=null,this.tooltip&&(this.tooltip.remove(),this.tooltip=null);for(g=0;g
        +
        + + + +
        > + +
        + + + + + diff --git a/wp-content/themes/generatepress/functions.php b/wp-content/themes/generatepress/functions.php new file mode 100644 index 0000000..9c828f3 --- /dev/null +++ b/wp-content/themes/generatepress/functions.php @@ -0,0 +1,98 @@ + 70, + 'width' => 350, + 'flex-height' => true, + 'flex-width' => true, + ) ); + + // Register primary menu. + register_nav_menus( array( + 'primary' => __( 'Primary Menu', 'generatepress' ), + ) ); + + /** + * Set the content width to something large + * We set a more accurate width in generate_smart_content_width() + */ + global $content_width; + if ( ! isset( $content_width ) ) { + $content_width = 1200; /* pixels */ + } + + // This theme styles the visual editor to resemble the theme style. + add_editor_style( 'css/admin/editor-style.css' ); + } +} + +/** + * Get all necessary theme files + */ +$theme_dir = get_template_directory(); + +require $theme_dir . '/inc/theme-functions.php'; +require $theme_dir . '/inc/defaults.php'; +require $theme_dir . '/inc/class-css.php'; +require $theme_dir . '/inc/css-output.php'; +require $theme_dir . '/inc/general.php'; +require $theme_dir . '/inc/customizer.php'; +require $theme_dir . '/inc/markup.php'; +require $theme_dir . '/inc/typography.php'; +require $theme_dir . '/inc/plugin-compat.php'; +require $theme_dir . '/inc/block-editor.php'; +require $theme_dir . '/inc/migrate.php'; +require $theme_dir . '/inc/deprecated.php'; + +if ( is_admin() ) { + require $theme_dir . '/inc/meta-box.php'; + require $theme_dir . '/inc/dashboard.php'; +} + +/** + * Load our theme structure + */ +require $theme_dir . '/inc/structure/archives.php'; +require $theme_dir . '/inc/structure/comments.php'; +require $theme_dir . '/inc/structure/featured-images.php'; +require $theme_dir . '/inc/structure/footer.php'; +require $theme_dir . '/inc/structure/header.php'; +require $theme_dir . '/inc/structure/navigation.php'; +require $theme_dir . '/inc/structure/post-meta.php'; +require $theme_dir . '/inc/structure/sidebars.php'; diff --git a/wp-content/themes/generatepress/header.php b/wp-content/themes/generatepress/header.php new file mode 100644 index 0000000..9059538 --- /dev/null +++ b/wp-content/themes/generatepress/header.php @@ -0,0 +1,75 @@ + +> + + + + + + + > + + +
        + +
        + post_type ) { + $layout = generate_get_option( 'single_layout_setting' ); + } + } + + // Add in our default filter in case people have adjusted it. + $layout = apply_filters( 'generate_sidebar_layout', $layout ); + + if ( $meta ) { + $layout_meta = get_post_meta( get_the_ID(), '_generate-sidebar-layout-meta', true ); + + if ( $layout_meta ) { + $layout = $layout_meta; + } + } + + return apply_filters( 'generate_block_editor_sidebar_layout', $layout ); +} + +/** + * Check whether we're disabling the content title or not. + * We need this function as the post meta in generate_show_title() only runs + * on is_singular() + * + * @since 2.2 + */ +function generate_get_block_editor_show_content_title() { + $title = generate_show_title(); + + $disable_title = get_post_meta( get_the_ID(), '_generate-disable-headline', true ); + + if ( $disable_title ) { + $title = false; + } + + return apply_filters( 'generate_block_editor_show_content_title', $title ); +} + +/** + * Get the content width for this post. + * + * @since 2.2 + */ +function generate_get_block_editor_content_width() { + $container_width = generate_get_option( 'container_width' ); + + $content_width = $container_width; + + $right_sidebar_width = apply_filters( 'generate_right_sidebar_width', '25' ); + + $left_sidebar_width = apply_filters( 'generate_left_sidebar_width', '25' ); + + $layout = generate_get_block_editor_sidebar_layout(); + + if ( 'left-sidebar' == $layout ) { + $content_width = $container_width * ( ( 100 - $left_sidebar_width ) / 100 ); + } elseif ( 'right-sidebar' == $layout ) { + $content_width = $container_width * ( ( 100 - $right_sidebar_width ) / 100 ); + } elseif ( 'no-sidebar' == $layout ) { + $content_width = $container_width; + } else { + $content_width = $container_width * ( ( 100 - ( $left_sidebar_width + $right_sidebar_width ) ) / 100 ); + } + + return apply_filters( 'generate_block_editor_content_width', $content_width ); +} + +add_action( 'enqueue_block_editor_assets', 'generate_enqueue_google_fonts' ); +add_action( 'enqueue_block_editor_assets', 'generate_enqueue_backend_block_editor_assets' ); +/** + * Add CSS to the admin side of the block editor. + * + * @since 2.2 + */ +function generate_enqueue_backend_block_editor_assets() { + wp_enqueue_style( 'generate-block-editor-styles', get_template_directory_uri() . "/css/admin/block-editor.css", false, GENERATE_VERSION, 'all' ); + wp_enqueue_script( 'generate-block-editor-tinycolor', get_template_directory_uri() . "/js/admin/tinycolor.js", false, GENERATE_VERSION, true ); + wp_enqueue_script( 'generate-block-editor-scripts', get_template_directory_uri() . "/js/admin/block-editor.js", array( 'jquery', 'generate-block-editor-tinycolor' ), GENERATE_VERSION, true ); + + $show_editor_styles = apply_filters( 'generate_show_block_editor_styles', true ); + + if ( $show_editor_styles ) { + wp_add_inline_style( 'generate-block-editor-styles', generate_do_inline_block_editor_css() ); + } + + $color_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_color_defaults() + ); + + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + + $text_color = generate_get_option( 'text_color' ); + + if ( $color_settings['content_text_color'] ) { + $text_color = $color_settings['content_text_color']; + } + + wp_localize_script( 'generate-block-editor-scripts', 'generate_block_editor', array( + 'global_sidebar_layout' => generate_get_block_editor_sidebar_layout( false ), + 'container_width' => generate_get_option( 'container_width' ), + 'right_sidebar_width' => apply_filters( 'generate_right_sidebar_width', '25' ), + 'left_sidebar_width' => apply_filters( 'generate_left_sidebar_width', '25' ), + 'content_padding_right' => absint( $spacing_settings['content_right'] ) . 'px', + 'content_padding_left' => absint( $spacing_settings['content_left'] ) . 'px', + 'content_title' => generate_get_block_editor_show_content_title() ? 'true' : 'false', + 'disable_content_title' => esc_html( 'Disable Content Title', 'generatepress' ), + 'show_content_title' => esc_html( 'Show Content Title', 'generatepress' ), + 'text_color' => $text_color, + 'show_editor_styles' => $show_editor_styles, + ) ); +} + +/** + * Write our CSS for the block editor. + * + * @since 2.2 + */ +function generate_do_inline_block_editor_css() { + $color_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_color_defaults() + ); + + $font_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_default_fonts() + ); + + $css = new GeneratePress_CSS; + + $content_width = generate_get_block_editor_content_width(); + + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + + $content_width_calc = sprintf( + 'calc(%1$s - %2$s - %3$s)', + absint( $content_width ) . 'px', + absint( $spacing_settings['content_left'] ) . 'px', + absint( $spacing_settings['content_right'] ) . 'px' + ); + + $css->set_selector( 'body .wp-block, html body.gutenberg-editor-page .editor-post-title__block, html body.gutenberg-editor-page .editor-default-block-appender, html body.gutenberg-editor-page .editor-block-list__block' ); + + if ( 'true' === get_post_meta( get_the_ID(), '_generate-full-width-content', true ) ) { + $css->add_property( 'max-width', '100%' ); + } else { + $css->add_property( 'max-width', $content_width_calc ); + } + + $css->set_selector( 'html body.gutenberg-editor-page .block-editor-block-list__block[data-align="full"]' ); + $css->add_property( 'max-width', 'none' ); + + $css->set_selector( '.edit-post-visual-editor .block-editor-block-list__block[data-align=wide]' ); + $css->add_property( 'max-width', absint( $content_width ), false, 'px' ); + + if ( apply_filters( 'generate_do_group_inner_container_style', true ) ) { + $css->set_selector( '.wp-block-group__inner-container' ); + $css->add_property( 'max-width', absint( $content_width ), false, 'px' ); + $css->add_property( 'margin-left', 'auto' ); + $css->add_property( 'margin-right', 'auto' ); + $css->add_property( 'padding', generate_padding_css( $spacing_settings['content_top'], $spacing_settings['content_right'], $spacing_settings['content_bottom'], $spacing_settings['content_left'] ) ); + } + + $css->set_selector( '.wp-block-button__link:not(.has-background)' ); + $css->add_property( 'color', esc_attr( $color_settings['form_button_text_color'] ) ); + $css->add_property( 'background-color', esc_attr( $color_settings['form_button_background_color'] ) ); + + $css->set_selector( '.wp-block-button__link:not(.has-background):active, .wp-block-button__link:not(.has-background):focus, .wp-block-button__link:not(.has-background):hover' ); + $css->add_property( 'color', esc_attr( $color_settings['form_button_text_color_hover'] ) ); + $css->add_property( 'background-color', esc_attr( $color_settings['form_button_background_color_hover'] ) ); + + $body_family = generate_get_font_family_css( 'font_body', 'generate_settings', generate_get_default_fonts() ); + $h1_family = generate_get_font_family_css( 'font_heading_1', 'generate_settings', generate_get_default_fonts() ); + $h2_family = generate_get_font_family_css( 'font_heading_2', 'generate_settings', generate_get_default_fonts() ); + $h3_family = generate_get_font_family_css( 'font_heading_3', 'generate_settings', generate_get_default_fonts() ); + $h4_family = generate_get_font_family_css( 'font_heading_4', 'generate_settings', generate_get_default_fonts() ); + $h5_family = generate_get_font_family_css( 'font_heading_5', 'generate_settings', generate_get_default_fonts() ); + $h6_family = generate_get_font_family_css( 'font_heading_6', 'generate_settings', generate_get_default_fonts() ); + $buttons_family = generate_get_font_family_css( 'font_buttons', 'generate_settings', generate_get_default_fonts() ); + + $css->set_selector( 'body.gutenberg-editor-page .block-editor-block-list__block, body .editor-styles-wrapper' ); + $css->add_property( 'font-family', $body_family ); + $css->add_property( 'font-size', absint( $font_settings['body_font_size'] ), false, 'px' ); + + if ( $color_settings['content_text_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['content_text_color'] ) ); + } else { + $css->add_property( 'color', esc_attr( generate_get_option( 'text_color' ) ) ); + } + + $css->set_selector( '.content-title-visibility' ); + + if ( $color_settings['content_text_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['content_text_color'] ) ); + } else { + $css->add_property( 'color', esc_attr( generate_get_option( 'text_color' ) ) ); + } + + $css->set_selector( 'body .editor-styles-wrapper, body .editor-styles-wrapper p, body .editor-styles-wrapper .mce-content-body' ); + $css->add_property( 'line-height', floatval( $font_settings['body_line_height'] ) ); + + $css->set_selector( 'body .editor-styles-wrapper h1, .wp-block-heading h1.editor-rich-text__tinymce, .editor-post-title__block .editor-post-title__input' ); + $css->add_property( 'font-family', 'inherit' === $h1_family || '' === $h1_family ? $body_family : $h1_family ); + $css->add_property( 'font-weight', esc_attr( $font_settings['heading_1_weight'] ) ); + $css->add_property( 'text-transform', esc_attr( $font_settings['heading_1_transform'] ) ); + $css->add_property( 'font-size', absint( $font_settings['heading_1_font_size'] ), false, 'px' ); + $css->add_property( 'line-height', floatval( $font_settings['heading_1_line_height'] ), false, 'em' ); + + if ( $color_settings['h1_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['h1_color'] ) ); + } elseif ( $color_settings['content_text_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['content_text_color'] ) ); + } else { + $css->add_property( 'color', esc_attr( generate_get_option( 'text_color' ) ) ); + } + + if ( $color_settings['content_title_color'] ) { + $css->set_selector( '.editor-post-title__block .editor-post-title__input' ); + $css->add_property( 'color', esc_attr( $color_settings['content_title_color'] ) ); + } + + $css->set_selector( 'body .editor-styles-wrapper h2, .wp-block-heading h2.editor-rich-text__tinymce' ); + $css->add_property( 'font-family', $h2_family ); + $css->add_property( 'font-weight', esc_attr( $font_settings['heading_2_weight'] ) ); + $css->add_property( 'text-transform', esc_attr( $font_settings['heading_2_transform'] ) ); + $css->add_property( 'font-size', absint( $font_settings['heading_2_font_size'] ), false, 'px' ); + $css->add_property( 'line-height', floatval( $font_settings['heading_2_line_height'] ), false, 'em' ); + + if ( $color_settings['h2_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['h2_color'] ) ); + } elseif ( $color_settings['content_text_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['content_text_color'] ) ); + } else { + $css->add_property( 'color', esc_attr( generate_get_option( 'text_color' ) ) ); + } + + $css->set_selector( 'body .editor-styles-wrapper h3, .wp-block-heading h3.editor-rich-text__tinymce' ); + $css->add_property( 'font-family', $h3_family ); + $css->add_property( 'font-weight', esc_attr( $font_settings['heading_3_weight'] ) ); + $css->add_property( 'text-transform', esc_attr( $font_settings['heading_3_transform'] ) ); + $css->add_property( 'font-size', absint( $font_settings['heading_3_font_size'] ), false, 'px' ); + $css->add_property( 'line-height', floatval( $font_settings['heading_3_line_height'] ), false, 'em' ); + + if ( $color_settings['h3_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['h3_color'] ) ); + } elseif ( $color_settings['content_text_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['content_text_color'] ) ); + } else { + $css->add_property( 'color', esc_attr( generate_get_option( 'text_color' ) ) ); + } + + $css->set_selector( 'body .editor-styles-wrapper h4, .wp-block-heading h4.editor-rich-text__tinymce' ); + $css->add_property( 'font-family', $h4_family ); + $css->add_property( 'font-weight', esc_attr( $font_settings['heading_4_weight'] ) ); + $css->add_property( 'text-transform', esc_attr( $font_settings['heading_4_transform'] ) ); + + if ( '' !== $font_settings['heading_4_font_size'] ) { + $css->add_property( 'font-size', absint( $font_settings['heading_4_font_size'] ), false, 'px' ); + } else { + $css->add_property( 'font-size', 'inherit' ); + } + + if ( '' !== $font_settings['heading_4_line_height'] ) { + $css->add_property( 'line-height', floatval( $font_settings['heading_4_line_height'] ), false, 'em' ); + } + + if ( $color_settings['h4_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['h4_color'] ) ); + } elseif ( $color_settings['content_text_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['content_text_color'] ) ); + } else { + $css->add_property( 'color', esc_attr( generate_get_option( 'text_color' ) ) ); + } + + $css->set_selector( 'body .editor-styles-wrapper h5, .wp-block-heading h5.editor-rich-text__tinymce' ); + $css->add_property( 'font-family', $h5_family ); + $css->add_property( 'font-weight', esc_attr( $font_settings['heading_5_weight'] ) ); + $css->add_property( 'text-transform', esc_attr( $font_settings['heading_5_transform'] ) ); + + if ( '' !== $font_settings['heading_5_font_size'] ) { + $css->add_property( 'font-size', absint( $font_settings['heading_5_font_size'] ), false, 'px' ); + } else { + $css->add_property( 'font-size', 'inherit' ); + } + + if ( '' !== $font_settings['heading_5_line_height'] ) { + $css->add_property( 'line-height', floatval( $font_settings['heading_5_line_height'] ), false, 'em' ); + } + + if ( $color_settings['h5_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['h5_color'] ) ); + } elseif ( $color_settings['content_text_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['content_text_color'] ) ); + } else { + $css->add_property( 'color', esc_attr( generate_get_option( 'text_color' ) ) ); + } + + $css->set_selector( 'body .editor-styles-wrapper h6, .wp-block-heading h6.editor-rich-text__tinymce' ); + $css->add_property( 'font-family', $h6_family ); + $css->add_property( 'font-weight', esc_attr( $font_settings['heading_6_weight'] ) ); + $css->add_property( 'text-transform', esc_attr( $font_settings['heading_6_transform'] ) ); + + if ( '' !== $font_settings['heading_6_font_size'] ) { + $css->add_property( 'font-size', absint( $font_settings['heading_6_font_size'] ), false, 'px' ); + } else { + $css->add_property( 'font-size', 'inherit' ); + } + + if ( '' !== $font_settings['heading_6_line_height'] ) { + $css->add_property( 'line-height', floatval( $font_settings['heading_6_line_height'] ), false, 'em' ); + } + + if ( $color_settings['h6_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['h6_color'] ) ); + } elseif ( $color_settings['content_text_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['content_text_color'] ) ); + } else { + $css->add_property( 'color', esc_attr( generate_get_option( 'text_color' ) ) ); + } + + $css->set_selector( '.block-editor-block-list__layout .wp-block-button .wp-block-button__link' ); + $css->add_property( 'font-family', $buttons_family ); + $css->add_property( 'font-weight', esc_attr( $font_settings['buttons_font_weight'] ) ); + $css->add_property( 'text-transform', esc_attr( $font_settings['buttons_font_transform'] ) ); + + if ( '' !== $font_settings['buttons_font_size'] ) { + $css->add_property( 'font-size', absint( $font_settings['buttons_font_size'] ), false, 'px' ); + } + + $css->set_selector( 'body .editor-styles-wrapper' ); + $css->add_property( 'background-color', esc_attr( generate_get_option( 'background_color' ) ) ); + + if ( $color_settings['content_background_color'] ) { + $body_background = esc_attr( generate_get_option( 'background_color' ) ); + $content_background = esc_attr( $color_settings['content_background_color'] ); + $css->add_property( 'background', 'linear-gradient(' . $content_background . ',' . $content_background . '), linear-gradient(' . $body_background . ',' . $body_background . ')' ); + } + + $css->set_selector( '.block-editor-block-list__block a, .block-editor-block-list__block a:visited' ); + + if ( $color_settings['content_link_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['content_link_color'] ) ); + } else { + $css->add_property( 'color', esc_attr( generate_get_option( 'link_color' ) ) ); + } + + $css->set_selector( '.block-editor-block-list__block a:hover, .block-editor-block-list__block a:focus, .block-editor-block-list__block a:active' ); + + if ( $color_settings['content_link_hover_color'] ) { + $css->add_property( 'color', esc_attr( $color_settings['content_link_hover_color'] ) ); + } else { + $css->add_property( 'color', esc_attr( generate_get_option( 'link_color_hover' ) ) ); + } + + return $css->css_output(); +} diff --git a/wp-content/themes/generatepress/inc/class-css.php b/wp-content/themes/generatepress/inc/class-css.php new file mode 100644 index 0000000..e5b1c2a --- /dev/null +++ b/wp-content/themes/generatepress/inc/class-css.php @@ -0,0 +1,212 @@ +_selector !== '' ) { + $this->add_selector_rules_to_output(); + } + + $this->_selector = $selector; + return $this; + } + + /** + * Adds a css property with value to the css output + * + * @access public + * @since 1.0 + * + * @param string $property - the css property + * @param string $value - the value to be placed with the property + * @param string $og_default - check to see if the value matches the default + * @param string $unit - the unit for the value (px) + * @return $this + */ + public function add_property( $property, $value, $og_default = false, $unit = false ) { + // Add our unit to our value if it exists. + if ( $unit && '' !== $unit ) { + $value = $value . $unit; + if ( '' !== $og_default ) { + $og_default = $og_default . $unit; + } + } + + // If we don't have a value or our value is the same as our og default, bail. + if ( empty( $value ) || $og_default == $value ) { + return false; + } + + $this->_css .= $property . ':' . $value . ';'; + return $this; + } + + /** + * Sets a media query in the class + * + * @since 1.1 + * @param string $value + * @return $this + */ + public function start_media_query( $value ) { + // Add the current rules to the output. + $this->add_selector_rules_to_output(); + + // Add any previous media queries to the output. + if ( ! empty( $this->_media_query ) ) { + $this->add_media_query_rules_to_output(); + } + + // Set the new media query. + $this->_media_query = $value; + return $this; + } + + /** + * Stops using a media query. + * + * @see start_media_query() + * + * @since 1.1 + * @return $this + */ + public function stop_media_query() { + return $this->start_media_query( null ); + } + + /** + * Adds the current media query's rules to the class' output variable + * + * @since 1.1 + * @return $this + */ + private function add_media_query_rules_to_output() { + if ( ! empty( $this->_media_query_output ) ) { + $this->_output .= sprintf( '@media %1$s{%2$s}', $this->_media_query, $this->_media_query_output ); + + // Reset the media query output string. + $this->_media_query_output = ''; + } + + return $this; + } + + /** + * Adds the current selector rules to the output variable + * + * @access private + * @since 1.0 + * + * @return $this + */ + private function add_selector_rules_to_output() { + if ( ! empty( $this->_css ) ) { + $this->_selector_output = $this->_selector; + $selector_output = sprintf( '%1$s{%2$s}', $this->_selector_output, $this->_css ); + + // Add our CSS to the output. + if ( ! empty( $this->_media_query ) ) { + $this->_media_query_output .= $selector_output; + $this->_css = ''; + } else { + $this->_output .= $selector_output; + } + + // Reset the css. + $this->_css = ''; + } + + return $this; + } + + /** + * Returns the minified css in the $_output variable + * + * @access public + * @since 1.0 + * + * @return string + */ + public function css_output() { + // Add current selector's rules to output. + $this->add_selector_rules_to_output(); + + // Output minified css. + return $this->_output; + } + + } +} diff --git a/wp-content/themes/generatepress/inc/css-output.php b/wp-content/themes/generatepress/inc/css-output.php new file mode 100644 index 0000000..941aaef --- /dev/null +++ b/wp-content/themes/generatepress/inc/css-output.php @@ -0,0 +1,814 @@ + section using the Theme Customizer. + * + * @since 0.1 + */ + function generate_base_css() { + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_defaults() + ); + + $css = new GeneratePress_CSS; + + $css->set_selector( 'body' ); + $css->add_property( 'background-color', esc_attr( $generate_settings['background_color'] ) ); + $css->add_property( 'color', esc_attr( $generate_settings['text_color'] ) ); + + $css->set_selector( 'a, a:visited' ); + $css->add_property( 'color', esc_attr( $generate_settings['link_color'] ) ); + + $css->set_selector( 'a:visited' )->add_property( 'color', esc_attr( $generate_settings['link_color_visited'] ) ); + + $css->set_selector( 'a:hover, a:focus, a:active' ); + $css->add_property( 'color', esc_attr( $generate_settings['link_color_hover'] ) ); + + $css->set_selector( 'body .grid-container' )->add_property( 'max-width', absint( $generate_settings['container_width'] ), false, 'px' ); + + if ( apply_filters( 'generate_do_group_inner_container_style', true ) ) { + $css->set_selector( '.wp-block-group__inner-container' ); + $css->add_property( 'max-width', absint( $generate_settings['container_width'] ), false, 'px' ); + $css->add_property( 'margin-left', 'auto' ); + $css->add_property( 'margin-right', 'auto' ); + } + + $nav_drop_point = generate_get_option( 'nav_drop_point' ); + $nav_location = generate_get_navigation_location(); + + if ( ( 'nav-float-right' === $nav_location || 'nav-float-left' === $nav_location ) && $nav_drop_point ) { + $media_query = sprintf( + '(max-width: %1$s) and %2$s', + absint( $nav_drop_point ) . 'px', + apply_filters( 'generate_not_mobile_menu_media_query', '(min-width: 769px)' ) + ); + + $css->start_media_query( $media_query ); + $css->set_selector( '.inside-header' ); + $css->add_property( 'display', '-ms-flexbox' ); + $css->add_property( 'display', 'flex' ); + + $css->add_property( '-ms-flex-direction', 'column' ); + $css->add_property( 'flex-direction', 'column' ); + + $css->add_property( '-ms-flex-align', 'center' ); + $css->add_property( 'align-items', 'center' ); + + $css->set_selector( '.site-logo, .site-branding' ); + $css->add_property( 'margin-bottom', '1.5em' ); + + $css->set_selector( '#site-navigation' ); + $css->add_property( 'margin', '0 auto' ); + + $css->set_selector( '.header-widget' ); + $css->add_property( 'margin-top', '1.5em' ); + + if ( 'nav-float-left' === generate_get_option( 'nav_position_setting' ) ) { + $css->set_selector( '.nav-float-left .site-logo,.nav-float-left .site-branding,.nav-float-left .header-widget' ); + $css->add_property( '-webkit-box-ordinal-group', 'initial' ); + $css->add_property( '-ms-flex-order', 'initial' ); + $css->add_property( 'order', 'initial' ); + } + $css->stop_media_query(); + } + + if ( generate_get_option( 'logo_width' ) ) { + $css->set_selector( '.site-header .header-image' ); + $css->add_property( 'width', absint( generate_get_option( 'logo_width' ) ), false, 'px' ); + } + + do_action( 'generate_base_css', $css ); + + return apply_filters( 'generate_base_css_output', $css->css_output() ); + } +} + +if ( ! function_exists( 'generate_advanced_css' ) ) { + /** + * Generate the CSS in the section using the Theme Customizer. + * + * @since 0.1 + */ + function generate_advanced_css() { + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_color_defaults() + ); + + $css = new GeneratePress_CSS; + + $css->set_selector( '.top-bar' ); + $css->add_property( 'background-color', esc_attr( $generate_settings['top_bar_background_color'] ) ); + $css->add_property( 'color', esc_attr( $generate_settings['top_bar_text_color'] ) ); + + $css->set_selector( '.top-bar a,.top-bar a:visited' ); + $css->add_property( 'color', esc_attr( $generate_settings['top_bar_link_color'] ) ); + + $css->set_selector( '.top-bar a:hover' ); + $css->add_property( 'color', esc_attr( $generate_settings['top_bar_link_color_hover'] ) ); + + $css->set_selector( '.site-header' ); + $css->add_property( 'background-color', esc_attr( $generate_settings['header_background_color'] ) ); + $css->add_property( 'color', esc_attr( $generate_settings['header_text_color'] ) ); + + $css->set_selector( '.site-header a,.site-header a:visited' ); + $css->add_property( 'color', esc_attr( $generate_settings['header_link_color'] ) ); + + $css->set_selector( '.site-header a:hover' ); + $css->add_property( 'color', esc_attr( $generate_settings['header_link_hover_color'] ) ); + + $css->set_selector( '.main-title a,.main-title a:hover,.main-title a:visited' ); + $css->add_property( 'color', esc_attr( $generate_settings['site_title_color'] ) ); + + $css->set_selector( '.site-description' ); + $css->add_property( 'color', esc_attr( $generate_settings['site_tagline_color'] ) ); + + $css->set_selector( '.main-navigation,.main-navigation ul ul' ); + $css->add_property( 'background-color', esc_attr( $generate_settings['navigation_background_color'] ) ); + + $css->set_selector( '.main-navigation .main-nav ul li a,.menu-toggle' ); + $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_color'] ) ); + + $css->set_selector( '.main-navigation .main-nav ul li:hover > a,.main-navigation .main-nav ul li:focus > a, .main-navigation .main-nav ul li.sfHover > a' ); + $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_hover_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['navigation_background_hover_color'] ) ); + + $css->set_selector( 'button.menu-toggle:hover,button.menu-toggle:focus,.main-navigation .mobile-bar-items a,.main-navigation .mobile-bar-items a:hover,.main-navigation .mobile-bar-items a:focus' ); + $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_color'] ) ); + + $css->set_selector( '.main-navigation .main-nav ul li[class*="current-menu-"] > a' ); + $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_current_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['navigation_background_current_color'] ) ); + + $css->set_selector( '.main-navigation .main-nav ul li[class*="current-menu-"] > a:hover,.main-navigation .main-nav ul li[class*="current-menu-"].sfHover > a' ); + $css->add_property( 'color', esc_attr( $generate_settings['navigation_text_current_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['navigation_background_current_color'] ) ); + + $navigation_search_background = $generate_settings['navigation_background_hover_color']; + $navigation_search_text = $generate_settings['navigation_text_hover_color']; + + if ( '' !== $generate_settings['navigation_search_background_color'] ) { + $navigation_search_background = $generate_settings['navigation_search_background_color']; + } + + if ( '' !== $generate_settings['navigation_search_text_color'] ) { + $navigation_search_text = $generate_settings['navigation_search_text_color']; + } + + $css->set_selector( '.navigation-search input[type="search"],.navigation-search input[type="search"]:active, .navigation-search input[type="search"]:focus, .main-navigation .main-nav ul li.search-item.active > a' ); + $css->add_property( 'color', esc_attr( $navigation_search_text ) ); + $css->add_property( 'background-color', esc_attr( $navigation_search_background ) ); + + if ( '' !== $generate_settings['navigation_search_background_color'] ) { + $css->add_property( 'opacity', '1' ); + } + + $css->set_selector( '.main-navigation ul ul' ); + $css->add_property( 'background-color', esc_attr( $generate_settings['subnavigation_background_color'] ) ); + + $css->set_selector( '.main-navigation .main-nav ul ul li a' ); + $css->add_property( 'color', esc_attr( $generate_settings['subnavigation_text_color'] ) ); + + $css->set_selector( '.main-navigation .main-nav ul ul li:hover > a,.main-navigation .main-nav ul ul li:focus > a,.main-navigation .main-nav ul ul li.sfHover > a' ); + $css->add_property( 'color', esc_attr( $generate_settings['subnavigation_text_hover_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['subnavigation_background_hover_color'] ) ); + + $css->set_selector( '.main-navigation .main-nav ul ul li[class*="current-menu-"] > a' ); + $css->add_property( 'color', esc_attr( $generate_settings['subnavigation_text_current_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['subnavigation_background_current_color'] ) ); + + $css->set_selector( '.main-navigation .main-nav ul ul li[class*="current-menu-"] > a:hover,.main-navigation .main-nav ul ul li[class*="current-menu-"].sfHover > a' ); + $css->add_property( 'color', esc_attr( $generate_settings['subnavigation_text_current_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['subnavigation_background_current_color'] ) ); + + $css->set_selector( '.separate-containers .inside-article, .separate-containers .comments-area, .separate-containers .page-header, .one-container .container, .separate-containers .paging-navigation, .inside-page-header' ); + $css->add_property( 'color', esc_attr( $generate_settings['content_text_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['content_background_color'] ) ); + + $css->set_selector( '.inside-article a,.inside-article a:visited,.paging-navigation a,.paging-navigation a:visited,.comments-area a,.comments-area a:visited,.page-header a,.page-header a:visited' ); + $css->add_property( 'color', esc_attr( $generate_settings['content_link_color'] ) ); + + $css->set_selector( '.inside-article a:hover,.paging-navigation a:hover,.comments-area a:hover,.page-header a:hover' ); + $css->add_property( 'color', esc_attr( $generate_settings['content_link_hover_color'] ) ); + + $css->set_selector( '.entry-header h1,.page-header h1' ); + $css->add_property( 'color', esc_attr( $generate_settings['content_title_color'] ) ); + + $css->set_selector( '.entry-title a,.entry-title a:visited' ); + $css->add_property( 'color', esc_attr( $generate_settings['blog_post_title_color'] ) ); + + $css->set_selector( '.entry-title a:hover' ); + $css->add_property( 'color', esc_attr( $generate_settings['blog_post_title_hover_color'] ) ); + + $css->set_selector( '.entry-meta' ); + $css->add_property( 'color', esc_attr( $generate_settings['entry_meta_text_color'] ) ); + + $css->set_selector( '.entry-meta a,.entry-meta a:visited' ); + $css->add_property( 'color', esc_attr( $generate_settings['entry_meta_link_color'] ) ); + + $css->set_selector( '.entry-meta a:hover' ); + $css->add_property( 'color', esc_attr( $generate_settings['entry_meta_link_color_hover'] ) ); + + $css->set_selector( 'h1' ); + $css->add_property( 'color', esc_attr( $generate_settings['h1_color'] ) ); + + $css->set_selector( 'h2' ); + $css->add_property( 'color', esc_attr( $generate_settings['h2_color'] ) ); + + $css->set_selector( 'h3' ); + $css->add_property( 'color', esc_attr( $generate_settings['h3_color'] ) ); + + $css->set_selector( 'h4' ); + $css->add_property( 'color', esc_attr( $generate_settings['h4_color'] ) ); + + $css->set_selector( 'h5' ); + $css->add_property( 'color', esc_attr( $generate_settings['h5_color'] ) ); + + $css->set_selector( 'h6' ); + $css->add_property( 'color', esc_attr( $generate_settings['h6_color'] ) ); + + $css->set_selector( '.sidebar .widget' ); + $css->add_property( 'color', esc_attr( $generate_settings['sidebar_widget_text_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['sidebar_widget_background_color'] ) ); + + $css->set_selector( '.sidebar .widget a,.sidebar .widget a:visited' ); + $css->add_property( 'color', esc_attr( $generate_settings['sidebar_widget_link_color'] ) ); + + $css->set_selector( '.sidebar .widget a:hover' ); + $css->add_property( 'color', esc_attr( $generate_settings['sidebar_widget_link_hover_color'] ) ); + + $css->set_selector( '.sidebar .widget .widget-title' ); + $css->add_property( 'color', esc_attr( $generate_settings['sidebar_widget_title_color'] ) ); + + $css->set_selector( '.footer-widgets' ); + $css->add_property( 'color', esc_attr( $generate_settings['footer_widget_text_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['footer_widget_background_color'] ) ); + + $css->set_selector( '.footer-widgets a,.footer-widgets a:visited' ); + $css->add_property( 'color', esc_attr( $generate_settings['footer_widget_link_color'] ) ); + + $css->set_selector( '.footer-widgets a:hover' ); + $css->add_property( 'color', esc_attr( $generate_settings['footer_widget_link_hover_color'] ) ); + + $css->set_selector( '.footer-widgets .widget-title' ); + $css->add_property( 'color', esc_attr( $generate_settings['footer_widget_title_color'] ) ); + + $css->set_selector( '.site-info' ); + $css->add_property( 'color', esc_attr( $generate_settings['footer_text_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['footer_background_color'] ) ); + + $css->set_selector( '.site-info a,.site-info a:visited' ); + $css->add_property( 'color', esc_attr( $generate_settings['footer_link_color'] ) ); + + $css->set_selector( '.site-info a:hover' ); + $css->add_property( 'color', esc_attr( $generate_settings['footer_link_hover_color'] ) ); + + $css->set_selector( '.footer-bar .widget_nav_menu .current-menu-item a' ); + $css->add_property( 'color', esc_attr( $generate_settings['footer_link_hover_color'] ) ); + + $css->set_selector( 'input[type="text"],input[type="email"],input[type="url"],input[type="password"],input[type="search"],input[type="tel"],input[type="number"],textarea,select' ); + $css->add_property( 'color', esc_attr( $generate_settings['form_text_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['form_background_color'] ) ); + $css->add_property( 'border-color', esc_attr( $generate_settings['form_border_color'] ) ); + + $css->set_selector( 'input[type="text"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="password"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="number"]:focus,textarea:focus,select:focus' ); + $css->add_property( 'color', esc_attr( $generate_settings['form_text_color_focus'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['form_background_color_focus'] ) ); + $css->add_property( 'border-color', esc_attr( $generate_settings['form_border_color_focus'] ) ); + + $css->set_selector( 'button,html input[type="button"],input[type="reset"],input[type="submit"],a.button,a.button:visited,a.wp-block-button__link:not(.has-background)' ); + $css->add_property( 'color', esc_attr( $generate_settings['form_button_text_color'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['form_button_background_color'] ) ); + + $css->set_selector( 'button:hover,html input[type="button"]:hover,input[type="reset"]:hover,input[type="submit"]:hover,a.button:hover,button:focus,html input[type="button"]:focus,input[type="reset"]:focus,input[type="submit"]:focus,a.button:focus,a.wp-block-button__link:not(.has-background):active,a.wp-block-button__link:not(.has-background):focus,a.wp-block-button__link:not(.has-background):hover' ); + $css->add_property( 'color', esc_attr( $generate_settings['form_button_text_color_hover'] ) ); + $css->add_property( 'background-color', esc_attr( $generate_settings['form_button_background_color_hover'] ) ); + + $css->set_selector( '.generate-back-to-top,.generate-back-to-top:visited' ); + $css->add_property( 'background-color', esc_attr( $generate_settings['back_to_top_background_color'] ) ); + $css->add_property( 'color', esc_attr( $generate_settings['back_to_top_text_color'] ) ); + + $css->set_selector( '.generate-back-to-top:hover,.generate-back-to-top:focus' ); + $css->add_property( 'background-color', esc_attr( $generate_settings['back_to_top_background_color_hover'] ) ); + $css->add_property( 'color', esc_attr( $generate_settings['back_to_top_text_color_hover'] ) ); + + do_action( 'generate_colors_css', $css ); + + return apply_filters( 'generate_colors_css_output', $css->css_output() ); + } +} + +if ( ! function_exists( 'generate_font_css' ) ) { + /** + * Generate the CSS in the section using the Theme Customizer. + * + * @since 0.1 + */ + function generate_font_css() { + + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_default_fonts() + ); + + $og_defaults = generate_get_default_fonts( false ); + + $css = new GeneratePress_CSS; + + $subnav_font_size = $generate_settings['navigation_font_size'] >= 17 ? $generate_settings['navigation_font_size'] - 3 : $generate_settings['navigation_font_size'] - 1; + + $body_family = generate_get_font_family_css( 'font_body', 'generate_settings', generate_get_default_fonts() ); + $top_bar_family = generate_get_font_family_css( 'font_top_bar', 'generate_settings', generate_get_default_fonts() ); + $site_title_family = generate_get_font_family_css( 'font_site_title', 'generate_settings', generate_get_default_fonts() ); + $site_tagline_family = generate_get_font_family_css( 'font_site_tagline', 'generate_settings', generate_get_default_fonts() ); + $navigation_family = generate_get_font_family_css( 'font_navigation', 'generate_settings', generate_get_default_fonts() ); + $widget_family = generate_get_font_family_css( 'font_widget_title', 'generate_settings', generate_get_default_fonts() ); + $h1_family = generate_get_font_family_css( 'font_heading_1', 'generate_settings', generate_get_default_fonts() ); + $h2_family = generate_get_font_family_css( 'font_heading_2', 'generate_settings', generate_get_default_fonts() ); + $h3_family = generate_get_font_family_css( 'font_heading_3', 'generate_settings', generate_get_default_fonts() ); + $h4_family = generate_get_font_family_css( 'font_heading_4', 'generate_settings', generate_get_default_fonts() ); + $h5_family = generate_get_font_family_css( 'font_heading_5', 'generate_settings', generate_get_default_fonts() ); + $h6_family = generate_get_font_family_css( 'font_heading_6', 'generate_settings', generate_get_default_fonts() ); + $footer_family = generate_get_font_family_css( 'font_footer', 'generate_settings', generate_get_default_fonts() ); + $buttons_family = generate_get_font_family_css( 'font_buttons', 'generate_settings', generate_get_default_fonts() ); + + $css->set_selector( 'body, button, input, select, textarea' ); + $css->add_property( 'font-family', $body_family ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['body_font_weight'] ), $og_defaults['body_font_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['body_font_transform'] ), $og_defaults['body_font_transform'] ); + $css->add_property( 'font-size', absint( $generate_settings['body_font_size'] ), $og_defaults['body_font_size'], 'px' ); + + $css->set_selector( 'body' ); + $css->add_property( 'line-height', floatval( $generate_settings['body_line_height'] ), $og_defaults['body_line_height'] ); + + $css->set_selector( 'p' ); + $css->add_property( 'margin-bottom', floatval( $generate_settings['paragraph_margin'] ), $og_defaults['paragraph_margin'], 'em' ); + + $css->set_selector( '.entry-content > [class*="wp-block-"]:not(:last-child)' ); + $css->add_property( 'margin-bottom', floatval( $generate_settings['paragraph_margin'] ), false, 'em' ); + + $css->set_selector( '.top-bar' ); + $css->add_property( 'font-family', $og_defaults['font_top_bar'] !== $generate_settings['font_top_bar'] ? $top_bar_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['top_bar_font_weight'] ), $og_defaults['top_bar_font_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['top_bar_font_transform'] ), $og_defaults['top_bar_font_transform'] ); + $css->add_property( 'font-size', absint( $generate_settings['top_bar_font_size'] ), absint( $og_defaults['top_bar_font_size'] ), 'px' ); + + $css->set_selector( '.main-title' ); + $css->add_property( 'font-family', $og_defaults['font_site_title'] !== $generate_settings['font_site_title'] ? $site_title_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['site_title_font_weight'] ), $og_defaults['site_title_font_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['site_title_font_transform'] ), $og_defaults['site_title_font_transform'] ); + $css->add_property( 'font-size', absint( $generate_settings['site_title_font_size'] ), $og_defaults['site_title_font_size'], 'px' ); + + $css->set_selector( '.site-description' ); + $css->add_property( 'font-family', $og_defaults['font_site_tagline'] !== $generate_settings['font_site_tagline'] ? $site_tagline_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['site_tagline_font_weight'] ), $og_defaults['site_tagline_font_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['site_tagline_font_transform'] ), $og_defaults['site_tagline_font_transform'] ); + $css->add_property( 'font-size', absint( $generate_settings['site_tagline_font_size'] ), $og_defaults['site_tagline_font_size'], 'px' ); + + $css->set_selector( '.main-navigation a, .menu-toggle' ); + $css->add_property( 'font-family', $og_defaults['font_navigation'] !== $generate_settings['font_navigation'] ? $navigation_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['navigation_font_weight'] ), $og_defaults['navigation_font_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['navigation_font_transform'] ), $og_defaults['navigation_font_transform'] ); + $css->add_property( 'font-size', absint( $generate_settings['navigation_font_size'] ), $og_defaults['navigation_font_size'], 'px' ); + + $css->set_selector( '.main-navigation .main-nav ul ul li a' ); + $css->add_property( 'font-size', absint( $subnav_font_size ), false, 'px' ); + + $css->set_selector( '.widget-title' ); + $css->add_property( 'font-family', $og_defaults['font_widget_title'] !== $generate_settings['font_widget_title'] ? $widget_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['widget_title_font_weight'] ), $og_defaults['widget_title_font_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['widget_title_font_transform'] ), $og_defaults['widget_title_font_transform'] ); + $css->add_property( 'font-size', absint( $generate_settings['widget_title_font_size'] ), $og_defaults['widget_title_font_size'], 'px' ); + $css->add_property( 'margin-bottom', absint( $generate_settings['widget_title_separator'] ), absint( $og_defaults['widget_title_separator'] ), 'px' ); + + $css->set_selector( '.sidebar .widget, .footer-widgets .widget' ); + $css->add_property( 'font-size', absint( $generate_settings['widget_content_font_size'] ), $og_defaults['widget_content_font_size'], 'px' ); + + $css->set_selector( 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.button:visited,.wp-block-button .wp-block-button__link' ); + $css->add_property( 'font-family', $og_defaults['font_buttons'] !== $generate_settings['font_buttons'] ? $buttons_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['buttons_font_weight'] ), $og_defaults['buttons_font_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['buttons_font_transform'] ), $og_defaults['buttons_font_transform'] ); + + if ( '' !== $generate_settings['buttons_font_size'] ) { + $css->add_property( 'font-size', absint( $generate_settings['buttons_font_size'] ), $og_defaults['buttons_font_size'], 'px' ); + } + + $css->set_selector( 'h1' ); + $css->add_property( 'font-family', $og_defaults['font_heading_1'] !== $generate_settings['font_heading_1'] ? $h1_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['heading_1_weight'] ), $og_defaults['heading_1_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['heading_1_transform'] ), $og_defaults['heading_1_transform'] ); + $css->add_property( 'font-size', absint( $generate_settings['heading_1_font_size'] ), $og_defaults['heading_1_font_size'], 'px' ); + $css->add_property( 'line-height', floatval( $generate_settings['heading_1_line_height'] ), $og_defaults['heading_1_line_height'], 'em' ); + $css->add_property( 'margin-bottom', floatval( $generate_settings['heading_1_margin_bottom'] ), $og_defaults['heading_1_margin_bottom'], 'px' ); + + $css->set_selector( 'h2' ); + $css->add_property( 'font-family', $og_defaults['font_heading_2'] !== $generate_settings['font_heading_2'] ? $h2_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['heading_2_weight'] ), $og_defaults['heading_2_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['heading_2_transform'] ), $og_defaults['heading_2_transform'] ); + $css->add_property( 'font-size', absint( $generate_settings['heading_2_font_size'] ), $og_defaults['heading_2_font_size'], 'px' ); + $css->add_property( 'line-height', floatval( $generate_settings['heading_2_line_height'] ), $og_defaults['heading_2_line_height'], 'em' ); + $css->add_property( 'margin-bottom', floatval( $generate_settings['heading_2_margin_bottom'] ), $og_defaults['heading_2_margin_bottom'], 'px' ); + + $css->set_selector( 'h3' ); + $css->add_property( 'font-family', $og_defaults['font_heading_3'] !== $generate_settings['font_heading_3'] ? $h3_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['heading_3_weight'] ), $og_defaults['heading_3_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['heading_3_transform'] ), $og_defaults['heading_3_transform'] ); + $css->add_property( 'font-size', absint( $generate_settings['heading_3_font_size'] ), $og_defaults['heading_3_font_size'], 'px' ); + $css->add_property( 'line-height', floatval( $generate_settings['heading_3_line_height'] ), $og_defaults['heading_3_line_height'], 'em' ); + $css->add_property( 'margin-bottom', floatval( $generate_settings['heading_3_margin_bottom'] ), $og_defaults['heading_3_margin_bottom'], 'px' ); + + $css->set_selector( 'h4' ); + $css->add_property( 'font-family', $og_defaults['font_heading_4'] !== $generate_settings['font_heading_4'] ? $h4_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['heading_4_weight'] ), $og_defaults['heading_4_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['heading_4_transform'] ), $og_defaults['heading_4_transform'] ); + + if ( '' !== $generate_settings['heading_4_font_size'] ) { + $css->add_property( 'font-size', absint( $generate_settings['heading_4_font_size'] ), $og_defaults['heading_4_font_size'], 'px' ); + } + + if ( '' !== $generate_settings['heading_4_line_height'] ) { + $css->add_property( 'line-height', floatval( $generate_settings['heading_4_line_height'] ), $og_defaults['heading_4_line_height'], 'em' ); + } + + $css->set_selector( 'h5' ); + $css->add_property( 'font-family', $og_defaults['font_heading_5'] !== $generate_settings['font_heading_5'] ? $h5_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['heading_5_weight'] ), $og_defaults['heading_5_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['heading_5_transform'] ), $og_defaults['heading_5_transform'] ); + + if ( '' !== $generate_settings['heading_5_font_size'] ) { + $css->add_property( 'font-size', absint( $generate_settings['heading_5_font_size'] ), $og_defaults['heading_5_font_size'], 'px' ); + } + + if ( '' !== $generate_settings['heading_5_line_height'] ) { + $css->add_property( 'line-height', floatval( $generate_settings['heading_5_line_height'] ), $og_defaults['heading_5_line_height'], 'em' ); + } + + $css->set_selector( 'h6' ); + $css->add_property( 'font-family', $og_defaults['font_heading_6'] !== $generate_settings['font_heading_6'] ? $h6_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['heading_6_weight'] ), $og_defaults['heading_6_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['heading_6_transform'] ), $og_defaults['heading_6_transform'] ); + + if ( '' !== $generate_settings['heading_6_font_size'] ) { + $css->add_property( 'font-size', absint( $generate_settings['heading_6_font_size'] ), $og_defaults['heading_6_font_size'], 'px' ); + } + + if ( '' !== $generate_settings['heading_6_line_height'] ) { + $css->add_property( 'line-height', floatval( $generate_settings['heading_6_line_height'] ), $og_defaults['heading_6_line_height'], 'em' ); + } + + $css->set_selector( '.site-info' ); + $css->add_property( 'font-family', $og_defaults['font_footer'] !== $generate_settings['font_footer'] ? $footer_family : null ); + $css->add_property( 'font-weight', esc_attr( $generate_settings['footer_weight'] ), $og_defaults['footer_weight'] ); + $css->add_property( 'text-transform', esc_attr( $generate_settings['footer_transform'] ), $og_defaults['footer_transform'] ); + $css->add_property( 'font-size', absint( $generate_settings['footer_font_size'] ), $og_defaults['footer_font_size'], 'px' ); + + $css->start_media_query( generate_get_media_query( 'mobile' ) ); + $mobile_site_title = ( isset( $generate_settings['mobile_site_title_font_size'] ) ) ? $generate_settings['mobile_site_title_font_size'] : '30'; + $css->set_selector( '.main-title' ); + $css->add_property( 'font-size', absint( $mobile_site_title ), false, 'px' ); + + $mobile_h1 = ( isset( $generate_settings['mobile_heading_1_font_size'] ) ) ? $generate_settings['mobile_heading_1_font_size'] : '30'; + $css->set_selector( 'h1' ); + $css->add_property( 'font-size', absint( $mobile_h1 ), false, 'px' ); + + $mobile_h2 = ( isset( $generate_settings['mobile_heading_2_font_size'] ) ) ? $generate_settings['mobile_heading_2_font_size'] : '25'; + $css->set_selector( 'h2' ); + $css->add_property( 'font-size', absint( $mobile_h2 ), false, 'px' ); + $css->stop_media_query(); + + do_action( 'generate_typography_css', $css ); + + return apply_filters( 'generate_typography_css_output', $css->css_output() ); + } +} + +if ( ! function_exists( 'generate_spacing_css' ) ) { + /** + * Write our dynamic CSS. + * + * @since 0.1 + */ + function generate_spacing_css() { + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + + $og_defaults = generate_spacing_get_defaults( false ); + $sidebar_layout = generate_get_layout(); + + $css = new GeneratePress_CSS; + + $css->set_selector( '.inside-top-bar' ); + $css->add_property( 'padding', generate_padding_css( $spacing_settings['top_bar_top'], $spacing_settings['top_bar_right'], $spacing_settings['top_bar_bottom'], $spacing_settings['top_bar_left'] ), generate_padding_css( $og_defaults['top_bar_top'], $og_defaults['top_bar_right'], $og_defaults['top_bar_bottom'], $og_defaults['top_bar_left'] ) ); + + $css->set_selector( '.inside-header' ); + $css->add_property( 'padding', generate_padding_css( $spacing_settings['header_top'], $spacing_settings['header_right'], $spacing_settings['header_bottom'], $spacing_settings['header_left'] ), generate_padding_css( $og_defaults['header_top'], $og_defaults['header_right'], $og_defaults['header_bottom'], $og_defaults['header_left'] ) ); + + $css->set_selector( '.separate-containers .inside-article, .separate-containers .comments-area, .separate-containers .page-header, .separate-containers .paging-navigation, .one-container .site-content, .inside-page-header, .wp-block-group__inner-container' ); + $css->add_property( 'padding', generate_padding_css( $spacing_settings['content_top'], $spacing_settings['content_right'], $spacing_settings['content_bottom'], $spacing_settings['content_left'] ), generate_padding_css( $og_defaults['content_top'], $og_defaults['content_right'], $og_defaults['content_bottom'], $og_defaults['content_left'] ) ); + + $content_padding = absint( $spacing_settings['content_right'] ) + absint( $spacing_settings['content_left'] ); + $css->set_selector( '.entry-content .alignwide, body:not(.no-sidebar) .entry-content .alignfull' ); + $css->add_property( 'margin-left', '-' . absint( $spacing_settings['content_left'] ) . 'px' ); + $css->add_property( 'width', 'calc(100% + ' . absint( $content_padding ) . 'px)' ); + $css->add_property( 'max-width', 'calc(100% + ' . absint( $content_padding ) . 'px)' ); + + if ( 'text' === generate_get_option( 'container_alignment' ) ) { + $css->set_selector( '.container.grid-container' ); + $css->add_property( 'max-width', generate_get_option( 'container_width' ) + $content_padding, false, 'px' ); + } + + $css->set_selector( '.one-container.right-sidebar .site-main,.one-container.both-right .site-main' ); + $css->add_property( 'margin-right', absint( $spacing_settings['content_right'] ), absint( $og_defaults['content_right'] ), 'px' ); + + $css->set_selector( '.one-container.left-sidebar .site-main,.one-container.both-left .site-main' ); + $css->add_property( 'margin-left', absint( $spacing_settings['content_left'] ), absint( $og_defaults['content_left'] ), 'px' ); + + $css->set_selector( '.one-container.both-sidebars .site-main' ); + $css->add_property( 'margin', generate_padding_css( '0', $spacing_settings['content_right'], '0', $spacing_settings['content_left'] ), generate_padding_css( '0', $og_defaults['content_right'], '0', $og_defaults['content_left'] ) ); + + $css->set_selector( '.separate-containers .widget, .separate-containers .site-main > *, .separate-containers .page-header, .widget-area .main-navigation' ); + $css->add_property( 'margin-bottom', absint( $spacing_settings['separator'] ), absint( $og_defaults['separator'] ), 'px' ); + + $css->set_selector( '.separate-containers .site-main' ); + $css->add_property( 'margin', absint( $spacing_settings['separator'] ), $og_defaults['separator'], 'px' ); + + $css->set_selector( '.both-right.separate-containers .inside-left-sidebar' ); + $css->add_property( 'margin-right', absint( $spacing_settings['separator'] / 2 ), absint( $og_defaults['separator'] / 2 ), 'px' ); + + $css->set_selector( '.both-right.separate-containers .inside-right-sidebar' ); + $css->add_property( 'margin-left', absint( $spacing_settings['separator'] / 2 ), absint( $og_defaults['separator'] / 2 ), 'px' ); + + $css->set_selector( '.both-left.separate-containers .inside-left-sidebar' ); + $css->add_property( 'margin-right', absint( $spacing_settings['separator'] / 2 ), absint( $og_defaults['separator'] / 2 ), 'px' ); + + $css->set_selector( '.both-left.separate-containers .inside-right-sidebar' ); + $css->add_property( 'margin-left', absint( $spacing_settings['separator'] / 2 ), absint( $og_defaults['separator'] / 2 ), 'px' ); + + $css->set_selector( '.separate-containers .page-header-image, .separate-containers .page-header-contained, .separate-containers .page-header-image-single, .separate-containers .page-header-content-single' ); + $css->add_property( 'margin-top', absint( $spacing_settings['separator'] ), absint( $og_defaults['separator'] ), 'px' ); + + $css->set_selector( '.separate-containers .inside-right-sidebar, .separate-containers .inside-left-sidebar' ); + $css->add_property( 'margin-top', absint( $spacing_settings['separator'] ), absint( $og_defaults['separator'] ), 'px' ); + $css->add_property( 'margin-bottom', absint( $spacing_settings['separator'] ), absint( $og_defaults['separator'] ), 'px' ); + + $css->set_selector( '.main-navigation .main-nav ul li a,.menu-toggle,.main-navigation .mobile-bar-items a' ); + $css->add_property( 'padding-left', absint( $spacing_settings['menu_item'] ), absint( $og_defaults['menu_item'] ), 'px' ); + $css->add_property( 'padding-right', absint( $spacing_settings['menu_item'] ), absint( $og_defaults['menu_item'] ), 'px' ); + $css->add_property( 'line-height', absint( $spacing_settings['menu_item_height'] ), absint( $og_defaults['menu_item_height'] ), 'px' ); + + $css->set_selector( '.main-navigation .main-nav ul ul li a' ); + $css->add_property( 'padding', generate_padding_css( $spacing_settings['sub_menu_item_height'], $spacing_settings['menu_item'], $spacing_settings['sub_menu_item_height'], $spacing_settings['menu_item'] ), generate_padding_css( $og_defaults['sub_menu_item_height'], $og_defaults['menu_item'], $og_defaults['sub_menu_item_height'], $og_defaults['menu_item'] ) ); + + $css->set_selector( '.main-navigation ul ul' ); + $css->add_property( 'width', absint( $spacing_settings['sub_menu_width'] ), absint( $og_defaults['sub_menu_width'] ), 'px' ); + + $css->set_selector( '.navigation-search input' ); + $css->add_property( 'height', absint( $spacing_settings['menu_item_height'] ), absint( $og_defaults['menu_item_height'] ), 'px' ); + + $css->set_selector( '.rtl .menu-item-has-children .dropdown-menu-toggle' ); + $css->add_property( 'padding-left', absint( $spacing_settings['menu_item'] ), false, 'px' ); + + $css->set_selector( '.menu-item-has-children .dropdown-menu-toggle' ); + $css->add_property( 'padding-right', absint( $spacing_settings['menu_item'] ), absint( $og_defaults['menu_item'] ), 'px' ); + + $css->set_selector( '.menu-item-has-children ul .dropdown-menu-toggle' ); + $css->add_property( 'padding-top', absint( $spacing_settings['sub_menu_item_height'] ), absint( $og_defaults['sub_menu_item_height'] ), 'px' ); + $css->add_property( 'padding-bottom', absint( $spacing_settings['sub_menu_item_height'] ), absint( $og_defaults['sub_menu_item_height'] ), 'px' ); + $css->add_property( 'margin-top', '-' . absint( $spacing_settings['sub_menu_item_height'] ), '-' . absint( $og_defaults['sub_menu_item_height'] ), 'px' ); + + $css->set_selector( '.rtl .main-navigation .main-nav ul li.menu-item-has-children > a' ); + $css->add_property( 'padding-right', absint( $spacing_settings['menu_item'] ), false, 'px' ); + + $css->set_selector( '.widget-area .widget' ); + $css->add_property( 'padding', generate_padding_css( $spacing_settings['widget_top'], $spacing_settings['widget_right'], $spacing_settings['widget_bottom'], $spacing_settings['widget_left'] ), generate_padding_css( $og_defaults['widget_top'], $og_defaults['widget_right'], $og_defaults['widget_bottom'], $og_defaults['widget_left'] ) ); + + $css->set_selector( '.footer-widgets' ); + $css->add_property( 'padding', generate_padding_css( $spacing_settings['footer_widget_container_top'], $spacing_settings['footer_widget_container_right'], $spacing_settings['footer_widget_container_bottom'], $spacing_settings['footer_widget_container_left'] ), generate_padding_css( $og_defaults['footer_widget_container_top'], $og_defaults['footer_widget_container_right'], $og_defaults['footer_widget_container_bottom'], $og_defaults['footer_widget_container_left'] ) ); + + $css->set_selector( '.site-footer .footer-widgets-container .inner-padding' ); + $css->add_property( 'padding', generate_padding_css( '0', '0', '0', $spacing_settings['footer_widget_separator'] ), generate_padding_css( '0', '0', '0', $og_defaults['footer_widget_separator'] ) ); + + $css->set_selector( '.site-footer .footer-widgets-container .inside-footer-widgets' ); + $css->add_property( 'margin-left', '-' . absint( $spacing_settings['footer_widget_separator'] ), '-' . absint( $og_defaults['footer_widget_separator'] ), 'px' ); + + $css->set_selector( '.site-info' ); + $css->add_property( 'padding', generate_padding_css( $spacing_settings['footer_top'], $spacing_settings['footer_right'], $spacing_settings['footer_bottom'], $spacing_settings['footer_left'] ), generate_padding_css( $og_defaults['footer_top'], $og_defaults['footer_right'], $og_defaults['footer_bottom'], $og_defaults['footer_left'] ) ); + + $css->start_media_query( generate_get_media_query( 'mobile' ) ); + $css->set_selector( '.separate-containers .inside-article, .separate-containers .comments-area, .separate-containers .page-header, .separate-containers .paging-navigation, .one-container .site-content, .inside-page-header, .wp-block-group__inner-container' ); + $css->add_property( 'padding', generate_padding_css( $spacing_settings['mobile_content_top'], $spacing_settings['mobile_content_right'], $spacing_settings['mobile_content_bottom'], $spacing_settings['mobile_content_left'] ) ); + + $mobile_content_padding = absint( $spacing_settings['mobile_content_right'] ) + absint( $spacing_settings['mobile_content_left'] ); + $css->set_selector( '.entry-content .alignwide, body:not(.no-sidebar) .entry-content .alignfull' ); + $css->add_property( 'margin-left', '-' . absint( $spacing_settings['mobile_content_left'] ) . 'px' ); + $css->add_property( 'width', 'calc(100% + ' . absint( $mobile_content_padding ) . 'px)' ); + $css->add_property( 'max-width', 'calc(100% + ' . absint( $mobile_content_padding ) . 'px)' ); + + if ( '' !== $spacing_settings['mobile_separator'] ) { + $css->set_selector( '.separate-containers .widget, .separate-containers .site-main > *, .separate-containers .page-header' ); + $css->add_property( 'margin-bottom', absint( $spacing_settings['mobile_separator'] ), false, 'px' ); + + $css->set_selector( '.separate-containers .site-main' ); + $css->add_property( 'margin', absint( $spacing_settings['mobile_separator'] ), false, 'px' ); + + $css->set_selector( '.separate-containers .page-header-image, .separate-containers .page-header-image-single' ); + $css->add_property( 'margin-top', absint( $spacing_settings['mobile_separator'] ), false, 'px' ); + + $css->set_selector( '.separate-containers .inside-right-sidebar, .separate-containers .inside-left-sidebar' ); + $css->add_property( 'margin-top', absint( $spacing_settings['mobile_separator'] ), false, 'px' ); + $css->add_property( 'margin-bottom', absint( $spacing_settings['mobile_separator'] ), false, 'px' ); + } + $css->stop_media_query(); + + // Add spacing back where dropdown arrow should be. + // Old versions of WP don't get nice things. + if ( version_compare( $GLOBALS['wp_version'], '4.4', '<' ) ) { + $css->set_selector( '.main-navigation .main-nav ul li.menu-item-has-children>a, .secondary-navigation .main-nav ul li.menu-item-has-children>a' ); + $css->add_property( 'padding-right', absint( $spacing_settings['menu_item'] ), absint( $og_defaults['menu_item'] ), 'px' ); + } + + $output = ''; + + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_color_defaults() + ); + + // Find out if the content background color and sidebar widget background color is the same. + $sidebar = strtoupper( $generate_settings['sidebar_widget_background_color'] ); + $content = strtoupper( $generate_settings['content_background_color'] ); + $colors_match = ( ( $sidebar == $content ) || '' == $sidebar ) ? true : false; + + // If they're all 40 (default), remove the padding when one container is set. + // This way, the user can still adjust the padding and it will work (unless they want 40px padding). + // We'll also remove the padding if there's no color difference between the widgets and content background color. + if ( ( '40' == $spacing_settings['widget_top'] && '40' == $spacing_settings['widget_right'] && '40' == $spacing_settings['widget_bottom'] && '40' == $spacing_settings['widget_left'] ) && $colors_match ) { + $output .= '.one-container .sidebar .widget{padding:0px;}'; + } + + do_action( 'generate_spacing_css', $css ); + + return apply_filters( 'generate_spacing_css_output', $css->css_output() . $output ); + } +} + +/** + * Generates any CSS that can't be cached (can change from page to page). + * + * @since 2.0 + */ +function generate_no_cache_dynamic_css() { + $css = new GeneratePress_CSS; + + if ( ! generate_show_title() ) { + $css->set_selector( '.page .entry-content' )->add_property( 'margin-top', '0px' ); + + if ( is_single() ) { + if ( ! apply_filters( 'generate_post_author', true ) && ! apply_filters( 'generate_post_date', true ) ) { + $css->set_selector( '.single .entry-content' )->add_property( 'margin-top', '0px' ); + } + } + } + + $css->start_media_query( generate_get_media_query( 'mobile-menu' ) ); + $css->set_selector( '.main-navigation .menu-toggle,.main-navigation .mobile-bar-items,.sidebar-nav-mobile:not(#sticky-placeholder)' ); + $css->add_property( 'display', 'block' ); + + $css->set_selector( '.main-navigation ul,.gen-sidebar-nav' ); + $css->add_property( 'display', 'none' ); + + $css->set_selector( '[class*="nav-float-"] .site-header .inside-header > *' ); + $css->add_property( 'float', 'none' ); + $css->add_property( 'clear', 'both' ); + $css->stop_media_query(); + + return $css->css_output(); +} + +add_action( 'wp_enqueue_scripts', 'generate_enqueue_dynamic_css', 50 ); +/** + * Enqueue our dynamic CSS. + * + * @since 2.0 + */ +function generate_enqueue_dynamic_css() { + if ( ! get_option( 'generate_dynamic_css_output', false ) || is_customize_preview() || apply_filters( 'generate_dynamic_css_skip_cache', false ) ) { + $css = generate_base_css() . generate_font_css() . generate_advanced_css() . generate_spacing_css(); + } else { + $css = get_option( 'generate_dynamic_css_output' ) . '/* End cached CSS */'; + } + + $css = $css . generate_no_cache_dynamic_css() . generate_do_icon_css(); + + wp_add_inline_style( 'generate-style', $css ); +} + +add_action( 'init', 'generate_set_dynamic_css_cache' ); +/** + * Sets our dynamic CSS cache if it doesn't exist. + * + * If the theme version changed, bust the cache. + * + * @since 2.0 + */ +function generate_set_dynamic_css_cache() { + if ( apply_filters( 'generate_dynamic_css_skip_cache', false ) ) { + return; + } + + $cached_css = get_option( 'generate_dynamic_css_output', false ); + $cached_version = get_option( 'generate_dynamic_css_cached_version', '' ); + + if ( ! $cached_css || $cached_version !== GENERATE_VERSION ) { + $css = generate_base_css() . generate_font_css() . generate_advanced_css() . generate_spacing_css(); + + update_option( 'generate_dynamic_css_output', $css ); + update_option( 'generate_dynamic_css_cached_version', GENERATE_VERSION ); + } +} + +add_action( 'customize_save_after', 'generate_update_dynamic_css_cache' ); +/** + * Update our CSS cache when done saving Customizer options. + * + * @since 2.0 + */ +function generate_update_dynamic_css_cache() { + if ( apply_filters( 'generate_dynamic_css_skip_cache', false ) ) { + return; + } + + $css = generate_base_css() . generate_font_css() . generate_advanced_css() . generate_spacing_css(); + update_option( 'generate_dynamic_css_output', $css ); +} + +/** + * Output CSS for the icon fonts. + * + * @since 2.3 + */ +function generate_do_icon_css() { + $output = false; + + if ( 'font' === generate_get_option( 'icons' ) ) { + $url = trailingslashit( get_template_directory_uri() ); + + $output = '@font-face { + font-family: "GeneratePress"; + src: url("' . $url . 'fonts/generatepress.eot"); + src: url("' . $url . 'fonts/generatepress.eot#iefix") format("embedded-opentype"), + url("' . $url . 'fonts/generatepress.woff2") format("woff2"), + url("' . $url . 'fonts/generatepress.woff") format("woff"), + url("' . $url . 'fonts/generatepress.ttf") format("truetype"), + url("' . $url . 'fonts/generatepress.svg#GeneratePress") format("svg"); + font-weight: normal; + font-style: normal; + }'; + + if ( defined( 'GENERATE_MENU_PLUS_VERSION' ) ) { + $output .= '.main-navigation .slideout-toggle a:before, + .slide-opened .slideout-overlay .slideout-exit:before { + font-family: GeneratePress; + } + + .slideout-navigation .dropdown-menu-toggle:before { + content: "\f107" !important; + } + + .slideout-navigation .sfHover > a .dropdown-menu-toggle:before { + content: "\f106" !important; + }'; + } + } + + if ( 'svg' === generate_get_option( 'icons' ) ) { + $output = 'button.menu-toggle:before, + .search-item a:before, + .dropdown-menu-toggle:before, + .cat-links:before, + .tags-links:before, + .comments-link:before, + .nav-previous .prev:before, + .nav-next .next:before, + .generate-back-to-top:before { + display: none; + }'; + } + + if ( $output ) { + return str_replace( array( "\r", "\n", "\t" ), '', $output ); + } +} diff --git a/wp-content/themes/generatepress/inc/customizer.php b/wp-content/themes/generatepress/inc/customizer.php new file mode 100644 index 0000000..2afdc83 --- /dev/null +++ b/wp-content/themes/generatepress/inc/customizer.php @@ -0,0 +1,1445 @@ +get_control( 'blogdescription' ) ) { + $wp_customize->get_control( 'blogdescription' )->priority = 3; + $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + } + + if ( $wp_customize->get_control( 'blogname' ) ) { + $wp_customize->get_control( 'blogname' )->priority = 1; + $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; + } + + if ( $wp_customize->get_control( 'custom_logo' ) ) { + $wp_customize->get_setting( 'custom_logo' )->transport = 'refresh'; + } + + if ( method_exists( $wp_customize, 'register_control_type' ) ) { + $wp_customize->register_control_type( 'Generate_Customize_Misc_Control' ); + $wp_customize->register_control_type( 'Generate_Range_Slider_Control' ); + } + + if ( method_exists( $wp_customize, 'register_section_type' ) ) { + $wp_customize->register_section_type( 'GeneratePress_Upsell_Section' ); + } + + if ( isset( $wp_customize->selective_refresh ) ) { + $wp_customize->selective_refresh->add_partial( 'blogname', array( + 'selector' => '.main-title a', + 'render_callback' => 'generate_customize_partial_blogname', + ) ); + + $wp_customize->selective_refresh->add_partial( 'blogdescription', array( + 'selector' => '.site-description', + 'render_callback' => 'generate_customize_partial_blogdescription', + ) ); + } + + if ( ! defined( 'GP_PREMIUM_VERSION' ) ) { + $wp_customize->add_section( + new GeneratePress_Upsell_Section( $wp_customize, 'generatepress_upsell_section', + array( + 'pro_text' => __( 'Premium Modules Available', 'generatepress' ), + 'pro_url' => generate_get_premium_url( 'https://generatepress.com/premium' ), + 'capability' => 'edit_theme_options', + 'priority' => 0, + 'type' => 'gp-upsell-section', + ) + ) + ); + } + + $wp_customize->add_setting( + 'generate_settings[hide_title]', + array( + 'default' => $defaults['hide_title'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_checkbox', + ) + ); + + $wp_customize->add_control( + 'generate_settings[hide_title]', + array( + 'type' => 'checkbox', + 'label' => __( 'Hide site title', 'generatepress' ), + 'section' => 'title_tagline', + 'priority' => 2, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[hide_tagline]', + array( + 'default' => $defaults['hide_tagline'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_checkbox', + ) + ); + + $wp_customize->add_control( + 'generate_settings[hide_tagline]', + array( + 'type' => 'checkbox', + 'label' => __( 'Hide site tagline', 'generatepress' ), + 'section' => 'title_tagline', + 'priority' => 4, + ) + ); + + if ( ! function_exists( 'the_custom_logo' ) ) { + $wp_customize->add_setting( + 'generate_settings[logo]', + array( + 'default' => $defaults['logo'], + 'type' => 'option', + 'sanitize_callback' => 'esc_url_raw', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Image_Control( + $wp_customize, + 'generate_settings[logo]', + array( + 'label' => __( 'Logo', 'generatepress' ), + 'section' => 'title_tagline', + 'settings' => 'generate_settings[logo]', + ) + ) + ); + } + + $wp_customize->add_setting( + 'generate_settings[retina_logo]', + array( + 'default' => $defaults['retina_logo'], + 'type' => 'option', + 'sanitize_callback' => 'esc_url_raw', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Image_Control( + $wp_customize, + 'generate_settings[retina_logo]', + array( + 'label' => __( 'Retina Logo', 'generatepress' ), + 'section' => 'title_tagline', + 'settings' => 'generate_settings[retina_logo]', + 'active_callback' => 'generate_has_custom_logo_callback', + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[logo_width]', + array( + 'default' => $defaults['logo_width'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_empty_absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new Generate_Range_Slider_Control( + $wp_customize, + 'generate_settings[logo_width]', + array( + 'label' => __( 'Logo Width', 'generatepress' ), + 'section' => 'title_tagline', + 'settings' => array( + 'desktop' => 'generate_settings[logo_width]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 30, + 'max' => 800, + 'step' => 10, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'active_callback' => 'generate_has_custom_logo_callback', + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[inline_logo_site_branding]', + array( + 'default' => $defaults['inline_logo_site_branding'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_checkbox', + ) + ); + + $wp_customize->add_control( + 'generate_settings[inline_logo_site_branding]', + array( + 'type' => 'checkbox', + 'label' => esc_html__( 'Place logo next to title', 'generatepress' ), + 'section' => 'title_tagline', + 'active_callback' => 'generate_has_logo_site_branding', + ) + ); + + $wp_customize->add_section( + 'body_section', + array( + 'title' => $wp_customize->get_panel( 'generate_colors_panel' ) ? __( 'Body', 'generatepress' ) : __( 'Colors', 'generatepress' ), + 'capability' => 'edit_theme_options', + 'priority' => 30, + 'panel' => $wp_customize->get_panel( 'generate_colors_panel' ) ? 'generate_colors_panel' : false, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[background_color]', array( + 'default' => $defaults['background_color'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'generate_settings[background_color]', + array( + 'label' => __( 'Background Color', 'generatepress' ), + 'section' => 'body_section', + 'settings' => 'generate_settings[background_color]', + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[text_color]', array( + 'default' => $defaults['text_color'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'generate_settings[text_color]', + array( + 'label' => __( 'Text Color', 'generatepress' ), + 'section' => 'body_section', + 'settings' => 'generate_settings[text_color]', + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[link_color]', array( + 'default' => $defaults['link_color'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'generate_settings[link_color]', + array( + 'label' => __( 'Link Color', 'generatepress' ), + 'section' => 'body_section', + 'settings' => 'generate_settings[link_color]', + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[link_color_hover]', array( + 'default' => $defaults['link_color_hover'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'generate_settings[link_color_hover]', + array( + 'label' => __( 'Link Color Hover', 'generatepress' ), + 'section' => 'body_section', + 'settings' => 'generate_settings[link_color_hover]', + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[link_color_visited]', array( + 'default' => $defaults['link_color_visited'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_hex_color', + 'transport' => 'refresh', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'generate_settings[link_color_visited]', + array( + 'label' => __( 'Link Color Visited', 'generatepress' ), + 'section' => 'body_section', + 'settings' => 'generate_settings[link_color_visited]', + ) + ) + ); + + $color_defaults = generate_get_color_defaults(); + + if ( ! $wp_customize->get_setting( 'generate_settings[blog_post_title_color]' ) ) { + $wp_customize->add_setting( + 'generate_settings[blog_post_title_color]', array( + 'default' => $color_defaults['blog_post_title_color'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'blog_post_title_color', + array( + 'label' => __( 'Blog Post Title', 'generatepress' ), + 'section' => $wp_customize->get_section( 'content_color_section' ) ? 'content_color_section' : 'body_section', + 'settings' => 'generate_settings[blog_post_title_color]', + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[blog_post_title_hover_color]', array( + 'default' => $color_defaults['blog_post_title_hover_color'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'blog_post_title_hover_color', + array( + 'label' => __( 'Blog Post Title Hover', 'generatepress' ), + 'section' => $wp_customize->get_section( 'content_color_section' ) ? 'content_color_section' : 'body_section', + 'settings' => 'generate_settings[blog_post_title_hover_color]', + ) + ) + ); + } + + $wp_customize->add_setting( + 'nav_color_presets', + array( + 'default' => 'current', + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_preset_layout', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'nav_color_presets', + array( + 'type' => 'select', + 'label' => __( 'Navigation Color Presets', 'generatepress' ), + 'section' => $wp_customize->get_section( 'navigation_color_section' ) ? 'navigation_color_section' : 'body_section', + 'priority' => $wp_customize->get_section( 'navigation_color_section' ) ? 0 : null, + 'choices' => array( + 'current' => __( 'Current', 'generatepress' ), + 'default' => __( 'Default', 'generatepress' ), + 'white' => __( 'White', 'generatepress' ), + 'grey' => __( 'Grey', 'generatepress' ), + 'red' => __( 'Red', 'generatepress' ), + 'green' => __( 'Green', 'generatepress' ), + 'blue' => __( 'Blue', 'generatepress' ), + ), + 'settings' => 'nav_color_presets', + ) + ); + + if ( ! $wp_customize->get_setting( 'generate_settings[navigation_background_color]' ) ) { + $wp_customize->add_setting( + 'generate_settings[navigation_background_color]', array( + 'default' => $color_defaults['navigation_background_color'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_rgba_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[navigation_text_color]', array( + 'default' => $color_defaults['navigation_text_color'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[navigation_background_hover_color]', + array( + 'default' => $color_defaults['navigation_background_hover_color'], + 'type' => 'option', + 'transport' => 'postMessage', + 'sanitize_callback' => 'generate_sanitize_rgba_color', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[navigation_text_hover_color]', + array( + 'default' => $color_defaults['navigation_text_hover_color'], + 'type' => 'option', + 'transport' => 'postMessage', + 'sanitize_callback' => 'generate_sanitize_hex_color', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[navigation_background_current_color]', + array( + 'default' => $color_defaults['navigation_background_current_color'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_rgba_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[navigation_text_current_color]', + array( + 'default' => $color_defaults['navigation_text_current_color'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[subnavigation_background_color]', + array( + 'default' => $color_defaults['subnavigation_background_color'], + 'type' => 'option', + 'transport' => 'postMessage', + 'sanitize_callback' => 'generate_sanitize_rgba_color', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[subnavigation_text_color]', array( + 'default' => $color_defaults['subnavigation_text_color'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[subnavigation_background_hover_color]', + array( + 'default' => $color_defaults['subnavigation_background_hover_color'], + 'type' => 'option', + 'transport' => 'postMessage', + 'sanitize_callback' => 'generate_sanitize_rgba_color', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[subnavigation_text_hover_color]', array( + 'default' => $color_defaults['subnavigation_text_hover_color'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[subnavigation_background_current_color]', + array( + 'default' => $color_defaults['subnavigation_background_current_color'], + 'type' => 'option', + 'transport' => 'postMessage', + 'sanitize_callback' => 'generate_sanitize_rgba_color', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[subnavigation_text_current_color]', array( + 'default' => $color_defaults['subnavigation_text_current_color'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + } + + if ( ! function_exists( 'generate_colors_customize_register' ) && ! defined( 'GP_PREMIUM_VERSION' ) ) { + $wp_customize->add_control( + new Generate_Customize_Misc_Control( + $wp_customize, + 'colors_get_addon_desc', + array( + 'section' => 'body_section', + 'type' => 'addon', + 'label' => __( 'Learn More', 'generatepress' ), + 'description' => __( 'More options are available for this section in our premium version.', 'generatepress' ), + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#colors', false ), + 'priority' => 30, + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + ) + ) + ); + } + + if ( class_exists( 'WP_Customize_Panel' ) ) { + if ( ! $wp_customize->get_panel( 'generate_layout_panel' ) ) { + $wp_customize->add_panel( 'generate_layout_panel', array( + 'priority' => 25, + 'title' => __( 'Layout', 'generatepress' ), + ) ); + } + } + + $wp_customize->add_section( + 'generate_layout_container', + array( + 'title' => __( 'Container', 'generatepress' ), + 'priority' => 10, + 'panel' => 'generate_layout_panel', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[container_width]', + array( + 'default' => $defaults['container_width'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_integer', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new Generate_Range_Slider_Control( + $wp_customize, + 'generate_settings[container_width]', + array( + 'type' => 'generatepress-range-slider', + 'label' => __( 'Container Width', 'generatepress' ), + 'section' => 'generate_layout_container', + 'settings' => array( + 'desktop' => 'generate_settings[container_width]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 700, + 'max' => 2000, + 'step' => 5, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 0, + ) + ) + ); + + $wp_customize->add_section( + 'generate_top_bar', + array( + 'title' => __( 'Top Bar', 'generatepress' ), + 'priority' => 15, + 'panel' => 'generate_layout_panel', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[top_bar_width]', + array( + 'default' => $defaults['top_bar_width'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_settings[top_bar_width]', + array( + 'type' => 'select', + 'label' => __( 'Top Bar Width', 'generatepress' ), + 'section' => 'generate_top_bar', + 'choices' => array( + 'full' => __( 'Full', 'generatepress' ), + 'contained' => __( 'Contained', 'generatepress' ), + ), + 'settings' => 'generate_settings[top_bar_width]', + 'priority' => 5, + 'active_callback' => 'generate_is_top_bar_active', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[top_bar_inner_width]', + array( + 'default' => $defaults['top_bar_inner_width'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_settings[top_bar_inner_width]', + array( + 'type' => 'select', + 'label' => __( 'Top Bar Inner Width', 'generatepress' ), + 'section' => 'generate_top_bar', + 'choices' => array( + 'full' => __( 'Full', 'generatepress' ), + 'contained' => __( 'Contained', 'generatepress' ), + ), + 'settings' => 'generate_settings[top_bar_inner_width]', + 'priority' => 10, + 'active_callback' => 'generate_is_top_bar_active', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[top_bar_alignment]', + array( + 'default' => $defaults['top_bar_alignment'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_settings[top_bar_alignment]', + array( + 'type' => 'select', + 'label' => __( 'Top Bar Alignment', 'generatepress' ), + 'section' => 'generate_top_bar', + 'choices' => array( + 'left' => __( 'Left', 'generatepress' ), + 'center' => __( 'Center', 'generatepress' ), + 'right' => __( 'Right', 'generatepress' ), + ), + 'settings' => 'generate_settings[top_bar_alignment]', + 'priority' => 15, + 'active_callback' => 'generate_is_top_bar_active', + ) + ); + + $wp_customize->add_section( + 'generate_layout_header', + array( + 'title' => __( 'Header', 'generatepress' ), + 'priority' => 20, + 'panel' => 'generate_layout_panel', + ) + ); + + $wp_customize->add_setting( + 'generate_header_helper', + array( + 'default' => 'current', + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_preset_layout', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_header_helper', + array( + 'type' => 'select', + 'label' => __( 'Header Presets', 'generatepress' ), + 'section' => 'generate_layout_header', + 'choices' => array( + 'current' => __( 'Current', 'generatepress' ), + 'default' => __( 'Default', 'generatepress' ), + 'nav-before-centered' => __( 'Navigation Before - Centered', 'generatepress' ), + 'nav-after-centered' => __( 'Navigation After - Centered', 'generatepress' ), + 'nav-right' => __( 'Navigation Right', 'generatepress' ), + 'nav-left' => __( 'Navigation Left', 'generatepress' ), + ), + 'settings' => 'generate_header_helper', + 'priority' => 4, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[header_layout_setting]', + array( + 'default' => $defaults['header_layout_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_settings[header_layout_setting]', + array( + 'type' => 'select', + 'label' => __( 'Header Width', 'generatepress' ), + 'section' => 'generate_layout_header', + 'choices' => array( + 'fluid-header' => __( 'Full', 'generatepress' ), + 'contained-header' => __( 'Contained', 'generatepress' ), + ), + 'settings' => 'generate_settings[header_layout_setting]', + 'priority' => 5, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[header_inner_width]', + array( + 'default' => $defaults['header_inner_width'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_settings[header_inner_width]', + array( + 'type' => 'select', + 'label' => __( 'Inner Header Width', 'generatepress' ), + 'section' => 'generate_layout_header', + 'choices' => array( + 'contained' => __( 'Contained', 'generatepress' ), + 'full-width' => __( 'Full', 'generatepress' ), + ), + 'settings' => 'generate_settings[header_inner_width]', + 'priority' => 6, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[header_alignment_setting]', + array( + 'default' => $defaults['header_alignment_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_settings[header_alignment_setting]', + array( + 'type' => 'select', + 'label' => __( 'Header Alignment', 'generatepress' ), + 'section' => 'generate_layout_header', + 'choices' => array( + 'left' => __( 'Left', 'generatepress' ), + 'center' => __( 'Center', 'generatepress' ), + 'right' => __( 'Right', 'generatepress' ), + ), + 'settings' => 'generate_settings[header_alignment_setting]', + 'priority' => 10, + ) + ); + + $wp_customize->add_section( + 'generate_layout_navigation', + array( + 'title' => __( 'Primary Navigation', 'generatepress' ), + 'priority' => 30, + 'panel' => 'generate_layout_panel', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[nav_layout_setting]', + array( + 'default' => $defaults['nav_layout_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_settings[nav_layout_setting]', + array( + 'type' => 'select', + 'label' => __( 'Navigation Width', 'generatepress' ), + 'section' => 'generate_layout_navigation', + 'choices' => array( + 'fluid-nav' => __( 'Full', 'generatepress' ), + 'contained-nav' => __( 'Contained', 'generatepress' ), + ), + 'settings' => 'generate_settings[nav_layout_setting]', + 'priority' => 15, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[nav_inner_width]', + array( + 'default' => $defaults['nav_inner_width'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_settings[nav_inner_width]', + array( + 'type' => 'select', + 'label' => __( 'Inner Navigation Width', 'generatepress' ), + 'section' => 'generate_layout_navigation', + 'choices' => array( + 'contained' => __( 'Contained', 'generatepress' ), + 'full-width' => __( 'Full', 'generatepress' ), + ), + 'settings' => 'generate_settings[nav_inner_width]', + 'priority' => 16, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[nav_alignment_setting]', + array( + 'default' => $defaults['nav_alignment_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_settings[nav_alignment_setting]', + array( + 'type' => 'select', + 'label' => __( 'Navigation Alignment', 'generatepress' ), + 'section' => 'generate_layout_navigation', + 'choices' => array( + 'left' => __( 'Left', 'generatepress' ), + 'center' => __( 'Center', 'generatepress' ), + 'right' => __( 'Right', 'generatepress' ), + ), + 'settings' => 'generate_settings[nav_alignment_setting]', + 'priority' => 20, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[nav_position_setting]', + array( + 'default' => $defaults['nav_position_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + 'transport' => ( '' !== generate_get_option( 'nav_position_setting' ) ) ? 'postMessage' : 'refresh', + ) + ); + + $wp_customize->add_control( + 'generate_settings[nav_position_setting]', + array( + 'type' => 'select', + 'label' => __( 'Navigation Location', 'generatepress' ), + 'section' => 'generate_layout_navigation', + 'choices' => array( + 'nav-below-header' => __( 'Below Header', 'generatepress' ), + 'nav-above-header' => __( 'Above Header', 'generatepress' ), + 'nav-float-right' => __( 'Float Right', 'generatepress' ), + 'nav-float-left' => __( 'Float Left', 'generatepress' ), + 'nav-left-sidebar' => __( 'Left Sidebar', 'generatepress' ), + 'nav-right-sidebar' => __( 'Right Sidebar', 'generatepress' ), + '' => __( 'No Navigation', 'generatepress' ), + ), + 'settings' => 'generate_settings[nav_position_setting]', + 'priority' => 22, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[nav_drop_point]', + array( + 'default' => $defaults['nav_drop_point'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_empty_absint', + ) + ); + + $wp_customize->add_control( + new Generate_Range_Slider_Control( + $wp_customize, + 'generate_settings[nav_drop_point]', + array( + 'label' => __( 'Navigation Drop Point', 'generatepress' ), + 'sub_description' => __( 'The width when the navigation ceases to float and drops below your logo.', 'generatepress' ), + 'section' => 'generate_layout_navigation', + 'settings' => array( + 'desktop' => 'generate_settings[nav_drop_point]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 500, + 'max' => 2000, + 'step' => 10, + 'edit' => true, + 'unit' => 'px', + ), + ), + 'priority' => 22, + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[nav_dropdown_type]', + array( + 'default' => $defaults['nav_dropdown_type'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + ) + ); + + $wp_customize->add_control( + 'generate_settings[nav_dropdown_type]', + array( + 'type' => 'select', + 'label' => __( 'Navigation Dropdown', 'generatepress' ), + 'section' => 'generate_layout_navigation', + 'choices' => array( + 'hover' => __( 'Hover', 'generatepress' ), + 'click' => __( 'Click - Menu Item', 'generatepress' ), + 'click-arrow' => __( 'Click - Arrow', 'generatepress' ), + ), + 'settings' => 'generate_settings[nav_dropdown_type]', + 'priority' => 22, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[nav_dropdown_direction]', + array( + 'default' => $defaults['nav_dropdown_direction'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + ) + ); + + $wp_customize->add_control( + 'generate_settings[nav_dropdown_direction]', + array( + 'type' => 'select', + 'label' => __( 'Dropdown Direction', 'generatepress' ), + 'section' => 'generate_layout_navigation', + 'choices' => array( + 'right' => __( 'Right', 'generatepress' ), + 'left' => __( 'Left', 'generatepress' ), + ), + 'settings' => 'generate_settings[nav_dropdown_direction]', + 'priority' => 22, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[nav_search]', + array( + 'default' => $defaults['nav_search'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + ) + ); + + $wp_customize->add_control( + 'generate_settings[nav_search]', + array( + 'type' => 'select', + 'label' => __( 'Navigation Search', 'generatepress' ), + 'section' => 'generate_layout_navigation', + 'choices' => array( + 'enable' => __( 'Enable', 'generatepress' ), + 'disable' => __( 'Disable', 'generatepress' ), + ), + 'settings' => 'generate_settings[nav_search]', + 'priority' => 23, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[content_layout_setting]', + array( + 'default' => $defaults['content_layout_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_settings[content_layout_setting]', + array( + 'type' => 'select', + 'label' => __( 'Content Layout', 'generatepress' ), + 'section' => 'generate_layout_container', + 'choices' => array( + 'separate-containers' => __( 'Separate Containers', 'generatepress' ), + 'one-container' => __( 'One Container', 'generatepress' ), + ), + 'settings' => 'generate_settings[content_layout_setting]', + 'priority' => 25, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[container_alignment]', + array( + 'default' => $defaults['container_alignment'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + ) + ); + + $wp_customize->add_control( + 'generate_settings[container_alignment]', + array( + 'type' => 'select', + 'label' => __( 'Container Alignment', 'generatepress' ), + 'section' => 'generate_layout_container', + 'choices' => array( + 'boxes' => __( 'Boxes', 'generatepress' ), + 'text' => __( 'Text', 'generatepress' ), + ), + 'settings' => 'generate_settings[container_alignment]', + 'priority' => 30, + ) + ); + + $wp_customize->add_section( + 'generate_layout_sidebars', + array( + 'title' => __( 'Sidebars', 'generatepress' ), + 'priority' => 40, + 'panel' => 'generate_layout_panel', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[layout_setting]', + array( + 'default' => $defaults['layout_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + ) + ); + + $wp_customize->add_control( + 'generate_settings[layout_setting]', + array( + 'type' => 'select', + 'label' => __( 'Sidebar Layout', 'generatepress' ), + 'section' => 'generate_layout_sidebars', + 'choices' => array( + 'left-sidebar' => __( 'Sidebar / Content', 'generatepress' ), + 'right-sidebar' => __( 'Content / Sidebar', 'generatepress' ), + 'no-sidebar' => __( 'Content (no sidebars)', 'generatepress' ), + 'both-sidebars' => __( 'Sidebar / Content / Sidebar', 'generatepress' ), + 'both-left' => __( 'Sidebar / Sidebar / Content', 'generatepress' ), + 'both-right' => __( 'Content / Sidebar / Sidebar', 'generatepress' ), + ), + 'settings' => 'generate_settings[layout_setting]', + 'priority' => 30, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[blog_layout_setting]', + array( + 'default' => $defaults['blog_layout_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + ) + ); + + $wp_customize->add_control( + 'generate_settings[blog_layout_setting]', + array( + 'type' => 'select', + 'label' => __( 'Blog Sidebar Layout', 'generatepress' ), + 'section' => 'generate_layout_sidebars', + 'choices' => array( + 'left-sidebar' => __( 'Sidebar / Content', 'generatepress' ), + 'right-sidebar' => __( 'Content / Sidebar', 'generatepress' ), + 'no-sidebar' => __( 'Content (no sidebars)', 'generatepress' ), + 'both-sidebars' => __( 'Sidebar / Content / Sidebar', 'generatepress' ), + 'both-left' => __( 'Sidebar / Sidebar / Content', 'generatepress' ), + 'both-right' => __( 'Content / Sidebar / Sidebar', 'generatepress' ), + ), + 'settings' => 'generate_settings[blog_layout_setting]', + 'priority' => 35, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[single_layout_setting]', + array( + 'default' => $defaults['single_layout_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + ) + ); + + $wp_customize->add_control( + 'generate_settings[single_layout_setting]', + array( + 'type' => 'select', + 'label' => __( 'Single Post Sidebar Layout', 'generatepress' ), + 'section' => 'generate_layout_sidebars', + 'choices' => array( + 'left-sidebar' => __( 'Sidebar / Content', 'generatepress' ), + 'right-sidebar' => __( 'Content / Sidebar', 'generatepress' ), + 'no-sidebar' => __( 'Content (no sidebars)', 'generatepress' ), + 'both-sidebars' => __( 'Sidebar / Content / Sidebar', 'generatepress' ), + 'both-left' => __( 'Sidebar / Sidebar / Content', 'generatepress' ), + 'both-right' => __( 'Content / Sidebar / Sidebar', 'generatepress' ), + ), + 'settings' => 'generate_settings[single_layout_setting]', + 'priority' => 36, + ) + ); + + $wp_customize->add_section( + 'generate_layout_footer', + array( + 'title' => __( 'Footer', 'generatepress' ), + 'priority' => 50, + 'panel' => 'generate_layout_panel', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[footer_layout_setting]', + array( + 'default' => $defaults['footer_layout_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_settings[footer_layout_setting]', + array( + 'type' => 'select', + 'label' => __( 'Footer Width', 'generatepress' ), + 'section' => 'generate_layout_footer', + 'choices' => array( + 'fluid-footer' => __( 'Full', 'generatepress' ), + 'contained-footer' => __( 'Contained', 'generatepress' ), + ), + 'settings' => 'generate_settings[footer_layout_setting]', + 'priority' => 40, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[footer_inner_width]', + array( + 'default' => $defaults['footer_inner_width'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_settings[footer_inner_width]', + array( + 'type' => 'select', + 'label' => __( 'Inner Footer Width', 'generatepress' ), + 'section' => 'generate_layout_footer', + 'choices' => array( + 'contained' => __( 'Contained', 'generatepress' ), + 'full-width' => __( 'Full', 'generatepress' ), + ), + 'settings' => 'generate_settings[footer_inner_width]', + 'priority' => 41, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[footer_widget_setting]', + array( + 'default' => $defaults['footer_widget_setting'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + ) + ); + + $wp_customize->add_control( + 'generate_settings[footer_widget_setting]', + array( + 'type' => 'select', + 'label' => __( 'Footer Widgets', 'generatepress' ), + 'section' => 'generate_layout_footer', + 'choices' => array( + '0' => '0', + '1' => '1', + '2' => '2', + '3' => '3', + '4' => '4', + '5' => '5', + ), + 'settings' => 'generate_settings[footer_widget_setting]', + 'priority' => 45, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[footer_bar_alignment]', + array( + 'default' => $defaults['footer_bar_alignment'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'generate_settings[footer_bar_alignment]', + array( + 'type' => 'select', + 'label' => __( 'Footer Bar Alignment', 'generatepress' ), + 'section' => 'generate_layout_footer', + 'choices' => array( + 'left' => __( 'Left','generatepress' ), + 'center' => __( 'Center','generatepress' ), + 'right' => __( 'Right','generatepress' ), + ), + 'settings' => 'generate_settings[footer_bar_alignment]', + 'priority' => 47, + 'active_callback' => 'generate_is_footer_bar_active', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[back_to_top]', + array( + 'default' => $defaults['back_to_top'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + ) + ); + + $wp_customize->add_control( + 'generate_settings[back_to_top]', + array( + 'type' => 'select', + 'label' => __( 'Back to Top Button', 'generatepress' ), + 'section' => 'generate_layout_footer', + 'choices' => array( + 'enable' => __( 'Enable', 'generatepress' ), + '' => __( 'Disable', 'generatepress' ), + ), + 'settings' => 'generate_settings[back_to_top]', + 'priority' => 50, + ) + ); + + $wp_customize->add_section( + 'generate_blog_section', + array( + 'title' => __( 'Blog', 'generatepress' ), + 'priority' => 55, + 'panel' => 'generate_layout_panel', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[post_content]', + array( + 'default' => $defaults['post_content'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_blog_excerpt', + ) + ); + + $wp_customize->add_control( + 'blog_content_control', + array( + 'type' => 'select', + 'label' => __( 'Content Type', 'generatepress' ), + 'section' => 'generate_blog_section', + 'choices' => array( + 'full' => __( 'Full', 'generatepress' ), + 'excerpt' => __( 'Excerpt', 'generatepress' ), + ), + 'settings' => 'generate_settings[post_content]', + 'priority' => 10, + ) + ); + + if ( ! function_exists( 'generate_blog_customize_register' ) && ! defined( 'GP_PREMIUM_VERSION' ) ) { + $wp_customize->add_control( + new Generate_Customize_Misc_Control( + $wp_customize, + 'blog_get_addon_desc', + array( + 'section' => 'generate_blog_section', + 'type' => 'addon', + 'label' => __( 'Learn more', 'generatepress' ), + 'description' => __( 'More options are available for this section in our premium version.', 'generatepress' ), + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#blog', false ), + 'priority' => 30, + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + ) + ) + ); + } + + $wp_customize->add_section( + 'generate_general_section', + array( + 'title' => __( 'General', 'generatepress' ), + 'priority' => 99, + ) + ); + + if ( ! apply_filters( 'generate_fontawesome_essentials', false ) ) { + $wp_customize->add_setting( + 'generate_settings[font_awesome_essentials]', + array( + 'default' => $defaults['font_awesome_essentials'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_checkbox', + ) + ); + + $wp_customize->add_control( + 'generate_settings[font_awesome_essentials]', + array( + 'type' => 'checkbox', + 'label' => __( 'Load essential icons only', 'generatepress' ), + 'description' => __( 'Load essential Font Awesome icons instead of the full library.', 'generatepress' ), + 'section' => 'generate_general_section', + 'settings' => 'generate_settings[font_awesome_essentials]', + ) + ); + } + + $wp_customize->add_setting( + 'generate_settings[icons]', + array( + 'default' => $defaults['icons'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_choices', + ) + ); + + $wp_customize->add_control( + 'generate_settings[icons]', + array( + 'type' => 'select', + 'label' => __( 'Icon Type', 'generatepress' ), + 'section' => 'generate_general_section', + 'choices' => array( + 'svg' => __( 'SVG', 'generatepress' ), + 'font' => __( 'Font', 'generatepress' ), + ), + 'settings' => 'generate_settings[icons]', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[combine_css]', + array( + 'default' => $defaults['combine_css'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_checkbox', + ) + ); + + $wp_customize->add_control( + 'generate_settings[combine_css]', + array( + 'type' => 'checkbox', + 'label' => __( 'Combine CSS', 'generatepress' ), + 'description' => __( 'Reduce the number of CSS file requests and use a lite version of our grid system.', 'generatepress' ), + 'section' => 'generate_general_section', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[dynamic_css_cache]', + array( + 'default' => $defaults['dynamic_css_cache'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_checkbox', + ) + ); + + $wp_customize->add_control( + 'generate_settings[dynamic_css_cache]', + array( + 'type' => 'checkbox', + 'label' => __( 'Cache dynamic CSS', 'generatepress' ), + 'description' => __( 'Cache CSS generated by your options to boost performance.', 'generatepress' ), + 'section' => 'generate_general_section', + ) + ); + } +} diff --git a/wp-content/themes/generatepress/inc/customizer/controls/class-deprecated.php b/wp-content/themes/generatepress/inc/customizer/controls/class-deprecated.php new file mode 100644 index 0000000..28b474b --- /dev/null +++ b/wp-content/themes/generatepress/inc/customizer/controls/class-deprecated.php @@ -0,0 +1,230 @@ + wp_create_nonce( 'gp_customize_nonce' ) ) ); + } + + public function to_json() { + parent::to_json(); + + $number_of_fonts = apply_filters( 'generate_number_of_fonts', 200 ); + $this->json['link'] = $this->get_link(); + $this->json['value'] = $this->value(); + $this->json['default_fonts_title'] = __( 'Default fonts', 'generatepress' ); + $this->json['google_fonts_title'] = __( 'Google fonts', 'generatepress' ); + $this->json['description'] = __( 'Font family','generatepress' ); + $this->json['google_fonts'] = apply_filters( 'generate_typography_customize_list', generate_get_all_google_fonts( $number_of_fonts ) ); + $this->json['default_fonts'] = generate_typography_default_fonts(); + } + + public function content_template() { + ?> + + choices as $name => $choice ) { + $this->choices[ $name ] = $choice; + } + + $this->json['choices'] = $this->choices; + $this->json['link'] = $this->get_link(); + $this->json['value'] = $this->value(); + + } + + public function content_template() { + ?> + <# if ( ! data.choices ) + return; + #> + + json['link'] = $this->get_link(); + $this->json['value'] = $this->value(); + $this->json['id'] = $this->id; + } + + public function content_template() { + ?> + + + + + + json['choices'][ $device ]['min'] = ( isset( $this->choices[ $device ]['min'] ) ) ? $this->choices[ $device ]['min'] : '0'; + $this->json['choices'][ $device ]['max'] = ( isset( $this->choices[ $device ]['max'] ) ) ? $this->choices[ $device ]['max'] : '100'; + $this->json['choices'][ $device ]['step'] = ( isset( $this->choices[ $device ]['step'] ) ) ? $this->choices[ $device ]['step'] : '1'; + $this->json['choices'][ $device ]['edit'] = ( isset( $this->choices[ $device ]['edit'] ) ) ? $this->choices[ $device ]['edit'] : false; + $this->json['choices'][ $device ]['unit'] = ( isset( $this->choices[ $device ]['unit'] ) ) ? $this->choices[ $device ]['unit'] : false; + } + + foreach ( $this->settings as $setting_key => $setting_id ) { + $this->json[ $setting_key ] = array( + 'link' => $this->get_link( $setting_key ), + 'value' => $this->value( $setting_key ), + 'default' => isset( $setting_id->default ) ? $setting_id->default : '', + ); + } + + $this->json['desktop_label'] = __( 'Desktop','generatepress' ); + $this->json['tablet_label'] = __( 'Tablet','generatepress' ); + $this->json['mobile_label'] = __( 'Mobile','generatepress' ); + $this->json['reset_label'] = __( 'Reset','generatepress' ); + + $this->json['description'] = $this->description; + $this->json['sub_description'] = $this->sub_description; + } + + /** + * Enqueue control related scripts/styles. + * + * @access public + */ + public function enqueue() { + wp_enqueue_script( 'generatepress-range-slider', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/controls/js/slider-control.js', array( 'jquery', 'customize-base', 'jquery-ui-slider' ), false, true ); + wp_enqueue_style( 'generatepress-range-slider-css', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/controls/css/slider-customizer.css', null ); + } + + /** + * An Underscore (JS) template for this control's content (but not its container). + * + * Class variables for this control class are available in the `data` JS object; + * export custom variables by overriding {@see WP_Customize_Control::to_json()}. + * + * @see WP_Customize_Control::print_template() + * + * @access protected + */ + protected function content_template() { + ?> +
        +
        + <# if ( data.label || data.description ) { #> +
        + <# if ( data.label ) { #> + {{{ data.label }}} + <# } #> + + <# if ( data.description ) { #> +

        {{{ data.description }}}

        + <# } #> +
        + <# } #> + +
        + + <# if ( 'undefined' !== typeof ( data.desktop ) ) { #> + + <# } #> + + <# if ( 'undefined' !== typeof (data.tablet) ) { #> + + <# } #> + + <# if ( 'undefined' !== typeof (data.mobile) ) { #> + + <# } #> + + + +
        +
        + +
        + <# if ( 'undefined' !== typeof ( data.desktop ) ) { #> + + <# } #> + + <# if ( 'undefined' !== typeof ( data.tablet ) ) { #> + + <# } #> + + <# if ( 'undefined' !== typeof ( data.mobile ) ) { #> + + <# } #> +
        + + <# if ( data.sub_description ) { #> +

        {{{ data.sub_description }}}

        + <# } #> +
        + json['default_fonts_title'] = __( 'System fonts', 'generatepress' ); + $this->json['google_fonts_title'] = __( 'Google fonts', 'generatepress' ); + $this->json['default_fonts'] = generate_typography_default_fonts(); + $this->json['family_title'] = esc_html__( 'Font family', 'generatepress' ); + $this->json['weight_title'] = esc_html__( 'Font weight', 'generatepress' ); + $this->json['transform_title'] = esc_html__( 'Text transform', 'generatepress' ); + $this->json['category_title'] = ''; + $this->json['variant_title'] = esc_html__( 'Variants', 'generatepress' ); + + foreach ( $this->settings as $setting_key => $setting_id ) { + $this->json[ $setting_key ] = array( + 'link' => $this->get_link( $setting_key ), + 'value' => $this->value( $setting_key ), + 'default' => isset( $setting_id->default ) ? $setting_id->default : '', + 'id' => isset( $setting_id->id ) ? $setting_id->id : '' + ); + + if ( 'weight' === $setting_key ) { + $this->json[ $setting_key ]['choices'] = $this->get_font_weight_choices(); + } + + if ( 'transform' === $setting_key ) { + $this->json[ $setting_key ]['choices'] = $this->get_font_transform_choices(); + } + } + } + + public function content_template() { + ?> + <# if ( '' !== data.label ) { #> + {{ data.label }} + <# } #> + <# if ( 'undefined' !== typeof ( data.family ) ) { #> +
        + +
        + <# } #> + + <# if ( 'undefined' !== typeof ( data.variant ) ) { #> + <# + var id = data.family.value.split(' ').join('_').toLowerCase(); + var font_data = generatePressTypography.googleFonts[id]; + var variants = ''; + if ( typeof font_data !== 'undefined' ) { + variants = font_data.variants; + } + + if ( null === data.variant.value ) { + data.variant.value = data.variant.default; + } + #> +
        + +
        + <# } #> + + <# if ( 'undefined' !== typeof ( data.category ) ) { #> +
        + +
        + <# } #> + +
        + <# if ( 'undefined' !== typeof ( data.weight ) ) { #> +
        + +
        + <# } #> + + <# if ( 'undefined' !== typeof ( data.transform ) ) { #> +
        + +
        + <# } #> +
        + esc_html( 'normal' ), + 'bold' => esc_html( 'bold' ), + '100' => esc_html( '100' ), + '200' => esc_html( '200' ), + '300' => esc_html( '300' ), + '400' => esc_html( '400' ), + '500' => esc_html( '500' ), + '600' => esc_html( '600' ), + '700' => esc_html( '700' ), + '800' => esc_html( '800' ), + '900' => esc_html( '900' ), + ); + } + + public function get_font_transform_choices() { + return array( + 'none' => esc_html( 'none' ), + 'capitalize' => esc_html( 'capitalize' ), + 'uppercase' => esc_html( 'uppercase' ), + 'lowercase' => esc_html( 'lowercase' ), + ); + } + } +} diff --git a/wp-content/themes/generatepress/inc/customizer/controls/class-upsell-control.php b/wp-content/themes/generatepress/inc/customizer/controls/class-upsell-control.php new file mode 100644 index 0000000..f017bcc --- /dev/null +++ b/wp-content/themes/generatepress/inc/customizer/controls/class-upsell-control.php @@ -0,0 +1,43 @@ +json['url'] = esc_url( $this->url ); + } + + public function content_template() { + ?> +

        {{{ data.description }}}

        + + {{ data.label }} + + pro_text; + $json['pro_url'] = esc_url( $this->pro_url ); + $json['id'] = $this->id; + return $json; + } + + protected function render_template() { + ?> +
      • +

        {{ data.pro_text }}

        +
      • + .select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[data-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[data-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[data-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} diff --git a/wp-content/themes/generatepress/inc/customizer/controls/css/slider-customizer.css b/wp-content/themes/generatepress/inc/customizer/controls/css/slider-customizer.css new file mode 100644 index 0000000..427d320 --- /dev/null +++ b/wp-content/themes/generatepress/inc/customizer/controls/css/slider-customizer.css @@ -0,0 +1,142 @@ +.customize-control-generatepress-range-slider .generatepress-slider { + position: relative; + width: calc(100% - 60px); + height: 6px; + background-color: rgba(0,0,0,.10); + cursor: pointer; + -webkit-transition: background .5s; + -moz-transition: background .5s; + transition: background .5s; +} + +.customize-control-generatepress-range-slider .has-unit .generatepress-slider { + width: calc(100% - 90px); +} + +.customize-control-generatepress-range-slider .gp_range_value.hide-value { + display: none; +} + +.customize-control-generatepress-range-slider .gp_range_value.hide-value + .generatepress-slider { + width: 100%; +} + +.customize-control-generatepress-range-slider .generatepress-slider .ui-slider-handle { + height: 16px; + width: 16px; + background-color: #3498D9; + display: inline-block; + position: absolute; + top: 50%; + -webkit-transform: translateY(-50%) translateX(-4px); + transform: translateY(-50%) translateX(-4px); + border-radius: 50%; + cursor: pointer; +} + +.gp-range-title-area { + display: flex; +} + +.gp-range-slider-controls { + margin-left: auto; +} + +.customize-control-generatepress-range-slider .wrapper { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.customize-control-generatepress-range-slider .gp_range_value { + font-size: 14px; + padding: 0; + font-weight: 400; + width: 50px; + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} + +.customize-control-generatepress-range-slider .has-unit .gp_range_value { + width: 80px; +} + +.customize-control-generatepress-range-slider .gp_range_value span.value { + font-size: 12px; + width: calc(100% - 2px); + text-align: center; + min-height: 30px; + background: #FFF; + line-height: 30px; + border: 1px solid #DDD; +} + +.customize-control-generatepress-range-slider .has-unit .gp_range_value span.value { + width: calc(100% - 32px); + display: block; +} + +.customize-control-generatepress-range-slider .gp_range_value .unit { + width: 29px; + text-align: center; + font-size: 12px; + line-height: 30px; + background: #fff; + border: 1px solid #ddd; + margin-left: 1px; +} + +.customize-control-generatepress-range-slider .generatepress-range-slider-reset span { + font-size: 16px; + line-height: 22px; +} + +.customize-control-generatepress-range-slider .gp_range_value input { + font-size: 12px; + padding: 0px; + text-align: center; + min-height: 30px; + height: auto; + border-radius: 0; + border-color: #ddd; +} + +.customize-control-generatepress-range-slider .has-unit .gp_range_value input { + width: calc(100% - 30px); +} + +.customize-control-generatepress-range-slider .gp-range-title-area .dashicons { + cursor: pointer; + font-size: 11px; + width: 20px; + height: 20px; + line-height: 20px; + color: #222; + text-align: center; + position: relative; + top: 2px; +} + +.customize-control-generatepress-range-slider .gp-range-title-area .dashicons:hover { + background: #fafafa; +} + +.customize-control-generatepress-range-slider .gp-range-title-area .dashicons.selected { + background: #fff; + color: #222; +} + +.customize-control-generatepress-range-slider .gp-device-controls > span:first-child:last-child { + display: none; +} + +.customize-control-generatepress-range-slider .sub-description { + margin-top: 10px; +} diff --git a/wp-content/themes/generatepress/inc/customizer/controls/css/typography-customizer.css b/wp-content/themes/generatepress/inc/customizer/controls/css/typography-customizer.css new file mode 100644 index 0000000..c6ed651 --- /dev/null +++ b/wp-content/themes/generatepress/inc/customizer/controls/css/typography-customizer.css @@ -0,0 +1,47 @@ +.generatepress-font-family { + margin-bottom: 12px; +} + +.generatepress-weight-transform-wrapper { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; +} + +.generatepress-font-weight, +.generatepress-font-transform { + width: calc(50% - 5px); +} + +span.select2-container.select2-container--default.select2-container--open li.select2-results__option { + margin:0; +} + +span.select2-container.select2-container--default.select2-container--open{ + z-index:999999; +} + +.select2-selection__rendered li { + margin-bottom: 0; +} + +.select2-container--default .select2-selection--single, +.select2-container--default.select2-container .select2-selection--multiple, +.select2-dropdown, +.select2-container--default .select2-selection--multiple .select2-selection__choice { + border-color: #ddd; + border-radius: 0; +} + +.select2-container--default .select2-results__option[aria-selected=true] { + color: rgba(0,0,0,0.4); +} + +#customize-control-font_heading_1_control, +#customize-control-font_heading_2_control, +#customize-control-font_heading_3_control { + margin-top: 20px; +} diff --git a/wp-content/themes/generatepress/inc/customizer/controls/css/upsell-customizer.css b/wp-content/themes/generatepress/inc/customizer/controls/css/upsell-customizer.css new file mode 100644 index 0000000..b5707d7 --- /dev/null +++ b/wp-content/themes/generatepress/inc/customizer/controls/css/upsell-customizer.css @@ -0,0 +1,54 @@ +.customize-control-addon:before { + content: ""; + height: 1px; + width: 50px; + background: rgba(0,0,0,.10); + display: block; + margin-bottom: 10px; +} + +.customize-control-addon { + margin-top: 10px; +} + +li#accordion-section-generatepress_upsell_section { + border-top: 1px solid #D54E21; + border-bottom: 1px solid #D54E21; +} +.generate-upsell-accordion-section a { + background: #FFF; + display: block; + padding: 10px 10px 11px 14px; + line-height: 21px; + color: #D54E21; + text-decoration: none; +} + +.generate-upsell-accordion-section a:hover { + background:#FAFAFA; +} + +.generate-upsell-accordion-section h3 { + margin: 0; + position: relative; +} + +.generate-upsell-accordion-section h3 a:after { + content: "\f345"; + color: #D54E21; + position: absolute; + top: 11px; + right: 10px; + z-index: 1; + float: right; + border: none; + background: none; + font: normal 20px/1 dashicons; + speak: none; + display: block; + padding: 0; + text-indent: 0; + text-align: center; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} \ No newline at end of file diff --git a/wp-content/themes/generatepress/inc/customizer/controls/js/customizer-controls.js b/wp-content/themes/generatepress/inc/customizer/controls/js/customizer-controls.js new file mode 100644 index 0000000..b4551c7 --- /dev/null +++ b/wp-content/themes/generatepress/inc/customizer/controls/js/customizer-controls.js @@ -0,0 +1,338 @@ +( function( api ) { + 'use strict'; + + // Add callback for when the header_textcolor setting exists. + api( 'generate_settings[nav_position_setting]', function( setting ) { + var isNavFloated, linkSettingValueToControlActiveState; + + /** + * Determine whether the navigation is floating. + * + * @returns {boolean} Is floating? + */ + isNavFloated = function() { + if ( 'nav-float-right' === setting.get() || 'nav-float-left' === setting.get() ) { + return true; + } + + return false; + }; + + /** + * Update a control's active state according to the navigation location setting's value. + * + * @param {wp.customize.Control} control + */ + linkSettingValueToControlActiveState = function( control ) { + var setActiveState = function() { + control.active.set( isNavFloated() ); + }; + + // FYI: With the following we can eliminate all of our PHP active_callback code. + control.active.validate = isNavFloated; + + // Set initial active state. + setActiveState(); + + /* + * Update activate state whenever the setting is changed. + * Even when the setting does have a refresh transport where the + * server-side active callback will manage the active state upon + * refresh, having this JS management of the active state will + * ensure that controls will have their visibility toggled + * immediately instead of waiting for the preview to load. + * This is especially important if the setting has a postMessage + * transport where changing the setting wouldn't normally cause + * the preview to refresh and thus the server-side active_callbacks + * would not get invoked. + */ + setting.bind( setActiveState ); + }; + + // Call linkSettingValueToControlActiveState on the navigation dropdown point. + api.control( 'generate_settings[nav_drop_point]', linkSettingValueToControlActiveState ); + } ); + + var setOption = function( headerAlignment, navLocation, navAlignment ) { + if ( headerAlignment ) { + api.control( 'generate_settings[header_alignment_setting]' ).setting.set( headerAlignment ); + } + + if ( navLocation ) { + api.control( 'generate_settings[nav_position_setting]' ).setting.set( navLocation ); + } + + if ( navAlignment ) { + api.control( 'generate_settings[nav_alignment_setting]' ).setting.set( navAlignment ); + } + }; + + api( 'generate_header_helper', function( value ) { + var headerAlignment = false, + navLocation = false, + navAlignment = false; + + value.bind( function( newval ) { + var headerAlignmentSetting = api.control( 'generate_settings[header_alignment_setting]' ).setting; + var navLocationSetting = api.control( 'generate_settings[nav_position_setting]' ).setting; + var navAlignmentSetting = api.control( 'generate_settings[nav_alignment_setting]' ).setting; + + if ( ! headerAlignmentSetting._dirty ) { + headerAlignment = headerAlignmentSetting.get(); + } + + if ( ! navLocationSetting._dirty ) { + navLocation = navLocationSetting.get(); + } + + if ( ! navAlignmentSetting._dirty ) { + navAlignment = navAlignmentSetting.get(); + } + + if ( 'current' === newval ) { + setOption( headerAlignment, navLocation, navAlignment ); + } + + if ( 'default' === newval ) { + setOption( generatepress_defaults.header_alignment_setting, generatepress_defaults.nav_position_setting, generatepress_defaults.nav_alignment_setting ); + } + + if ( 'nav-before-centered' === newval ) { + setOption( 'center', 'nav-above-header', 'center' ); + } + + if ( 'nav-after-centered' === newval ) { + setOption( 'center', 'nav-below-header', 'center' ); + } + + if ( 'nav-right' === newval ) { + setOption( 'left', 'nav-float-right', 'left' ); + } + + if ( 'nav-left' === newval ) { + setOption( 'right', 'nav-float-left', 'right' ); + } + } ); + } ); + + api( 'nav_color_presets', function( value ) { + var backgroundColor = false, + textColor = false, + backgroundColorHover = false, + textColorHover = false, + currentBackgroundColor = false, + currentTextColor = false, + subMenuBackgroundColor = false, + subMenuTextColor = false, + subMenuBackgroundColorHover = false, + subMenuTextColorHover = false, + subMenuCurrentBackgroundColor = false, + subMenuCurrentTextColor = false; + + value.bind( function( newval ) { + var backgroundColorSetting = api.instance( 'generate_settings[navigation_background_color]' ), + textColorSetting = api.instance( 'generate_settings[navigation_text_color]' ), + backgroundColorHoverSetting = api.instance( 'generate_settings[navigation_background_hover_color]' ), + textColorHoverSetting = api.instance( 'generate_settings[navigation_text_hover_color]' ), + currentBackgroundColorSetting = api.instance( 'generate_settings[navigation_background_current_color]' ), + currentTextColorSetting = api.instance( 'generate_settings[navigation_text_current_color]' ), + subMenuBackgroundColorSetting = api.instance( 'generate_settings[subnavigation_background_color]' ), + subMenuTextColorSetting = api.instance( 'generate_settings[subnavigation_text_color]' ), + subMenuBackgroundColorHoverSetting = api.instance( 'generate_settings[subnavigation_background_hover_color]' ), + subMenuTextColorHoverSetting = api.instance( 'generate_settings[subnavigation_text_hover_color]' ), + subMenuCurrentBackgroundColorSetting = api.instance( 'generate_settings[subnavigation_background_current_color]' ), + subMenuCurrentTextColorSetting = api.instance( 'generate_settings[subnavigation_text_current_color]' ); + + if ( ! backgroundColorSetting._dirty ) { + backgroundColor = backgroundColorSetting.get(); + } + + if ( ! textColorSetting._dirty ) { + textColor = textColorSetting.get(); + } + + if ( ! backgroundColorHoverSetting._dirty ) { + backgroundColorHover = backgroundColorHoverSetting.get(); + } + + if ( ! textColorHoverSetting._dirty ) { + textColorHover = textColorHoverSetting.get(); + } + + if ( ! currentBackgroundColorSetting._dirty ) { + currentBackgroundColor = currentBackgroundColorSetting.get(); + } + + if ( ! currentTextColorSetting._dirty ) { + currentTextColor = currentTextColorSetting.get(); + } + + if ( ! subMenuBackgroundColorSetting._dirty ) { + subMenuBackgroundColor = subMenuBackgroundColorSetting.get(); + } + + if ( ! subMenuTextColorSetting._dirty ) { + subMenuTextColor = subMenuTextColorSetting.get(); + } + + if ( ! subMenuBackgroundColorHoverSetting._dirty ) { + subMenuBackgroundColorHover = subMenuBackgroundColorHoverSetting.get(); + } + + if ( ! subMenuTextColorHoverSetting._dirty ) { + subMenuTextColorHover = subMenuTextColorHoverSetting.get(); + } + + if ( ! subMenuCurrentBackgroundColorSetting._dirty ) { + subMenuCurrentBackgroundColor = subMenuCurrentBackgroundColorSetting.get(); + } + + if ( ! subMenuCurrentTextColorSetting._dirty ) { + subMenuCurrentTextColor = subMenuCurrentTextColorSetting.get(); + } + + if ( 'current' === newval ) { + backgroundColorSetting.set( backgroundColor ); + textColorSetting.set( textColor ); + + backgroundColorHoverSetting.set( backgroundColorHover ); + textColorHoverSetting.set( textColorHover ); + + currentBackgroundColorSetting.set( currentBackgroundColor ); + currentTextColorSetting.set( currentTextColorSetting ); + + subMenuBackgroundColorSetting.set( subMenuBackgroundColor ); + subMenuTextColorSetting.set( subMenuTextColor ); + + subMenuBackgroundColorHoverSetting.set( subMenuBackgroundColorHover ); + subMenuTextColorHoverSetting.set( subMenuTextColorHover ); + + subMenuCurrentBackgroundColorSetting.set( subMenuCurrentBackgroundColor ); + subMenuCurrentTextColorSetting.set( subMenuCurrentTextColorSetting ); + } + + if ( 'default' === newval ) { + backgroundColorSetting.set( generatepress_color_defaults.navigation_background_color ); + textColorSetting.set( generatepress_color_defaults.navigation_text_color ); + + backgroundColorHoverSetting.set( generatepress_color_defaults.navigation_background_hover_color ); + textColorHoverSetting.set( generatepress_color_defaults.navigation_text_hover_color ); + + currentBackgroundColorSetting.set( generatepress_color_defaults.navigation_background_current_color ); + currentTextColorSetting.set( generatepress_color_defaults.navigation_text_current_color ); + + subMenuBackgroundColorSetting.set( generatepress_color_defaults.subnavigation_background_color ); + subMenuTextColorSetting.set( generatepress_color_defaults.subnavigation_text_color ); + + subMenuBackgroundColorHoverSetting.set( generatepress_color_defaults.subnavigation_background_hover_color ); + subMenuTextColorHoverSetting.set( generatepress_color_defaults.subnavigation_text_hover_color ); + + subMenuCurrentBackgroundColorSetting.set( generatepress_color_defaults.subnavigation_background_current_color ); + subMenuCurrentTextColorSetting.set( generatepress_color_defaults.subnavigation_text_current_color ); + } + + if ( 'white' === newval ) { + backgroundColorSetting.set( '#ffffff' ); + textColorSetting.set( '#000000' ); + + backgroundColorHoverSetting.set( '#ffffff' ); + textColorHoverSetting.set( '#8f919e' ); + + currentBackgroundColorSetting.set( '#ffffff' ); + currentTextColorSetting.set( '#8f919e' ); + + subMenuBackgroundColorSetting.set( '#f6f9fc' ); + subMenuTextColorSetting.set( '#000000' ); + + subMenuBackgroundColorHoverSetting.set( '#f6f9fc' ); + subMenuTextColorHoverSetting.set( '#8f919e' ); + + subMenuCurrentBackgroundColorSetting.set( '#f6f9fc' ); + subMenuCurrentTextColorSetting.set( '#8f919e' ); + } + + if ( 'grey' === newval ) { + backgroundColorSetting.set( '#595959' ); + textColorSetting.set( '#ffffff' ); + + backgroundColorHoverSetting.set( '#424242' ); + textColorHoverSetting.set( '#ffffff' ); + + currentBackgroundColorSetting.set( '#424242' ); + currentTextColorSetting.set( '#ffffff' ); + + subMenuBackgroundColorSetting.set( '#424242' ); + subMenuTextColorSetting.set( '#ffffff' ); + + subMenuBackgroundColorHoverSetting.set( '#424242' ); + subMenuTextColorHoverSetting.set( '#dbdbdb' ); + + subMenuCurrentBackgroundColorSetting.set( '#424242' ); + subMenuCurrentTextColorSetting.set( '#dbdbdb' ); + } + + if ( 'blue' === newval ) { + backgroundColorSetting.set( '#1e73be' ); + textColorSetting.set( '#ffffff' ); + + backgroundColorHoverSetting.set( '#035a9e' ); + textColorHoverSetting.set( '#ffffff' ); + + currentBackgroundColorSetting.set( '#035a9e' ); + currentTextColorSetting.set( '#ffffff' ); + + subMenuBackgroundColorSetting.set( '#035a9e' ); + subMenuTextColorSetting.set( '#ffffff' ); + + subMenuBackgroundColorHoverSetting.set( '#035a9e' ); + subMenuTextColorHoverSetting.set( '#bbd2e8' ); + + subMenuCurrentBackgroundColorSetting.set( '#035a9e' ); + subMenuCurrentTextColorSetting.set( '#bbd2e8' ); + } + + if ( 'red' === newval ) { + backgroundColorSetting.set( '#ed4250' ); + textColorSetting.set( '#ffffff' ); + + backgroundColorHoverSetting.set( '#c42f2f' ); + textColorHoverSetting.set( '#ffffff' ); + + currentBackgroundColorSetting.set( '#c42f2f' ); + currentTextColorSetting.set( '#ffffff' ); + + subMenuBackgroundColorSetting.set( '#c42f2f' ); + subMenuTextColorSetting.set( '#ffffff' ); + + subMenuBackgroundColorHoverSetting.set( '#c42f2f' ); + subMenuTextColorHoverSetting.set( '#fcd9d6' ); + + subMenuCurrentBackgroundColorSetting.set( '#c42f2f' ); + subMenuCurrentTextColorSetting.set( '#fcd9d6' ); + } + + if ( 'green' === newval ) { + backgroundColorSetting.set( '#16aa74' ); + textColorSetting.set( '#ffffff' ); + + backgroundColorHoverSetting.set( '#119b6d' ); + textColorHoverSetting.set( '#ffffff' ); + + currentBackgroundColorSetting.set( '#119b6d' ); + currentTextColorSetting.set( '#ffffff' ); + + subMenuBackgroundColorSetting.set( '#119b6d' ); + subMenuTextColorSetting.set( '#ffffff' ); + + subMenuBackgroundColorHoverSetting.set( '#119b6d' ); + subMenuTextColorHoverSetting.set( '#c2e8de' ); + + subMenuCurrentBackgroundColorSetting.set( '#119b6d' ); + subMenuCurrentTextColorSetting.set( '#c2e8de' ); + } + + jQuery('.wp-color-picker').wpColorPicker().change(); + } ); + } ); + +}( wp.customize ) ); diff --git a/wp-content/themes/generatepress/inc/customizer/controls/js/customizer-live-preview.js b/wp-content/themes/generatepress/inc/customizer/controls/js/customizer-live-preview.js new file mode 100644 index 0000000..0ab0783 --- /dev/null +++ b/wp-content/themes/generatepress/inc/customizer/controls/js/customizer-live-preview.js @@ -0,0 +1,609 @@ +/** + * Theme Customizer enhancements for a better user experience. + * + * Contains handlers to make Theme Customizer preview reload changes asynchronously. + */ +function generatepress_colors_live_update( id, selector, property, default_value, get_value ) { + default_value = typeof default_value !== 'undefined' ? default_value : 'initial'; + get_value = typeof get_value !== 'undefined' ? get_value : ''; + + wp.customize( 'generate_settings[' + id + ']', function( value ) { + value.bind( function( newval ) { + default_value = ( '' !== get_value ) ? wp.customize.value('generate_settings[' + get_value + ']')() : default_value; + newval = ( '' !== newval ) ? newval : default_value; + + if ( jQuery( 'style#' + id ).length ) { + jQuery( 'style#' + id ).html( selector + '{' + property + ':' + newval + ';}' ); + } else { + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#' + id ).not( ':last' ).remove(); + }, 1000); + } + } ); + } ); +} + +function generatepress_classes_live_update( id, classes, selector, prefix ) { + classes = typeof classes !== 'undefined' ? classes : ''; + prefix = typeof prefix !== 'undefined' ? prefix : ''; + wp.customize( 'generate_settings[' + id + ']', function( value ) { + value.bind( function( newval ) { + jQuery.each( classes, function( i, v ) { + jQuery( selector ).removeClass( prefix + v ); + }); + jQuery( selector ).addClass( prefix + newval ); + } ); + } ); +} + +function generatepress_typography_live_update( id, selector, property, unit, media, settings ) { + settings = typeof settings !== 'undefined' ? settings : 'generate_settings'; + wp.customize( settings + '[' + id + ']', function( value ) { + value.bind( function( newval ) { + // Get our unit if applicable + unit = typeof unit !== 'undefined' ? unit : ''; + + var isTablet = ( 'tablet' == id.substring( 0, 6 ) ) ? true : false, + isMobile = ( 'mobile' == id.substring( 0, 6 ) ) ? true : false; + + if ( isTablet ) { + if ( '' == wp.customize(settings + '[' + id + ']').get() ) { + var desktopID = id.replace( 'tablet_', '' ); + newval = wp.customize(settings + '[' + desktopID + ']').get(); + } + } + + if ( isMobile ) { + if ( '' == wp.customize(settings + '[' + id + ']').get() ) { + var desktopID = id.replace( 'mobile_', '' ); + newval = wp.customize(settings + '[' + desktopID + ']').get(); + } + } + + if ( 'buttons_font_size' == id && '' == wp.customize('generate_settings[buttons_font_size]').get() ) { + newval = wp.customize('generate_settings[body_font_size]').get(); + } + + // We're using a desktop value + if ( ! isTablet && ! isMobile ) { + + var tabletValue = ( typeof wp.customize(settings + '[tablet_' + id + ']') !== 'undefined' ) ? wp.customize(settings + '[tablet_' + id + ']').get() : '', + mobileValue = ( typeof wp.customize(settings + '[mobile_' + id + ']') !== 'undefined' ) ? wp.customize(settings + '[mobile_' + id + ']').get() : ''; + + // The tablet setting exists, mobile doesn't + if ( '' !== tabletValue && '' == mobileValue ) { + media = generatepress_live_preview.desktop + ', ' + generatepress_live_preview.mobile; + } + + // The tablet setting doesn't exist, mobile does + if ( '' == tabletValue && '' !== mobileValue ) { + media = generatepress_live_preview.desktop + ', ' + generatepress_live_preview.tablet; + } + + // The tablet setting doesn't exist, neither does mobile + if ( '' == tabletValue && '' == mobileValue ) { + media = generatepress_live_preview.desktop + ', ' + generatepress_live_preview.tablet + ', ' + generatepress_live_preview.mobile; + } + + } + + // Check if media query + media_query = typeof media !== 'undefined' ? 'media="' + media + '"' : ''; + + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#' + id ).not( ':last' ).remove(); + }, 1000); + + setTimeout("jQuery('body').trigger('generate_spacing_updated');", 1000); + } ); + } ); +} + +( function( $ ) { + + // Update the site title in real time... + wp.customize( 'blogname', function( value ) { + value.bind( function( newval ) { + $( '.main-title a' ).html( newval ); + } ); + } ); + + //Update the site description in real time... + wp.customize( 'blogdescription', function( value ) { + value.bind( function( newval ) { + $( '.site-description' ).html( newval ); + } ); + } ); + + wp.customize( 'generate_settings[logo_width]', function( value ) { + value.bind( function( newval ) { + $( '.site-header .header-image' ).css( 'width', newval + 'px' ); + + if ( '' == newval ) { + $( '.site-header .header-image' ).css( 'width', '' ); + } + } ); + } ); + + /** + * Body background color + * Empty: white + */ + generatepress_colors_live_update( 'background_color', 'body', 'background-color', '#FFFFFF' ); + + /** + * Text color + * Empty: black + */ + generatepress_colors_live_update( 'text_color', 'body', 'color', '#000000' ); + + /** + * Link color + * Empty: initial + */ + generatepress_colors_live_update( 'link_color', 'a, a:visited', 'color', 'initial' ); + + /** + * Link color hover + * Empty: initial + */ + generatepress_colors_live_update( 'link_color_hover', 'a:hover', 'color', 'initial' ); + + /** + * Live update for content & navigation colors thanks to our preset option. + * We only want to run this if GP Premium isn't already doing it. + */ + if ( 'undefined' == typeof generate_colors_live_update ) { + /** + * Blog post title color + * Empty: Body link color + */ + generatepress_colors_live_update( 'blog_post_title_color', '.entry-title a, .entry-title a:visited', 'color', '', 'link_color' ); + + /** + * Blog post title color on hover + * Empty: Body link color on hover + */ + generatepress_colors_live_update( 'blog_post_title_hover_color', '.entry-title a:hover', 'color', '', 'link_color_hover' ); + + /** + * Navigation background color + * Empty: Transparent + */ + generatepress_colors_live_update( 'navigation_background_color', '.main-navigation', 'background-color', 'transparent' ); + + /** + * Primary navigation text color + * Empty: link_color + */ + generatepress_colors_live_update( 'navigation_text_color', + '.main-navigation .main-nav ul li a,\ + .menu-toggle,button.menu-toggle:hover,\ + button.menu-toggle:focus,\ + .main-navigation .mobile-bar-items a,\ + .main-navigation .mobile-bar-items a:hover,\ + .main-navigation .mobile-bar-items a:focus', + 'color', + '', + 'link_color' + ); + + /** + * Primary navigation text color hover + * Empty: link_color_hover + */ + generatepress_colors_live_update( 'navigation_text_hover_color', + '.navigation-search input[type="search"],\ + .navigation-search input[type="search"]:active,\ + .navigation-search input[type="search"]:focus,\ + .main-navigation .main-nav ul li:hover > a,\ + .main-navigation .main-nav ul li:focus > a,\ + .main-navigation .main-nav ul li.sfHover > a', + 'color', + '', + 'link_color_hover' + ); + + /** + * Primary navigation menu item hover + * Empty: transparent + */ + generatepress_colors_live_update( 'navigation_background_hover_color', + '.navigation-search input[type="search"],\ + .navigation-search input[type="search"]:focus,\ + .main-navigation .main-nav ul li:hover > a,\ + .main-navigation .main-nav ul li:focus > a,\ + .main-navigation .main-nav ul li.sfHover > a', + 'background-color', + 'transparent' + ); + + /** + * Primary sub-navigation color + * Empty: transparent + */ + generatepress_colors_live_update( 'subnavigation_background_color', '.main-navigation ul ul', 'background-color', 'transparent' ); + + /** + * Primary sub-navigation text color + * Empty: link_color + */ + generatepress_colors_live_update( 'subnavigation_text_color', '.main-navigation .main-nav ul ul li a', 'color', 'link_color' ); + + /** + * Primary sub-navigation hover + */ + var subnavigation_hover = '.main-navigation .main-nav ul ul li:hover > a, \ + .main-navigation .main-nav ul ul li:focus > a, \ + .main-navigation .main-nav ul ul li.sfHover > a'; + + /** + * Primary sub-navigation text hover + * Empty: link_color_hover + */ + generatepress_colors_live_update( 'subnavigation_text_hover_color', subnavigation_hover, 'color', '', 'link_color_hover' ); + + /** + * Primary sub-navigation background hover + * Empty: transparent + */ + generatepress_colors_live_update( 'subnavigation_background_hover_color', subnavigation_hover, 'background-color', 'transparent' ); + + /** + * Navigation current selectors + */ + var navigation_current = '.main-navigation .main-nav ul li[class*="current-menu-"] > a, \ + .main-navigation .main-nav ul li[class*="current-menu-"]:hover > a, \ + .main-navigation .main-nav ul li[class*="current-menu-"].sfHover > a'; + + /** + * Primary navigation current text + * Empty: link_color + */ + generatepress_colors_live_update( 'navigation_text_current_color', navigation_current, 'color', '', 'link_color' ); + + /** + * Primary navigation current background + * Empty: transparent + */ + generatepress_colors_live_update( 'navigation_background_current_color', navigation_current, 'background-color', 'transparent' ); + + /** + * Primary sub-navigation current selectors + */ + var subnavigation_current = '.main-navigation .main-nav ul ul li[class*="current-menu-"] > a,\ + .main-navigation .main-nav ul ul li[class*="current-menu-"]:hover > a, \ + .main-navigation .main-nav ul ul li[class*="current-menu-"].sfHover > a'; + + /** + * Primary sub-navigation current text + * Empty: link_color + */ + generatepress_colors_live_update( 'subnavigation_text_current_color', subnavigation_current, 'color', '', 'link_color' ); + + /** + * Primary navigation current item background + * Empty: transparent + */ + generatepress_colors_live_update( 'subnavigation_background_current_color', subnavigation_current, 'background-color', 'transparent' ); + } + + /** + * Container width + */ + wp.customize( 'generate_settings[container_width]', function( value ) { + value.bind( function( newval ) { + if ( jQuery( 'style#container_width' ).length ) { + jQuery( 'style#container_width' ).html( 'body .grid-container, .wp-block-group__inner-container{max-width:' + newval + 'px;}' ); + } else { + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#container_width' ).not( ':last' ).remove(); + }, 100); + } + jQuery('body').trigger('generate_spacing_updated'); + } ); + } ); + + /** + * Live update for typography options. + * We only want to run this if GP Premium isn't already doing it. + */ + if ( 'undefined' == typeof gp_premium_typography_live_update ) { + /** + * Body font size, weight and transform + */ + generatepress_typography_live_update( 'body_font_size', 'body, button, input, select, textarea', 'font-size', 'px' ); + generatepress_typography_live_update( 'body_line_height', 'body', 'line-height', '' ); + generatepress_typography_live_update( 'paragraph_margin', 'p, .entry-content > [class*="wp-block-"]:not(:last-child)', 'margin-bottom', 'em' ); + generatepress_typography_live_update( 'body_font_weight', 'body, button, input, select, textarea', 'font-weight' ); + generatepress_typography_live_update( 'body_font_transform', 'body, button, input, select, textarea', 'text-transform' ); + + /** + * H1 font size, weight and transform + */ + generatepress_typography_live_update( 'heading_1_font_size', 'h1', 'font-size', 'px', generatepress_live_preview.desktop ); + generatepress_typography_live_update( 'mobile_heading_1_font_size', 'h1', 'font-size', 'px', generatepress_live_preview.mobile ); + generatepress_typography_live_update( 'heading_1_weight', 'h1', 'font-weight' ); + generatepress_typography_live_update( 'heading_1_transform', 'h1', 'text-transform' ); + generatepress_typography_live_update( 'heading_1_line_height', 'h1', 'line-height', 'em' ); + + /** + * H2 font size, weight and transform + */ + generatepress_typography_live_update( 'heading_2_font_size', 'h2', 'font-size', 'px', generatepress_live_preview.desktop ); + generatepress_typography_live_update( 'mobile_heading_2_font_size', 'h2', 'font-size', 'px', generatepress_live_preview.mobile ); + generatepress_typography_live_update( 'heading_2_weight', 'h2', 'font-weight' ); + generatepress_typography_live_update( 'heading_2_transform', 'h2', 'text-transform' ); + generatepress_typography_live_update( 'heading_2_line_height', 'h2', 'line-height', 'em' ); + + /** + * H3 font size, weight and transform + */ + generatepress_typography_live_update( 'heading_3_font_size', 'h3', 'font-size', 'px' ); + generatepress_typography_live_update( 'heading_3_weight', 'h3', 'font-weight' ); + generatepress_typography_live_update( 'heading_3_transform', 'h3', 'text-transform' ); + generatepress_typography_live_update( 'heading_3_line_height', 'h3', 'line-height', 'em' ); + } + + /** + * Content layout + */ + generatepress_classes_live_update( 'content_layout_setting', [ 'one-container', 'separate-containers' ], 'body' ); + + /** + * Top bar width + */ + wp.customize( 'generate_settings[top_bar_width]', function( value ) { + value.bind( function( newval ) { + if ( 'full' == newval ) { + $( '.top-bar' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' ); + if ( 'contained' == wp.customize.value('generate_settings[top_bar_inner_width]')() ) { + $( '.inside-top-bar' ).addClass( 'grid-container' ).addClass( 'grid-parent' ); + } + } + if ( 'contained' == newval ) { + $( '.top-bar' ).addClass( 'grid-container' ).addClass( 'grid-parent' ); + $( '.inside-top-bar' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' ); + } + } ); + } ); + + /** + * Inner top bar width + */ + wp.customize( 'generate_settings[top_bar_inner_width]', function( value ) { + value.bind( function( newval ) { + if ( 'full' == newval ) { + $( '.inside-top-bar' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' ); + } + if ( 'contained' == newval ) { + $( '.inside-top-bar' ).addClass( 'grid-container' ).addClass( 'grid-parent' ); + } + } ); + } ); + + /** + * Top bar alignment + */ + generatepress_classes_live_update( 'top_bar_alignment', [ 'left', 'center', 'right' ], '.top-bar', 'top-bar-align-' ); + + /** + * Header layout + */ + wp.customize( 'generate_settings[header_layout_setting]', function( value ) { + value.bind( function( newval ) { + if ( 'fluid-header' == newval ) { + $( '.site-header' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' ); + if ( 'contained' == wp.customize.value('generate_settings[header_inner_width]')() ) { + $( '.inside-header' ).addClass( 'grid-container' ).addClass( 'grid-parent' ); + } + } + if ( 'contained-header' == newval ) { + $( '.site-header' ).addClass( 'grid-container' ).addClass( 'grid-parent' ); + $( '.inside-header' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' ); + } + } ); + } ); + + /** + * Inner Header layout + */ + wp.customize( 'generate_settings[header_inner_width]', function( value ) { + value.bind( function( newval ) { + if ( 'full-width' == newval ) { + $( '.inside-header' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' ); + } + if ( 'contained' == newval ) { + $( '.inside-header' ).addClass( 'grid-container' ).addClass( 'grid-parent' ); + } + } ); + } ); + + /** + * Header alignment + */ + generatepress_classes_live_update( 'header_alignment_setting', [ 'left', 'center', 'right' ], 'body', 'header-aligned-' ); + + /** + * Navigation width + */ + wp.customize( 'generate_settings[nav_layout_setting]', function( value ) { + value.bind( function( newval ) { + if ( $( 'body' ).hasClass( 'sticky-enabled' ) ) { + wp.customize.preview.send( 'refresh' ); + } else { + if ( 'fluid-nav' == newval ) { + $( '.main-navigation' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' ); + if ( 'full-width' !== wp.customize.value('generate_settings[nav_inner_width]')() ) { + $( '.main-navigation .inside-navigation' ).addClass( 'grid-container' ).addClass( 'grid-parent' ); + } + } + if ( 'contained-nav' == newval ) { + $( '.main-navigation' ).addClass( 'grid-container' ).addClass( 'grid-parent' ); + $( '.main-navigation .inside-navigation' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' ); + } + } + } ); + } ); + + /** + * Inner navigation width + */ + wp.customize( 'generate_settings[nav_inner_width]', function( value ) { + value.bind( function( newval ) { + if ( 'full-width' == newval ) { + $( '.main-navigation .inside-navigation' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' ); + } + if ( 'contained' == newval ) { + $( '.main-navigation .inside-navigation' ).addClass( 'grid-container' ).addClass( 'grid-parent' ); + } + } ); + } ); + + /** + * Navigation position + */ + wp.customize( 'generate_settings[nav_position_setting]', function( value ) { + value.bind( function( newval ) { + $( 'body' ).trigger( 'generate_navigation_location_updated' ); + + // Update navigation alignment settings. + $( 'body' ).removeClass( 'nav-aligned-center' ); + $( 'body' ).removeClass( 'nav-aligned-left' ); + $( 'body' ).removeClass( 'nav-aligned-right' ); + $( 'body' ).addClass( 'nav-aligned-' + wp.customize.value('generate_settings[nav_alignment_setting]')() ); + + if ( $( '.gen-sidebar-nav' ).length ) { + wp.customize.preview.send( 'refresh' ); + return false; + } + if ( 'nav-left-sidebar' == newval ) { + wp.customize.preview.send( 'refresh' ); + return false; + } + if ( 'nav-right-sidebar' == newval ) { + wp.customize.preview.send( 'refresh' ); + return false; + } + + if ( '' !== wp.customize.value('generate_settings[nav_drop_point]')() ) { + wp.customize.preview.send( 'refresh' ); + return false; + } + + var classes = [ 'nav-below-header', 'nav-above-header', 'nav-float-right', 'nav-float-left', 'nav-left-sidebar', 'nav-right-sidebar' ]; + if ( 'nav-left-sidebar' !== newval && 'nav-right-sidebar' !== newval ) { + $.each( classes, function( i, v ) { + $( 'body' ).removeClass( v ); + }); + } + $( 'body' ).addClass( newval ); + if ( 'nav-below-header' == newval ) { + $( '#site-navigation:first' ).insertAfter( '.site-header' ).show(); + } + if ( 'nav-above-header' == newval ) { + if ( $( '.top-bar:not(.secondary-navigation .top-bar)' ).length ) { + $( '#site-navigation:first' ).insertAfter( '.top-bar' ).show(); + } else { + $( '#site-navigation:first' ).prependTo( 'body' ).show(); + } + } + if ( 'nav-float-right' == newval ) { + if ( ! $( 'body' ).hasClass( 'using-floats' ) && $( '.header-widget' ).length ) { + $( '#site-navigation:first' ).insertBefore( '.header-widget' ).show(); + } else { + $( '#site-navigation:first' ).appendTo( '.inside-header' ).show(); + } + } + if ( 'nav-float-left' == newval ) { + $( '#site-navigation:first' ).appendTo( '.inside-header' ).show(); + } + if ( '' == newval ) { + if ( $( '.gen-sidebar-nav' ).length ) { + wp.customize.preview.send( 'refresh' ); + } else { + $( '#site-navigation:first' ).hide(); + } + } + } ); + } ); + + /** + * Navigation alignment + */ + generatepress_classes_live_update( 'nav_alignment_setting', [ 'left', 'center', 'right' ], 'body', 'nav-aligned-' ); + + /** + * Footer width + */ + wp.customize( 'generate_settings[footer_layout_setting]', function( value ) { + value.bind( function( newval ) { + if ( 'fluid-footer' == newval ) { + $( '.site-footer' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' ); + } + if ( 'contained-footer' == newval ) { + $( '.site-footer' ).addClass( 'grid-container' ).addClass( 'grid-parent' ); + } + } ); + } ); + + /** + * Inner footer width + */ + wp.customize( 'generate_settings[footer_inner_width]', function( value ) { + value.bind( function( newval ) { + if ( 'full-width' == newval ) { + if ( $( '.footer-widgets-container' ).length ) { + $( '.footer-widgets-container' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' ); + } else { + $( '.inside-footer-widgets' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' ); + } + $( '.inside-site-info' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' ); + } + if ( 'contained' == newval ) { + if ( $( '.footer-widgets-container' ).length ) { + $( '.footer-widgets-container' ).addClass( 'grid-container' ).addClass( 'grid-parent' ); + } else { + $( '.inside-footer-widgets' ).addClass( 'grid-container' ).addClass( 'grid-parent' ); + } + $( '.inside-site-info' ).addClass( 'grid-container' ).addClass( 'grid-parent' ); + } + } ); + } ); + + /** + * Footer bar alignment + */ + generatepress_classes_live_update( 'footer_bar_alignment', [ 'left', 'center', 'right' ], '.site-footer', 'footer-bar-align-' ); + + jQuery( 'body' ).on( 'generate_spacing_updated', function() { + var containerAlignment = wp.customize( 'generate_settings[container_alignment]' ).get(), + containerWidth = wp.customize( 'generate_settings[container_width]' ).get(), + contentLeft = generatepress_live_preview.contentLeft, + contentRight = generatepress_live_preview.contentRight; + + if ( 'text' === containerAlignment ) { + if ( typeof wp.customize( 'generate_spacing_settings[content_left]' ) !== 'undefined' ) { + contentLeft = wp.customize( 'generate_spacing_settings[content_left]' ).get(); + } + + if ( typeof wp.customize( 'generate_spacing_settings[content_right]' ) !== 'undefined' ) { + contentRight = wp.customize( 'generate_spacing_settings[content_right]' ).get(); + } + + var newContainerWidth = Number( containerWidth ) + Number( contentLeft ) + Number( contentRight ); + + if ( jQuery( 'style#wide_container_width' ).length ) { + jQuery( 'style#wide_container_width' ).html( '#page{max-width:' + newContainerWidth + 'px;}' ); + } else { + jQuery( 'head' ).append( '' ); + setTimeout(function() { + jQuery( 'style#wide_container_width' ).not( ':last' ).remove(); + }, 100); + } + } + } ); +} )( jQuery ); diff --git a/wp-content/themes/generatepress/inc/customizer/controls/js/selectWoo.min.js b/wp-content/themes/generatepress/inc/customizer/controls/js/selectWoo.min.js new file mode 100644 index 0000000..bf9600c --- /dev/null +++ b/wp-content/themes/generatepress/inc/customizer/controls/js/selectWoo.min.js @@ -0,0 +1 @@ +/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
          ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a(''),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[data-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("data-selected","true"):b.attr("data-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('
            '),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('
          • ')},d.prototype.update=function(a){var b=this;if(this.clear(),0!==a.length){for(var d=[],e=0;e1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('×');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
          • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen())if(c===d.ESC||c===d.TAB||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault()),c===d.DOWN||c===d.UP)b.focusOnActiveElement();else{var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3)}else b.hasFocus()&&(c===d.ENTER||c===d.SPACE||c===d.DOWN&&a.altKey)&&(b.open(),a.preventDefault())})},e.prototype.focusOnActiveElement=function(){c.isTouchscreen()||this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c}); \ No newline at end of file diff --git a/wp-content/themes/generatepress/inc/customizer/controls/js/slider-control.js b/wp-content/themes/generatepress/inc/customizer/controls/js/slider-control.js new file mode 100644 index 0000000..afb97ca --- /dev/null +++ b/wp-content/themes/generatepress/inc/customizer/controls/js/slider-control.js @@ -0,0 +1,134 @@ +wp.customize.controlConstructor['generatepress-range-slider'] = wp.customize.Control.extend({ + + ready: function() { + + 'use strict'; + + var control = this, + value, + thisInput, + inputDefault, + changeAction, + controlClass = '.customize-control-generatepress-range-slider', + footerActions = jQuery( '#customize-footer-actions' ); + + // Set up the sliders + jQuery( '.generatepress-slider' ).each( function() { + var _this = jQuery( this ); + var _input = _this.closest( 'label' ).find( 'input[type="number"]' ); + var _text = _input.next( '.value' ); + _this.slider({ + value: _input.val(), + min: _this.data( 'min' ), + max: _this.data( 'max' ), + step: _this.data( 'step' ), + slide: function( event, ui ) { + _input.val( ui.value ).change(); + _text.text( ui.value ); + } + }); + }); + + // Update the range value based on the input value + jQuery( controlClass + ' .gp_range_value input[type=number]' ).on( 'input', function() { + value = jQuery( this ).attr( 'value' ); + if ( '' == value ) { + value = -1; + } + jQuery( this ).closest( 'label' ).find( '.generatepress-slider' ).slider( 'value', parseFloat(value)).change(); + }); + + // Handle the reset button + jQuery( controlClass + ' .generatepress-reset' ).on( 'click', function() { + var icon = jQuery( this ), + visible_area = icon.closest( '.gp-range-title-area' ).next( '.gp-range-slider-areas' ).children( 'label:visible' ), + input = visible_area.find( 'input[type=number]' ), + slider_value = visible_area.find( '.generatepress-slider' ), + visual_value = visible_area.find( '.gp_range_value' ), + reset_value = input.attr( 'data-reset_value' ); + + input.val( reset_value ).change(); + visual_value.find( 'input' ).val( reset_value ); + visual_value.find( '.value' ).text( reset_value ); + + if ( '' == reset_value ) { + reset_value = -1; + } + + slider_value.slider( 'value', parseFloat( reset_value ) ); + }); + + // Figure out which device icon to make active on load + jQuery( controlClass + ' .generatepress-range-slider-control' ).each( function() { + var _this = jQuery( this ); + _this.find( '.gp-device-controls' ).children( 'span:first-child' ).addClass( 'selected' ); + _this.find( '.range-option-area:first-child' ).show(); + }); + + // Do stuff when device icons are clicked + jQuery( controlClass + ' .gp-device-controls > span' ).on( 'click', function( event ) { + var device = jQuery( this ).data( 'option' ); + + jQuery( controlClass + ' .gp-device-controls span' ).each( function() { + var _this = jQuery( this ); + if ( device == _this.attr( 'data-option' ) ) { + _this.addClass( 'selected' ); + _this.siblings().removeClass( 'selected' ); + } + }); + + jQuery( controlClass + ' .gp-range-slider-areas label' ).each( function() { + var _this = jQuery( this ); + if ( device == _this.attr( 'data-option' ) ) { + _this.show(); + _this.siblings().hide(); + } + }); + + // Set the device we're currently viewing + wp.customize.previewedDevice.set( jQuery( event.currentTarget ).data( 'option' ) ); + } ); + + // Set the selected devices in our control when the Customizer devices are clicked + footerActions.find( '.devices button' ).on( 'click', function() { + var device = jQuery( this ).data( 'device' ); + jQuery( controlClass + ' .gp-device-controls span' ).each( function() { + var _this = jQuery( this ); + if ( device == _this.attr( 'data-option' ) ) { + _this.addClass( 'selected' ); + _this.siblings().removeClass( 'selected' ); + } + }); + + jQuery( controlClass + ' .gp-range-slider-areas label' ).each( function() { + var _this = jQuery( this ); + if ( device == _this.attr( 'data-option' ) ) { + _this.show(); + _this.siblings().hide(); + } + }); + }); + + // Apply changes when desktop slider is changed + control.container.on( 'input change', '.desktop-range', + function() { + control.settings['desktop'].set( jQuery( this ).val() ); + } + ); + + // Apply changes when tablet slider is changed + control.container.on( 'input change', '.tablet-range', + function() { + control.settings['tablet'].set( jQuery( this ).val() ); + } + ); + + // Apply changes when mobile slider is changed + control.container.on( 'input change', '.mobile-range', + function() { + control.settings['mobile'].set( jQuery( this ).val() ); + } + ); + } + +}); \ No newline at end of file diff --git a/wp-content/themes/generatepress/inc/customizer/controls/js/typography-customizer.js b/wp-content/themes/generatepress/inc/customizer/controls/js/typography-customizer.js new file mode 100644 index 0000000..bd67534 --- /dev/null +++ b/wp-content/themes/generatepress/inc/customizer/controls/js/typography-customizer.js @@ -0,0 +1,154 @@ +( function( api ) { + + api.controlConstructor['gp-customizer-typography'] = api.Control.extend( { + ready: function() { + var control = this; + + control.container.on( 'change', '.generatepress-font-family select', + function() { + var _this = jQuery( this ), + _value = _this.val(), + _categoryID = _this.attr( 'data-category' ), + _variantsID = _this.attr( 'data-variants' ); + + // Set our font family + control.settings['family'].set( _this.val() ); + + // Bail if our controls don't exist + if ( 'undefined' == typeof control.settings['category'] || 'undefined' == typeof control.settings['variant'] ) { + return; + } + + setTimeout( function() { + // Send our request to the generate_get_all_google_fonts_ajax function + var response = jQuery.getJSON({ + type: 'POST', + url: ajaxurl, + data: { + action: 'generate_get_all_google_fonts_ajax', + gp_customize_nonce: gp_customize.nonce + }, + async: false, + dataType: 'json', + }); + + // Get our response + var fonts = response.responseJSON; + + // Create an ID from our selected font + var id = _value.split(' ').join('_').toLowerCase(); + + // Set our values if we have them + if ( id in fonts ) { + + // Get existing variants if this font is already selected + var got_variants = false; + jQuery( '.generatepress-font-family select' ).not( _this ).each( function( key, select ) { + var parent = jQuery( this ).closest( '.generatepress-font-family' ); + + if ( _value == jQuery( select ).val() && _this.data( 'category' ) !== jQuery( select ).data( 'category' ) ) { + if ( ! got_variants ) { + updated_variants = jQuery( parent.next( '.generatepress-font-variant' ).find( 'select' ) ).val(); + got_variants = true; + } + } + } ); + + // We're using a Google font, so show the variants field + _this.closest( '.generatepress-font-family' ).next( 'div' ).show(); + + // Remove existing variants + jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove(); + + // Populate our select input with available variants + jQuery.each( fonts[ id ].variants, function( key, value ) { + jQuery( 'select[name="' + _variantsID + '"]' ).append( jQuery( '' ).attr( 'value', value ).text( value ) ); + } ); + + // Set our variants + if ( ! got_variants ) { + control.settings[ 'variant' ].set( fonts[ id ].variants ); + } else { + control.settings[ 'variant' ].set( updated_variants ); + } + + // Set our font category + control.settings[ 'category' ].set( fonts[ id ].category ); + jQuery( 'input[name="' + _categoryID + '"' ).val( fonts[ id ].category ); + } else { + _this.closest( '.generatepress-font-family' ).next( 'div' ).hide(); + control.settings[ 'category' ].set( '' ) + control.settings[ 'variant' ].set( '' ) + jQuery( 'input[name="' + _categoryID + '"' ).val( '' ); + jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove(); + } + }, 25 ); + } + ); + + control.container.on( 'change', '.generatepress-font-variant select', + function() { + var _this = jQuery( this ); + var variants = _this.val(); + + control.settings['variant'].set( variants ); + + jQuery( '.generatepress-font-variant select' ).each( function( key, value ) { + var this_control = jQuery( this ).closest( 'li' ).attr( 'id' ).replace( 'customize-control-', '' ); + var parent = jQuery( this ).closest( '.generatepress-font-variant' ); + var font_val = api.control( this_control ).settings['family'].get(); + + if ( font_val == control.settings['family'].get() && _this.attr( 'name' ) !== jQuery( value ).attr( 'name' ) ) { + jQuery( parent.find( 'select' ) ).not( _this ).val( variants ).triggerHandler( 'change' ); + api.control( this_control ).settings['variant'].set( variants ); + } + } ); + } + ); + + control.container.on( 'change', '.generatepress-font-category input', + function() { + control.settings['category'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change', '.generatepress-font-weight select', + function() { + control.settings['weight'].set( jQuery( this ).val() ); + } + ); + + control.container.on( 'change', '.generatepress-font-transform select', + function() { + control.settings['transform'].set( jQuery( this ).val() ); + } + ); + + } + } ); + +} )( wp.customize ); + +jQuery( document ).ready( function( $ ) { + + $( '.generatepress-font-family select' ).select2(); + + $( '.generatepress-font-variant' ).each( function( key, value ) { + var _this = $( this ); + var value = _this.data( 'saved-value' ); + + if ( value ) { + value = value.toString().split( ',' ); + } + + _this.find( 'select' ).select2().val( value ).trigger( 'change.select2' ); + } ); + + $( ".generatepress-font-family" ).each( function( key, value ) { + var _this = $( this ); + if ( $.inArray( _this.find( 'select' ).val(), typography_defaults ) !== -1 ) { + _this.next( '.generatepress-font-variant' ).hide(); + } + } ); + +} ); diff --git a/wp-content/themes/generatepress/inc/customizer/controls/js/upsell-control.js b/wp-content/themes/generatepress/inc/customizer/controls/js/upsell-control.js new file mode 100644 index 0000000..164312d --- /dev/null +++ b/wp-content/themes/generatepress/inc/customizer/controls/js/upsell-control.js @@ -0,0 +1,12 @@ +( function( $, api ) { + api.sectionConstructor['gp-upsell-section'] = api.Section.extend( { + + // No events for this type of section. + attachEvents: function () {}, + + // Always make the section active. + isContextuallyActive: function () { + return true; + } + } ); +} )( jQuery, wp.customize ); \ No newline at end of file diff --git a/wp-content/themes/generatepress/inc/customizer/customizer-helpers.php b/wp-content/themes/generatepress/inc/customizer/customizer-helpers.php new file mode 100644 index 0000000..c0292ca --- /dev/null +++ b/wp-content/themes/generatepress/inc/customizer/customizer-helpers.php @@ -0,0 +1,23 @@ + $fam ) { + $font_names[] = $fam['name']; + } + + // Get all non-Google font names + $not_google = generate_typography_default_fonts(); + + // Merge them both into one array + $valid = array_merge( $font_names, $not_google ); + + // Sanitize + if ( in_array( $input, $valid ) ) { + return $input; + } else { + return 'Open Sans'; + } + } +} + +if ( ! function_exists( 'generate_sanitize_font_weight' ) ) { + /** + * Sanitize font weight. + * + * @since 1.1.10 + * @deprecated 1.3.40 + */ + function generate_sanitize_font_weight( $input ) { + + $valid = array( + 'normal', + 'bold', + '100', + '200', + '300', + '400', + '500', + '600', + '700', + '800', + '900', + ); + + if ( in_array( $input, $valid ) ) { + return $input; + } else { + return 'normal'; + } + } +} + +if ( ! function_exists( 'generate_sanitize_text_transform' ) ) { + /** + * Sanitize text transform. + * + * @since 1.1.10 + * @deprecated 1.3.40 + */ + function generate_sanitize_text_transform( $input ) { + + $valid = array( + 'none', + 'capitalize', + 'uppercase', + 'lowercase', + ); + + if ( in_array( $input, $valid ) ) { + return $input; + } else { + return 'none'; + } + } +} + +if ( ! function_exists( 'generate_typography_customize_preview_css' ) ) { + /** + * Hide the hidden input control + * @since 1.3.40 + */ + function generate_typography_customize_preview_css() { + ?> + + +
            + +
            + manager->get_control( $setting->id )->choices; + + // If the input is a valid key, return it; + // otherwise, return the default + return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); + } +} + +/** + * Sanitize our Google Font variants + * + * @since 2.0 + */ +function generate_sanitize_variants( $input ) { + if ( is_array( $input ) ) { + $input = implode( ',', $input ); + } + return sanitize_text_field( $input ); +} + +add_action( 'customize_controls_enqueue_scripts', 'generate_do_control_inline_scripts', 100 ); +/** + * Add misc inline scripts to our controls. + * + * We don't want to add these to the controls themselves, as they will be repeated + * each time the control is initialized. + * + * @since 2.0 + */ +function generate_do_control_inline_scripts() { + wp_localize_script( 'generatepress-typography-customizer', 'gp_customize', + array( + 'nonce' => wp_create_nonce( 'gp_customize_nonce' ) + ) + ); + + $number_of_fonts = apply_filters( 'generate_number_of_fonts', 200 ); + + wp_localize_script( + 'generatepress-typography-customizer', + 'generatePressTypography', + array( + 'googleFonts' => apply_filters( 'generate_typography_customize_list', generate_get_all_google_fonts( $number_of_fonts ) ) + ) + ); + + wp_localize_script( 'generatepress-typography-customizer', 'typography_defaults', generate_typography_default_fonts() ); + + wp_enqueue_script( 'generatepress-customizer-controls', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/controls/js/customizer-controls.js', array( 'customize-controls', 'jquery' ), GENERATE_VERSION, true ); + wp_localize_script( 'generatepress-customizer-controls', 'generatepress_defaults', generate_get_defaults() ); + wp_localize_script( 'generatepress-customizer-controls', 'generatepress_color_defaults', generate_get_color_defaults() ); +} + +if ( ! function_exists( 'generate_customizer_live_preview' ) ) { + add_action( 'customize_preview_init', 'generate_customizer_live_preview', 100 ); + /** + * Add our live preview scripts + * + * @since 0.1 + */ + function generate_customizer_live_preview() { + $spacing_settings = wp_parse_args( + get_option( 'generate_spacing_settings', array() ), + generate_spacing_get_defaults() + ); + + wp_enqueue_script( 'generate-themecustomizer', trailingslashit( get_template_directory_uri() ) . 'inc/customizer/controls/js/customizer-live-preview.js', array( 'customize-preview' ), GENERATE_VERSION, true ); + + wp_localize_script( 'generate-themecustomizer', 'generatepress_live_preview', array( + 'mobile' => generate_get_media_query( 'mobile' ), + 'tablet' => generate_get_media_query( 'tablet' ), + 'desktop' => generate_get_media_query( 'desktop' ), + 'contentLeft' => absint( $spacing_settings['content_left'] ), + 'contentRight' => absint( $spacing_settings['content_right'] ), + ) ); + } +} + +/** + * Check to see if we have a logo or not. + * + * Used as an active callback. Calling has_custom_logo creates a PHP notice for + * multisite users. + * + * @since 2.0.1 + */ +function generate_has_custom_logo_callback() { + if ( get_theme_mod( 'custom_logo' ) ) { + return true; + } + + return false; +} + +/** + * Save our preset layout controls. These should always save to be "current". + * + * @since 2.2 + */ +function generate_sanitize_preset_layout( $input ) { + return 'current'; +} diff --git a/wp-content/themes/generatepress/inc/dashboard.php b/wp-content/themes/generatepress/inc/dashboard.php new file mode 100644 index 0000000..3c57a61 --- /dev/null +++ b/wp-content/themes/generatepress/inc/dashboard.php @@ -0,0 +1,367 @@ + +
            +
            +
            +
            + + +
            +
            + + + +
            +
            +
            + + + +
            +

            +
            + + +
            + %2$s', + esc_url( admin_url( 'customize.php' ) ), + esc_html__( 'Customize', 'generatepress' ) + ); + ?> +
            + + +
            + + array( + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#backgrounds', false ), + ), + 'Blog' => array( + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#blog', false ), + ), + 'Colors' => array( + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#colors', false ), + ), + 'Copyright' => array( + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#copyright', false ), + ), + 'Disable Elements' => array( + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#disable-elements', false ), + ), + 'Elements' => array( + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#elements', false ), + ), + 'Import / Export' => array( + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#import-export', false ), + ), + 'Menu Plus' => array( + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#menu-plus', false ), + ), + 'Secondary Nav' => array( + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#secondary-nav', false ), + ), + 'Sections' => array( + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#sections', false ), + ), + 'Site Library' => array( + 'url' => generate_get_premium_url( 'https://generatepress.com/site-library', false ), + ), + 'Spacing' => array( + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#spacing', false ), + ), + 'Typography' => array( + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#typography', false ), + ), + 'WooCommerce' => array( + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#woocommerce', false ), + ), + ); + + if ( ! defined( 'GP_PREMIUM_VERSION' ) ) : ?> +
            +

            +
            +
            + $info ) { ?> +
            +
            + +
            +
            + +
            +
            +
            + +
            +
            +
            + array( + 'title' => __( 'Upload Logo', 'generatepress' ), + 'icon' => 'dashicons-format-image', + 'url' => admin_url( 'customize.php?autofocus[control]=custom_logo' ), + ), + 'typography' => array( + 'title' => __( 'Customize Fonts', 'generatepress' ), + 'icon' => 'dashicons-editor-textcolor', + 'url' => admin_url( $typography_section ), + ), + 'colors' => array( + 'title' => __( 'Customize Colors', 'generatepress' ), + 'icon' => 'dashicons-admin-customizer', + 'url' => admin_url( $colors_section ), + ), + 'layout' => array( + 'title' => __( 'Layout Options', 'generatepress' ), + 'icon' => 'dashicons-layout', + 'url' => admin_url( 'customize.php?autofocus[panel]=generate_layout_panel' ), + ), + 'all' => array( + 'title' => __( 'All Options', 'generatepress' ), + 'icon' => 'dashicons-admin-generic', + 'url' => admin_url( 'customize.php' ), + ), + ); + ?> +
            + +
            +
            +

            +
            +
              + $data ) { + printf( + '
            • %3$s
            • ', + esc_attr( $data['icon'] ), + esc_url( $data['url'] ), + esc_html( $data['title'] ) + ); + } + ?> +
            + +

            + +
            +
            + + + +
            +

            +
            +

            +
            +

            +

            + esc_js( $warning ) + ) + ); + ?> +

            + +
            + +
            +
            +
            +
            +
            + +
            +
            +
            + base ) { + return; + } + + if ( isset( $_GET['settings-updated'] ) && 'true' == $_GET['settings-updated'] ) { + add_settings_error( 'generate-notices', 'true', esc_html__( 'Settings saved.', 'generatepress' ), 'updated' ); + } + + if ( isset( $_GET['status'] ) && 'imported' == $_GET['status'] ) { + add_settings_error( 'generate-notices', 'imported', esc_html__( 'Import successful.', 'generatepress' ), 'updated' ); + } + + if ( isset( $_GET['status'] ) && 'reset' == $_GET['status'] ) { + add_settings_error( 'generate-notices', 'reset', esc_html__( 'Settings removed.', 'generatepress' ), 'updated' ); + } + + settings_errors( 'generate-notices' ); + } +} diff --git a/wp-content/themes/generatepress/inc/defaults.php b/wp-content/themes/generatepress/inc/defaults.php new file mode 100644 index 0000000..3b4b102 --- /dev/null +++ b/wp-content/themes/generatepress/inc/defaults.php @@ -0,0 +1,354 @@ + '', + 'hide_tagline' => '', + 'logo' => '', + 'inline_logo_site_branding' => false, + 'retina_logo' => '', + 'logo_width' => '', + 'top_bar_width' => 'full', + 'top_bar_inner_width' => 'contained', + 'top_bar_alignment' => 'right', + 'container_width' => '1100', + 'container_alignment' => 'boxes', + 'header_layout_setting' => 'fluid-header', + 'header_inner_width' => 'contained', + 'nav_alignment_setting' => ( is_rtl() ) ? 'right' : 'left', + 'header_alignment_setting' => ( is_rtl() ) ? 'right' : 'left', + 'nav_layout_setting' => 'fluid-nav', + 'nav_inner_width' => 'contained', + 'nav_position_setting' => 'nav-below-header', + 'nav_drop_point' => '', + 'nav_dropdown_type' => 'hover', + 'nav_dropdown_direction' => 'right', + 'nav_search' => 'disable', + 'content_layout_setting' => 'separate-containers', + 'layout_setting' => 'right-sidebar', + 'blog_layout_setting' => 'right-sidebar', + 'single_layout_setting' => 'right-sidebar', + 'post_content' => 'excerpt', + 'footer_layout_setting' => 'fluid-footer', + 'footer_inner_width' => 'contained', + 'footer_widget_setting' => '3', + 'footer_bar_alignment' => 'right', + 'back_to_top' => '', + 'background_color' => '#efefef', + 'text_color' => '#3a3a3a', + 'link_color' => '#1e73be', + 'link_color_hover' => '#000000', + 'link_color_visited' => '', + 'font_awesome_essentials' => true, + 'icons' => 'font', + 'combine_css' => true, + 'dynamic_css_cache' => true, + ) + ); + } +} + +if ( ! function_exists( 'generate_get_color_defaults' ) ) { + /** + * Set default options + */ + function generate_get_color_defaults() { + return apply_filters( 'generate_color_option_defaults', + array( + 'top_bar_background_color' => '#636363', + 'top_bar_text_color' => '#ffffff', + 'top_bar_link_color' => '#ffffff', + 'top_bar_link_color_hover' => '#303030', + 'header_background_color' => '#ffffff', + 'header_text_color' => '#3a3a3a', + 'header_link_color' => '#3a3a3a', + 'header_link_hover_color' => '', + 'site_title_color' => '#222222', + 'site_tagline_color' => '#757575', + 'navigation_background_color' => '#222222', + 'navigation_text_color' => '#ffffff', + 'navigation_background_hover_color' => '#3f3f3f', + 'navigation_text_hover_color' => '#ffffff', + 'navigation_background_current_color' => '#3f3f3f', + 'navigation_text_current_color' => '#ffffff', + 'subnavigation_background_color' => '#3f3f3f', + 'subnavigation_text_color' => '#ffffff', + 'subnavigation_background_hover_color' => '#4f4f4f', + 'subnavigation_text_hover_color' => '#ffffff', + 'subnavigation_background_current_color' => '#4f4f4f', + 'subnavigation_text_current_color' => '#ffffff', + 'navigation_search_background_color' => '', + 'navigation_search_text_color' => '', + 'content_background_color' => '#ffffff', + 'content_text_color' => '', + 'content_link_color' => '', + 'content_link_hover_color' => '', + 'content_title_color' => '', + 'blog_post_title_color' => '', + 'blog_post_title_hover_color' => '', + 'entry_meta_text_color' => '#595959', + 'entry_meta_link_color' => '#595959', + 'entry_meta_link_color_hover' => '#1e73be', + 'h1_color' => '', + 'h2_color' => '', + 'h3_color' => '', + 'h4_color' => '', + 'h5_color' => '', + 'h6_color' => '', + 'sidebar_widget_background_color' => '#ffffff', + 'sidebar_widget_text_color' => '', + 'sidebar_widget_link_color' => '', + 'sidebar_widget_link_hover_color' => '', + 'sidebar_widget_title_color' => '#000000', + 'footer_widget_background_color' => '#ffffff', + 'footer_widget_text_color' => '', + 'footer_widget_link_color' => '', + 'footer_widget_link_hover_color' => '', + 'footer_widget_title_color' => '#000000', + 'footer_background_color' => '#222222', + 'footer_text_color' => '#ffffff', + 'footer_link_color' => '#ffffff', + 'footer_link_hover_color' => '#606060', + 'form_background_color' => '#fafafa', + 'form_text_color' => '#666666', + 'form_background_color_focus' => '#ffffff', + 'form_text_color_focus' => '#666666', + 'form_border_color' => '#cccccc', + 'form_border_color_focus' => '#bfbfbf', + 'form_button_background_color' => '#666666', + 'form_button_background_color_hover' => '#3f3f3f', + 'form_button_text_color' => '#ffffff', + 'form_button_text_color_hover' => '#ffffff', + 'back_to_top_background_color' => 'rgba( 0,0,0,0.4 )', + 'back_to_top_background_color_hover' => 'rgba( 0,0,0,0.6 )', + 'back_to_top_text_color' => '#ffffff', + 'back_to_top_text_color_hover' => '#ffffff', + ) + ); + } +} + +if ( ! function_exists( 'generate_get_default_fonts' ) ) { + /** + * Set default options. + * + * @since 0.1 + * + * @param bool $filter Whether to return the filtered values or original values. + * @return array Option defaults. + */ + function generate_get_default_fonts( $filter = true ) { + $defaults = array( + 'font_body' => 'System Stack', + 'font_body_category' => '', + 'font_body_variants' => '', + 'body_font_weight' => 'normal', + 'body_font_transform' => 'none', + 'body_font_size' => '17', + 'body_line_height' => '1.5', // no unit + 'paragraph_margin' => '1.5', // em + 'font_top_bar' => 'inherit', + 'font_top_bar_category' => '', + 'font_top_bar_variants' => '', + 'top_bar_font_weight' => 'normal', + 'top_bar_font_transform' => 'none', + 'top_bar_font_size' => '13', + 'font_site_title' => 'inherit', + 'font_site_title_category' => '', + 'font_site_title_variants' => '', + 'site_title_font_weight' => 'bold', + 'site_title_font_transform' => 'none', + 'site_title_font_size' => '45', + 'mobile_site_title_font_size' => '30', + 'font_site_tagline' => 'inherit', + 'font_site_tagline_category' => '', + 'font_site_tagline_variants' => '', + 'site_tagline_font_weight' => 'normal', + 'site_tagline_font_transform' => 'none', + 'site_tagline_font_size' => '15', + 'font_navigation' => 'inherit', + 'font_navigation_category' => '', + 'font_navigation_variants' => '', + 'navigation_font_weight' => 'normal', + 'navigation_font_transform' => 'none', + 'navigation_font_size' => '15', + 'font_widget_title' => 'inherit', + 'font_widget_title_category' => '', + 'font_widget_title_variants' => '', + 'widget_title_font_weight' => 'normal', + 'widget_title_font_transform' => 'none', + 'widget_title_font_size' => '20', + 'widget_title_separator' => '30', + 'widget_content_font_size' => '17', + 'font_buttons' => 'inherit', + 'font_buttons_category' => '', + 'font_buttons_variants' => '', + 'buttons_font_weight' => 'normal', + 'buttons_font_transform' => 'none', + 'buttons_font_size' => '', + 'font_heading_1' => 'inherit', + 'font_heading_1_category' => '', + 'font_heading_1_variants' => '', + 'heading_1_weight' => '300', + 'heading_1_transform' => 'none', + 'heading_1_font_size' => '40', + 'heading_1_line_height' => '1.2', // em + 'heading_1_margin_bottom' => '20', + 'mobile_heading_1_font_size' => '30', + 'font_heading_2' => 'inherit', + 'font_heading_2_category' => '', + 'font_heading_2_variants' => '', + 'heading_2_weight' => '300', + 'heading_2_transform' => 'none', + 'heading_2_font_size' => '30', + 'heading_2_line_height' => '1.2', // em + 'heading_2_margin_bottom' => '20', + 'mobile_heading_2_font_size' => '25', + 'font_heading_3' => 'inherit', + 'font_heading_3_category' => '', + 'font_heading_3_variants' => '', + 'heading_3_weight' => 'normal', + 'heading_3_transform' => 'none', + 'heading_3_font_size' => '20', + 'heading_3_line_height' => '1.2', // em + 'heading_3_margin_bottom' => '20', + 'font_heading_4' => 'inherit', + 'font_heading_4_category' => '', + 'font_heading_4_variants' => '', + 'heading_4_weight' => 'normal', + 'heading_4_transform' => 'none', + 'heading_4_font_size' => '', + 'heading_4_line_height' => '', // em + 'font_heading_5' => 'inherit', + 'font_heading_5_category' => '', + 'font_heading_5_variants' => '', + 'heading_5_weight' => 'normal', + 'heading_5_transform' => 'none', + 'heading_5_font_size' => '', + 'heading_5_line_height' => '', // em + 'font_heading_6' => 'inherit', + 'font_heading_6_category' => '', + 'font_heading_6_variants' => '', + 'heading_6_weight' => 'normal', + 'heading_6_transform' => 'none', + 'heading_6_font_size' => '', + 'heading_6_line_height' => '', // em + 'font_footer' => 'inherit', + 'font_footer_category' => '', + 'font_footer_variants' => '', + 'footer_weight' => 'normal', + 'footer_transform' => 'none', + 'footer_font_size' => '15', + ); + + if ( $filter ) { + return apply_filters( 'generate_font_option_defaults', $defaults ); + } + + return $defaults; + } +} + +if ( ! function_exists( 'generate_spacing_get_defaults' ) ) { + /** + * Set the default options. + * + * @since 0.1 + * + * @param bool $filter Whether to return the filtered values or original values. + * @return array Option defaults. + */ + function generate_spacing_get_defaults( $filter = true ) { + $defaults = array( + 'top_bar_top' => '10', + 'top_bar_right' => '10', + 'top_bar_bottom' => '10', + 'top_bar_left' => '10', + 'header_top' => '40', + 'header_right' => '40', + 'header_bottom' => '40', + 'header_left' => '40', + 'menu_item' => '20', + 'menu_item_height' => '60', + 'sub_menu_item_height' => '10', + 'sub_menu_width' => '200', + 'content_top' => '40', + 'content_right' => '40', + 'content_bottom' => '40', + 'content_left' => '40', + 'mobile_content_top' => '30', + 'mobile_content_right' => '30', + 'mobile_content_bottom' => '30', + 'mobile_content_left' => '30', + 'separator' => '20', + 'mobile_separator' => '', + 'left_sidebar_width' => '25', + 'right_sidebar_width' => '25', + 'widget_top' => '40', + 'widget_right' => '40', + 'widget_bottom' => '40', + 'widget_left' => '40', + 'footer_widget_container_top' => '40', + 'footer_widget_container_right' => '40', + 'footer_widget_container_bottom' => '40', + 'footer_widget_container_left' => '40', + 'footer_widget_separator' => '40', + 'footer_top' => '20', + 'footer_right' => '20', + 'footer_bottom' => '20', + 'footer_left' => '20', + ); + + if ( $filter ) { + return apply_filters( 'generate_spacing_option_defaults', $defaults ); + } + + return $defaults; + } +} + +if ( ! function_exists( 'generate_typography_default_fonts' ) ) { + /** + * Set the default system fonts. + * + * @since 1.3.40 + */ + function generate_typography_default_fonts() { + $fonts = array( + 'inherit', + 'System Stack', + 'Arial, Helvetica, sans-serif', + 'Century Gothic', + 'Comic Sans MS', + 'Courier New', + 'Georgia, Times New Roman, Times, serif', + 'Helvetica', + 'Impact', + 'Lucida Console', + 'Lucida Sans Unicode', + 'Palatino Linotype', + 'Segoe UI, Helvetica Neue, Helvetica, sans-serif', + 'Tahoma, Geneva, sans-serif', + 'Trebuchet MS, Helvetica, sans-serif', + 'Verdana, Geneva, sans-serif', + ); + + return apply_filters( 'generate_typography_default_fonts', $fonts ); + } +} diff --git a/wp-content/themes/generatepress/inc/deprecated.php b/wp-content/themes/generatepress/inc/deprecated.php new file mode 100644 index 0000000..450d59b --- /dev/null +++ b/wp-content/themes/generatepress/inc/deprecated.php @@ -0,0 +1,712 @@ + apply_filters( 'generate_pagination_mid_size', 1 ), + 'prev_text' => __( '← Previous', 'generatepress' ), + 'next_text' => __( 'Next →', 'generatepress' ) + ) ); + } + } +} + +if ( ! function_exists( 'generate_additional_spacing' ) ) { + /** + * Add fallback CSS for our mobile search icon color + * @deprecated 1.3.47 + */ + function generate_additional_spacing() { + // No longer needed + } +} + +if ( ! function_exists( 'generate_mobile_search_spacing_fallback_css' ) ) { + /** + * Enqueue our mobile search icon color fallback CSS + * @deprecated 1.3.47 + */ + function generate_mobile_search_spacing_fallback_css() { + // No longer needed + } +} + +if ( ! function_exists( 'generate_addons_available' ) ) { + /** + * Check to see if there's any addons not already activated + * @since 1.0.9 + * @deprecated 1.3.47 + */ + function generate_addons_available() { + if ( defined( 'GP_PREMIUM_VERSION' ) ) { + return false; + } + } +} + +if ( ! function_exists( 'generate_no_addons' ) ) { + /** + * Check to see if no addons are activated + * @since 1.0.9 + * @deprecated 1.3.47 + */ + function generate_no_addons() { + if ( defined( 'GP_PREMIUM_VERSION' ) ) { + return false; + } + } +} + +if ( ! function_exists( 'generate_get_min_suffix' ) ) { + /** + * Figure out if we should use minified scripts or not + * @since 1.3.29 + * @deprecated 2.0 + */ + function generate_get_min_suffix() { + return defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + } +} + +if ( ! function_exists( 'generate_add_layout_meta_box' ) ) { + function generate_add_layout_meta_box() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_register_layout_meta_box()' ); + } +} + +if ( ! function_exists( 'generate_show_layout_meta_box' ) ) { + function generate_show_layout_meta_box() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_do_layout_meta_box()' ); + } +} + +if ( ! function_exists( 'generate_save_layout_meta' ) ) { + function generate_save_layout_meta() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_save_layout_meta_data()' ); + } +} + +if ( ! function_exists( 'generate_add_footer_widget_meta_box' ) ) { + function generate_add_footer_widget_meta_box() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_register_layout_meta_box()' ); + } +} + +if ( ! function_exists( 'generate_show_footer_widget_meta_box' ) ) { + function generate_show_footer_widget_meta_box() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_do_layout_meta_box()' ); + } +} + +if ( ! function_exists( 'generate_save_footer_widget_meta' ) ) { + function generate_save_footer_widget_meta() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_save_layout_meta_data()' ); + } +} + +if ( ! function_exists( 'generate_add_page_builder_meta_box' ) ) { + function generate_add_page_builder_meta_box() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_register_layout_meta_box()' ); + } +} + +if ( ! function_exists( 'generate_show_page_builder_meta_box' ) ) { + function generate_show_page_builder_meta_box() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_do_layout_meta_box()' ); + } +} + +if ( ! function_exists( 'generate_save_page_builder_meta' ) ) { + function generate_save_page_builder_meta() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_save_layout_meta_data()' ); + } +} + +if ( ! function_exists( 'generate_add_de_meta_box' ) ) { + function generate_add_de_meta_box() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_register_layout_meta_box()' ); + } +} + +if ( ! function_exists( 'generate_show_de_meta_box' ) ) { + function generate_show_de_meta_box() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_do_layout_meta_box()' ); + } +} + +if ( ! function_exists( 'generate_save_de_meta' ) ) { + function generate_save_de_meta() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_save_layout_meta_data()' ); + } +} + +if ( ! function_exists( 'generate_add_base_inline_css' ) ) { + function generate_add_base_inline_css() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_enqueue_dynamic_css()' ); + } +} + +if ( ! function_exists( 'generate_color_scripts' ) ) { + function generate_color_scripts() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_enqueue_dynamic_css()' ); + } +} + +if ( ! function_exists( 'generate_typography_scripts' ) ) { + function generate_typography_scripts() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_enqueue_dynamic_css()' ); + } +} + +if ( ! function_exists( 'generate_spacing_scripts' ) ) { + function generate_spacing_scripts() { + _deprecated_function( __FUNCTION__, '2.0', 'generate_enqueue_dynamic_css()' ); + } +} + +if ( ! function_exists( 'generate_get_setting' ) ) { + /** + * A wrapper function to get our settings. + * + * @since 1.3.40 + * + * @param string $option The option name to look up. + * @return string The option value. + * @todo Ability to specify different option name and defaults. + */ + function generate_get_setting( $setting ) { + return generate_get_option( $setting ); + } +} +if ( ! function_exists( 'generate_right_sidebar_class' ) ) { + /** + * Display the classes for the sidebar. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_right_sidebar_class( $class = '' ) { + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', generate_get_right_sidebar_class( $class ) ) . '"'; // WPCS: XSS ok, sanitization ok. + } +} + +if ( ! function_exists( 'generate_get_right_sidebar_class' ) ) { + /** + * Retrieve the classes for the sidebar. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ + function generate_get_right_sidebar_class( $class = '' ) { + + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + return apply_filters( 'generate_right_sidebar_class', $classes, $class ); + } +} + +if ( ! function_exists( 'generate_left_sidebar_class' ) ) { + /** + * Display the classes for the sidebar. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_left_sidebar_class( $class = '' ) { + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', generate_get_left_sidebar_class( $class ) ) . '"'; // WPCS: XSS ok, sanitization ok. + } +} + +if ( ! function_exists( 'generate_get_left_sidebar_class' ) ) { + /** + * Retrieve the classes for the sidebar. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ + function generate_get_left_sidebar_class( $class = '' ) { + + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + return apply_filters( 'generate_left_sidebar_class', $classes, $class ); + } +} + +if ( ! function_exists( 'generate_content_class' ) ) { + /** + * Display the classes for the content. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_content_class( $class = '' ) { + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', generate_get_content_class( $class ) ) . '"'; // WPCS: XSS ok, sanitization ok. + } +} + +if ( ! function_exists( 'generate_get_content_class' ) ) { + /** + * Retrieve the classes for the content. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ + function generate_get_content_class( $class = '' ) { + + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + return apply_filters( 'generate_content_class', $classes, $class ); + } +} + +if ( ! function_exists( 'generate_header_class' ) ) { + /** + * Display the classes for the header. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_header_class( $class = '' ) { + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', generate_get_header_class( $class ) ) . '"'; // WPCS: XSS ok, sanitization ok. + } +} + +if ( ! function_exists( 'generate_get_header_class' ) ) { + /** + * Retrieve the classes for the content. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ + function generate_get_header_class( $class = '' ) { + + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + return apply_filters( 'generate_header_class', $classes, $class ); + } +} + +if ( ! function_exists( 'generate_inside_header_class' ) ) { + /** + * Display the classes for inside the header. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_inside_header_class( $class = '' ) { + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', generate_get_inside_header_class( $class ) ) . '"'; // WPCS: XSS ok, sanitization ok. + } +} + +if ( ! function_exists( 'generate_get_inside_header_class' ) ) { + /** + * Retrieve the classes for inside the header. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ + function generate_get_inside_header_class( $class = '' ) { + + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + return apply_filters( 'generate_inside_header_class', $classes, $class ); + } +} + +if ( ! function_exists( 'generate_container_class' ) ) { + /** + * Display the classes for the container. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_container_class( $class = '' ) { + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', generate_get_container_class( $class ) ) . '"'; // WPCS: XSS ok, sanitization ok. + } +} + +if ( ! function_exists( 'generate_get_container_class' ) ) { + /** + * Retrieve the classes for the content. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ + function generate_get_container_class( $class = '' ) { + + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + return apply_filters( 'generate_container_class', $classes, $class ); + } +} + +if ( ! function_exists( 'generate_navigation_class' ) ) { + /** + * Display the classes for the navigation. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_navigation_class( $class = '' ) { + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', generate_get_navigation_class( $class ) ) . '"'; // WPCS: XSS ok, sanitization ok. + } +} + +if ( ! function_exists( 'generate_get_navigation_class' ) ) { + /** + * Retrieve the classes for the navigation. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ + function generate_get_navigation_class( $class = '' ) { + + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + return apply_filters( 'generate_navigation_class', $classes, $class ); + } +} + +if ( ! function_exists( 'generate_inside_navigation_class' ) ) { + /** + * Display the classes for the inner navigation. + * + * @since 1.3.41 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_inside_navigation_class( $class = '' ) { + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + $return = apply_filters( 'generate_inside_navigation_class', $classes, $class ); + + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', $return ) . '"'; // WPCS: XSS ok, sanitization ok. + } +} + +if ( ! function_exists( 'generate_menu_class' ) ) { + /** + * Display the classes for the navigation. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_menu_class( $class = '' ) { + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', generate_get_menu_class( $class ) ) . '"'; // WPCS: XSS ok, sanitization ok. + } +} + +if ( ! function_exists( 'generate_get_menu_class' ) ) { + /** + * Retrieve the classes for the navigation. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ + function generate_get_menu_class( $class = '' ) { + + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + return apply_filters( 'generate_menu_class', $classes, $class ); + } +} + +if ( ! function_exists( 'generate_main_class' ) ) { + /** + * Display the classes for the
            container. + * + * @since 1.1.0 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_main_class( $class = '' ) { + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', generate_get_main_class( $class ) ) . '"'; // WPCS: XSS ok, sanitization ok. + } +} + +if ( ! function_exists( 'generate_get_main_class' ) ) { + /** + * Retrieve the classes for the footer. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ + function generate_get_main_class( $class = '' ) { + + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + return apply_filters( 'generate_main_class', $classes, $class ); + } +} + +if ( ! function_exists( 'generate_footer_class' ) ) { + /** + * Display the classes for the footer. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_footer_class( $class = '' ) { + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', generate_get_footer_class( $class ) ) . '"'; // WPCS: XSS ok, sanitization ok. + } +} + +if ( ! function_exists( 'generate_get_footer_class' ) ) { + /** + * Retrieve the classes for the footer. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + * @return array Array of classes. + */ + function generate_get_footer_class( $class = '' ) { + + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + return apply_filters( 'generate_footer_class', $classes, $class ); + } +} + +if ( ! function_exists( 'generate_inside_footer_class' ) ) { + /** + * Display the classes for the footer. + * + * @since 0.1 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_inside_footer_class( $class = '' ) { + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + $return = apply_filters( 'generate_inside_footer_class', $classes, $class ); + + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', $return ) . '"'; // WPCS: XSS ok, sanitization ok. + } +} + +if ( ! function_exists( 'generate_top_bar_class' ) ) { + /** + * Display the classes for the top bar. + * + * @since 1.3.45 + * @param string|array $class One or more classes to add to the class list. + */ + function generate_top_bar_class( $class = '' ) { + $classes = array(); + + if ( ! empty( $class ) ) { + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + + $classes = array_merge( $classes, $class ); + } + + $classes = array_map( 'esc_attr', $classes ); + + $return = apply_filters( 'generate_top_bar_class', $classes, $class ); + + // Separates classes with a single space, collates classes for post DIV + echo 'class="' . join( ' ', $return ) . '"'; // WPCS: XSS ok, sanitization ok. + } +} + +if ( ! function_exists( 'generate_body_schema' ) ) { + /** + * Figure out which schema tags to apply to the element. + * + * @since 1.3.15 + */ + function generate_body_schema() { + // Set up blog variable + $blog = ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) ? true : false; + + // Set up default itemtype + $itemtype = 'WebPage'; + + // Get itemtype for the blog + $itemtype = ( $blog ) ? 'Blog' : $itemtype; + + // Get itemtype for search results + $itemtype = ( is_search() ) ? 'SearchResultsPage' : $itemtype; + + // Get the result + $result = esc_html( apply_filters( 'generate_body_itemtype', $itemtype ) ); + + // Return our HTML + echo "itemtype='https://schema.org/$result' itemscope='itemscope'"; // WPCS: XSS ok, sanitization ok. + } +} + +if ( ! function_exists( 'generate_article_schema' ) ) { + /** + * Figure out which schema tags to apply to the
            element + * The function determines the itemtype: generate_article_schema( 'BlogPosting' ) + * @since 1.3.15 + */ + function generate_article_schema( $type = 'CreativeWork' ) { + // Get the itemtype + $itemtype = esc_html( apply_filters( 'generate_article_itemtype', $type ) ); + + // Print the results + echo "itemtype='https://schema.org/$itemtype' itemscope='itemscope'"; // WPCS: XSS ok, sanitization ok. + } +} diff --git a/wp-content/themes/generatepress/inc/general.php b/wp-content/themes/generatepress/inc/general.php new file mode 100644 index 0000000..624ac3b --- /dev/null +++ b/wp-content/themes/generatepress/inc/general.php @@ -0,0 +1,350 @@ + esc_attr__( 'Open Search Bar', 'generatepress' ), + 'close' => esc_attr__( 'Close Search Bar', 'generatepress' ), + ) + ); + } + + if ( 'enable' === generate_get_option( 'back_to_top' ) ) { + wp_enqueue_script( 'generate-back-to-top', $dir_uri . "/js/back-to-top{$suffix}.js", array(), GENERATE_VERSION, true ); + } + + if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { + wp_enqueue_script( 'comment-reply' ); + } + } +} + +if ( ! function_exists( 'generate_widgets_init' ) ) { + add_action( 'widgets_init', 'generate_widgets_init' ); + /** + * Register widgetized area and update sidebar with default widgets + */ + function generate_widgets_init() { + $widgets = array( + 'sidebar-1' => __( 'Right Sidebar', 'generatepress' ), + 'sidebar-2' => __( 'Left Sidebar', 'generatepress' ), + 'header' => __( 'Header', 'generatepress' ), + 'footer-1' => __( 'Footer Widget 1', 'generatepress' ), + 'footer-2' => __( 'Footer Widget 2', 'generatepress' ), + 'footer-3' => __( 'Footer Widget 3', 'generatepress' ), + 'footer-4' => __( 'Footer Widget 4', 'generatepress' ), + 'footer-5' => __( 'Footer Widget 5', 'generatepress' ), + 'footer-bar' => __( 'Footer Bar','generatepress' ), + 'top-bar' => __( 'Top Bar','generatepress' ), + ); + + foreach ( $widgets as $id => $name ) { + register_sidebar( array( + 'name' => $name, + 'id' => $id, + 'before_widget' => '', + 'before_title' => apply_filters( 'generate_start_widget_title', '

            ' ), + 'after_title' => apply_filters( 'generate_end_widget_title', '

            ' ), + ) ); + } + } +} + +if ( ! function_exists( 'generate_smart_content_width' ) ) { + add_action( 'wp', 'generate_smart_content_width' ); + /** + * Set the $content_width depending on layout of current page + * Hook into "wp" so we have the correct layout setting from generate_get_layout() + * Hooking into "after_setup_theme" doesn't get the correct layout setting + */ + function generate_smart_content_width() { + global $content_width; + + $container_width = generate_get_option( 'container_width' ); + $right_sidebar_width = apply_filters( 'generate_right_sidebar_width', '25' ); + $left_sidebar_width = apply_filters( 'generate_left_sidebar_width', '25' ); + $layout = generate_get_layout(); + + if ( 'left-sidebar' == $layout ) { + $content_width = $container_width * ( ( 100 - $left_sidebar_width ) / 100 ); + } elseif ( 'right-sidebar' == $layout ) { + $content_width = $container_width * ( ( 100 - $right_sidebar_width ) / 100 ); + } elseif ( 'no-sidebar' == $layout ) { + $content_width = $container_width; + } else { + $content_width = $container_width * ( ( 100 - ( $left_sidebar_width + $right_sidebar_width ) ) / 100 ); + } + } +} + +if ( ! function_exists( 'generate_page_menu_args' ) ) { + add_filter( 'wp_page_menu_args', 'generate_page_menu_args' ); + /** + * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. + * + * @since 0.1 + * + * @param array $args The existing menu args. + * @return array Menu args. + */ + function generate_page_menu_args( $args ) { + $args['show_home'] = true; + + return $args; + } +} + +if ( ! function_exists( 'generate_disable_title' ) ) { + add_filter( 'generate_show_title', 'generate_disable_title' ); + /** + * Remove our title if set. + * + * @since 1.3.18 + * + * @param bool $title Whether the title is displayed or not. + * @return bool Whether to display the content title. + */ + function generate_disable_title( $title ) { + if ( is_singular() ) { + $disable_title = get_post_meta( get_the_ID(), '_generate-disable-headline', true ); + + if ( $disable_title ) { + $title = false; + } + } + + return $title; + } +} + +if ( ! function_exists( 'generate_resource_hints' ) ) { + add_filter( 'wp_resource_hints', 'generate_resource_hints', 10, 2 ); + /** + * Add resource hints to our Google fonts call. + * + * @since 1.3.42 + * + * @param array $urls URLs to print for resource hints. + * @param string $relation_type The relation type the URLs are printed. + * @return array $urls URLs to print for resource hints. + */ + function generate_resource_hints( $urls, $relation_type ) { + if ( wp_style_is( 'generate-fonts', 'queue' ) && 'preconnect' === $relation_type ) { + if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { + $urls[] = array( + 'href' => 'https://fonts.gstatic.com', + 'crossorigin', + ); + } else { + $urls[] = 'https://fonts.gstatic.com'; + } + } + + return $urls; + } +} + +if ( ! function_exists( 'generate_remove_caption_padding' ) ) { + add_filter( 'img_caption_shortcode_width', 'generate_remove_caption_padding' ); + /** + * Remove WordPress's default padding on images with captions + * + * @param int $width Default WP .wp-caption width (image width + 10px) + * @return int Updated width to remove 10px padding + */ + function generate_remove_caption_padding( $width ) { + return $width - 10; + } +} + +if ( ! function_exists( 'generate_enhanced_image_navigation' ) ) { + add_filter( 'attachment_link', 'generate_enhanced_image_navigation', 10, 2 ); + /** + * Filter in a link to a content ID attribute for the next/previous image links on image attachment pages + */ + function generate_enhanced_image_navigation( $url, $id ) { + if ( ! is_attachment() && ! wp_attachment_is_image( $id ) ) { + return $url; + } + + $image = get_post( $id ); + if ( ! empty( $image->post_parent ) && $image->post_parent != $id ) { + $url .= '#main'; + } + + return $url; + } +} + +if ( ! function_exists( 'generate_categorized_blog' ) ) { + /** + * Determine whether blog/site has more than one category. + * + * @since 1.2.5 + * + * @return bool True of there is more than one category, false otherwise. + */ + function generate_categorized_blog() { + if ( false === ( $all_the_cool_cats = get_transient( 'generate_categories' ) ) ) { + // Create an array of all the categories that are attached to posts. + $all_the_cool_cats = get_categories( array( + 'fields' => 'ids', + 'hide_empty' => 1, + + // We only need to know if there is more than one category. + 'number' => 2, + ) ); + + // Count the number of categories that are attached to the posts. + $all_the_cool_cats = count( $all_the_cool_cats ); + + set_transient( 'generate_categories', $all_the_cool_cats ); + } + + if ( $all_the_cool_cats > 1 ) { + // This blog has more than 1 category so twentyfifteen_categorized_blog should return true. + return true; + } else { + // This blog has only 1 category so twentyfifteen_categorized_blog should return false. + return false; + } + } +} + +if ( ! function_exists( 'generate_category_transient_flusher' ) ) { + add_action( 'edit_category', 'generate_category_transient_flusher' ); + add_action( 'save_post', 'generate_category_transient_flusher' ); + /** + * Flush out the transients used in {@see generate_categorized_blog()}. + * + * @since 1.2.5 + */ + function generate_category_transient_flusher() { + // Like, beat it. Dig? + delete_transient( 'generate_categories' ); + } +} + +if ( ! function_exists( 'generate_get_default_color_palettes' ) ) { + /** + * Set up our colors for the color picker palettes and filter them so you can change them. + * + * @since 1.3.42 + */ + function generate_get_default_color_palettes() { + $palettes = array( + '#000000', + '#FFFFFF', + '#F1C40F', + '#E74C3C', + '#1ABC9C', + '#1e72bd', + '#8E44AD', + '#00CC77', + ); + + return apply_filters( 'generate_default_color_palettes', $palettes ); + } +} + +add_filter( 'generate_fontawesome_essentials', 'generate_set_font_awesome_essentials' ); +/** + * Check to see if we should include the full Font Awesome library or not. + * + * @since 2.0 + * + * @param bool $essentials + * @return bool + */ +function generate_set_font_awesome_essentials( $essentials ) { + if ( generate_get_option( 'font_awesome_essentials' ) ) { + return true; + } + + return $essentials; +} + +add_filter( 'generate_dynamic_css_skip_cache', 'generate_skip_dynamic_css_cache' ); +/** + * Skips caching of the dynamic CSS if set to false. + * + * @since 2.0 + * + * @param bool $cache + * @return bool + */ +function generate_skip_dynamic_css_cache( $cache ) { + if ( ! generate_get_option( 'dynamic_css_cache' ) ) { + return true; + } + + return $cache; +} + +add_filter( 'wp_headers', 'generate_set_wp_headers' ); +/** + * Set any necessary headers. + * + * @since 2.3 + */ +function generate_set_wp_headers( $headers ) { + $headers['X-UA-Compatible'] = 'IE=edge'; + + return $headers; +} diff --git a/wp-content/themes/generatepress/inc/markup.php b/wp-content/themes/generatepress/inc/markup.php new file mode 100644 index 0000000..fc48d70 --- /dev/null +++ b/wp-content/themes/generatepress/inc/markup.php @@ -0,0 +1,565 @@ + element + * @since 1.1.0 + */ + function generate_main_classes( $classes ) { + $classes[] = 'site-main'; + + return $classes; + } +} + +if ( ! function_exists( 'generate_post_classes' ) ) { + add_filter( 'post_class', 'generate_post_classes' ); + /** + * Adds custom classes to the
            element. + * Remove .hentry class from pages to comply with structural data guidelines. + * + * @since 1.3.39 + */ + function generate_post_classes( $classes ) { + if ( 'page' == get_post_type() ) { + $classes = array_diff( $classes, array( 'hentry' ) ); + } + + return $classes; + } +} diff --git a/wp-content/themes/generatepress/inc/meta-box.php b/wp-content/themes/generatepress/inc/meta-box.php new file mode 100644 index 0000000..23fdccd --- /dev/null +++ b/wp-content/themes/generatepress/inc/meta-box.php @@ -0,0 +1,315 @@ + true ) ); + $screen = get_current_screen(); + $post_type = $screen->id; + + if ( in_array( $post_type, ( array ) $post_types ) ) { + wp_enqueue_style( 'generate-layout-metabox', get_template_directory_uri() . '/css/admin/meta-box.css', array(), GENERATE_VERSION ); + } + } +} + +add_action( 'add_meta_boxes', 'generate_register_layout_meta_box' ); +/** + * Generate the layout metabox + * + * @since 2.0 + */ +function generate_register_layout_meta_box() { + if ( ! current_user_can( apply_filters( 'generate_metabox_capability', 'edit_theme_options' ) ) ) { + return; + } + + if ( ! defined( 'GENERATE_LAYOUT_META_BOX' ) ) { + define( 'GENERATE_LAYOUT_META_BOX', true ); + } + + $post_types = get_post_types( array( 'public' => true ) ); + + foreach ( $post_types as $type ) { + if ( 'attachment' !== $type ) { + add_meta_box( + 'generate_layout_options_meta_box', + esc_html__( 'Layout', 'generatepress' ), + 'generate_do_layout_meta_box', + $type, + 'side' + ); + } + } +} + +/** + * Build our meta box. + * + * @since 2.0 + * + * @param object $post All post information. + */ +function generate_do_layout_meta_box( $post ) { + wp_nonce_field( basename( __FILE__ ), 'generate_layout_nonce' ); + $stored_meta = (array) get_post_meta( $post->ID ); + $stored_meta['_generate-sidebar-layout-meta'][0] = ( isset( $stored_meta['_generate-sidebar-layout-meta'][0] ) ) ? $stored_meta['_generate-sidebar-layout-meta'][0] : ''; + $stored_meta['_generate-footer-widget-meta'][0] = ( isset( $stored_meta['_generate-footer-widget-meta'][0] ) ) ? $stored_meta['_generate-footer-widget-meta'][0] : ''; + $stored_meta['_generate-full-width-content'][0] = ( isset( $stored_meta['_generate-full-width-content'][0] ) ) ? $stored_meta['_generate-full-width-content'][0] : ''; + $stored_meta['_generate-disable-headline'][0] = ( isset( $stored_meta['_generate-disable-headline'][0] ) ) ? $stored_meta['_generate-disable-headline'][0] : ''; + + $tabs = apply_filters( 'generate_metabox_tabs', + array( + 'sidebars' => array( + 'title' => esc_html__( 'Sidebars', 'generatepress' ), + 'target' => '#generate-layout-sidebars', + 'class' => 'current', + ), + 'footer_widgets' => array( + 'title' => esc_html__( 'Footer Widgets', 'generatepress' ), + 'target' => '#generate-layout-footer-widgets', + 'class' => '', + ), + 'disable_elements' => array( + 'title' => esc_html__( 'Disable Elements', 'generatepress' ), + 'target' => '#generate-layout-disable-elements', + 'class' => '', + ), + 'container' => array( + 'title' => esc_html__( 'Page Builder Container', 'generatepress' ), + 'target' => '#generate-layout-page-builder-container', + 'class' => '', + ), + ) + ); + ?> + +
            + +
            +
            +
            + + + + + + + + + + + + + +
            +
            + + + + +
            +
            + 'Open Sans', + ) + ); + + $category = get_theme_mod( 'font_body_category', 'sans-serif' ); + $variants = get_theme_mod( 'font_body_variants', '300,300italic,regular,italic,600,600italic,700,700italic,800,800italic' ); + + if ( 'Open Sans' == $generate_settings['font_body'] ) { + $new_settings['font_body'] = 'Open Sans'; + set_theme_mod( 'font_body_category', $category ); + set_theme_mod( 'font_body_variants', $variants ); + } + } + + // Set blog post content to full content if it hasn't been set otherwise. + if ( ! isset( $migration_settings['blog_post_content_preview'] ) || 'true' !== $migration_settings['blog_post_content_preview'] ) { + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + array( + 'post_content' => 'full', + ) + ); + + if ( 'full' === $generate_settings['post_content'] ) { + $new_settings['post_content'] = 'full'; + } + } + + } + + // Set our flags. + if ( ! isset( $migration_settings['font_awesome_essentials_updated'] ) || 'true' !== $migration_settings['font_awesome_essentials_updated'] ) { + $migrated_flags['font_awesome_essentials_updated'] = 'true'; + } + + if ( ! isset( $migration_settings['skip_dynamic_css_cache'] ) || 'true' !== $migration_settings['skip_dynamic_css_cache'] ) { + $migrated_flags['skip_dynamic_css_cache'] = 'true'; + } + + if ( ! isset( $migration_settings['default_font_updated'] ) || 'true' !== $migration_settings['default_font_updated'] ) { + $migrated_flags['default_font_updated'] = 'true'; + } + + if ( ! isset( $migration_settings['blog_post_content_preview'] ) || 'true' !== $migration_settings['blog_post_content_preview'] ) { + $migrated_flags['blog_post_content_preview'] = 'true'; + } + + // Merge our new settings with our existing settings. + if ( ! empty( $new_settings ) ) { + $update_settings = wp_parse_args( $new_settings, $settings ); + update_option( 'generate_settings', $update_settings ); + } + + // Set our migrated setting flags. + if ( ! empty( $migrated_flags ) ) { + $update_migration_flags = wp_parse_args( $migrated_flags, $migration_settings ); + update_option( 'generate_migration_settings', $update_migration_flags ); + } +} diff --git a/wp-content/themes/generatepress/inc/plugin-compat.php b/wp-content/themes/generatepress/inc/plugin-compat.php new file mode 100644 index 0000000..c315e7a --- /dev/null +++ b/wp-content/themes/generatepress/inc/plugin-compat.php @@ -0,0 +1,268 @@ + +
            > +
            > + +
            > +
            + +
            + +
            + +
            +
            + +
            +
            + post_date ); + if ( $post_date < $compare_date ) { + $css = '.fl-builder.no-sidebar .container.grid-container { + max-width: 100%; + } + + .fl-builder.one-container.no-sidebar .site-content { + padding:0; + }'; + $css = str_replace( array( "\r", "\n", "\t" ), '', $css ); + wp_add_inline_style( 'generate-style', $css ); + } + } + } +} diff --git a/wp-content/themes/generatepress/inc/structure/archives.php b/wp-content/themes/generatepress/inc/structure/archives.php new file mode 100644 index 0000000..209cb9f --- /dev/null +++ b/wp-content/themes/generatepress/inc/structure/archives.php @@ -0,0 +1,116 @@ + +
            + + +

            + +

            + + +
            + %2$s', + get_avatar( get_the_author_meta( 'ID' ), 75 ), + get_the_author() + ); + /* + * Since we called the_post() above, we need to + * rewind the loop back to the beginning that way + * we can run the loop properly, in full. + */ + rewind_posts(); + } + + return $title; + + } +} + +add_action( 'generate_after_archive_title', 'generate_do_archive_description' ); +/** + * Output the archive description. + * + * @since 2.3 + */ +function generate_do_archive_description() { + $term_description = term_description(); + + if ( ! empty( $term_description ) ) { + printf( '
            %s
            ', $term_description ); // WPCS: XSS ok, sanitization ok. + } + + if ( get_the_author_meta( 'description' ) && is_author() ) { + echo '
            ' . get_the_author_meta( 'description' ) . '
            '; // WPCS: XSS ok, sanitization ok. + } + + /** + * generate_after_archive_description hook. + * + * @since 0.1 + */ + do_action( 'generate_after_archive_description' ); +} diff --git a/wp-content/themes/generatepress/inc/structure/comments.php b/wp-content/themes/generatepress/inc/structure/comments.php new file mode 100644 index 0000000..84df2d2 --- /dev/null +++ b/wp-content/themes/generatepress/inc/structure/comments.php @@ -0,0 +1,161 @@ +comment_type || 'trackback' == $comment->comment_type ) : ?> + +
          • > +
            + ', '' ); ?> +
            + + + +
          • > +
            > +
            + +
            +
            > + %s', get_comment_author_link() ); ?> +
            + + +
            + + comment_approved ) : ?> +

            + +
            + +
            + +
            +
            + 'div-comment', + 'depth' => $depth, + 'max_depth' => $args['max_depth'], + 'before' => '', + 'after' => '', + ) ) ); +} + +add_filter( 'comment_form_defaults', 'generate_set_comment_form_defaults' ); +/** + * Set the default settings for our comments. + * + * @since 2.3 + * + * @param array $defaults + * @return array + */ +function generate_set_comment_form_defaults( $defaults ) { + $defaults['comment_field'] = sprintf( + '

            ', + esc_html__( 'Comment', 'generatepress' ) + ); + + $defaults['comment_notes_before'] = null; + $defaults['comment_notes_after'] = null; + $defaults['id_form'] = 'commentform'; + $defaults['id_submit'] = 'submit'; + $defaults['title_reply'] = apply_filters( 'generate_leave_comment', __( 'Leave a Comment', 'generatepress' ) ); + $defaults['label_submit'] = apply_filters( 'generate_post_comment', __( 'Post Comment', 'generatepress' ) ); + + return $defaults; +} + +add_filter( 'comment_form_default_fields', 'generate_filter_comment_fields' ); +/** + * Customizes the existing comment fields. + * + * @since 2.1.2 + * @param array $fields + * @return array + */ +function generate_filter_comment_fields( $fields ) { + $commenter = wp_get_current_commenter(); + + $fields['author'] = sprintf( + '', + esc_html__( 'Name', 'generatepress' ), + esc_attr( $commenter['comment_author'] ) + ); + + $fields['email'] = sprintf( + '', + esc_html__( 'Email', 'generatepress' ), + esc_attr( $commenter['comment_author_email'] ) + ); + + $fields['url'] = sprintf( + '', + esc_html__( 'Website', 'generatepress' ), + esc_attr( $commenter['comment_author_url'] ) + ); + + return $fields; +} diff --git a/wp-content/themes/generatepress/inc/structure/featured-images.php b/wp-content/themes/generatepress/inc/structure/featured-images.php new file mode 100644 index 0000000..c807c1f --- /dev/null +++ b/wp-content/themes/generatepress/inc/structure/featured-images.php @@ -0,0 +1,112 @@ + + %3$s + + %2$s + +
          • ', + esc_url( get_permalink() ), + get_the_post_thumbnail( + get_the_ID(), + apply_filters( 'generate_page_header_default_size', 'full' ), + array( + 'itemprop' => 'image', + ) + ), + apply_filters( 'generate_inside_featured_image_output', '' ) + ) ); + } + } +} + +if ( ! function_exists( 'generate_featured_page_header_area' ) ) { + /** + * Build the page header. + * + * @since 1.0.7 + * + * @param string The featured image container class + */ + function generate_featured_page_header_area( $class ) { + // Don't run the function unless we're on a page it applies to. + if ( ! is_singular() ) { + return; + } + + // Don't run the function unless we have a post thumbnail. + if ( ! has_post_thumbnail() ) { + return; + } + ?> +
            + 'image', + ) + ); ?> +
            + +
            > +
            + + +
            +
            + + + © %1$s %2$s • %4$s ', + date( 'Y' ), + get_bloginfo( 'name' ), + esc_url( 'https://generatepress.com' ), + _x( 'Powered by', 'GeneratePress', 'generatepress' ), + __( 'GeneratePress', 'generatepress' ) + ); + + echo apply_filters( 'generate_copyright', $copyright ); // WPCS: XSS ok. + } +} + +/** + * Build our individual footer widgets. + * Displays a sample widget if no widget is found in the area. + * + * @since 2.0 + * + * @param int $widget_width The width class of our widget. + * @param int $widget The ID of our widget. + */ +function generate_do_footer_widget( $widget_width, $widget ) { + $widget_width = apply_filters( "generate_footer_widget_{$widget}_width", $widget_width ); + $tablet_widget_width = apply_filters( "generate_footer_widget_{$widget}_tablet_width", '50' ); + ?> + + + + + %5$s + %6$s + ', + esc_attr__( 'Scroll back to top', 'generatepress' ), + absint( apply_filters( 'generate_back_to_top_scroll_speed', 400 ) ), + absint( apply_filters( 'generate_back_to_top_start_scroll', 300 ) ), + esc_attr( apply_filters( 'generate_back_to_top_icon', 'fa-angle-up' ) ), + esc_html__( 'Scroll back to top', 'generatepress' ), + generate_get_svg_icon( 'arrow' ) + ) ); + } +} diff --git a/wp-content/themes/generatepress/inc/structure/header.php b/wp-content/themes/generatepress/inc/structure/header.php new file mode 100644 index 0000000..1396a50 --- /dev/null +++ b/wp-content/themes/generatepress/inc/structure/header.php @@ -0,0 +1,310 @@ + +
            > +
            > + +
            +
            + 'header-image', + 'alt' => esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ), + 'src' => $logo_url, + 'title' => esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ), + ) ); + + if ( '' !== $retina_logo_url ) { + $attr['srcset'] = $logo_url . ' 1x, ' . $retina_logo_url . ' 2x'; + + // Add dimensions to image if retina is set. This fixes a container width bug in Firefox. + if ( function_exists( 'the_custom_logo' ) && get_theme_mod( 'custom_logo' ) ) { + $data = wp_get_attachment_metadata( get_theme_mod( 'custom_logo' ) ); + + if ( ! empty( $data ) ) { + $attr['width'] = $data['width']; + $attr['height'] = $data['height']; + } + } + } + + $attr = array_map( 'esc_attr', $attr ); + + $html_attr = ''; + foreach ( $attr as $name => $value ) { + $html_attr .= " $name=" . '"' . $value . '"'; + } + + // Print our HTML. + echo apply_filters( 'generate_logo_output', sprintf( // WPCS: XSS ok, sanitization ok. + '', + esc_url( apply_filters( 'generate_logo_href' , home_url( '/' ) ) ), + esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ), + $html_attr + ), $logo_url, $html_attr ); + + /** + * generate_after_logo hook. + * + * @since 0.1 + */ + do_action( 'generate_after_logo' ); + } +} + +if ( ! function_exists( 'generate_construct_site_title' ) ) { + /** + * Build the site title and tagline. + * + * @since 1.3.28 + */ + function generate_construct_site_title() { + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_defaults() + ); + + // Get the title and tagline. + $title = get_bloginfo( 'title' ); + $tagline = get_bloginfo( 'description' ); + + // If the disable title checkbox is checked, or the title field is empty, return true. + $disable_title = ( '1' == $generate_settings['hide_title'] || '' == $title ) ? true : false; + + // If the disable tagline checkbox is checked, or the tagline field is empty, return true. + $disable_tagline = ( '1' == $generate_settings['hide_tagline'] || '' == $tagline ) ? true : false; + + // Build our site title. + $site_title = apply_filters( 'generate_site_title_output', sprintf( + '<%1$s class="main-title" itemprop="headline"> + + %3$s + + ', + ( is_front_page() && is_home() ) ? 'h1' : 'p', + esc_url( apply_filters( 'generate_site_title_href', home_url( '/' ) ) ), + get_bloginfo( 'name' ) + ) ); + + // Build our tagline. + $site_tagline = apply_filters( 'generate_site_description_output', sprintf( + '

            + %1$s +

            ', + html_entity_decode( get_bloginfo( 'description', 'display' ) ) + ) ); + + // Site title and tagline. + if ( false == $disable_title || false == $disable_tagline ) { + if ( generate_get_option( 'inline_logo_site_branding' ) && generate_has_logo_site_branding() ) { + echo '
            '; + generate_construct_logo(); + } + + echo apply_filters( 'generate_site_branding_output', sprintf( // WPCS: XSS ok, sanitization ok. + '
            + %1$s + %2$s +
            ', + ( ! $disable_title ) ? $site_title : '', + ( ! $disable_tagline ) ? $site_tagline : '' + ) ); + + if ( generate_get_option( 'inline_logo_site_branding' ) && generate_has_logo_site_branding() ) { + echo '
            '; + } + } + } +} + +add_filter( 'generate_header_items_order', 'generate_reorder_inline_site_branding' ); +/** + * Remove the logo from it's usual position. + * + * @since 2.3 + */ +function generate_reorder_inline_site_branding( $order ) { + if ( ! generate_get_option( 'inline_logo_site_branding' ) || ! generate_has_logo_site_branding() ) { + return $order; + } + + return array( + 'header-widget', + 'site-branding', + ); +} + +if ( ! function_exists( 'generate_construct_header_widget' ) ) { + /** + * Build the header widget. + * + * @since 1.3.28 + */ + function generate_construct_header_widget() { + if ( is_active_sidebar( 'header' ) ) : ?> +
            + +
            + +
            > +
            + +
            +
            + ' . "\n", esc_url( get_bloginfo( 'pingback_url' ) ) ); + } + } +} + +if ( ! function_exists( 'generate_add_viewport' ) ) { + add_action( 'wp_head', 'generate_add_viewport' ); + /** + * Add viewport to wp_head. + * + * @since 1.1.0 + */ + function generate_add_viewport() { + echo apply_filters( 'generate_meta_viewport', '' ); // WPCS: XSS ok. + } +} + +add_action( 'generate_before_header', 'generate_do_skip_to_content_link', 2 ); +/** + * Add skip to content link before the header. + * + * @since 2.0 + */ +function generate_do_skip_to_content_link() { + printf( '', + esc_attr__( 'Skip to content', 'generatepress' ), + esc_html__( 'Skip to content', 'generatepress' ) + ); +} diff --git a/wp-content/themes/generatepress/inc/structure/navigation.php b/wp-content/themes/generatepress/inc/structure/navigation.php new file mode 100644 index 0000000..7a8e9be --- /dev/null +++ b/wp-content/themes/generatepress/inc/structure/navigation.php @@ -0,0 +1,397 @@ + + + + + '; + generate_navigation_position(); + echo '
            '; + } + } +} + +if ( ! function_exists( 'generate_add_navigation_before_left_sidebar' ) ) { + add_action( 'generate_before_left_sidebar_content', 'generate_add_navigation_before_left_sidebar', 5 ); + function generate_add_navigation_before_left_sidebar() { + if ( 'nav-left-sidebar' == generate_get_navigation_location() ) { + echo '
            '; + generate_navigation_position(); + echo '
            '; + } + } +} + +if ( ! class_exists( 'Generate_Page_Walker' ) && class_exists( 'Walker_Page' ) ) { + /** + * Add current-menu-item to the current item if no theme location is set + * This means we don't have to duplicate CSS properties for current_page_item and current-menu-item + * + * @since 1.3.21 + */ + class Generate_Page_Walker extends Walker_Page { + function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) { + $css_class = array( 'page_item', 'page-item-' . $page->ID ); + $button = ''; + + if ( isset( $args['pages_with_children'][ $page->ID ] ) ) { + $css_class[] = 'menu-item-has-children'; + $icon = generate_get_svg_icon( 'arrow' ); + $button = '' . $icon . ''; + } + + if ( ! empty( $current_page ) ) { + $_current_page = get_post( $current_page ); + if ( $_current_page && in_array( $page->ID, $_current_page->ancestors ) ) { + $css_class[] = 'current-menu-ancestor'; + } + if ( $page->ID == $current_page ) { + $css_class[] = 'current-menu-item'; + } elseif ( $_current_page && $page->ID == $_current_page->post_parent ) { + $css_class[] = 'current-menu-parent'; + } + } elseif ( $page->ID == get_option( 'page_for_posts' ) ) { + $css_class[] = 'current-menu-parent'; + } + + $css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) ); + + $args['link_before'] = empty( $args['link_before'] ) ? '' : $args['link_before']; + $args['link_after'] = empty( $args['link_after'] ) ? '' : $args['link_after']; + + $output .= sprintf( + '
          • %s%s%s%s', + $css_classes, + get_permalink( $page->ID ), + $args['link_before'], + apply_filters( 'the_title', $page->post_title, $page->ID ), + $args['link_after'], + $button + ); + } + } +} + +if ( ! function_exists( 'generate_dropdown_icon_to_menu_link' ) ) { + add_filter( 'nav_menu_item_title', 'generate_dropdown_icon_to_menu_link', 10, 4 ); + /** + * Add dropdown icon if menu item has children. + * + * @since 1.3.42 + * + * @param string $title The menu item title. + * @param WP_Post $item All of our menu item data. + * @param stdClass $args All of our menu item args. + * @param int $dept Depth of menu item. + * @return string The menu item. + */ + function generate_dropdown_icon_to_menu_link( $title, $item, $args, $depth ) { + $role = 'presentation'; + $tabindex = ''; + + if ( 'click-arrow' === generate_get_option( 'nav_dropdown_type' ) ) { + $role = 'button'; + $tabindex = ' tabindex="0"'; + } + + if ( isset( $args->container_class ) && 'main-nav' === $args->container_class ) { + foreach ( $item->classes as $value ) { + if ( 'menu-item-has-children' === $value ) { + $icon = generate_get_svg_icon( 'arrow' ); + $title = $title . '' . $icon . ''; + } + } + } + + return $title; + } +} + +if ( ! function_exists( 'generate_navigation_search' ) ) { + add_action( 'generate_inside_navigation', 'generate_navigation_search' ); + /** + * Add the search bar to the navigation. + * + * @since 1.1.4 + */ + function generate_navigation_search() { + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_defaults() + ); + + if ( 'enable' !== $generate_settings['nav_search'] ) { + return; + } + + echo apply_filters( 'generate_navigation_search_output', sprintf( // WPCS: XSS ok, sanitization ok. + '', + esc_url( home_url( '/' ) ), + esc_attr( get_search_query() ), + esc_attr_x( 'Search', 'label', 'generatepress' ) + )); + } +} + +if ( ! function_exists( 'generate_menu_search_icon' ) ) { + add_filter( 'wp_nav_menu_items', 'generate_menu_search_icon', 10, 2 ); + /** + * Add search icon to primary menu if set + * + * @since 1.2.9.7 + * + * @param string $nav The HTML list content for the menu items. + * @param stdClass $args An object containing wp_nav_menu() arguments. + * @return string The search icon menu item. + */ + function generate_menu_search_icon( $nav, $args ) { + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_defaults() + ); + + // If the search icon isn't enabled, return the regular nav. + if ( 'enable' !== $generate_settings['nav_search'] ) { + return $nav; + } + + // If our primary menu is set, add the search icon. + if ( isset( $args->theme_location ) && 'primary' === $args->theme_location ) { + return sprintf( + '%1$s
          • %3$s
          • ', + $nav, + esc_attr__( 'Open Search Bar', 'generatepress' ), + generate_get_svg_icon( 'search', true ) + ); + } + + // Our primary menu isn't set, return the regular nav. + // In this case, the search icon is added to the generate_menu_fallback() function in navigation.php. + return $nav; + } +} + +if ( ! function_exists( 'generate_mobile_menu_search_icon' ) ) { + add_action( 'generate_inside_navigation', 'generate_mobile_menu_search_icon' ); + /** + * Add search icon to mobile menu bar + * + * @since 1.3.12 + */ + function generate_mobile_menu_search_icon() { + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_defaults() + ); + + // If the search icon isn't enabled, return the regular nav. + if ( 'enable' !== $generate_settings['nav_search'] ) { + return; + } + + ?> +
            + + + + + + +
            + + + post_parent ) : get_adjacent_post( false, '', true ); + $next = get_adjacent_post( false, '', false ); + + if ( ! $next && ! $previous ) { + return; + } + } + + // Don't print empty markup in archives if there's only one page. + if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) ) { + return; + } + + $nav_class = ( is_single() ) ? 'post-navigation' : 'paging-navigation'; + ?> + + %3$s'; + } + + return $template; + } +} + +/** + * Output requested post meta. + * + * @since 2.3 + * + * @param string $item The post meta item we're requesting + * @return The requested HTML. + */ +function generate_do_post_meta_item( $item ) { + if ( 'date' === $item ) { + $date = apply_filters( 'generate_post_date', true ); + + $time_string = ''; + + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $time_string = '' . $time_string; + } + + $time_string = sprintf( $time_string, + esc_attr( get_the_date( 'c' ) ), + esc_html( get_the_date() ), + esc_attr( get_the_modified_date( 'c' ) ), + esc_html( get_the_modified_date() ) + ); + + // If our date is enabled, show it. + if ( $date ) { + echo apply_filters( 'generate_post_date_output', + sprintf( // WPCS: XSS ok, sanitization ok. + '%1$s%4$s ', + apply_filters( 'generate_inside_post_meta_item_output', '', 'date' ), + esc_url( get_permalink() ), + esc_attr( get_the_time() ), + $time_string + ), + $time_string ); + } + } + + if ( 'author' === $item ) { + $author = apply_filters( 'generate_post_author', true ); + + if ( $author ) { + echo apply_filters( 'generate_post_author_output', + sprintf( ' ', + apply_filters( 'generate_inside_post_meta_item_output', '', 'author' ), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + /* translators: 1: Author name */ + esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ), + esc_html( get_the_author() ), + generate_get_microdata( 'post-author' ) + ) + ); + } + } + + if ( 'categories' === $item ) { + $categories = apply_filters( 'generate_show_categories', true ); + + $term_separator = apply_filters( 'generate_term_separator', _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ), 'categories' ); + $categories_list = get_the_category_list( $term_separator ); + + if ( $categories_list && $categories ) { + echo apply_filters( 'generate_category_list_output', + sprintf( '%3$s%1$s %2$s ', // WPCS: XSS ok, sanitization ok. + esc_html_x( 'Categories', 'Used before category names.', 'generatepress' ), + $categories_list, + apply_filters( 'generate_inside_post_meta_item_output', '', 'categories' ) + ) + ); + } + } + + if ( 'tags' === $item ) { + $tags = apply_filters( 'generate_show_tags', true ); + + $term_separator = apply_filters( 'generate_term_separator', _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ), 'tags' ); + $tags_list = get_the_tag_list( '', $term_separator ); + + if ( $tags_list && $tags ) { + echo apply_filters( 'generate_tag_list_output', + sprintf( '%3$s%1$s %2$s ', // WPCS: XSS ok, sanitization ok. + esc_html_x( 'Tags', 'Used before tag names.', 'generatepress' ), + $tags_list, + apply_filters( 'generate_inside_post_meta_item_output', '', 'tags' ) + ) + ); + } + } + + if ( 'comments-link' === $item ) { + $comments = apply_filters( 'generate_show_comments', true ); + + if ( $comments && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { + echo ''; + echo apply_filters( 'generate_inside_post_meta_item_output', '', 'comments-link' ); + comments_popup_link( __( 'Leave a comment', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ) ); + echo ' '; + } + } + + /** + * generate_post_meta_items hook. + * + * @since 2.4 + */ + do_action( 'generate_post_meta_items', $item ); +} + +add_filter( 'generate_inside_post_meta_item_output', 'generate_do_post_meta_prefix', 10, 2 ); +/** + * Add svg icons or text to our post meta output. + * + * @since 2.4 + */ +function generate_do_post_meta_prefix( $output, $item ) { + if ( 'author' === $item ) { + $output = __( 'by', 'generatepress' ) . ' '; + } + + if ( 'categories' === $item ) { + $output = generate_get_svg_icon( 'categories' ); + } + + if ( 'tags' === $item ) { + $output = generate_get_svg_icon( 'tags' ); + } + + if ( 'comments-link' === $item ) { + $output = generate_get_svg_icon( 'comments' ); + } + + return $output; +} + +if ( ! function_exists( 'generate_posted_on' ) ) { + /** + * Prints HTML with meta information for the current post-date/time and author. + * + * @since 0.1 + */ + function generate_posted_on() { + $items = apply_filters( 'generate_header_entry_meta_items', array( + 'date', + 'author', + ) ); + + foreach ( $items as $item ) { + generate_do_post_meta_item( $item ); + } + } +} + +if ( ! function_exists( 'generate_entry_meta' ) ) { + /** + * Prints HTML with meta information for the categories, tags. + * + * @since 1.2.5 + */ + function generate_entry_meta() { + $items = apply_filters( 'generate_footer_entry_meta_items', array( + 'categories', + 'tags', + 'comments-link', + ) ); + + foreach ( $items as $item ) { + generate_do_post_meta_item( $item ); + } + } +} + +if ( ! function_exists( 'generate_excerpt_more' ) ) { + add_filter( 'excerpt_more', 'generate_excerpt_more' ); + /** + * Prints the read more HTML to post excerpts. + * + * @since 0.1 + * + * @param string $more The string shown within the more link. + * @return string The HTML for the more link. + */ + function generate_excerpt_more( $more ) { + return apply_filters( 'generate_excerpt_more_output', sprintf( ' ... %3$s %4$s', + the_title_attribute( 'echo=0' ), + esc_url( get_permalink( get_the_ID() ) ), + __( 'Read more', 'generatepress' ), + '' . get_the_title() . '' + ) ); + } +} + +if ( ! function_exists( 'generate_content_more' ) ) { + add_filter( 'the_content_more_link', 'generate_content_more' ); + /** + * Prints the read more HTML to post content using the more tag. + * + * @since 0.1 + * + * @param string $more The string shown within the more link. + * @return string The HTML for the more link + */ + function generate_content_more( $more ) { + return apply_filters( 'generate_content_more_link_output', sprintf( '

            %3$s%4$s

            ', + the_title_attribute( 'echo=0' ), + esc_url( get_permalink( get_the_ID() ) . apply_filters( 'generate_more_jump','#more-' . get_the_ID() ) ), + __( 'Read more', 'generatepress' ), + '' . get_the_title() . '' + ) ); + } +} + +if ( ! function_exists( 'generate_post_meta' ) ) { + add_action( 'generate_after_entry_title', 'generate_post_meta' ); + /** + * Build the post meta. + * + * @since 1.3.29 + */ + function generate_post_meta() { + $post_types = apply_filters( 'generate_entry_meta_post_types', array( + 'post', + ) ); + + if ( in_array( get_post_type(), $post_types ) ) : ?> + + +
            + +
            + + + + + post_content, '' ) ); + + $format = ( false !== get_post_format() ) ? get_post_format() : 'standard'; + + $show_excerpt = ( 'excerpt' === generate_get_option( 'post_content' ) ) ? true : false; + + $show_excerpt = ( 'standard' !== $format ) ? false : $show_excerpt; + + $show_excerpt = ( $more_tag ) ? false : $show_excerpt; + + $show_excerpt = ( is_search() ) ? true : $show_excerpt; + + return apply_filters( 'generate_show_excerpt', $show_excerpt ); + } +} + +if ( ! function_exists( 'generate_show_title' ) ) { + /** + * Check to see if we should show our page/post title or not. + * + * @since 1.3.18 + * + * @return bool Whether to show the content title. + */ + function generate_show_title() { + return apply_filters( 'generate_show_title', true ); + } +} + +if ( ! function_exists( 'generate_get_premium_url' ) ) { + /** + * Generate a URL to our premium add-ons. + * Allows the use of a referral ID and campaign. + * + * @since 1.3.42 + * + * @param string $url URL to premium page. + * @param bool $trailing_slash Whether we want to include a trailing slash. + * @return string The URL to generatepress.com. + */ + function generate_get_premium_url( $url = 'https://generatepress.com/premium', $trailing_slash = true ) { + if ( $trailing_slash ) { + $url = trailingslashit( $url ); + } + + $args = apply_filters( 'generate_premium_url_args', array( + 'ref' => null, + 'campaign' => null, + ) ); + + if ( isset( $args['ref'] ) ) { + $url = add_query_arg( 'ref', absint( $args['ref'] ), $url ); + } + + if ( isset( $args['campaign'] ) ) { + $url = add_query_arg( 'campaign', sanitize_text_field( $args['campaign'] ), $url ); + } + + return esc_url( $url ); + } +} + +if ( ! function_exists( 'generate_padding_css' ) ) { + /** + * Shorten our padding/margin values into shorthand form. + * + * @since 0.1 + * + * @param int $top Top spacing. + * @param int $right Right spacing. + * @param int $bottom Bottom spacing. + * @param int $left Left spacing. + * @return string Element spacing values. + */ + function generate_padding_css( $top, $right, $bottom, $left ) { + $padding_top = ( isset( $top ) && '' !== $top ) ? absint( $top ) . 'px ' : '0px '; + $padding_right = ( isset( $right ) && '' !== $right ) ? absint( $right ) . 'px ' : '0px '; + $padding_bottom = ( isset( $bottom ) && '' !== $bottom ) ? absint( $bottom ) . 'px ' : '0px '; + $padding_left = ( isset( $left ) && '' !== $left ) ? absint( $left ) . 'px' : '0px'; + + if ( ( absint( $padding_top ) === absint( $padding_right ) ) && ( absint( $padding_right ) === absint( $padding_bottom ) ) && ( absint( $padding_bottom ) === absint( $padding_left ) ) ) { + return $padding_left; + } + + return $padding_top . $padding_right . $padding_bottom . $padding_left; + } +} + +if ( ! function_exists( 'generate_get_link_url' ) ) { + /** + * Return the post URL. + * + * Falls back to the post permalink if no URL is found in the post. + * + * @since 1.2.5 + * + * @see get_url_in_content() + * @return string The Link format URL. + */ + function generate_get_link_url() { + $has_url = get_url_in_content( get_the_content() ); + + return $has_url ? $has_url : apply_filters( 'the_permalink', get_permalink() ); + } +} + +if ( ! function_exists( 'generate_get_navigation_location' ) ) { + /** + * Get the location of the navigation and filter it. + * + * @since 1.3.41 + * + * @return string The primary menu location. + */ + function generate_get_navigation_location() { + return apply_filters( 'generate_navigation_location', generate_get_option( 'nav_position_setting' ) ); + } +} + +/** + * Check if the logo and site branding are active. + * + * @since 2.3 + */ +function generate_has_logo_site_branding() { + if ( get_theme_mod( 'custom_logo' ) && ( ! generate_get_option( 'hide_title' ) || ! generate_get_option( 'hide_tagline' ) ) ) { + return true; + } + + return false; +} + +/** + * Create SVG icons. + * + * @since 2.3 + */ +function generate_get_svg_icon( $icon, $replace = false ) { + if ( 'svg' !== generate_get_option( 'icons' ) ) { + return; + } + + $output = ''; + + if ( 'menu-bars' === $icon ) { + $output = ''; + } + + if ( 'close' === $icon ) { + $output = ''; + } + + if ( 'search' === $icon ) { + $output = ''; + } + + if ( 'categories' === $icon ) { + $output = ''; + } + + if ( 'tags' === $icon ) { + $output = ''; + } + + if ( 'comments' === $icon ) { + $output = ''; + } + + if ( 'arrow' === $icon ) { + $output = ''; + } + + if ( $replace ) { + $output .= ''; + } + + $output = apply_filters( 'generate_svg_icon_element', $output, $icon ); + + $classes = array( + 'gp-icon', + 'icon-' . $icon, + ); + + $output = sprintf( + '%2$s', + implode( ' ', $classes ), + $output + ); + + return apply_filters( 'generate_svg_icon', $output, $icon ); +} + +/** + * Out our icon HTML. + * + * @since 2.3 + * + * @param string $icon + * @param bool $replace Whether to include the close icon to be shown using JS. + * @return string + */ +function generate_do_svg_icon( $icon, $replace = false ) { + echo generate_get_svg_icon( $icon, $replace ); +} + +/** + * Get our media queries. + * + * @since 2.4 + * + * @param string $name + * @return string The full media query. + */ +function generate_get_media_query( $name ) { + $desktop = apply_filters( 'generate_desktop_media_query', '(min-width:1025px)' ); + $tablet = apply_filters( 'generate_tablet_media_query', '(min-width: 769px) and (max-width: 1024px)' ); + $mobile = apply_filters( 'generate_mobile_media_query', '(max-width:768px)' ); + $mobile_menu = apply_filters( 'generate_mobile_menu_media_query', $mobile ); + + $queries = apply_filters( 'generate_media_queries', array( + 'desktop' => $desktop, + 'tablet' => $tablet, + 'mobile' => $mobile, + 'mobile-menu' => $mobile_menu, + ) ); + + return $queries[ $name ]; +} diff --git a/wp-content/themes/generatepress/inc/typography.php b/wp-content/themes/generatepress/inc/typography.php new file mode 100644 index 0000000..1cc5527 --- /dev/null +++ b/wp-content/themes/generatepress/inc/typography.php @@ -0,0 +1,1076 @@ +register_control_type( 'Generate_Typography_Customize_Control' ); + $wp_customize->register_control_type( 'Generate_Range_Slider_Control' ); + } + + $wp_customize->add_section( + 'font_section', + array( + 'title' => __( 'Typography', 'generatepress' ), + 'capability' => 'edit_theme_options', + 'priority' => 30, + ) + ); + + $wp_customize->add_setting( + 'generate_settings[font_body]', + array( + 'default' => $defaults['font_body'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_body_category', + array( + 'default' => $defaults['font_body_category'], + 'sanitize_callback' => 'sanitize_text_field', + ) + ); + + $wp_customize->add_setting( + 'font_body_variants', + array( + 'default' => $defaults['font_body_variants'], + 'sanitize_callback' => 'generate_sanitize_variants', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[body_font_weight]', + array( + 'default' => $defaults['body_font_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_setting( + 'generate_settings[body_font_transform]', + array( + 'default' => $defaults['body_font_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage', + + ) + ); + + $wp_customize->add_control( + new Generate_Typography_Customize_Control( + $wp_customize, + 'body_typography', + array( + 'label' => __( 'Body', 'generatepress' ), + 'section' => 'font_section', + 'priority' => 1, + 'settings' => array( + 'family' => 'generate_settings[font_body]', + 'variant' => 'font_body_variants', + 'category' => 'font_body_category', + 'weight' => 'generate_settings[body_font_weight]', + 'transform' => 'generate_settings[body_font_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[body_font_size]', + array( + 'default' => $defaults['body_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_integer', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new Generate_Range_Slider_Control( + $wp_customize, + 'generate_settings[body_font_size]', + array( + 'type' => 'generatepress-range-slider', + 'description' => __( 'Font size', 'generatepress' ), + 'section' => 'font_section', + 'settings' => array( + 'desktop' => 'generate_settings[body_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 6, + 'max' => 25, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[body_line_height]', + array( + 'default' => $defaults['body_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_decimal_integer', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new Generate_Range_Slider_Control( + $wp_customize, + 'generate_settings[body_line_height]', + array( + 'type' => 'generatepress-range-slider', + 'description' => __( 'Line height', 'generatepress' ), + 'section' => 'font_section', + 'settings' => array( + 'desktop' => 'generate_settings[body_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 1, + 'max' => 3, + 'step' => .1, + 'edit' => true, + 'unit' => '', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[paragraph_margin]', + array( + 'default' => $defaults['paragraph_margin'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_decimal_integer', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new Generate_Range_Slider_Control( + $wp_customize, + 'generate_settings[paragraph_margin]', + array( + 'type' => 'generatepress-range-slider', + 'description' => __( 'Paragraph margin', 'generatepress' ), + 'section' => 'font_section', + 'settings' => array( + 'desktop' => 'generate_settings[paragraph_margin]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[font_heading_1]', + array( + 'default' => $defaults['font_heading_1'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_1_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_1_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_sanitize_variants' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_1_weight]', + array( + 'default' => $defaults['heading_1_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_1_transform]', + array( + 'default' => $defaults['heading_1_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new Generate_Typography_Customize_Control( + $wp_customize, + 'font_heading_1_control', + array( + 'label' => __( 'Heading 1 (H1)', 'generatepress' ), + 'section' => 'font_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_1]', + 'variant' => 'font_heading_1_variants', + 'category' => 'font_heading_1_category', + 'weight' => 'generate_settings[heading_1_weight]', + 'transform' => 'generate_settings[heading_1_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_1_font_size]', + array( + 'default' => $defaults['heading_1_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[mobile_heading_1_font_size]', + array( + 'default' => $defaults['mobile_heading_1_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new Generate_Range_Slider_Control( + $wp_customize, + 'h1_font_sizes', + array( + 'description' => __( 'Font size', 'generatepress' ), + 'section' => 'font_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_1_font_size]', + 'mobile' => 'generate_settings[mobile_heading_1_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 15, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 15, + 'max' => 100, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_1_line_height]', + array( + 'default' => $defaults['heading_1_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_decimal_integer', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new Generate_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_1_line_height]', + array( + 'description' => __( 'Line height', 'generatepress' ), + 'section' => 'font_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_1_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[font_heading_2]', + array( + 'default' => $defaults['font_heading_2'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_2_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_2_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_sanitize_variants' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_2_weight]', + array( + 'default' => $defaults['heading_2_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_2_transform]', + array( + 'default' => $defaults['heading_2_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new Generate_Typography_Customize_Control( + $wp_customize, + 'font_heading_2_control', + array( + 'label' => __( 'Heading 2 (H2)', 'generatepress' ), + 'section' => 'font_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_2]', + 'variant' => 'font_heading_2_variants', + 'category' => 'font_heading_2_category', + 'weight' => 'generate_settings[heading_2_weight]', + 'transform' => 'generate_settings[heading_2_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_2_font_size]', + array( + 'default' => $defaults['heading_2_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[mobile_heading_2_font_size]', + array( + 'default' => $defaults['mobile_heading_2_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_empty_absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new Generate_Range_Slider_Control( + $wp_customize, + 'h2_font_sizes', + array( + 'description' => __( 'Font size', 'generatepress' ), + 'section' => 'font_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_2_font_size]', + 'mobile' => 'generate_settings[mobile_heading_2_font_size]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + 'mobile' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_2_line_height]', + array( + 'default' => $defaults['heading_2_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_decimal_integer', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new Generate_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_2_line_height]', + array( + 'description' => __( 'Line height', 'generatepress' ), + 'section' => 'font_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_2_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[font_heading_3]', + array( + 'default' => $defaults['font_heading_3'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_3_category', + array( + 'default' => '', + 'sanitize_callback' => 'sanitize_text_field' + ) + ); + + $wp_customize->add_setting( + 'font_heading_3_variants', + array( + 'default' => '', + 'sanitize_callback' => 'generate_sanitize_variants' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_3_weight]', + array( + 'default' => $defaults['heading_3_weight'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_3_transform]', + array( + 'default' => $defaults['heading_3_transform'], + 'type' => 'option', + 'sanitize_callback' => 'sanitize_key', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new Generate_Typography_Customize_Control( + $wp_customize, + 'font_heading_3_control', + array( + 'label' => __( 'Heading 3 (H3)', 'generatepress' ), + 'section' => 'font_section', + 'settings' => array( + 'family' => 'generate_settings[font_heading_3]', + 'variant' => 'font_heading_3_variants', + 'category' => 'font_heading_3_category', + 'weight' => 'generate_settings[heading_3_weight]', + 'transform' => 'generate_settings[heading_3_transform]', + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_3_font_size]', + array( + 'default' => $defaults['heading_3_font_size'], + 'type' => 'option', + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new Generate_Range_Slider_Control( + $wp_customize, + 'h3_font_sizes', + array( + 'description' => __( 'Font size', 'generatepress' ), + 'section' => 'font_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_3_font_size]' + ), + 'choices' => array( + 'desktop' => array( + 'min' => 10, + 'max' => 80, + 'step' => 1, + 'edit' => true, + 'unit' => 'px', + ), + ), + ) + ) + ); + + $wp_customize->add_setting( + 'generate_settings[heading_3_line_height]', + array( + 'default' => $defaults['heading_3_line_height'], + 'type' => 'option', + 'sanitize_callback' => 'generate_sanitize_decimal_integer', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( + new Generate_Range_Slider_Control( + $wp_customize, + 'generate_settings[heading_3_line_height]', + array( + 'description' => __( 'Line height', 'generatepress' ), + 'section' => 'font_section', + 'settings' => array( + 'desktop' => 'generate_settings[heading_3_line_height]', + ), + 'choices' => array( + 'desktop' => array( + 'min' => 0, + 'max' => 5, + 'step' => .1, + 'edit' => true, + 'unit' => 'em', + ), + ), + ) + ) + ); + + if ( ! function_exists( 'generate_fonts_customize_register' ) && ! defined( 'GP_PREMIUM_VERSION' ) ) { + $wp_customize->add_control( + new Generate_Customize_Misc_Control( + $wp_customize, + 'typography_get_addon_desc', + array( + 'section' => 'font_section', + 'type' => 'addon', + 'label' => __( 'Learn more','generatepress' ), + 'description' => __( 'More options are available for this section in our premium version.', 'generatepress' ), + 'url' => generate_get_premium_url( 'https://generatepress.com/premium/#typography', false ), + 'priority' => 50, + 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname', + ) + ) + ); + } + } +} + +if ( ! function_exists( 'generate_get_all_google_fonts' ) ) { + /** + * Return an array of all of our Google Fonts. + * + * @since 1.3.0 + * @param string $amount How many fonts to return. + * @return array The list of Google Fonts. + */ + function generate_get_all_google_fonts( $amount = 'all' ) { + // Our big list Google Fonts + // We use json_decode to reduce PHP memory usage + // Adding them as a PHP array seems to use quite a bit more memory + $content = json_decode( '[{"family":"Roboto","category":"sans-serif","variants":["100","100italic","300","300italic","regular","italic","500","500italic","700","700italic","900","900italic"]},{"family":"Open Sans","category":"sans-serif","variants":["300","300italic","regular","italic","600","600italic","700","700italic","800","800italic"]},{"family":"Lato","category":"sans-serif","variants":["100","100italic","300","300italic","regular","italic","700","700italic","900","900italic"]},{"family":"Slabo 27px","category":"serif","variants":["regular"]},{"family":"Oswald","category":"sans-serif","variants":["200","300","regular","500","600","700"]},{"family":"Roboto Condensed","category":"sans-serif","variants":["300","300italic","regular","italic","700","700italic"]},{"family":"Source Sans Pro","category":"sans-serif","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","900","900italic"]},{"family":"Montserrat","category":"sans-serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Raleway","category":"sans-serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"PT Sans","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Roboto Slab","category":"serif","variants":["100","300","regular","700"]},{"family":"Merriweather","category":"serif","variants":["300","300italic","regular","italic","700","700italic","900","900italic"]},{"family":"Open Sans Condensed","category":"sans-serif","variants":["300","300italic","700"]},{"family":"Droid Sans","category":"sans-serif","variants":["regular","700"]},{"family":"Lora","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Ubuntu","category":"sans-serif","variants":["300","300italic","regular","italic","500","500italic","700","700italic"]},{"family":"Droid Serif","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Playfair Display","category":"serif","variants":["regular","italic","700","700italic","900","900italic"]},{"family":"Arimo","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Noto Sans","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"PT Serif","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Titillium Web","category":"sans-serif","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","900"]},{"family":"PT Sans Narrow","category":"sans-serif","variants":["regular","700"]},{"family":"Muli","category":"sans-serif","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Indie Flower","category":"handwriting","variants":["regular"]},{"family":"Bitter","category":"serif","variants":["regular","italic","700"]},{"family":"Poppins","category":"sans-serif","variants":["300","regular","500","600","700"]},{"family":"Inconsolata","category":"monospace","variants":["regular","700"]},{"family":"Dosis","category":"sans-serif","variants":["200","300","regular","500","600","700","800"]},{"family":"Fjalla One","category":"sans-serif","variants":["regular"]},{"family":"Oxygen","category":"sans-serif","variants":["300","regular","700"]},{"family":"Hind","category":"sans-serif","variants":["300","regular","500","600","700"]},{"family":"Cabin","category":"sans-serif","variants":["regular","italic","500","500italic","600","600italic","700","700italic"]},{"family":"Anton","category":"sans-serif","variants":["regular"]},{"family":"Arvo","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Noto Serif","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Crimson Text","category":"serif","variants":["regular","italic","600","600italic","700","700italic"]},{"family":"Lobster","category":"display","variants":["regular"]},{"family":"Yanone Kaffeesatz","category":"sans-serif","variants":["200","300","regular","700"]},{"family":"Nunito","category":"sans-serif","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Bree Serif","category":"serif","variants":["regular"]},{"family":"Catamaran","category":"sans-serif","variants":["100","200","300","regular","500","600","700","800","900"]},{"family":"Libre Baskerville","category":"serif","variants":["regular","italic","700"]},{"family":"Abel","category":"sans-serif","variants":["regular"]},{"family":"Josefin Sans","category":"sans-serif","variants":["100","100italic","300","300italic","regular","italic","600","600italic","700","700italic"]},{"family":"Fira Sans","category":"sans-serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Gloria Hallelujah","category":"handwriting","variants":["regular"]},{"family":"Abril Fatface","category":"display","variants":["regular"]},{"family":"Exo 2","category":"sans-serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Merriweather Sans","category":"sans-serif","variants":["300","300italic","regular","italic","700","700italic","800","800italic"]},{"family":"Pacifico","category":"handwriting","variants":["regular"]},{"family":"Roboto Mono","category":"monospace","variants":["100","100italic","300","300italic","regular","italic","500","500italic","700","700italic"]},{"family":"Varela Round","category":"sans-serif","variants":["regular"]},{"family":"Asap","category":"sans-serif","variants":["regular","italic","500","500italic","700","700italic"]},{"family":"Amatic SC","category":"handwriting","variants":["regular","700"]},{"family":"Quicksand","category":"sans-serif","variants":["300","regular","500","700"]},{"family":"Karla","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Ubuntu Condensed","category":"sans-serif","variants":["regular"]},{"family":"Signika","category":"sans-serif","variants":["300","regular","600","700"]},{"family":"Alegreya","category":"serif","variants":["regular","italic","700","700italic","900","900italic"]},{"family":"Questrial","category":"sans-serif","variants":["regular"]},{"family":"Rubik","category":"sans-serif","variants":["300","300italic","regular","italic","500","500italic","700","700italic","900","900italic"]},{"family":"Shadows Into Light","category":"handwriting","variants":["regular"]},{"family":"PT Sans Caption","category":"sans-serif","variants":["regular","700"]},{"family":"Archivo Narrow","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Play","category":"sans-serif","variants":["regular","700"]},{"family":"Cuprum","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Dancing Script","category":"handwriting","variants":["regular","700"]},{"family":"Rokkitt","category":"serif","variants":["100","200","300","regular","500","600","700","800","900"]},{"family":"Work Sans","category":"sans-serif","variants":["100","200","300","regular","500","600","700","800","900"]},{"family":"Francois One","category":"sans-serif","variants":["regular"]},{"family":"Vollkorn","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Source Code Pro","category":"monospace","variants":["200","300","regular","500","600","700","900"]},{"family":"Exo","category":"sans-serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Maven Pro","category":"sans-serif","variants":["regular","500","700","900"]},{"family":"Architects Daughter","category":"handwriting","variants":["regular"]},{"family":"Orbitron","category":"sans-serif","variants":["regular","500","700","900"]},{"family":"Pathway Gothic One","category":"sans-serif","variants":["regular"]},{"family":"Acme","category":"sans-serif","variants":["regular"]},{"family":"Ropa Sans","category":"sans-serif","variants":["regular","italic"]},{"family":"Patua One","category":"display","variants":["regular"]},{"family":"EB Garamond","category":"serif","variants":["regular"]},{"family":"Lobster Two","category":"display","variants":["regular","italic","700","700italic"]},{"family":"Crete Round","category":"serif","variants":["regular","italic"]},{"family":"Cinzel","category":"serif","variants":["regular","700","900"]},{"family":"Josefin Slab","category":"serif","variants":["100","100italic","300","300italic","regular","italic","600","600italic","700","700italic"]},{"family":"Source Serif Pro","category":"serif","variants":["regular","600","700"]},{"family":"Alegreya Sans","category":"sans-serif","variants":["100","100italic","300","300italic","regular","italic","500","500italic","700","700italic","800","800italic","900","900italic"]},{"family":"Comfortaa","category":"display","variants":["300","regular","700"]},{"family":"Russo One","category":"sans-serif","variants":["regular"]},{"family":"News Cycle","category":"sans-serif","variants":["regular","700"]},{"family":"ABeeZee","category":"sans-serif","variants":["regular","italic"]},{"family":"Yellowtail","category":"handwriting","variants":["regular"]},{"family":"Noticia Text","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Monda","category":"sans-serif","variants":["regular","700"]},{"family":"Quattrocento Sans","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Hammersmith One","category":"sans-serif","variants":["regular"]},{"family":"Libre Franklin","category":"sans-serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Satisfy","category":"handwriting","variants":["regular"]},{"family":"Pontano Sans","category":"sans-serif","variants":["regular"]},{"family":"Righteous","category":"display","variants":["regular"]},{"family":"Poiret One","category":"display","variants":["regular"]},{"family":"BenchNine","category":"sans-serif","variants":["300","regular","700"]},{"family":"Arapey","category":"serif","variants":["regular","italic"]},{"family":"Kaushan Script","category":"handwriting","variants":["regular"]},{"family":"Economica","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Kanit","category":"sans-serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Old Standard TT","category":"serif","variants":["regular","italic","700"]},{"family":"Sanchez","category":"serif","variants":["regular","italic"]},{"family":"Courgette","category":"handwriting","variants":["regular"]},{"family":"Quattrocento","category":"serif","variants":["regular","700"]},{"family":"Domine","category":"serif","variants":["regular","700"]},{"family":"Gudea","category":"sans-serif","variants":["regular","italic","700"]},{"family":"Permanent Marker","category":"handwriting","variants":["regular"]},{"family":"Armata","category":"sans-serif","variants":["regular"]},{"family":"Cantarell","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Archivo Black","category":"sans-serif","variants":["regular"]},{"family":"Istok Web","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Cardo","category":"serif","variants":["regular","italic","700"]},{"family":"Playfair Display SC","category":"serif","variants":["regular","italic","700","700italic","900","900italic"]},{"family":"Passion One","category":"display","variants":["regular","700","900"]},{"family":"Tinos","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Cookie","category":"handwriting","variants":["regular"]},{"family":"Cormorant Garamond","category":"serif","variants":["300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"]},{"family":"Philosopher","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Yantramanav","category":"sans-serif","variants":["100","300","regular","500","700","900"]},{"family":"Chewy","category":"display","variants":["regular"]},{"family":"Antic Slab","category":"serif","variants":["regular"]},{"family":"Handlee","category":"handwriting","variants":["regular"]},{"family":"Teko","category":"sans-serif","variants":["300","regular","500","600","700"]},{"family":"Boogaloo","category":"display","variants":["regular"]},{"family":"Vidaloka","category":"serif","variants":["regular"]},{"family":"Audiowide","category":"display","variants":["regular"]},{"family":"Coming Soon","category":"handwriting","variants":["regular"]},{"family":"Alfa Slab One","category":"display","variants":["regular"]},{"family":"Cabin Condensed","category":"sans-serif","variants":["regular","500","600","700"]},{"family":"Ruda","category":"sans-serif","variants":["regular","700","900"]},{"family":"Ek Mukta","category":"sans-serif","variants":["200","300","regular","500","600","700","800"]},{"family":"Changa One","category":"display","variants":["regular","italic"]},{"family":"Tangerine","category":"handwriting","variants":["regular","700"]},{"family":"Great Vibes","category":"handwriting","variants":["regular"]},{"family":"Sintony","category":"sans-serif","variants":["regular","700"]},{"family":"Khand","category":"sans-serif","variants":["300","regular","500","600","700"]},{"family":"Bevan","category":"display","variants":["regular"]},{"family":"Kalam","category":"handwriting","variants":["300","regular","700"]},{"family":"Days One","category":"sans-serif","variants":["regular"]},{"family":"Bangers","category":"display","variants":["regular"]},{"family":"Rajdhani","category":"sans-serif","variants":["300","regular","500","600","700"]},{"family":"Droid Sans Mono","category":"monospace","variants":["regular"]},{"family":"Kreon","category":"serif","variants":["300","regular","700"]},{"family":"Rambla","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Shrikhand","category":"display","variants":["regular"]},{"family":"Fredoka One","category":"display","variants":["regular"]},{"family":"Shadows Into Light Two","category":"handwriting","variants":["regular"]},{"family":"Playball","category":"display","variants":["regular"]},{"family":"Neuton","category":"serif","variants":["200","300","regular","italic","700","800"]},{"family":"Copse","category":"serif","variants":["regular"]},{"family":"Didact Gothic","category":"sans-serif","variants":["regular"]},{"family":"Signika Negative","category":"sans-serif","variants":["300","regular","600","700"]},{"family":"Amiri","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Gentium Book Basic","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Glegoo","category":"serif","variants":["regular","700"]},{"family":"Oleo Script","category":"display","variants":["regular","700"]},{"family":"Voltaire","category":"sans-serif","variants":["regular"]},{"family":"Actor","category":"sans-serif","variants":["regular"]},{"family":"Amaranth","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Paytone One","category":"sans-serif","variants":["regular"]},{"family":"Volkhov","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Sorts Mill Goudy","category":"serif","variants":["regular","italic"]},{"family":"Bad Script","category":"handwriting","variants":["regular"]},{"family":"Coda","category":"display","variants":["regular","800"]},{"family":"Damion","category":"handwriting","variants":["regular"]},{"family":"Sacramento","category":"handwriting","variants":["regular"]},{"family":"Squada One","category":"display","variants":["regular"]},{"family":"Rock Salt","category":"handwriting","variants":["regular"]},{"family":"Adamina","category":"serif","variants":["regular"]},{"family":"Alice","category":"serif","variants":["regular"]},{"family":"Cantata One","category":"serif","variants":["regular"]},{"family":"Luckiest Guy","category":"display","variants":["regular"]},{"family":"Rochester","category":"handwriting","variants":["regular"]},{"family":"Covered By Your Grace","category":"handwriting","variants":["regular"]},{"family":"Heebo","category":"sans-serif","variants":["100","300","regular","500","700","800","900"]},{"family":"VT323","category":"monospace","variants":["regular"]},{"family":"Nothing You Could Do","category":"handwriting","variants":["regular"]},{"family":"Patrick Hand","category":"handwriting","variants":["regular"]},{"family":"Gentium Basic","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Nobile","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Rancho","category":"handwriting","variants":["regular"]},{"family":"Marck Script","category":"handwriting","variants":["regular"]},{"family":"Special Elite","category":"display","variants":["regular"]},{"family":"Julius Sans One","category":"sans-serif","variants":["regular"]},{"family":"Varela","category":"sans-serif","variants":["regular"]},{"family":"PT Mono","category":"monospace","variants":["regular"]},{"family":"Alex Brush","category":"handwriting","variants":["regular"]},{"family":"Homemade Apple","category":"handwriting","variants":["regular"]},{"family":"Scada","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Jura","category":"sans-serif","variants":["300","regular","500","600"]},{"family":"Antic","category":"sans-serif","variants":["regular"]},{"family":"Gochi Hand","category":"handwriting","variants":["regular"]},{"family":"Sarala","category":"sans-serif","variants":["regular","700"]},{"family":"Electrolize","category":"sans-serif","variants":["regular"]},{"family":"Sigmar One","category":"display","variants":["regular"]},{"family":"Candal","category":"sans-serif","variants":["regular"]},{"family":"Prata","category":"serif","variants":["regular"]},{"family":"Homenaje","category":"sans-serif","variants":["regular"]},{"family":"Pinyon Script","category":"handwriting","variants":["regular"]},{"family":"Unica One","category":"display","variants":["regular"]},{"family":"Basic","category":"sans-serif","variants":["regular"]},{"family":"Neucha","category":"handwriting","variants":["regular"]},{"family":"Convergence","category":"sans-serif","variants":["regular"]},{"family":"Molengo","category":"sans-serif","variants":["regular"]},{"family":"Caveat Brush","category":"handwriting","variants":["regular"]},{"family":"Monoton","category":"display","variants":["regular"]},{"family":"Calligraffitti","category":"handwriting","variants":["regular"]},{"family":"Kameron","category":"serif","variants":["regular","700"]},{"family":"Share","category":"display","variants":["regular","italic","700","700italic"]},{"family":"Alegreya Sans SC","category":"sans-serif","variants":["100","100italic","300","300italic","regular","italic","500","500italic","700","700italic","800","800italic","900","900italic"]},{"family":"Enriqueta","category":"serif","variants":["regular","700"]},{"family":"Martel","category":"serif","variants":["200","300","regular","600","700","800","900"]},{"family":"Black Ops One","category":"display","variants":["regular"]},{"family":"Just Another Hand","category":"handwriting","variants":["regular"]},{"family":"Caveat","category":"handwriting","variants":["regular","700"]},{"family":"PT Serif Caption","category":"serif","variants":["regular","italic"]},{"family":"Ultra","category":"serif","variants":["regular"]},{"family":"Ubuntu Mono","category":"monospace","variants":["regular","italic","700","700italic"]},{"family":"Carme","category":"sans-serif","variants":["regular"]},{"family":"Cousine","category":"monospace","variants":["regular","italic","700","700italic"]},{"family":"Cherry Cream Soda","category":"display","variants":["regular"]},{"family":"Reenie Beanie","category":"handwriting","variants":["regular"]},{"family":"Hind Siliguri","category":"sans-serif","variants":["300","regular","500","600","700"]},{"family":"Bubblegum Sans","category":"display","variants":["regular"]},{"family":"Aldrich","category":"sans-serif","variants":["regular"]},{"family":"Lustria","category":"serif","variants":["regular"]},{"family":"Alef","category":"sans-serif","variants":["regular","700"]},{"family":"Freckle Face","category":"display","variants":["regular"]},{"family":"Fanwood Text","category":"serif","variants":["regular","italic"]},{"family":"Advent Pro","category":"sans-serif","variants":["100","200","300","regular","500","600","700"]},{"family":"Allura","category":"handwriting","variants":["regular"]},{"family":"Ceviche One","category":"display","variants":["regular"]},{"family":"Press Start 2P","category":"display","variants":["regular"]},{"family":"Overlock","category":"display","variants":["regular","italic","700","700italic","900","900italic"]},{"family":"Niconne","category":"handwriting","variants":["regular"]},{"family":"Limelight","category":"display","variants":["regular"]},{"family":"Frank Ruhl Libre","category":"sans-serif","variants":["300","regular","500","700","900"]},{"family":"Allerta Stencil","category":"sans-serif","variants":["regular"]},{"family":"Marcellus","category":"serif","variants":["regular"]},{"family":"Pragati Narrow","category":"sans-serif","variants":["regular","700"]},{"family":"Michroma","category":"sans-serif","variants":["regular"]},{"family":"Fauna One","category":"serif","variants":["regular"]},{"family":"Syncopate","category":"sans-serif","variants":["regular","700"]},{"family":"Telex","category":"sans-serif","variants":["regular"]},{"family":"Marvel","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Cabin Sketch","category":"display","variants":["regular","700"]},{"family":"Hanuman","category":"serif","variants":["regular","700"]},{"family":"Cairo","category":"sans-serif","variants":["200","300","regular","600","700","900"]},{"family":"Chivo","category":"sans-serif","variants":["300","300italic","regular","italic","700","700italic","900","900italic"]},{"family":"Allerta","category":"sans-serif","variants":["regular"]},{"family":"Fugaz One","category":"display","variants":["regular"]},{"family":"Viga","category":"sans-serif","variants":["regular"]},{"family":"Ruslan Display","category":"display","variants":["regular"]},{"family":"Nixie One","category":"display","variants":["regular"]},{"family":"Marmelad","category":"sans-serif","variants":["regular"]},{"family":"Average","category":"serif","variants":["regular"]},{"family":"Spinnaker","category":"sans-serif","variants":["regular"]},{"family":"Leckerli One","category":"handwriting","variants":["regular"]},{"family":"Judson","category":"serif","variants":["regular","italic","700"]},{"family":"Lusitana","category":"serif","variants":["regular","700"]},{"family":"Montserrat Alternates","category":"sans-serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Contrail One","category":"display","variants":["regular"]},{"family":"Oranienbaum","category":"serif","variants":["regular"]},{"family":"Hind Vadodara","category":"sans-serif","variants":["300","regular","500","600","700"]},{"family":"Rufina","category":"serif","variants":["regular","700"]},{"family":"Quantico","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Concert One","category":"display","variants":["regular"]},{"family":"Marcellus SC","category":"serif","variants":["regular"]},{"family":"Jockey One","category":"sans-serif","variants":["regular"]},{"family":"Parisienne","category":"handwriting","variants":["regular"]},{"family":"Carter One","category":"display","variants":["regular"]},{"family":"Arbutus Slab","category":"serif","variants":["regular"]},{"family":"Slabo 13px","category":"serif","variants":["regular"]},{"family":"Tauri","category":"sans-serif","variants":["regular"]},{"family":"Goudy Bookletter 1911","category":"serif","variants":["regular"]},{"family":"Carrois Gothic","category":"sans-serif","variants":["regular"]},{"family":"Sue Ellen Francisco","category":"handwriting","variants":["regular"]},{"family":"Walter Turncoat","category":"handwriting","variants":["regular"]},{"family":"Annie Use Your Telescope","category":"handwriting","variants":["regular"]},{"family":"Puritan","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Grand Hotel","category":"handwriting","variants":["regular"]},{"family":"Yesteryear","category":"handwriting","variants":["regular"]},{"family":"Jaldi","category":"sans-serif","variants":["regular","700"]},{"family":"Khula","category":"sans-serif","variants":["300","regular","600","700","800"]},{"family":"Cinzel Decorative","category":"display","variants":["regular","700","900"]},{"family":"Crafty Girls","category":"handwriting","variants":["regular"]},{"family":"Merienda","category":"handwriting","variants":["regular","700"]},{"family":"Hind Guntur","category":"sans-serif","variants":["300","regular","500","600","700"]},{"family":"Cutive","category":"serif","variants":["regular"]},{"family":"Prompt","category":"sans-serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Coustard","category":"serif","variants":["regular","900"]},{"family":"Arima Madurai","category":"display","variants":["100","200","300","regular","500","700","800","900"]},{"family":"Doppio One","category":"sans-serif","variants":["regular"]},{"family":"Radley","category":"serif","variants":["regular","italic"]},{"family":"Fontdiner Swanky","category":"display","variants":["regular"]},{"family":"Iceland","category":"display","variants":["regular"]},{"family":"Alegreya SC","category":"serif","variants":["regular","italic","700","700italic","900","900italic"]},{"family":"Halant","category":"serif","variants":["300","regular","500","600","700"]},{"family":"Schoolbell","category":"handwriting","variants":["regular"]},{"family":"Waiting for the Sunrise","category":"handwriting","variants":["regular"]},{"family":"Italianno","category":"handwriting","variants":["regular"]},{"family":"Fredericka the Great","category":"display","variants":["regular"]},{"family":"Average Sans","category":"sans-serif","variants":["regular"]},{"family":"Rosario","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Mr Dafoe","category":"handwriting","variants":["regular"]},{"family":"Port Lligat Slab","category":"serif","variants":["regular"]},{"family":"Aclonica","category":"sans-serif","variants":["regular"]},{"family":"Graduate","category":"display","variants":["regular"]},{"family":"Racing Sans One","category":"display","variants":["regular"]},{"family":"Berkshire Swash","category":"handwriting","variants":["regular"]},{"family":"Forum","category":"display","variants":["regular"]},{"family":"Anonymous Pro","category":"monospace","variants":["regular","italic","700","700italic"]},{"family":"Love Ya Like A Sister","category":"display","variants":["regular"]},{"family":"Nunito Sans","category":"sans-serif","variants":["200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Magra","category":"sans-serif","variants":["regular","700"]},{"family":"Lateef","category":"handwriting","variants":["regular"]},{"family":"Assistant","category":"sans-serif","variants":["200","300","regular","600","700","800"]},{"family":"Six Caps","category":"sans-serif","variants":["regular"]},{"family":"Gilda Display","category":"serif","variants":["regular"]},{"family":"Oregano","category":"display","variants":["regular","italic"]},{"family":"Metrophobic","category":"sans-serif","variants":["regular"]},{"family":"Lalezar","category":"display","variants":["regular"]},{"family":"Caudex","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Kelly Slab","category":"display","variants":["regular"]},{"family":"Reem Kufi","category":"sans-serif","variants":["regular"]},{"family":"Cambay","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Gruppo","category":"display","variants":["regular"]},{"family":"Give You Glory","category":"handwriting","variants":["regular"]},{"family":"GFS Didot","category":"serif","variants":["regular"]},{"family":"Duru Sans","category":"sans-serif","variants":["regular"]},{"family":"Andika","category":"sans-serif","variants":["regular"]},{"family":"Tenor Sans","category":"sans-serif","variants":["regular"]},{"family":"Knewave","category":"display","variants":["regular"]},{"family":"Averia Serif Libre","category":"display","variants":["300","300italic","regular","italic","700","700italic"]},{"family":"Eczar","category":"serif","variants":["regular","500","600","700","800"]},{"family":"Inder","category":"sans-serif","variants":["regular"]},{"family":"Martel Sans","category":"sans-serif","variants":["200","300","regular","600","700","800","900"]},{"family":"Trocchi","category":"serif","variants":["regular"]},{"family":"Wire One","category":"sans-serif","variants":["regular"]},{"family":"Petit Formal Script","category":"handwriting","variants":["regular"]},{"family":"Mako","category":"sans-serif","variants":["regular"]},{"family":"Frijole","category":"display","variants":["regular"]},{"family":"Zeyada","category":"handwriting","variants":["regular"]},{"family":"Slackey","category":"display","variants":["regular"]},{"family":"Karma","category":"serif","variants":["300","regular","500","600","700"]},{"family":"Mate","category":"serif","variants":["regular","italic"]},{"family":"Belleza","category":"sans-serif","variants":["regular"]},{"family":"Montez","category":"handwriting","variants":["regular"]},{"family":"Quando","category":"serif","variants":["regular"]},{"family":"Capriola","category":"sans-serif","variants":["regular"]},{"family":"Lilita One","category":"display","variants":["regular"]},{"family":"Trirong","category":"serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Lekton","category":"sans-serif","variants":["regular","italic","700"]},{"family":"Just Me Again Down Here","category":"handwriting","variants":["regular"]},{"family":"Bowlby One SC","category":"display","variants":["regular"]},{"family":"The Girl Next Door","category":"handwriting","variants":["regular"]},{"family":"Happy Monkey","category":"display","variants":["regular"]},{"family":"Merienda One","category":"handwriting","variants":["regular"]},{"family":"Alike","category":"serif","variants":["regular"]},{"family":"Chelsea Market","category":"display","variants":["regular"]},{"family":"Unkempt","category":"display","variants":["regular","700"]},{"family":"Anaheim","category":"sans-serif","variants":["regular"]},{"family":"Strait","category":"sans-serif","variants":["regular"]},{"family":"Brawler","category":"serif","variants":["regular"]},{"family":"Clicker Script","category":"handwriting","variants":["regular"]},{"family":"Delius","category":"handwriting","variants":["regular"]},{"family":"Mouse Memoirs","category":"sans-serif","variants":["regular"]},{"family":"IM Fell Double Pica","category":"serif","variants":["regular","italic"]},{"family":"Crushed","category":"display","variants":["regular"]},{"family":"Rammetto One","category":"display","variants":["regular"]},{"family":"Prosto One","category":"display","variants":["regular"]},{"family":"Kranky","category":"display","variants":["regular"]},{"family":"IM Fell English","category":"serif","variants":["regular","italic"]},{"family":"Aladin","category":"handwriting","variants":["regular"]},{"family":"Mr De Haviland","category":"handwriting","variants":["regular"]},{"family":"NTR","category":"sans-serif","variants":["regular"]},{"family":"Londrina Solid","category":"display","variants":["regular"]},{"family":"Skranji","category":"display","variants":["regular","700"]},{"family":"Allan","category":"display","variants":["regular","700"]},{"family":"Baumans","category":"display","variants":["regular"]},{"family":"Ovo","category":"serif","variants":["regular"]},{"family":"Changa","category":"sans-serif","variants":["200","300","regular","500","600","700","800"]},{"family":"Lemon","category":"display","variants":["regular"]},{"family":"Federo","category":"sans-serif","variants":["regular"]},{"family":"Herr Von Muellerhoff","category":"handwriting","variants":["regular"]},{"family":"Arizonia","category":"handwriting","variants":["regular"]},{"family":"Bowlby One","category":"display","variants":["regular"]},{"family":"Orienta","category":"sans-serif","variants":["regular"]},{"family":"Short Stack","category":"handwriting","variants":["regular"]},{"family":"Bungee Inline","category":"display","variants":["regular"]},{"family":"Andada","category":"serif","variants":["regular"]},{"family":"Baloo Paaji","category":"display","variants":["regular"]},{"family":"Oxygen Mono","category":"monospace","variants":["regular"]},{"family":"Yeseva One","category":"display","variants":["regular"]},{"family":"UnifrakturMaguntia","category":"display","variants":["regular"]},{"family":"Bentham","category":"serif","variants":["regular"]},{"family":"Londrina Outline","category":"display","variants":["regular"]},{"family":"Pompiere","category":"display","variants":["regular"]},{"family":"Gabriela","category":"serif","variants":["regular"]},{"family":"Qwigley","category":"handwriting","variants":["regular"]},{"family":"Nova Square","category":"display","variants":["regular"]},{"family":"Poly","category":"serif","variants":["regular","italic"]},{"family":"Sniglet","category":"display","variants":["regular","800"]},{"family":"Patrick Hand SC","category":"handwriting","variants":["regular"]},{"family":"Gravitas One","category":"display","variants":["regular"]},{"family":"Khmer","category":"display","variants":["regular"]},{"family":"Shojumaru","category":"display","variants":["regular"]},{"family":"Kurale","category":"serif","variants":["regular"]},{"family":"Gafata","category":"sans-serif","variants":["regular"]},{"family":"Biryani","category":"sans-serif","variants":["200","300","regular","600","700","800","900"]},{"family":"Cambo","category":"serif","variants":["regular"]},{"family":"Titan One","category":"display","variants":["regular"]},{"family":"Carrois Gothic SC","category":"sans-serif","variants":["regular"]},{"family":"La Belle Aurore","category":"handwriting","variants":["regular"]},{"family":"Holtwood One SC","category":"serif","variants":["regular"]},{"family":"Oleo Script Swash Caps","category":"display","variants":["regular","700"]},{"family":"Headland One","category":"serif","variants":["regular"]},{"family":"Cherry Swash","category":"display","variants":["regular","700"]},{"family":"Belgrano","category":"serif","variants":["regular"]},{"family":"Norican","category":"handwriting","variants":["regular"]},{"family":"Mountains of Christmas","category":"display","variants":["regular","700"]},{"family":"Julee","category":"handwriting","variants":["regular"]},{"family":"Ramabhadra","category":"sans-serif","variants":["regular"]},{"family":"Mallanna","category":"sans-serif","variants":["regular"]},{"family":"Kristi","category":"handwriting","variants":["regular"]},{"family":"Imprima","category":"sans-serif","variants":["regular"]},{"family":"Lily Script One","category":"display","variants":["regular"]},{"family":"Chau Philomene One","category":"sans-serif","variants":["regular","italic"]},{"family":"Bilbo Swash Caps","category":"handwriting","variants":["regular"]},{"family":"Finger Paint","category":"display","variants":["regular"]},{"family":"Voces","category":"display","variants":["regular"]},{"family":"Itim","category":"handwriting","variants":["regular"]},{"family":"Megrim","category":"display","variants":["regular"]},{"family":"Simonetta","category":"display","variants":["regular","italic","900","900italic"]},{"family":"Cutive Mono","category":"monospace","variants":["regular"]},{"family":"Stardos Stencil","category":"display","variants":["regular","700"]},{"family":"IM Fell DW Pica","category":"serif","variants":["regular","italic"]},{"family":"Unna","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Loved by the King","category":"handwriting","variants":["regular"]},{"family":"Prociono","category":"serif","variants":["regular"]},{"family":"Corben","category":"display","variants":["regular","700"]},{"family":"Amiko","category":"sans-serif","variants":["regular","600","700"]},{"family":"Denk One","category":"sans-serif","variants":["regular"]},{"family":"Palanquin","category":"sans-serif","variants":["100","200","300","regular","500","600","700"]},{"family":"Baloo","category":"display","variants":["regular"]},{"family":"Fondamento","category":"handwriting","variants":["regular","italic"]},{"family":"Seaweed Script","category":"display","variants":["regular"]},{"family":"Shanti","category":"sans-serif","variants":["regular"]},{"family":"Wendy One","category":"sans-serif","variants":["regular"]},{"family":"Raleway Dots","category":"display","variants":["regular"]},{"family":"Amethysta","category":"serif","variants":["regular"]},{"family":"Vast Shadow","category":"display","variants":["regular"]},{"family":"Stalemate","category":"handwriting","variants":["regular"]},{"family":"Fira Mono","category":"monospace","variants":["regular","500","700"]},{"family":"Expletus Sans","category":"display","variants":["regular","italic","500","500italic","600","600italic","700","700italic"]},{"family":"Scheherazade","category":"serif","variants":["regular","700"]},{"family":"Fenix","category":"serif","variants":["regular"]},{"family":"Delius Swash Caps","category":"handwriting","variants":["regular"]},{"family":"Rouge Script","category":"handwriting","variants":["regular"]},{"family":"Life Savers","category":"display","variants":["regular","700"]},{"family":"IM Fell English SC","category":"serif","variants":["regular"]},{"family":"Meddon","category":"handwriting","variants":["regular"]},{"family":"Tienne","category":"serif","variants":["regular","700","900"]},{"family":"Over the Rainbow","category":"handwriting","variants":["regular"]},{"family":"Share Tech Mono","category":"monospace","variants":["regular"]},{"family":"Abhaya Libre","category":"serif","variants":["regular","500","600","700","800"]},{"family":"Kotta One","category":"serif","variants":["regular"]},{"family":"Pridi","category":"serif","variants":["200","300","regular","500","600","700"]},{"family":"Euphoria Script","category":"handwriting","variants":["regular"]},{"family":"Engagement","category":"handwriting","variants":["regular"]},{"family":"Podkova","category":"serif","variants":["regular","500","600","700","800"]},{"family":"Salsa","category":"display","variants":["regular"]},{"family":"Sofia","category":"handwriting","variants":["regular"]},{"family":"Suranna","category":"serif","variants":["regular"]},{"family":"Mada","category":"sans-serif","variants":["300","regular","500","900"]},{"family":"Chonburi","category":"display","variants":["regular"]},{"family":"Ledger","category":"serif","variants":["regular"]},{"family":"Italiana","category":"serif","variants":["regular"]},{"family":"Dawning of a New Day","category":"handwriting","variants":["regular"]},{"family":"Nokora","category":"serif","variants":["regular","700"]},{"family":"Angkor","category":"display","variants":["regular"]},{"family":"Medula One","category":"display","variants":["regular"]},{"family":"Taviraj","category":"serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Vampiro One","category":"display","variants":["regular"]},{"family":"Englebert","category":"sans-serif","variants":["regular"]},{"family":"Nova Mono","category":"monospace","variants":["regular"]},{"family":"Dorsa","category":"sans-serif","variants":["regular"]},{"family":"Averia Sans Libre","category":"display","variants":["300","300italic","regular","italic","700","700italic"]},{"family":"Cedarville Cursive","category":"handwriting","variants":["regular"]},{"family":"Geo","category":"sans-serif","variants":["regular","italic"]},{"family":"Rationale","category":"sans-serif","variants":["regular"]},{"family":"Balthazar","category":"serif","variants":["regular"]},{"family":"Sunshiney","category":"handwriting","variants":["regular"]},{"family":"Aguafina Script","category":"handwriting","variants":["regular"]},{"family":"Mystery Quest","category":"display","variants":["regular"]},{"family":"Fjord One","category":"serif","variants":["regular"]},{"family":"Fira Sans Extra Condensed","category":"sans-serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Kadwa","category":"serif","variants":["regular","700"]},{"family":"McLaren","category":"display","variants":["regular"]},{"family":"Rye","category":"display","variants":["regular"]},{"family":"Sail","category":"display","variants":["regular"]},{"family":"Athiti","category":"sans-serif","variants":["200","300","regular","500","600","700"]},{"family":"Rosarivo","category":"serif","variants":["regular","italic"]},{"family":"Kite One","category":"sans-serif","variants":["regular"]},{"family":"Odor Mean Chey","category":"display","variants":["regular"]},{"family":"Numans","category":"sans-serif","variants":["regular"]},{"family":"Artifika","category":"serif","variants":["regular"]},{"family":"Poller One","category":"display","variants":["regular"]},{"family":"Gurajada","category":"serif","variants":["regular"]},{"family":"Inika","category":"serif","variants":["regular","700"]},{"family":"Mandali","category":"sans-serif","variants":["regular"]},{"family":"Bungee Shade","category":"display","variants":["regular"]},{"family":"Suwannaphum","category":"display","variants":["regular"]},{"family":"Mate SC","category":"serif","variants":["regular"]},{"family":"Creepster","category":"display","variants":["regular"]},{"family":"Arsenal","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Montserrat Subrayada","category":"sans-serif","variants":["regular","700"]},{"family":"Metamorphous","category":"display","variants":["regular"]},{"family":"Palanquin Dark","category":"sans-serif","variants":["regular","500","600","700"]},{"family":"Coda Caption","category":"sans-serif","variants":["800"]},{"family":"Dynalight","category":"display","variants":["regular"]},{"family":"Maitree","category":"serif","variants":["200","300","regular","500","600","700"]},{"family":"IM Fell French Canon","category":"serif","variants":["regular","italic"]},{"family":"Amarante","category":"display","variants":["regular"]},{"family":"Quintessential","category":"handwriting","variants":["regular"]},{"family":"Codystar","category":"display","variants":["300","regular"]},{"family":"Cantora One","category":"sans-serif","variants":["regular"]},{"family":"Aref Ruqaa","category":"serif","variants":["regular","700"]},{"family":"Griffy","category":"display","variants":["regular"]},{"family":"Revalia","category":"display","variants":["regular"]},{"family":"Buenard","category":"serif","variants":["regular","700"]},{"family":"Donegal One","category":"serif","variants":["regular"]},{"family":"IM Fell DW Pica SC","category":"serif","variants":["regular"]},{"family":"Habibi","category":"serif","variants":["regular"]},{"family":"Share Tech","category":"sans-serif","variants":["regular"]},{"family":"Flamenco","category":"display","variants":["300","regular"]},{"family":"Mitr","category":"sans-serif","variants":["200","300","regular","500","600","700"]},{"family":"Maiden Orange","category":"display","variants":["regular"]},{"family":"Diplomata SC","category":"display","variants":["regular"]},{"family":"Cormorant","category":"serif","variants":["300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"]},{"family":"Delius Unicase","category":"handwriting","variants":["regular","700"]},{"family":"Stoke","category":"serif","variants":["300","regular"]},{"family":"Vibur","category":"handwriting","variants":["regular"]},{"family":"Sarpanch","category":"sans-serif","variants":["regular","500","600","700","800","900"]},{"family":"Baloo Bhaina","category":"display","variants":["regular"]},{"family":"Baloo Tamma","category":"display","variants":["regular"]},{"family":"Averia Libre","category":"display","variants":["300","300italic","regular","italic","700","700italic"]},{"family":"Esteban","category":"serif","variants":["regular"]},{"family":"Battambang","category":"display","variants":["regular","700"]},{"family":"Bokor","category":"display","variants":["regular"]},{"family":"Wallpoet","category":"display","variants":["regular"]},{"family":"IM Fell Great Primer","category":"serif","variants":["regular","italic"]},{"family":"Tulpen One","category":"display","variants":["regular"]},{"family":"Proza Libre","category":"sans-serif","variants":["regular","italic","500","500italic","600","600italic","700","700italic","800","800italic"]},{"family":"IM Fell French Canon SC","category":"serif","variants":["regular"]},{"family":"Vesper Libre","category":"serif","variants":["regular","500","700","900"]},{"family":"Rozha One","category":"serif","variants":["regular"]},{"family":"Sansita","category":"sans-serif","variants":["regular","italic","700","700italic","800","800italic","900","900italic"]},{"family":"Kavoon","category":"display","variants":["regular"]},{"family":"Della Respira","category":"serif","variants":["regular"]},{"family":"Milonga","category":"display","variants":["regular"]},{"family":"Condiment","category":"handwriting","variants":["regular"]},{"family":"Junge","category":"serif","variants":["regular"]},{"family":"New Rocker","category":"display","variants":["regular"]},{"family":"Chicle","category":"display","variants":["regular"]},{"family":"Mrs Saint Delafield","category":"handwriting","variants":["regular"]},{"family":"League Script","category":"handwriting","variants":["regular"]},{"family":"Miniver","category":"display","variants":["regular"]},{"family":"Galindo","category":"display","variants":["regular"]},{"family":"Moul","category":"display","variants":["regular"]},{"family":"Amatica SC","category":"display","variants":["regular","700"]},{"family":"Stint Ultra Expanded","category":"display","variants":["regular"]},{"family":"Yrsa","category":"serif","variants":["300","regular","500","600","700"]},{"family":"Stint Ultra Condensed","category":"display","variants":["regular"]},{"family":"Suez One","category":"serif","variants":["regular"]},{"family":"Text Me One","category":"sans-serif","variants":["regular"]},{"family":"Buda","category":"display","variants":["300"]},{"family":"Ruluko","category":"sans-serif","variants":["regular"]},{"family":"Sonsie One","category":"display","variants":["regular"]},{"family":"Krona One","category":"sans-serif","variants":["regular"]},{"family":"Elsie","category":"display","variants":["regular","900"]},{"family":"Pangolin","category":"handwriting","variants":["regular"]},{"family":"Linden Hill","category":"serif","variants":["regular","italic"]},{"family":"Secular One","category":"sans-serif","variants":["regular"]},{"family":"IM Fell Double Pica SC","category":"serif","variants":["regular"]},{"family":"Alike Angular","category":"serif","variants":["regular"]},{"family":"Sancreek","category":"display","variants":["regular"]},{"family":"Bilbo","category":"handwriting","variants":["regular"]},{"family":"Antic Didone","category":"serif","variants":["regular"]},{"family":"Paprika","category":"display","variants":["regular"]},{"family":"Asul","category":"sans-serif","variants":["regular","700"]},{"family":"David Libre","category":"serif","variants":["regular","500","700"]},{"family":"Almendra","category":"serif","variants":["regular","italic","700","700italic"]},{"family":"Sriracha","category":"handwriting","variants":["regular"]},{"family":"Miriam Libre","category":"sans-serif","variants":["regular","700"]},{"family":"Ribeye","category":"display","variants":["regular"]},{"family":"Swanky and Moo Moo","category":"handwriting","variants":["regular"]},{"family":"Trade Winds","category":"display","variants":["regular"]},{"family":"Overlock SC","category":"display","variants":["regular"]},{"family":"Nova Round","category":"display","variants":["regular"]},{"family":"Cagliostro","category":"sans-serif","variants":["regular"]},{"family":"Glass Antiqua","category":"display","variants":["regular"]},{"family":"Offside","category":"display","variants":["regular"]},{"family":"El Messiri","category":"sans-serif","variants":["regular","500","600","700"]},{"family":"Bigshot One","category":"display","variants":["regular"]},{"family":"IM Fell Great Primer SC","category":"serif","variants":["regular"]},{"family":"Akronim","category":"display","variants":["regular"]},{"family":"Fira Sans Condensed","category":"sans-serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Nosifer","category":"display","variants":["regular"]},{"family":"Autour One","category":"display","variants":["regular"]},{"family":"Pirata One","category":"display","variants":["regular"]},{"family":"Port Lligat Sans","category":"sans-serif","variants":["regular"]},{"family":"Scope One","category":"serif","variants":["regular"]},{"family":"Sumana","category":"serif","variants":["regular","700"]},{"family":"Lemonada","category":"display","variants":["300","regular","600","700"]},{"family":"Montaga","category":"serif","variants":["regular"]},{"family":"Iceberg","category":"display","variants":["regular"]},{"family":"Ruthie","category":"handwriting","variants":["regular"]},{"family":"Content","category":"display","variants":["regular","700"]},{"family":"Henny Penny","category":"display","variants":["regular"]},{"family":"Nova Slim","category":"display","variants":["regular"]},{"family":"Hind Madurai","category":"sans-serif","variants":["300","regular","500","600","700"]},{"family":"Harmattan","category":"sans-serif","variants":["regular"]},{"family":"UnifrakturCook","category":"display","variants":["700"]},{"family":"Sarina","category":"display","variants":["regular"]},{"family":"Bubbler One","category":"sans-serif","variants":["regular"]},{"family":"Dekko","category":"handwriting","variants":["regular"]},{"family":"Redressed","category":"handwriting","variants":["regular"]},{"family":"Laila","category":"serif","variants":["300","regular","500","600","700"]},{"family":"Faster One","category":"display","variants":["regular"]},{"family":"Arya","category":"sans-serif","variants":["regular","700"]},{"family":"Peralta","category":"display","variants":["regular"]},{"family":"Meie Script","category":"handwriting","variants":["regular"]},{"family":"Overpass","category":"sans-serif","variants":["100","100italic","200","200italic","300","300italic","regular","italic","600","600italic","700","700italic","800","800italic","900","900italic"]},{"family":"Monsieur La Doulaise","category":"handwriting","variants":["regular"]},{"family":"Bungee","category":"display","variants":["regular"]},{"family":"Snippet","category":"sans-serif","variants":["regular"]},{"family":"Emilys Candy","category":"display","variants":["regular"]},{"family":"Trykker","category":"serif","variants":["regular"]},{"family":"MedievalSharp","category":"display","variants":["regular"]},{"family":"Space Mono","category":"monospace","variants":["regular","italic","700","700italic"]},{"family":"Croissant One","category":"display","variants":["regular"]},{"family":"Monofett","category":"display","variants":["regular"]},{"family":"Lovers Quarrel","category":"handwriting","variants":["regular"]},{"family":"Oldenburg","category":"display","variants":["regular"]},{"family":"Galdeano","category":"sans-serif","variants":["regular"]},{"family":"Spicy Rice","category":"display","variants":["regular"]},{"family":"Wellfleet","category":"display","variants":["regular"]},{"family":"Germania One","category":"display","variants":["regular"]},{"family":"GFS Neohellenic","category":"sans-serif","variants":["regular","italic","700","700italic"]},{"family":"Baloo Thambi","category":"display","variants":["regular"]},{"family":"Jolly Lodger","category":"display","variants":["regular"]},{"family":"Rubik Mono One","category":"sans-serif","variants":["regular"]},{"family":"Pattaya","category":"sans-serif","variants":["regular"]},{"family":"Joti One","category":"display","variants":["regular"]},{"family":"Siemreap","category":"display","variants":["regular"]},{"family":"Ranga","category":"display","variants":["regular","700"]},{"family":"Chango","category":"display","variants":["regular"]},{"family":"Miltonian Tattoo","category":"display","variants":["regular"]},{"family":"Koulen","category":"display","variants":["regular"]},{"family":"Eagle Lake","category":"handwriting","variants":["regular"]},{"family":"Nova Flat","category":"display","variants":["regular"]},{"family":"Petrona","category":"serif","variants":["regular"]},{"family":"Jacques Francois","category":"serif","variants":["regular"]},{"family":"Amita","category":"handwriting","variants":["regular","700"]},{"family":"Plaster","category":"display","variants":["regular"]},{"family":"Ramaraja","category":"serif","variants":["regular"]},{"family":"Sura","category":"serif","variants":["regular","700"]},{"family":"Kenia","category":"display","variants":["regular"]},{"family":"Fresca","category":"sans-serif","variants":["regular"]},{"family":"Jomhuria","category":"display","variants":["regular"]},{"family":"Lancelot","category":"display","variants":["regular"]},{"family":"Pavanam","category":"sans-serif","variants":["regular"]},{"family":"Rum Raisin","category":"sans-serif","variants":["regular"]},{"family":"Almendra SC","category":"serif","variants":["regular"]},{"family":"Purple Purse","category":"display","variants":["regular"]},{"family":"Kumar One","category":"display","variants":["regular"]},{"family":"Modern Antiqua","category":"display","variants":["regular"]},{"family":"Piedra","category":"display","variants":["regular"]},{"family":"Irish Grover","category":"display","variants":["regular"]},{"family":"Molle","category":"handwriting","variants":["italic"]},{"family":"Cormorant Infant","category":"serif","variants":["300","300italic","regular","italic","500","500italic","600","600italic","700","700italic"]},{"family":"Margarine","category":"display","variants":["regular"]},{"family":"Sahitya","category":"serif","variants":["regular","700"]},{"family":"Mukta Vaani","category":"sans-serif","variants":["200","300","regular","500","600","700","800"]},{"family":"Astloch","category":"display","variants":["regular","700"]},{"family":"Snowburst One","category":"display","variants":["regular"]},{"family":"Rhodium Libre","category":"serif","variants":["regular"]},{"family":"Smythe","category":"display","variants":["regular"]},{"family":"Asset","category":"display","variants":["regular"]},{"family":"Ewert","category":"display","variants":["regular"]},{"family":"Keania One","category":"display","variants":["regular"]},{"family":"Ranchers","category":"display","variants":["regular"]},{"family":"Gorditas","category":"display","variants":["regular","700"]},{"family":"Sirin Stencil","category":"display","variants":["regular"]},{"family":"Averia Gruesa Libre","category":"display","variants":["regular"]},{"family":"Trochut","category":"display","variants":["regular","italic","700"]},{"family":"Baloo Chettan","category":"display","variants":["regular"]},{"family":"Kdam Thmor","category":"display","variants":["regular"]},{"family":"Timmana","category":"sans-serif","variants":["regular"]},{"family":"Original Surfer","category":"display","variants":["regular"]},{"family":"Supermercado One","category":"display","variants":["regular"]},{"family":"Mirza","category":"display","variants":["regular","500","600","700"]},{"family":"Passero One","category":"display","variants":["regular"]},{"family":"Nova Oval","category":"display","variants":["regular"]},{"family":"Caesar Dressing","category":"display","variants":["regular"]},{"family":"Taprom","category":"display","variants":["regular"]},{"family":"Fascinate","category":"display","variants":["regular"]},{"family":"Seymour One","category":"sans-serif","variants":["regular"]},{"family":"Freehand","category":"display","variants":["regular"]},{"family":"Ravi Prakash","category":"display","variants":["regular"]},{"family":"Coiny","category":"display","variants":["regular"]},{"family":"Atomic Age","category":"display","variants":["regular"]},{"family":"Jacques Francois Shadow","category":"display","variants":["regular"]},{"family":"Diplomata","category":"display","variants":["regular"]},{"family":"Dr Sugiyama","category":"handwriting","variants":["regular"]},{"family":"Miltonian","category":"display","variants":["regular"]},{"family":"Ribeye Marrow","category":"display","variants":["regular"]},{"family":"Elsie Swash Caps","category":"display","variants":["regular","900"]},{"family":"Felipa","category":"handwriting","variants":["regular"]},{"family":"Galada","category":"display","variants":["regular"]},{"family":"Nova Script","category":"display","variants":["regular"]},{"family":"Bayon","category":"display","variants":["regular"]},{"family":"Underdog","category":"display","variants":["regular"]},{"family":"Devonshire","category":"handwriting","variants":["regular"]},{"family":"Atma","category":"display","variants":["300","regular","500","600","700"]},{"family":"Londrina Shadow","category":"display","variants":["regular"]},{"family":"Sofadi One","category":"display","variants":["regular"]},{"family":"Tillana","category":"handwriting","variants":["regular","500","600","700","800"]},{"family":"Inknut Antiqua","category":"serif","variants":["300","regular","500","600","700","800","900"]},{"family":"Goblin One","category":"display","variants":["regular"]},{"family":"Rakkas","category":"display","variants":["regular"]},{"family":"Metal","category":"display","variants":["regular"]},{"family":"Farsan","category":"display","variants":["regular"]},{"family":"Londrina Sketch","category":"display","variants":["regular"]},{"family":"Nova Cut","category":"display","variants":["regular"]},{"family":"BioRhyme","category":"serif","variants":["200","300","regular","700","800"]},{"family":"Warnes","category":"display","variants":["regular"]},{"family":"Romanesco","category":"handwriting","variants":["regular"]},{"family":"Fascinate Inline","category":"display","variants":["regular"]},{"family":"Mrs Sheppards","category":"handwriting","variants":["regular"]},{"family":"Princess Sofia","category":"handwriting","variants":["regular"]},{"family":"Modak","category":"display","variants":["regular"]},{"family":"Spirax","category":"display","variants":["regular"]},{"family":"Cormorant Upright","category":"serif","variants":["300","regular","500","600","700"]},{"family":"Geostar Fill","category":"display","variants":["regular"]},{"family":"Cormorant SC","category":"serif","variants":["300","regular","500","600","700"]},{"family":"Baloo Bhai","category":"display","variants":["regular"]},{"family":"Sree Krushnadevaraya","category":"serif","variants":["regular"]},{"family":"Smokum","category":"display","variants":["regular"]},{"family":"Arbutus","category":"display","variants":["regular"]},{"family":"Fruktur","category":"display","variants":["regular"]},{"family":"Geostar","category":"display","variants":["regular"]},{"family":"Marko One","category":"serif","variants":["regular"]},{"family":"Erica One","category":"display","variants":["regular"]},{"family":"Yatra One","category":"display","variants":["regular"]},{"family":"Uncial Antiqua","category":"display","variants":["regular"]},{"family":"Combo","category":"display","variants":["regular"]},{"family":"Gidugu","category":"sans-serif","variants":["regular"]},{"family":"Aubrey","category":"display","variants":["regular"]},{"family":"Jim Nightshade","category":"handwriting","variants":["regular"]},{"family":"Butterfly Kids","category":"handwriting","variants":["regular"]},{"family":"Metal Mania","category":"display","variants":["regular"]},{"family":"Macondo","category":"display","variants":["regular"]},{"family":"Chenla","category":"display","variants":["regular"]},{"family":"Miss Fajardose","category":"handwriting","variants":["regular"]},{"family":"Macondo Swash Caps","category":"display","variants":["regular"]},{"family":"Barrio","category":"display","variants":["regular"]},{"family":"Sevillana","category":"display","variants":["regular"]},{"family":"Bigelow Rules","category":"display","variants":["regular"]},{"family":"Rasa","category":"serif","variants":["300","regular","500","600","700"]},{"family":"Risque","category":"display","variants":["regular"]},{"family":"Federant","category":"display","variants":["regular"]},{"family":"Dangrek","category":"display","variants":["regular"]},{"family":"Chathura","category":"sans-serif","variants":["100","300","regular","700","800"]},{"family":"Almendra Display","category":"display","variants":["regular"]},{"family":"Chela One","category":"display","variants":["regular"]},{"family":"Bonbon","category":"handwriting","variants":["regular"]},{"family":"Stalinist One","category":"display","variants":["regular"]},{"family":"Mr Bedfort","category":"handwriting","variants":["regular"]},{"family":"Eater","category":"display","variants":["regular"]},{"family":"Fasthand","category":"serif","variants":["regular"]},{"family":"Mogra","category":"display","variants":["regular"]},{"family":"Padauk","category":"sans-serif","variants":["regular","700"]},{"family":"Preahvihear","category":"display","variants":["regular"]},{"family":"Flavors","category":"display","variants":["regular"]},{"family":"Ruge Boogie","category":"handwriting","variants":["regular"]},{"family":"Tenali Ramakrishna","category":"sans-serif","variants":["regular"]},{"family":"Unlock","category":"display","variants":["regular"]},{"family":"Butcherman","category":"display","variants":["regular"]},{"family":"Baloo Da","category":"display","variants":["regular"]},{"family":"Lakki Reddy","category":"handwriting","variants":["regular"]},{"family":"Cormorant Unicase","category":"serif","variants":["300","regular","500","600","700"]},{"family":"Katibeh","category":"display","variants":["regular"]},{"family":"Asar","category":"serif","variants":["regular"]},{"family":"Emblema One","category":"display","variants":["regular"]},{"family":"Moulpali","category":"display","variants":["regular"]},{"family":"Meera Inimai","category":"sans-serif","variants":["regular"]},{"family":"Kantumruy","category":"sans-serif","variants":["300","regular","700"]},{"family":"Suravaram","category":"serif","variants":["regular"]},{"family":"Bungee Hairline","category":"display","variants":["regular"]},{"family":"Overpass Mono","category":"monospace","variants":["300","regular","600","700"]},{"family":"Peddana","category":"serif","variants":["regular"]},{"family":"Bahiana","category":"display","variants":["regular"]},{"family":"Kumar One Outline","category":"display","variants":["regular"]},{"family":"Hanalei Fill","category":"display","variants":["regular"]},{"family":"Dhurjati","category":"sans-serif","variants":["regular"]},{"family":"Hanalei","category":"display","variants":["regular"]},{"family":"Kavivanar","category":"handwriting","variants":["regular"]},{"family":"Bungee Outline","category":"display","variants":["regular"]},{"family":"BioRhyme Expanded","category":"serif","variants":["200","300","regular","700","800"]}]' ); + + // Loop through them and put what we need into our fonts array + $fonts = array(); + foreach ( $content as $item ) { + + // Grab what we need from our big list + $atts = array( + 'name' => $item->family, + 'category' => $item->category, + 'variants' => $item->variants, + ); + + // Create an ID using our font family name + $id = strtolower( str_replace( ' ', '_', $item->family ) ); + + // Add our attributes to our new array + $fonts[ $id ] = $atts; + } + + if ( 'all' !== $amount ) { + $fonts = array_slice( $fonts, 0, $amount ); + } + + // Alphabetize our fonts + if ( apply_filters( 'generate_alphabetize_google_fonts', true ) ) { + asort( $fonts ); + } + + // Filter to allow us to modify the fonts array + return apply_filters( 'generate_google_fonts_array', $fonts ); + } +} + +if ( ! function_exists( 'generate_get_all_google_fonts_ajax' ) ) { + add_action( 'wp_ajax_generate_get_all_google_fonts_ajax', 'generate_get_all_google_fonts_ajax' ); + /** + * Return an array of all of our Google Fonts. + * + * @since 1.3.0 + */ + function generate_get_all_google_fonts_ajax() { + // Bail if the nonce doesn't check out + if ( ! isset( $_POST['gp_customize_nonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['gp_customize_nonce'] ), 'gp_customize_nonce' ) ) { + wp_die(); + } + + // Do another nonce check + check_ajax_referer( 'gp_customize_nonce', 'gp_customize_nonce' ); + + // Bail if user can't edit theme options + if ( ! current_user_can( 'edit_theme_options' ) ) { + wp_die(); + } + + // Get all of our fonts + $fonts = generate_get_all_google_fonts(); + + // Send all of our fonts in JSON format + echo wp_json_encode( $fonts ); + + // Exit + die(); + } +} + +if ( ! function_exists( 'generate_get_google_font_variants' ) ) { + /** + * Wrapper function to find variants for chosen Google Fonts + * Example: generate_get_google_font_variation( 'Open Sans' ) + * @since 1.3.0 + */ + function generate_get_google_font_variants( $font, $key = '' ) { + // Don't need variants if we're using a system font + if ( in_array( $font, generate_typography_default_fonts() ) ) { + return; + } + + // Return if we have our variants saved + if ( '' !== $key && get_theme_mod( $key . '_variants' ) ) { + return get_theme_mod( $key . '_variants' ); + } + + // Get our defaults + $defaults = generate_get_default_fonts(); + + // If our default font is selected and the category isn't saved, we already know the category + if ( $defaults[ $key ] == $font ) { + return $defaults[ $key . '_variants' ]; + } + + // Grab all of our fonts + // It's a big list, so hopefully we're not even still reading + $fonts = generate_get_all_google_fonts(); + + // Get the ID from our font + $id = strtolower( str_replace( ' ', '_', $font ) ); + + // If the ID doesn't exist within our fonts, we can bail + if ( ! array_key_exists( $id, $fonts ) ) { + return; + } + + // Grab all of the variants associated with our font + $variants = $fonts[ $id ]['variants']; + + // Loop through them and put them into an array, then turn them into a comma separated list + $output = array(); + if ( $variants ) { + foreach ( $variants as $variant ) { + $output[] = $variant; + } + return implode( ',', apply_filters( 'generate_typography_variants', $output ) ); + } + } +} + +if ( ! function_exists( 'generate_get_google_font_category' ) ) { + /** + * Wrapper function to find the category for chosen Google Font + * Example: generate_get_google_font_category( 'Open Sans' ) + * + * @since 1.3.0 + * + * @param string $font The name of our font. + * @param string $key The ID of the font setting. + * @return string The category of our font. + */ + function generate_get_google_font_category( $font, $key = '' ) { + // Don't need a category if we're using a system font + if ( in_array( $font, generate_typography_default_fonts() ) ) { + return; + } + + // Return if we have our variants saved + if ( '' !== $key && get_theme_mod( $key . '_category' ) ) { + return ', ' . get_theme_mod( $key . '_category' ); + } + + // Get our defaults + $defaults = generate_get_default_fonts(); + + // If our default font is selected and the category isn't saved, we already know the category + if ( $defaults[ $key ] == $font ) { + return ', ' . $defaults[ $key . '_category' ]; + } + + // Grab all of our fonts + // It's a big list, so hopefully we're not even still reading + $fonts = generate_get_all_google_fonts(); + + // Get the ID from our font + $id = strtolower( str_replace( ' ', '_', $font ) ); + + // If the ID doesn't exist within our fonts, we can bail + if ( ! array_key_exists( $id, $fonts ) ) { + return; + } + + // Let's grab our category to go with our font + $category = ! empty( $fonts[ $id ]['category'] ) ? ', ' . $fonts[ $id ]['category'] : ''; + + // Return it to be used by our function + return $category; + + } +} + + + +if ( ! function_exists( 'generate_get_font_family_css' ) ) { + /** + * Wrapper function to create font-family value for CSS. + * + * @since 1.3.0 + * + * @param string $font The name of our font. + * @param string $settings The ID of the settings we're looking up. + * @param array $default The defaults for our $settings. + * @return string The CSS value for our font family. + */ + function generate_get_font_family_css( $font, $settings, $default ) { + $generate_settings = wp_parse_args( + get_option( $settings, array() ), + $default + ); + + // We don't want to wrap quotes around these values + $no_quotes = array( + 'inherit', + 'Arial, Helvetica, sans-serif', + 'Georgia, Times New Roman, Times, serif', + 'Helvetica', + 'Impact', + 'Segoe UI, Helvetica Neue, Helvetica, sans-serif', + 'Tahoma, Geneva, sans-serif', + 'Trebuchet MS, Helvetica, sans-serif', + 'Verdana, Geneva, sans-serif', + apply_filters( 'generate_typography_system_stack', '-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"' ), + ); + + // Get our font + $font_family = $generate_settings[ $font ]; + + if ( 'System Stack' == $font_family ) { + $font_family = apply_filters( 'generate_typography_system_stack', '-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"' ); + } + + // If our value is still using the old format, fix it + if ( strpos( $font_family, ':' ) !== false ) { + $font_family = current( explode( ':', $font_family ) ); + } + + // Set up our wrapper + if ( in_array( $font_family, $no_quotes ) ) { + $wrapper_start = null; + $wrapper_end = null; + } else { + $wrapper_start = '"'; + $wrapper_end = '"' . generate_get_google_font_category( $font_family, $font ); + } + + // Output the CSS + $output = ( 'inherit' == $font_family ) ? '' : $wrapper_start . $font_family . $wrapper_end; + return $output; + } +} + +if ( ! function_exists( 'generate_add_to_font_customizer_list' ) ) { + add_filter( 'generate_typography_customize_list', 'generate_add_to_font_customizer_list' ); + /** + * This function makes sure your selected typography option exists in the Customizer list + * Why wouldn't it? Originally, all 800+ fonts were in each list. This has been reduced to 200. + * This functions makes sure that if you were using a font that is now not included in the 200, you won't lose it. + * + * @since 1.3.40 + */ + function generate_add_to_font_customizer_list( $fonts ) { + // Bail if we don't have our defaults + if ( ! function_exists( 'generate_get_default_fonts' ) ) { + return; + } + + $generate_settings = wp_parse_args( + get_option( 'generate_settings', array() ), + generate_get_default_fonts() + ); + + $font_settings = array( + 'font_body', + 'font_top_bar', + 'font_site_title', + 'font_site_tagline', + 'font_navigation', + 'font_widget_title', + 'font_heading_1', + 'font_heading_2', + 'font_heading_3', + ); + + $all_fonts = generate_get_all_google_fonts(); + $select_fonts = generate_get_all_google_fonts( apply_filters( 'generate_number_of_fonts', 200 ) ); + + foreach ( $font_settings as $setting ) { + // If we don't have a setting, keep going + if ( ! isset( $generate_settings[ $setting ] ) ) { + continue; + } + + $id = strtolower( str_replace( ' ', '_', $generate_settings[ $setting ] ) ); + + if ( array_key_exists( $id, $select_fonts ) || in_array( $generate_settings[ $setting ], generate_typography_default_fonts() ) ) { + continue; + } + + $fonts[ strtolower( str_replace( ' ', '_', $generate_settings[ $setting ] ) ) ] = array( + 'name' => $generate_settings[ $setting ], + 'variants' => array_key_exists( $id, $all_fonts ) ? $all_fonts[ $id ]['variants'] : array(), + 'category' => array_key_exists( $id, $all_fonts ) ? $all_fonts[ $id ]['category'] : 'sans-serif', + ); + } + + if ( function_exists( 'generate_secondary_nav_get_defaults' ) ) { + $secondary_nav_settings = wp_parse_args( + get_option( 'generate_secondary_nav_settings', array() ), + generate_secondary_nav_get_defaults() + ); + + $secondary_nav_id = strtolower( str_replace( ' ', '_', $secondary_nav_settings['font_secondary_navigation'] ) ); + + if ( ! array_key_exists( $secondary_nav_id, $select_fonts ) && ! in_array( $secondary_nav_settings['font_secondary_navigation'], generate_typography_default_fonts() ) ) { + $fonts[ strtolower( str_replace( ' ', '_', $secondary_nav_settings['font_secondary_navigation'] ) ) ] = array( + 'name' => $secondary_nav_settings['font_secondary_navigation'], + 'variants' => array_key_exists( $secondary_nav_id, $all_fonts ) ? $all_fonts[ $secondary_nav_id ]['variants'] : array(), + 'category' => array_key_exists( $secondary_nav_id, $all_fonts ) ? $all_fonts[ $secondary_nav_id ]['category'] : 'sans-serif', + ); + } + } + + return $fonts; + } +} diff --git a/wp-content/themes/generatepress/index.php b/wp-content/themes/generatepress/index.php new file mode 100644 index 0000000..a4698c8 --- /dev/null +++ b/wp-content/themes/generatepress/index.php @@ -0,0 +1,77 @@ + + +
            > +
            > + +
            +
            + + ' + container_width_elements + '{max-width: 100%;}' ); + } else { + $( 'style#container_width' ).remove(); + } + } ); + + $( 'input[name="_generate-sidebar-layout-meta"]' ).on( 'change', function() { + if ( 'true' !== $( 'input[name="_generate-full-width-content"]:checked' ).val() ) { + var this_value = this.value, + content_width = '', + calc = '', + container_width = generate_block_editor.container_width, + right_sidebar_width = generate_block_editor.right_sidebar_width, + left_sidebar_width = generate_block_editor.left_sidebar_width, + right_content_padding = generate_block_editor.content_padding_right, + left_content_padding = generate_block_editor.content_padding_left; + + if ( '' === this_value ) { + this_value = generate_block_editor.global_sidebar_layout; + } + + if ( 'left-sidebar' == this_value ) { + content_width = container_width * ( ( 100 - left_sidebar_width ) / 100 ); + } else if ( 'right-sidebar' == this_value ) { + content_width = container_width * ( ( 100 - right_sidebar_width ) / 100 ); + } else if ( 'no-sidebar' == this_value ) { + content_width = container_width; + } else { + content_width = container_width * ( ( 100 - ( Number( left_sidebar_width ) + Number( right_sidebar_width ) ) ) / 100 ); + } + + calc = 'max-width: calc(' + content_width + 'px - ' + right_content_padding + ' - ' + left_content_padding + ')'; + + $( 'style#content-width' ).remove(); + $( 'head' ).append( '' ); + + $( 'style#wide-width' ).remove(); + $( 'head' ).append( ' + section and everything up until
            + * + * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials + * + * @package WordPress + * @subpackage Twenty_Nineteen + * @since Twenty Nineteen 1.0 + */ +?> +> + + + + + + + +> + +
            + + +
            + +
            + +
            + + + + +
            + +
            diff --git a/wp-content/themes/twentynineteen/image.php b/wp-content/themes/twentynineteen/image.php new file mode 100644 index 0000000..414d850 --- /dev/null +++ b/wp-content/themes/twentynineteen/image.php @@ -0,0 +1,104 @@ + + +
            +
            + + + +
            > + +
            + ', '' ); ?> +
            + +
            + +
            + + +
            + +
            + + '', + 'link_before' => '', + 'link_after' => '', + 'pagelink' => '' . __( 'Page', 'twentynineteen' ) . ' %', + 'separator' => ', ', + ) + ); + ?> +
            + +
            + %1$s%3$s × %4$s', + _x( 'Full size', 'Used before full size attachment link.', 'twentynineteen' ), + esc_url( wp_get_attachment_url() ), + absint( $metadata['width'] ), + absint( $metadata['height'] ) + ); + } + ?> + + + +
            +
            + + _x( 'Published in
            %title', 'Parent post link', 'twentynineteen' ), + ) + ); + + // If comments are open or we have at least one comment, load up the comment template. + if ( comments_open() || get_comments_number() ) { + comments_template(); + } + + // End the loop. + endwhile; + ?> + +
            +
            + +

            %s

            ', $message ); +} + +/** + * Prevents the Customizer from being loaded on WordPress versions prior to 4.7. + * + * @since Twenty Nineteen 1.0.0 + * + * @global string $wp_version WordPress version. + */ +function twentynineteen_customize() { + wp_die( + sprintf( + /* translators: %s: WordPress version. */ + __( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ), + $GLOBALS['wp_version'] + ), + '', + array( + 'back_link' => true, + ) + ); +} +add_action( 'load-customize.php', 'twentynineteen_customize' ); + +/** + * Prevents the Theme Preview from being loaded on WordPress versions prior to 4.7. + * + * @since Twenty Nineteen 1.0.0 + * + * @global string $wp_version WordPress version. + */ +function twentynineteen_preview() { + if ( isset( $_GET['preview'] ) ) { + /* translators: %s: WordPress version. */ + wp_die( sprintf( __( 'Twenty Nineteen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentynineteen' ), $GLOBALS['wp_version'] ) ); + } +} +add_action( 'template_redirect', 'twentynineteen_preview' ); diff --git a/wp-content/themes/twentynineteen/inc/color-patterns.php b/wp-content/themes/twentynineteen/inc/color-patterns.php new file mode 100644 index 0000000..b990fff --- /dev/null +++ b/wp-content/themes/twentynineteen/inc/color-patterns.php @@ -0,0 +1,271 @@ + .has-primary-background-color, + .entry .entry-content > *[class^="wp-block-"].has-primary-background-color, + .entry .entry-content > *[class^="wp-block-"] .has-primary-background-color, + .entry .entry-content > *[class^="wp-block-"].is-style-solid-color, + .entry .entry-content > *[class^="wp-block-"].is-style-solid-color.has-primary-background-color, + .entry .entry-content .wp-block-file .wp-block-file__button { + background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ + } + + /* + * Set Color for: + * - all links + * - main navigation links + * - Post navigation links + * - Post entry meta hover + * - Post entry header more-link hover + * - main navigation svg + * - comment navigation + * - Comment edit link hover + * - Site Footer Link hover + * - Widget links + */ + a, + a:visited, + .main-navigation .main-menu > li, + .main-navigation ul.main-menu > li > a, + .post-navigation .post-title, + .entry .entry-meta a:hover, + .entry .entry-footer a:hover, + .entry .entry-content .more-link:hover, + .main-navigation .main-menu > li > a + svg, + .comment .comment-metadata > a:hover, + .comment .comment-metadata .comment-edit-link:hover, + #colophon .site-info a:hover, + .widget a, + .entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color), + .entry .entry-content > .has-primary-color, + .entry .entry-content > *[class^="wp-block-"] .has-primary-color, + .entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-primary-color, + .entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-primary-color p { + color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ + } + + /* + * Set border color for: + * wp block quote + * :focus + */ + blockquote, + .entry .entry-content blockquote, + .entry .entry-content .wp-block-quote:not(.is-large), + .entry .entry-content .wp-block-quote:not(.is-style-large), + input[type="text"]:focus, + input[type="email"]:focus, + input[type="url"]:focus, + input[type="password"]:focus, + input[type="search"]:focus, + input[type="number"]:focus, + input[type="tel"]:focus, + input[type="range"]:focus, + input[type="date"]:focus, + input[type="month"]:focus, + input[type="week"]:focus, + input[type="time"]:focus, + input[type="datetime"]:focus, + input[type="datetime-local"]:focus, + input[type="color"]:focus, + textarea:focus { + border-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ + } + + .gallery-item > div > a:focus { + box-shadow: 0 0 0 2px hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ + } + + /* Hover colors */ + a:hover, a:active, + .main-navigation .main-menu > li > a:hover, + .main-navigation .main-menu > li > a:hover + svg, + .post-navigation .nav-links a:hover, + .post-navigation .nav-links a:hover .post-title, + .author-bio .author-description .author-link:hover, + .entry .entry-content > .has-secondary-color, + .entry .entry-content > *[class^="wp-block-"] .has-secondary-color, + .entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-secondary-color, + .entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-secondary-color p, + .comment .comment-author .fn a:hover, + .comment-reply-link:hover, + .comment-navigation .nav-previous a:hover, + .comment-navigation .nav-next a:hover, + #cancel-comment-reply-link:hover, + .widget a:hover { + color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */ + } + + .main-navigation .sub-menu > li > a:hover, + .main-navigation .sub-menu > li > a:focus, + .main-navigation .sub-menu > li > a:hover:after, + .main-navigation .sub-menu > li > a:focus:after, + .main-navigation .sub-menu > li > .menu-item-link-return:hover, + .main-navigation .sub-menu > li > .menu-item-link-return:focus, + .main-navigation .sub-menu > li > a:not(.submenu-expand):hover, + .main-navigation .sub-menu > li > a:not(.submenu-expand):focus, + .entry .entry-content > .has-secondary-background-color, + .entry .entry-content > *[class^="wp-block-"].has-secondary-background-color, + .entry .entry-content > *[class^="wp-block-"] .has-secondary-background-color, + .entry .entry-content > *[class^="wp-block-"].is-style-solid-color.has-secondary-background-color { + background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */ + } + + /* Text selection colors */ + ::selection { + background-color: hsl( ' . $primary_color . ', ' . $saturation_selection . ', ' . $lightness_selection . ' ); /* base: #005177; */ + } + ::-moz-selection { + background-color: hsl( ' . $primary_color . ', ' . $saturation_selection . ', ' . $lightness_selection . ' ); /* base: #005177; */ + }'; + + $editor_css = ' + /* + * Set colors for: + * - links + * - blockquote + * - pullquote (solid color) + * - buttons + */ + .editor-block-list__layout .editor-block-list__block a, + .editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color), + .editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:hover .wp-block-button__link:not(.has-text-color), + .editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:focus .wp-block-button__link:not(.has-text-color), + .editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:active .wp-block-button__link:not(.has-text-color), + .editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__textlink { + color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ + } + + .editor-block-list__layout .editor-block-list__block .wp-block-quote:not(.is-large):not(.is-style-large), + .editor-styles-wrapper .editor-block-list__layout .wp-block-freeform blockquote { + border-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ + } + + .editor-block-list__layout .editor-block-list__block .wp-block-pullquote.is-style-solid-color:not(.has-background-color) { + background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ + } + + .editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__button, + .editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link, + .editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:active, + .editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:focus, + .editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover { + background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */ + } + + /* Hover colors */ + .editor-block-list__layout .editor-block-list__block a:hover, + .editor-block-list__layout .editor-block-list__block a:active, + .editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__textlink:hover { + color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */ + } + + /* Do not overwrite solid color pullquote or cover links */ + .editor-block-list__layout .editor-block-list__block .wp-block-pullquote.is-style-solid-color a, + .editor-block-list__layout .editor-block-list__block .wp-block-cover a { + color: inherit; + } + '; + + if ( function_exists( 'register_block_type' ) && is_admin() ) { + $theme_css = $editor_css; + } + + /** + * Filters Twenty Nineteen custom colors CSS. + * + * @since Twenty Nineteen 1.0 + * + * @param string $css Base theme colors CSS. + * @param int $primary_color The user's selected color hue. + * @param string $saturation Filtered theme color saturation level. + */ + return apply_filters( 'twentynineteen_custom_colors_css', $theme_css, $primary_color, $saturation ); +} diff --git a/wp-content/themes/twentynineteen/inc/customizer.php b/wp-content/themes/twentynineteen/inc/customizer.php new file mode 100644 index 0000000..22d69ae --- /dev/null +++ b/wp-content/themes/twentynineteen/inc/customizer.php @@ -0,0 +1,158 @@ +get_setting( 'blogname' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; + + if ( isset( $wp_customize->selective_refresh ) ) { + $wp_customize->selective_refresh->add_partial( + 'blogname', + array( + 'selector' => '.site-title a', + 'render_callback' => 'twentynineteen_customize_partial_blogname', + ) + ); + $wp_customize->selective_refresh->add_partial( + 'blogdescription', + array( + 'selector' => '.site-description', + 'render_callback' => 'twentynineteen_customize_partial_blogdescription', + ) + ); + } + + /** + * Primary color. + */ + $wp_customize->add_setting( + 'primary_color', + array( + 'default' => 'default', + 'transport' => 'postMessage', + 'sanitize_callback' => 'twentynineteen_sanitize_color_option', + ) + ); + + $wp_customize->add_control( + 'primary_color', + array( + 'type' => 'radio', + 'label' => __( 'Primary Color', 'twentynineteen' ), + 'choices' => array( + 'default' => _x( 'Default', 'primary color', 'twentynineteen' ), + 'custom' => _x( 'Custom', 'primary color', 'twentynineteen' ), + ), + 'section' => 'colors', + 'priority' => 5, + ) + ); + + // Add primary color hue setting and control. + $wp_customize->add_setting( + 'primary_color_hue', + array( + 'default' => 199, + 'transport' => 'postMessage', + 'sanitize_callback' => 'absint', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'primary_color_hue', + array( + 'description' => __( 'Apply a custom color for buttons, links, featured images, etc.', 'twentynineteen' ), + 'section' => 'colors', + 'mode' => 'hue', + ) + ) + ); + + // Add image filter setting and control. + $wp_customize->add_setting( + 'image_filter', + array( + 'default' => 1, + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'image_filter', + array( + 'label' => __( 'Apply a filter to featured images using the primary color', 'twentynineteen' ), + 'section' => 'colors', + 'type' => 'checkbox', + ) + ); +} +add_action( 'customize_register', 'twentynineteen_customize_register' ); + +/** + * Render the site title for the selective refresh partial. + * + * @return void + */ +function twentynineteen_customize_partial_blogname() { + bloginfo( 'name' ); +} + +/** + * Render the site tagline for the selective refresh partial. + * + * @return void + */ +function twentynineteen_customize_partial_blogdescription() { + bloginfo( 'description' ); +} + +/** + * Bind JS handlers to instantly live-preview changes. + */ +function twentynineteen_customize_preview_js() { + wp_enqueue_script( 'twentynineteen-customize-preview', get_theme_file_uri( '/js/customize-preview.js' ), array( 'customize-preview' ), '20181214', true ); +} +add_action( 'customize_preview_init', 'twentynineteen_customize_preview_js' ); + +/** + * Load dynamic logic for the customizer controls area. + */ +function twentynineteen_panels_js() { + wp_enqueue_script( 'twentynineteen-customize-controls', get_theme_file_uri( '/js/customize-controls.js' ), array(), '20181214', true ); +} +add_action( 'customize_controls_enqueue_scripts', 'twentynineteen_panels_js' ); + +/** + * Sanitize custom color choice. + * + * @param string $choice Whether image filter is active. + * + * @return string + */ +function twentynineteen_sanitize_color_option( $choice ) { + $valid = array( + 'default', + 'custom', + ); + + if ( in_array( $choice, $valid, true ) ) { + return $choice; + } + + return 'default'; +} diff --git a/wp-content/themes/twentynineteen/inc/helper-functions.php b/wp-content/themes/twentynineteen/inc/helper-functions.php new file mode 100644 index 0000000..ef06cdd --- /dev/null +++ b/wp-content/themes/twentynineteen/inc/helper-functions.php @@ -0,0 +1,163 @@ +user_id > 0 ) { + $user = get_userdata( $comment->user_id ); + $post = get_post( $comment->comment_post_ID ); + if ( ! empty( $user ) && ! empty( $post ) ) { + return $comment->user_id === $post->post_author; + } + } + return false; +} + +/** + * Returns information about the current post's discussion, with cache support. + */ +function twentynineteen_get_discussion_data() { + static $discussion, $post_id; + + $current_post_id = get_the_ID(); + if ( $current_post_id === $post_id ) { + return $discussion; /* If we have discussion information for post ID, return cached object */ + } else { + $post_id = $current_post_id; + } + + $comments = get_comments( + array( + 'post_id' => $current_post_id, + 'orderby' => 'comment_date_gmt', + 'order' => get_option( 'comment_order', 'asc' ), /* Respect comment order from Settings » Discussion. */ + 'status' => 'approve', + 'number' => 20, /* Only retrieve the last 20 comments, as the end goal is just 6 unique authors */ + ) + ); + + $authors = array(); + foreach ( $comments as $comment ) { + $authors[] = ( (int) $comment->user_id > 0 ) ? (int) $comment->user_id : $comment->comment_author_email; + } + + $authors = array_unique( $authors ); + $discussion = (object) array( + 'authors' => array_slice( $authors, 0, 6 ), /* Six unique authors commenting on the post. */ + 'responses' => get_comments_number( $current_post_id ), /* Number of responses. */ + ); + + return $discussion; +} + +/** + * Converts HSL to HEX colors. + */ +function twentynineteen_hsl_hex( $h, $s, $l, $to_hex = true ) { + + $h /= 360; + $s /= 100; + $l /= 100; + + $r = $l; + $g = $l; + $b = $l; + $v = ( $l <= 0.5 ) ? ( $l * ( 1.0 + $s ) ) : ( $l + $s - $l * $s ); + if ( $v > 0 ) { + $m; + $sv; + $sextant; + $fract; + $vsf; + $mid1; + $mid2; + + $m = $l + $l - $v; + $sv = ( $v - $m ) / $v; + $h *= 6.0; + $sextant = floor( $h ); + $fract = $h - $sextant; + $vsf = $v * $sv * $fract; + $mid1 = $m + $vsf; + $mid2 = $v - $vsf; + + switch ( $sextant ) { + case 0: + $r = $v; + $g = $mid1; + $b = $m; + break; + case 1: + $r = $mid2; + $g = $v; + $b = $m; + break; + case 2: + $r = $m; + $g = $v; + $b = $mid1; + break; + case 3: + $r = $m; + $g = $mid2; + $b = $v; + break; + case 4: + $r = $mid1; + $g = $m; + $b = $v; + break; + case 5: + $r = $v; + $g = $m; + $b = $mid2; + break; + } + } + $r = round( $r * 255, 0 ); + $g = round( $g * 255, 0 ); + $b = round( $b * 255, 0 ); + + if ( $to_hex ) { + + $r = ( $r < 15 ) ? '0' . dechex( $r ) : dechex( $r ); + $g = ( $g < 15 ) ? '0' . dechex( $g ) : dechex( $g ); + $b = ( $b < 15 ) ? '0' . dechex( $b ) : dechex( $b ); + + return "#$r$g$b"; + + } + + return "rgb($r, $g, $b)"; +} diff --git a/wp-content/themes/twentynineteen/inc/icon-functions.php b/wp-content/themes/twentynineteen/inc/icon-functions.php new file mode 100644 index 0000000..f5dccb0 --- /dev/null +++ b/wp-content/themes/twentynineteen/inc/icon-functions.php @@ -0,0 +1,108 @@ +theme_location ) { + $svg = twentynineteen_get_social_link_svg( $item->url, 26 ); + if ( empty( $svg ) ) { + $svg = twentynineteen_get_icon_svg( 'link' ); + } + $item_output = str_replace( $args->link_after, '' . $svg, $item_output ); + } + + return $item_output; +} +add_filter( 'walker_nav_menu_start_el', 'twentynineteen_nav_menu_social_icons', 10, 4 ); + +/** + * Add a dropdown icon to top-level menu items. + * + * @param string $output Nav menu item start element. + * @param object $item Nav menu item. + * @param int $depth Depth. + * @param object $args Nav menu args. + * @return string Nav menu item start element. + * Add a dropdown icon to top-level menu items + */ +function twentynineteen_add_dropdown_icons( $output, $item, $depth, $args ) { + + // Only add class to 'top level' items on the 'primary' menu. + if ( ! isset( $args->theme_location ) || 'menu-1' !== $args->theme_location ) { + return $output; + } + + if ( in_array( 'mobile-parent-nav-menu-item', $item->classes, true ) && isset( $item->original_id ) ) { + // Inject the keyboard_arrow_left SVG inside the parent nav menu item, and let the item link to the parent item. + // @todo Only do this for nested submenus? If on a first-level submenu, then really the link could be "#" since the desire is to remove the target entirely. + $link = sprintf( + '. + $output = preg_replace( + '##i', + '', + $output, + 1 // Limit. + ); + + } elseif ( in_array( 'menu-item-has-children', $item->classes, true ) ) { + + // Add SVG icon to parent items. + $icon = twentynineteen_get_icon_svg( 'keyboard_arrow_down', 24 ); + + $output .= sprintf( + '', + $icon + ); + } + + return $output; +} +add_filter( 'walker_nav_menu_start_el', 'twentynineteen_add_dropdown_icons', 10, 4 ); diff --git a/wp-content/themes/twentynineteen/inc/template-functions.php b/wp-content/themes/twentynineteen/inc/template-functions.php new file mode 100644 index 0000000..3babf9f --- /dev/null +++ b/wp-content/themes/twentynineteen/inc/template-functions.php @@ -0,0 +1,211 @@ +'; + } +} +add_action( 'wp_head', 'twentynineteen_pingback_header' ); + +/** + * Changes comment form default fields. + */ +function twentynineteen_comment_form_defaults( $defaults ) { + $comment_field = $defaults['comment_field']; + + // Adjust height of comment form. + $defaults['comment_field'] = preg_replace( '/rows="\d+"/', 'rows="5"', $comment_field ); + + return $defaults; +} +add_filter( 'comment_form_defaults', 'twentynineteen_comment_form_defaults' ); + +/** + * Filters the default archive titles. + */ +function twentynineteen_get_the_archive_title() { + if ( is_category() ) { + $title = __( 'Category Archives: ', 'twentynineteen' ) . '' . single_term_title( '', false ) . ''; + } elseif ( is_tag() ) { + $title = __( 'Tag Archives: ', 'twentynineteen' ) . '' . single_term_title( '', false ) . ''; + } elseif ( is_author() ) { + $title = __( 'Author Archives: ', 'twentynineteen' ) . '' . get_the_author_meta( 'display_name' ) . ''; + } elseif ( is_year() ) { + $title = __( 'Yearly Archives: ', 'twentynineteen' ) . '' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentynineteen' ) ) . ''; + } elseif ( is_month() ) { + $title = __( 'Monthly Archives: ', 'twentynineteen' ) . '' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentynineteen' ) ) . ''; + } elseif ( is_day() ) { + $title = __( 'Daily Archives: ', 'twentynineteen' ) . '' . get_the_date() . ''; + } elseif ( is_post_type_archive() ) { + $title = __( 'Post Type Archives: ', 'twentynineteen' ) . '' . post_type_archive_title( '', false ) . ''; + } elseif ( is_tax() ) { + $tax = get_taxonomy( get_queried_object()->taxonomy ); + /* translators: %s: Taxonomy singular name. */ + $title = sprintf( esc_html__( '%s Archives:', 'twentynineteen' ), $tax->labels->singular_name ); + } else { + $title = __( 'Archives:', 'twentynineteen' ); + } + return $title; +} +add_filter( 'get_the_archive_title', 'twentynineteen_get_the_archive_title' ); + +/** + * Add custom sizes attribute to responsive image functionality for post thumbnails. + * + * @origin Twenty Nineteen 1.0 + * + * @param array $attr Attributes for the image markup. + * @return string Value for use in post thumbnail 'sizes' attribute. + */ +function twentynineteen_post_thumbnail_sizes_attr( $attr ) { + + if ( is_admin() ) { + return $attr; + } + + if ( ! is_singular() ) { + $attr['sizes'] = '(max-width: 34.9rem) calc(100vw - 2rem), (max-width: 53rem) calc(8 * (100vw / 12)), (min-width: 53rem) calc(6 * (100vw / 12)), 100vw'; + } + + return $attr; +} +add_filter( 'wp_get_attachment_image_attributes', 'twentynineteen_post_thumbnail_sizes_attr', 10, 1 ); + +/** + * Add an extra menu to our nav for our priority+ navigation to use + * + * @param object $nav_menu Nav menu. + * @param object $args Nav menu args. + * @return string More link for hidden menu items. + */ +function twentynineteen_add_ellipses_to_nav( $nav_menu, $args ) { + + if ( 'menu-1' === $args->theme_location ) : + + $nav_menu .= ' + '; + + endif; + + return $nav_menu; +} +add_filter( 'wp_nav_menu', 'twentynineteen_add_ellipses_to_nav', 10, 2 ); + +/** + * WCAG 2.0 Attributes for Dropdown Menus + * + * Adjustments to menu attributes tot support WCAG 2.0 recommendations + * for flyout and dropdown menus. + * + * @ref https://www.w3.org/WAI/tutorials/menus/flyout/ + */ +function twentynineteen_nav_menu_link_attributes( $atts, $item, $args, $depth ) { + + // Add [aria-haspopup] and [aria-expanded] to menu items that have children. + $item_has_children = in_array( 'menu-item-has-children', $item->classes ); + if ( $item_has_children ) { + $atts['aria-haspopup'] = 'true'; + $atts['aria-expanded'] = 'false'; + } + + return $atts; +} +add_filter( 'nav_menu_link_attributes', 'twentynineteen_nav_menu_link_attributes', 10, 4 ); + +/** + * Create a nav menu item to be displayed on mobile to navigate from submenu back to the parent. + * + * This duplicates each parent nav menu item and makes it the first child of itself. + * + * @param array $sorted_menu_items Sorted nav menu items. + * @param object $args Nav menu args. + * @return array Amended nav menu items. + */ +function twentynineteen_add_mobile_parent_nav_menu_items( $sorted_menu_items, $args ) { + static $pseudo_id = 0; + if ( ! isset( $args->theme_location ) || 'menu-1' !== $args->theme_location ) { + return $sorted_menu_items; + } + + $amended_menu_items = array(); + foreach ( $sorted_menu_items as $nav_menu_item ) { + $amended_menu_items[] = $nav_menu_item; + if ( in_array( 'menu-item-has-children', $nav_menu_item->classes, true ) ) { + $parent_menu_item = clone $nav_menu_item; + $parent_menu_item->original_id = $nav_menu_item->ID; + $parent_menu_item->ID = --$pseudo_id; + $parent_menu_item->db_id = $parent_menu_item->ID; + $parent_menu_item->object_id = $parent_menu_item->ID; + $parent_menu_item->classes = array( 'mobile-parent-nav-menu-item' ); + $parent_menu_item->menu_item_parent = $nav_menu_item->ID; + + $amended_menu_items[] = $parent_menu_item; + } + } + + return $amended_menu_items; +} +add_filter( 'wp_nav_menu_objects', 'twentynineteen_add_mobile_parent_nav_menu_items', 10, 2 ); diff --git a/wp-content/themes/twentynineteen/inc/template-tags.php b/wp-content/themes/twentynineteen/inc/template-tags.php new file mode 100644 index 0000000..e5a61aa --- /dev/null +++ b/wp-content/themes/twentynineteen/inc/template-tags.php @@ -0,0 +1,258 @@ +%2$s'; + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $time_string = ''; + } + + $time_string = sprintf( + $time_string, + esc_attr( get_the_date( DATE_W3C ) ), + esc_html( get_the_date() ), + esc_attr( get_the_modified_date( DATE_W3C ) ), + esc_html( get_the_modified_date() ) + ); + + printf( + '%1$s%3$s', + twentynineteen_get_icon_svg( 'watch', 16 ), + esc_url( get_permalink() ), + $time_string + ); + } +endif; + +if ( ! function_exists( 'twentynineteen_posted_by' ) ) : + /** + * Prints HTML with meta information about theme author. + */ + function twentynineteen_posted_by() { + printf( + /* translators: 1: SVG icon. 2: Post author, only visible to screen readers. 3: Author link. */ + '', + twentynineteen_get_icon_svg( 'person', 16 ), + __( 'Posted by', 'twentynineteen' ), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + esc_html( get_the_author() ) + ); + } +endif; + +if ( ! function_exists( 'twentynineteen_comment_count' ) ) : + /** + * Prints HTML with the comment count for the current post. + */ + function twentynineteen_comment_count() { + if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { + echo ''; + echo twentynineteen_get_icon_svg( 'comment', 16 ); + + /* translators: %s: Post title. Only visible to screen readers. */ + comments_popup_link( sprintf( __( 'Leave a comment on %s', 'twentynineteen' ), get_the_title() ) ); + + echo ''; + } + } +endif; + +if ( ! function_exists( 'twentynineteen_entry_footer' ) ) : + /** + * Prints HTML with meta information for the categories, tags and comments. + */ + function twentynineteen_entry_footer() { + + // Hide author, post date, category and tag text for pages. + if ( 'post' === get_post_type() ) { + + // Posted by. + twentynineteen_posted_by(); + + // Posted on. + twentynineteen_posted_on(); + + /* translators: Used between list items, there is a space after the comma. */ + $categories_list = get_the_category_list( __( ', ', 'twentynineteen' ) ); + if ( $categories_list ) { + printf( + /* translators: 1: SVG icon. 2: Posted in label, only visible to screen readers. 3: List of categories. */ + '%1$s%2$s%3$s', + twentynineteen_get_icon_svg( 'archive', 16 ), + __( 'Posted in', 'twentynineteen' ), + $categories_list + ); // WPCS: XSS OK. + } + + /* translators: Used between list items, there is a space after the comma. */ + $tags_list = get_the_tag_list( '', __( ', ', 'twentynineteen' ) ); + if ( $tags_list ) { + printf( + /* translators: 1: SVG icon. 2: Posted in label, only visible to screen readers. 3: List of tags. */ + '%1$s%2$s %3$s', + twentynineteen_get_icon_svg( 'tag', 16 ), + __( 'Tags:', 'twentynineteen' ), + $tags_list + ); // WPCS: XSS OK. + } + } + + // Comment count. + if ( ! is_singular() ) { + twentynineteen_comment_count(); + } + + // Edit post link. + edit_post_link( + sprintf( + wp_kses( + /* translators: %s: Post title. Only visible to screen readers. */ + __( 'Edit %s', 'twentynineteen' ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ), + get_the_title() + ), + '' . twentynineteen_get_icon_svg( 'edit', 16 ), + '' + ); + } +endif; + +if ( ! function_exists( 'twentynineteen_post_thumbnail' ) ) : + /** + * Displays an optional post thumbnail. + * + * Wraps the post thumbnail in an anchor element on index views, or a div + * element when on single views. + */ + function twentynineteen_post_thumbnail() { + if ( ! twentynineteen_can_show_post_thumbnail() ) { + return; + } + + if ( is_singular() ) : + ?> + +
            + +
            + + + +
            + +
            + + %s
            ', get_avatar( $id_or_email, twentynineteen_get_avatar_size() ) ); + } +endif; + +if ( ! function_exists( 'twentynineteen_discussion_avatars_list' ) ) : + /** + * Displays a list of avatars involved in a discussion for a given post. + */ + function twentynineteen_discussion_avatars_list( $comment_authors ) { + if ( empty( $comment_authors ) ) { + return; + } + echo '
              ', "\n"; + foreach ( $comment_authors as $id_or_email ) { + printf( + "
            1. %s
            2. \n", + twentynineteen_get_user_avatar_markup( $id_or_email ) + ); + } + echo '
            ', "\n"; + } +endif; + +if ( ! function_exists( 'twentynineteen_comment_form' ) ) : + /** + * Documentation for function. + */ + function twentynineteen_comment_form( $order ) { + if ( true === $order || strtolower( $order ) === strtolower( get_option( 'comment_order', 'asc' ) ) ) { + + comment_form( + array( + 'logged_in_as' => null, + 'title_reply' => null, + ) + ); + } + } +endif; + +if ( ! function_exists( 'twentynineteen_the_posts_navigation' ) ) : + /** + * Documentation for function. + */ + function twentynineteen_the_posts_navigation() { + the_posts_pagination( + array( + 'mid_size' => 2, + 'prev_text' => sprintf( + '%s %s', + twentynineteen_get_icon_svg( 'chevron_left', 22 ), + __( 'Newer posts', 'twentynineteen' ) + ), + 'next_text' => sprintf( + '%s %s', + __( 'Older posts', 'twentynineteen' ), + twentynineteen_get_icon_svg( 'chevron_right', 22 ) + ), + ) + ); + } +endif; + +if ( ! function_exists( 'wp_body_open' ) ) : + /** + * Fire the wp_body_open action. + * + * Added for backward compatibility to support pre-5.2.0 WordPress versions. + * + * @since Twenty Nineteen 1.4 + */ + function wp_body_open() { + /** + * Triggered after the opening tag. + * + * @since Twenty Nineteen 1.4 + */ + do_action( 'wp_body_open' ); + } +endif; diff --git a/wp-content/themes/twentynineteen/index.php b/wp-content/themes/twentynineteen/index.php new file mode 100644 index 0000000..ceaf2ae --- /dev/null +++ b/wp-content/themes/twentynineteen/index.php @@ -0,0 +1,47 @@ + + +
            +
            + + + +
            +
            + + getAvailableSpace( button, container ); + } + + /** + * Set menu container variable. + */ + var navContainer = document.querySelector('.main-navigation'); + var breaks = []; + + /** + * Let’s bail if we our menu doesn't exist. + */ + if ( ! navContainer ) { + return; + } + + /** + * Refreshes the list item from the menu depending on the menu size. + */ + function updateNavigationMenu( container ) { + + /** + * Let’s bail if our menu is empty. + */ + if ( ! container.parentNode.querySelector('.main-menu[id]') ) { + return; + } + + // Adds the necessary UI to operate the menu. + var visibleList = container.parentNode.querySelector('.main-menu[id]'); + var hiddenList = visibleList.parentNode.nextElementSibling.querySelector('.hidden-links'); + var toggleButton = visibleList.parentNode.nextElementSibling.querySelector('.main-menu-more-toggle'); + + if ( isOverflowingNavivation( visibleList, toggleButton, container ) ) { + + // Record the width of the list. + breaks.push( visibleList.offsetWidth ); + // Move last item to the hidden list. + prependElement( hiddenList, ! visibleList.lastChild || null === visibleList.lastChild ? visibleList.previousElementSibling : visibleList.lastChild ); + // Show the toggle button. + showButton( toggleButton ); + + } else { + + // There is space for another item in the nav. + if ( getAvailableSpace( toggleButton, container ) > breaks[breaks.length - 1] ) { + // Move the item to the visible list. + visibleList.appendChild( hiddenList.firstChild.nextSibling ); + breaks.pop(); + } + + // Hide the dropdown btn if hidden list is empty. + if (breaks.length < 2) { + hideButton( toggleButton ); + } + } + + // Recur if the visible list is still overflowing the nav. + if ( isOverflowingNavivation( visibleList, toggleButton, container ) ) { + updateNavigationMenu( container ); + } + } + + /** + * Run our priority+ function as soon as the document is `ready`. + */ + document.addEventListener( 'DOMContentLoaded', function() { + + updateNavigationMenu( navContainer ); + + // Also, run our priority+ function on selective refresh in the customizer. + var hasSelectiveRefresh = ( + 'undefined' !== typeof wp && + wp.customize && + wp.customize.selectiveRefresh && + wp.customize.navMenusPreview.NavMenuInstancePartial + ); + + if ( hasSelectiveRefresh ) { + // Re-run our priority+ function on Nav Menu partial refreshes. + wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function ( placement ) { + + var isNewNavMenu = ( + placement && + placement.partial.id.includes( 'nav_menu_instance' ) && + 'null' !== placement.container[0].parentNode && + placement.container[0].parentNode.classList.contains( 'main-navigation' ) + ); + + if ( isNewNavMenu ) { + updateNavigationMenu( placement.container[0].parentNode ); + } + }); + } + }); + + /** + * Run our priority+ function on load. + */ + window.addEventListener( 'load', function() { + updateNavigationMenu( navContainer ); + }); + + /** + * Run our priority+ function every time the window resizes. + */ + var isResizing = false; + window.addEventListener( 'resize', + debounce( function() { + if ( isResizing ) { + return; + } + + isResizing = true; + setTimeout( function() { + updateNavigationMenu( navContainer ); + isResizing = false; + }, 150 ); + } ) + ); + + /** + * Run our priority+ function. + */ + updateNavigationMenu( navContainer ); + +})(); diff --git a/wp-content/themes/twentynineteen/js/skip-link-focus-fix.js b/wp-content/themes/twentynineteen/js/skip-link-focus-fix.js new file mode 100644 index 0000000..32ba80c --- /dev/null +++ b/wp-content/themes/twentynineteen/js/skip-link-focus-fix.js @@ -0,0 +1,33 @@ +/** + * File skip-link-focus-fix.js. + * + * Helps with accessibility for keyboard only users. + * + * This is the source file for what is minified in the twentynineteen_skip_link_focus_fix() PHP function. + * + * Learn more: https://git.io/vWdr2 + */ +( function() { + var isIe = /(trident|msie)/i.test( navigator.userAgent ); + + if ( isIe && document.getElementById && window.addEventListener ) { + window.addEventListener( 'hashchange', function() { + var id = location.hash.substring( 1 ), + element; + + if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { + return; + } + + element = document.getElementById( id ); + + if ( element ) { + if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { + element.tabIndex = -1; + } + + element.focus(); + } + }, false ); + } +} )(); diff --git a/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js b/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js new file mode 100644 index 0000000..c8d1dd0 --- /dev/null +++ b/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js @@ -0,0 +1,354 @@ +/** + * Touch & Keyboard navigation. + * + * Contains handlers for touch devices and keyboard navigation. + */ + +(function() { + + /** + * Debounce. + * + * @param {Function} func + * @param {number} wait + * @param {boolean} immediate + */ + function debounce(func, wait, immediate) { + 'use strict'; + + var timeout; + wait = (typeof wait !== 'undefined') ? wait : 20; + immediate = (typeof immediate !== 'undefined') ? immediate : true; + + return function() { + + var context = this, args = arguments; + var later = function() { + timeout = null; + + if (!immediate) { + func.apply(context, args); + } + }; + + var callNow = immediate && !timeout; + + clearTimeout(timeout); + timeout = setTimeout(later, wait); + + if (callNow) { + func.apply(context, args); + } + }; + } + + /** + * Add class. + * + * @param {Object} el + * @param {string} cls + */ + function addClass(el, cls) { + if ( ! el.className.match( '(?:^|\\s)' + cls + '(?!\\S)') ) { + el.className += ' ' + cls; + } + } + + /** + * Delete class. + * + * @param {Object} el + * @param {string} cls + */ + function deleteClass(el, cls) { + el.className = el.className.replace( new RegExp( '(?:^|\\s)' + cls + '(?!\\S)' ),'' ); + } + + /** + * Has class? + * + * @param {Object} el + * @param {string} cls + * + * @returns {boolean} Has class + */ + function hasClass(el, cls) { + + if ( el.className.match( '(?:^|\\s)' + cls + '(?!\\S)' ) ) { + return true; + } + } + + /** + * Toggle Aria Expanded state for screenreaders. + * + * @param {Object} ariaItem + */ + function toggleAriaExpandedState( ariaItem ) { + 'use strict'; + + var ariaState = ariaItem.getAttribute('aria-expanded'); + + if ( ariaState === 'true' ) { + ariaState = 'false'; + } else { + ariaState = 'true'; + } + + ariaItem.setAttribute('aria-expanded', ariaState); + } + + /** + * Open sub-menu. + * + * @param {Object} currentSubMenu + */ + function openSubMenu( currentSubMenu ) { + 'use strict'; + + // Update classes. + // classList.add is not supported in IE11. + currentSubMenu.parentElement.className += ' off-canvas'; + currentSubMenu.parentElement.lastElementChild.className += ' expanded-true'; + + // Update aria-expanded state. + toggleAriaExpandedState( currentSubMenu ); + } + + /** + * Close sub-menu. + * + * @param {Object} currentSubMenu + */ + function closeSubMenu( currentSubMenu ) { + 'use strict'; + + var menuItem = getCurrentParent( currentSubMenu, '.menu-item' ); // this.parentNode + var menuItemAria = menuItem.querySelector('a[aria-expanded]'); + var subMenu = currentSubMenu.closest('.sub-menu'); + + // If this is in a sub-sub-menu, go back to parent sub-menu. + if ( getCurrentParent( currentSubMenu, 'ul' ).classList.contains( 'sub-menu' ) ) { + + // Update classes. + // classList.remove is not supported in IE11. + menuItem.className = menuItem.className.replace( 'off-canvas', '' ); + subMenu.className = subMenu.className.replace( 'expanded-true', '' ); + + // Update aria-expanded and :focus states. + toggleAriaExpandedState( menuItemAria ); + + // Or else close all sub-menus. + } else { + + // Update classes. + // classList.remove is not supported in IE11. + menuItem.className = menuItem.className.replace( 'off-canvas', '' ); + menuItem.lastElementChild.className = menuItem.lastElementChild.className.replace( 'expanded-true', '' ); + + // Update aria-expanded and :focus states. + toggleAriaExpandedState( menuItemAria ); + } + } + + /** + * Find first ancestor of an element by selector. + * + * @param {Object} child + * @param {String} selector + * @param {String} stopSelector + */ + function getCurrentParent( child, selector, stopSelector ) { + + var currentParent = null; + + while ( child ) { + + if ( child.matches(selector) ) { + + currentParent = child; + break; + + } else if ( stopSelector && child.matches(stopSelector) ) { + + break; + } + + child = child.parentElement; + } + + return currentParent; + } + + /** + * Remove all off-canvas states. + */ + function removeAllFocusStates() { + 'use strict'; + + var siteBranding = document.getElementsByClassName( 'site-branding' )[0]; + var getFocusedElements = siteBranding.querySelectorAll(':hover, :focus, :focus-within'); + var getFocusedClassElements = siteBranding.querySelectorAll('.is-focused'); + var i; + var o; + + for ( i = 0; i < getFocusedElements.length; i++) { + getFocusedElements[i].blur(); + } + + for ( o = 0; o < getFocusedClassElements.length; o++) { + deleteClass( getFocusedClassElements[o], 'is-focused' ); + } + } + + /** + * Matches polyfill for IE11. + */ + if (!Element.prototype.matches) { + Element.prototype.matches = Element.prototype.msMatchesSelector; + } + + /** + * Toggle `focus` class to allow sub-menu access on touch screens. + */ + function toggleSubmenuDisplay() { + + document.addEventListener('touchstart', function(event) { + + if ( event.target.matches('a') ) { + + var url = event.target.getAttribute( 'href' ) ? event.target.getAttribute( 'href' ) : ''; + + // Open submenu if URL is #. + if ( '#' === url && event.target.nextSibling.matches('.submenu-expand') ) { + openSubMenu( event.target ); + } + } + + // Check if .submenu-expand is touched. + if ( event.target.matches('.submenu-expand') ) { + openSubMenu(event.target); + + // Check if child of .submenu-expand is touched. + } else if ( null != getCurrentParent( event.target, '.submenu-expand' ) && + getCurrentParent( event.target, '.submenu-expand' ).matches( '.submenu-expand' ) ) { + openSubMenu( getCurrentParent( event.target, '.submenu-expand' ) ); + + // Check if .menu-item-link-return is touched. + } else if ( event.target.matches('.menu-item-link-return') ) { + closeSubMenu( event.target ); + + // Check if child of .menu-item-link-return is touched. + } else if ( null != getCurrentParent( event.target, '.menu-item-link-return' ) && getCurrentParent( event.target, '.menu-item-link-return' ).matches( '.menu-item-link-return' ) ) { + closeSubMenu( event.target ); + } + + // Prevent default mouse/focus events. + removeAllFocusStates(); + + }, false); + + document.addEventListener('touchend', function(event) { + + var mainNav = getCurrentParent( event.target, '.main-navigation' ); + + if ( null != mainNav && hasClass( mainNav, '.main-navigation' ) ) { + // Prevent default mouse events. + event.preventDefault(); + + } else if ( + event.target.matches('.submenu-expand') || + null != getCurrentParent( event.target, '.submenu-expand' ) && + getCurrentParent( event.target, '.submenu-expand' ).matches( '.submenu-expand' ) || + event.target.matches('.menu-item-link-return') || + null != getCurrentParent( event.target, '.menu-item-link-return' ) && + getCurrentParent( event.target, '.menu-item-link-return' ).matches( '.menu-item-link-return' ) ) { + // Prevent default mouse events. + event.preventDefault(); + } + + // Prevent default mouse/focus events. + removeAllFocusStates(); + + }, false); + + document.addEventListener('focus', function(event) { + + if ( event.target.matches('.main-navigation > div > ul > li a') ) { + + // Remove Focused elements in sibling div. + var currentDiv = getCurrentParent( event.target, 'div', '.main-navigation' ); + var currentDivSibling = currentDiv.previousElementSibling === null ? currentDiv.nextElementSibling : currentDiv.previousElementSibling; + var focusedElement = currentDivSibling.querySelector( '.is-focused' ); + var focusedClass = 'is-focused'; + var prevLi = getCurrentParent( event.target, '.main-navigation > div > ul > li', '.main-navigation' ).previousElementSibling; + var nextLi = getCurrentParent( event.target, '.main-navigation > div > ul > li', '.main-navigation' ).nextElementSibling; + + if ( null !== focusedElement && null !== hasClass( focusedElement, focusedClass ) ) { + deleteClass( focusedElement, focusedClass ); + } + + // Add .is-focused class to top-level li. + if ( getCurrentParent( event.target, '.main-navigation > div > ul > li', '.main-navigation' ) ) { + addClass( getCurrentParent( event.target, '.main-navigation > div > ul > li', '.main-navigation' ), focusedClass ); + } + + // Check for previous li. + if ( prevLi && hasClass( prevLi, focusedClass ) ) { + deleteClass( prevLi, focusedClass ); + } + + // Check for next li. + if ( nextLi && hasClass( nextLi, focusedClass ) ) { + deleteClass( nextLi, focusedClass ); + } + } + + }, true); + + document.addEventListener('click', function(event) { + + // Remove all focused menu states when clicking outside site branding. + if ( event.target !== document.getElementsByClassName( 'site-branding' )[0] ) { + removeAllFocusStates(); + } else { + // Nothing. + } + + }, false); + } + + /** + * Run our sub-menu function as soon as the document is `ready`. + */ + document.addEventListener( 'DOMContentLoaded', function() { + toggleSubmenuDisplay(); + }); + + /** + * Run our sub-menu function on selective refresh in the customizer. + */ + document.addEventListener( 'customize-preview-menu-refreshed', function( e, params ) { + if ( 'menu-1' === params.wpNavMenuArgs.theme_location ) { + toggleSubmenuDisplay(); + } + }); + + /** + * Run our sub-menu function every time the window resizes. + */ + var isResizing = false; + window.addEventListener( 'resize', function() { + isResizing = true; + debounce( function() { + if ( isResizing ) { + return; + } + + toggleSubmenuDisplay(); + isResizing = false; + + }, 150 ); + } ); + +})(); diff --git a/wp-content/themes/twentynineteen/package-lock.json b/wp-content/themes/twentynineteen/package-lock.json new file mode 100644 index 0000000..59d5354 --- /dev/null +++ b/wp-content/themes/twentynineteen/package-lock.json @@ -0,0 +1,4627 @@ +{ + "name": "twentynineteen", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "dev": true, + "requires": { + "call-me-maybe": "^1.0.1", + "glob-to-regexp": "^0.3.0" + } + }, + "@nodelib/fs.stat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", + "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", + "dev": true + }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/node": { + "version": "12.0.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.10.tgz", + "integrity": "sha512-LcsGbPomWsad6wmMNv7nBLw7YYYyfdYcz6xryKYQhx89c3XXan+8Q6AJ43G5XDIaklaVkK3mE4fCb0SBvMiPSQ==", + "dev": true + }, + "@wordpress/browserslist-config": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-2.5.0.tgz", + "integrity": "sha512-cspE4iJ87YjweKAtnIsCxm7ZJQ/ved3TdRJWS0DX/0AOukoRhOMYh7CP1aVc0M3J1kB4LtTY7u3HOcqF2Yf2VA==", + "dev": true + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "ajv": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "dev": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-map": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "async-foreach": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", + "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "autoprefixer": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.6.0.tgz", + "integrity": "sha512-kuip9YilBqhirhHEGHaBTZKXL//xxGnzvsD0FtBQa6z+A69qZD6s/BAX9VzDF1i9VKDquTJDQaPLSEhOnL6FvQ==", + "dev": true, + "requires": { + "browserslist": "^4.6.1", + "caniuse-lite": "^1.0.30000971", + "chalk": "^2.4.2", + "normalize-range": "^0.1.2", + "num2fraction": "^1.2.2", + "postcss": "^7.0.16", + "postcss-value-parser": "^3.3.1" + } + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true + }, + "block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "dev": true, + "requires": { + "inherits": "~2.0.0" + } + }, + "bluebird": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", + "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "browserslist": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.6.3.tgz", + "integrity": "sha512-CNBqTCq22RKM8wKJNowcqihHJ4SkI8CGeK7KOR9tPboXUuS5Zk5lQgzzTbs4oxD8x+6HUshZUa2OyNI9lR93bQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30000975", + "electron-to-chromium": "^1.3.164", + "node-releases": "^1.1.23" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", + "dev": true + }, + "caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "dev": true, + "requires": { + "callsites": "^2.0.0" + } + }, + "caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "dev": true, + "requires": { + "caller-callsite": "^2.0.0" + } + }, + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + } + } + }, + "caniuse-lite": { + "version": "1.0.30000978", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000978.tgz", + "integrity": "sha512-H6gK6kxUzG6oAwg/Jal279z8pHw0BzrpZfwo/CA9FFm/vA0l8IhDfkZtepyJNE2Y4V6Dp3P3ubz6czby1/Mgsw==", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chokidar": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.1.tgz", + "integrity": "sha512-gfw3p2oQV2wEt+8VuMlNsPjCxDxvvgnm/kz+uATu805mWVF8IJN7uz9DN7iBz+RMJISmiVbCOBFs9qBGMjtPfQ==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.0" + } + }, + "chokidar-cli": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chokidar-cli/-/chokidar-cli-2.0.0.tgz", + "integrity": "sha512-E3N0WlV1L4c60cs9owdGQpZXY5obZya5Xds7+sF6GTVWWZKwqlq9QG7c2ESPNtjS+5QusAg8VmUEnOnAtZYNcg==", + "dev": true, + "requires": { + "bluebird": "3.5.5", + "chokidar": "3.0.2", + "lodash": "4.17.15", + "yargs": "13.3.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "dev": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chokidar": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.0.2.tgz", + "integrity": "sha512-c4PR2egjNjI1um6bamCQ6bUNPDiyofNQruHvKgHQ4gDUP/ITSVSzNsiI5OWtHOsX323i5ha/kk4YmOZ1Ktg7KA==", + "dev": true, + "requires": { + "anymatch": "^3.0.1", + "braces": "^3.0.2", + "fsevents": "^2.0.6", + "glob-parent": "^5.0.0", + "is-binary-path": "^2.1.0", + "is-glob": "^4.0.1", + "normalize-path": "^3.0.0", + "readdirp": "^3.1.1" + } + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fsevents": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.0.tgz", + "integrity": "sha512-+iXhW3LuDQsno8dOIrCIT/CBjeBWuP7PXe8w9shnj9Lebny/Gx1ZjVBYwexLz36Ri2jKuXMNpV6CYNh8lHHgrQ==", + "dev": true, + "optional": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "glob-parent": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "readdirp": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.1.3.tgz", + "integrity": "sha512-ZOsfTGkjO2kqeR5Mzr5RYDbTGYneSkdNKX2fOX2P5jF7vMrd/GNnIAUtDldeHHumHUCQ3V05YfWUdxMPAsRu9Q==", + "dev": true, + "requires": { + "picomatch": "^2.0.4" + } + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" + } + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colors": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", + "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz", + "integrity": "sha1-0SG7roYNmZKj1Re6lvVliOR8Z4E=", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + }, + "dependencies": { + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + } + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "dependency-graph": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.8.0.tgz", + "integrity": "sha512-DCvzSq2UiMsuLnj/9AL484ummEgLtZIcRS7YvtO38QnpX3vqh9nJ8P+zhu8Ja+SmLrBHO2iDbva20jq38qvBkQ==", + "dev": true + }, + "dir-glob": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", + "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", + "dev": true, + "requires": { + "path-type": "^3.0.0" + }, + "dependencies": { + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "electron-to-chromium": { + "version": "1.3.179", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.179.tgz", + "integrity": "sha512-hRjlOdKImgIRicKYRY6hHbUMrX2NJYBrIusTepwPt/apcabuzrzhXpkkWu7elWdTZEQwKV6BfX8EvWIBWLCNQw==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "fast-glob": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", + "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.1.2", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.3", + "micromatch": "^3.1.10" + } + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "findup": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/findup/-/findup-0.1.5.tgz", + "integrity": "sha1-itkpozk7rGJ5V6fl3kYjsGsOLOs=", + "dev": true, + "requires": { + "colors": "~0.6.0-1", + "commander": "~2.1.0" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true, + "optional": true + }, + "minipass": { + "version": "2.3.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.3.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^4.1.0", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.7.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "yallist": { + "version": "3.0.3", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "fstream": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "gaze": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", + "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", + "dev": true, + "requires": { + "globule": "^1.0.0" + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", + "dev": true + }, + "globby": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz", + "integrity": "sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^1.0.2", + "dir-glob": "^2.2.2", + "fast-glob": "^2.2.6", + "glob": "^7.1.3", + "ignore": "^4.0.3", + "pify": "^4.0.1", + "slash": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } + } + }, + "globule": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz", + "integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==", + "dev": true, + "requires": { + "glob": "~7.1.1", + "lodash": "~4.17.10", + "minimatch": "~3.0.2" + } + }, + "graceful-fs": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", + "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==", + "dev": true + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "dev": true, + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + } + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-cwd": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz", + "integrity": "sha1-qmzzbnInYShcs3HsZRn1PiQ1sKk=", + "dev": true, + "requires": { + "import-from": "^2.1.0" + } + }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "dev": true, + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + } + }, + "import-from": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz", + "integrity": "sha1-M1238qev/VOqpHHUuAId7ja387E=", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + } + }, + "in-publish": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz", + "integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E=", + "dev": true + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "js-base64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz", + "integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "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, + "requires": { + "p-defer": "^1.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + } + }, + "merge2": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.3.tgz", + "integrity": "sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "dev": true + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "dev": true, + "requires": { + "mime-db": "1.40.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-gyp": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", + "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", + "dev": true, + "requires": { + "fstream": "^1.0.0", + "glob": "^7.0.3", + "graceful-fs": "^4.1.2", + "mkdirp": "^0.5.0", + "nopt": "2 || 3", + "npmlog": "0 || 1 || 2 || 3 || 4", + "osenv": "0", + "request": "^2.87.0", + "rimraf": "2", + "semver": "~5.3.0", + "tar": "^2.0.0", + "which": "1" + }, + "dependencies": { + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true + } + } + }, + "node-releases": { + "version": "1.1.24", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.24.tgz", + "integrity": "sha512-wym2jptfuKowMmkZsfCSTsn8qAVo8zm+UiQA6l5dNqUcpfChZSnS/vbbpOeXczf+VdPhutxh+99lWHhdd6xKzg==", + "dev": true, + "requires": { + "semver": "^5.3.0" + } + }, + "node-sass": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.12.0.tgz", + "integrity": "sha512-A1Iv4oN+Iel6EPv77/HddXErL2a+gZ4uBeZUy+a8O35CFYTXhgA8MgLCWBtwpGZdCvTvQ9d+bQxX/QC36GDPpQ==", + "dev": true, + "requires": { + "async-foreach": "^0.1.3", + "chalk": "^1.1.1", + "cross-spawn": "^3.0.0", + "gaze": "^1.0.0", + "get-stdin": "^4.0.1", + "glob": "^7.0.3", + "in-publish": "^2.0.0", + "lodash": "^4.17.11", + "meow": "^3.7.0", + "mkdirp": "^0.5.1", + "nan": "^2.13.2", + "node-gyp": "^3.8.0", + "npmlog": "^4.0.0", + "request": "^2.88.0", + "sass-graph": "^2.2.4", + "stdout-stream": "^1.4.0", + "true-case-path": "^1.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "cross-spawn": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", + "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "which": "^1.2.9" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=", + "dev": true + }, + "npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "dependencies": { + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "num2fraction": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", + "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=", + "dev": true + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "dev": true + }, + "p-limit": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "picomatch": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", + "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==", + "dev": true + }, + "pidtree": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.0.tgz", + "integrity": "sha512-9CT4NFlDcosssyg8KVFltgokyKZIFjoBxw8CTGy+5F38Y1eQWrt8tRayiUOXE+zVKQnYu5BR8JjCtvK3BcnBhg==", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "postcss": { + "version": "7.0.17", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.17.tgz", + "integrity": "sha512-546ZowA+KZ3OasvQZHsbuEpysvwTZNGJv9EfyCQdsIDltPSWHAeTQ5fQy/Npi2ZDtLI3zs7Ps/p6wThErhm9fQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "source-map": "^0.6.1", + "supports-color": "^6.1.0" + }, + "dependencies": { + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-cli": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-cli/-/postcss-cli-6.1.2.tgz", + "integrity": "sha512-jIWfIkqt8cTThSpH8DBaNxHlBf99OKSem2RseRpfVPqWayxHKQB0IWdS/IF5XSGeFU5QslSDTdVHnw6qggXGkA==", + "dev": true, + "requires": { + "chalk": "^2.1.0", + "chokidar": "^2.0.0", + "dependency-graph": "^0.8.0", + "fs-extra": "^7.0.0", + "get-stdin": "^6.0.0", + "globby": "^9.0.0", + "postcss": "^7.0.0", + "postcss-load-config": "^2.0.0", + "postcss-reporter": "^6.0.0", + "pretty-hrtime": "^1.0.3", + "read-cache": "^1.0.0", + "yargs": "^12.0.1" + }, + "dependencies": { + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + } + } + }, + "postcss-focus-within": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-focus-within/-/postcss-focus-within-3.0.0.tgz", + "integrity": "sha512-W0APui8jQeBKbCGZudW37EeMCjDeVxKgiYfIIEo8Bdh5SpB9sxds/Iq8SEuzS0Q4YFOlG7EPFulbbxujpkrV2w==", + "dev": true, + "requires": { + "postcss": "^7.0.2" + } + }, + "postcss-load-config": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-2.1.0.tgz", + "integrity": "sha512-4pV3JJVPLd5+RueiVVB+gFOAa7GWc25XQcMp86Zexzke69mKf6Nx9LRcQywdz7yZI9n1udOxmLuAwTBypypF8Q==", + "dev": true, + "requires": { + "cosmiconfig": "^5.0.0", + "import-cwd": "^2.0.0" + } + }, + "postcss-reporter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-6.0.1.tgz", + "integrity": "sha512-LpmQjfRWyabc+fRygxZjpRxfhRf9u/fdlKf4VHG4TSPbV2XNsuISzYW1KL+1aQzx53CAppa1bKG4APIB/DOXXw==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "lodash": "^4.17.11", + "log-symbols": "^2.2.0", + "postcss": "^7.0.7" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "psl": { + "version": "1.1.33", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.33.tgz", + "integrity": "sha512-LTDP2uSrsc7XCb5lO7A8BI1qYxRe/8EqlRvMeEl6rsnYAqDOl8xHR+8lSAIVfrNaSAlTPTNOCgNjWcoUL3AZsw==", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha1-5mTvMRYRZsl1HNvo28+GtftY93Q=", + "dev": true, + "requires": { + "pify": "^2.3.0" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + } + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "resolve": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", + "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rtlcss": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/rtlcss/-/rtlcss-2.4.0.tgz", + "integrity": "sha512-hdjFhZ5FCI0ABOfyXOMOhBtwPWtANLCG7rOiOcRf+yi5eDdxmDjqBruWouEnwVdzfh/TWF6NNncIEsigOCFZOA==", + "dev": true, + "requires": { + "chalk": "^2.3.0", + "findup": "^0.1.5", + "mkdirp": "^0.5.1", + "postcss": "^6.0.14", + "strip-json-comments": "^2.0.0" + }, + "dependencies": { + "postcss": { + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + } + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "sass-graph": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz", + "integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=", + "dev": true, + "requires": { + "glob": "^7.0.0", + "lodash": "^4.0.0", + "scss-tokenizer": "^0.2.3", + "yargs": "^7.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yargs": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.0" + } + }, + "yargs-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", + "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "dev": true, + "requires": { + "camelcase": "^3.0.0" + } + } + } + }, + "scss-tokenizer": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz", + "integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=", + "dev": true, + "requires": { + "js-base64": "^2.1.8", + "source-map": "^0.4.2" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "~0.0.0", + "array-map": "~0.0.0", + "array-reduce": "~0.0.0", + "jsonify": "~0.0.0" + } + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", + "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stdout-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz", + "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "string.prototype.padend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz", + "integrity": "sha1-86rvfBcZ8XDF6rHDK/eA2W4h8vA=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.4.3", + "function-bind": "^1.0.2" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "tar": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", + "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", + "dev": true, + "requires": { + "block-stream": "*", + "fstream": "^1.0.12", + "inherits": "2" + } + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "true-case-path": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz", + "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==", + "dev": true, + "requires": { + "glob": "^7.1.2" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "upath": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", + "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } +} diff --git a/wp-content/themes/twentynineteen/package.json b/wp-content/themes/twentynineteen/package.json new file mode 100644 index 0000000..b2c6879 --- /dev/null +++ b/wp-content/themes/twentynineteen/package.json @@ -0,0 +1,44 @@ +{ + "name": "twentynineteen", + "version": "1.0.0", + "description": "Default WP Theme", + "bugs": { + "url": "https://github.com/WordPress/twentynineteen/issues" + }, + "homepage": "https://github.com/WordPress/twentynineteen#readme", + "devDependencies": { + "@wordpress/browserslist-config": "^2.5.0", + "autoprefixer": "^9.6.0", + "chokidar-cli": "^2.0.0", + "node-sass": "^4.12.0", + "npm-run-all": "^4.1.5", + "postcss-cli": "^6.1.2", + "postcss-focus-within": "^3.0.0", + "rtlcss": "^2.4.0" + }, + "rtlcssConfig": { + "options": { + "autoRename": false, + "autoRenameStrict": false, + "blacklist": {}, + "clean": true, + "greedy": false, + "processUrls": false, + "stringMap": [] + }, + "plugins": [], + "map": false + }, + "browserslist": [ + "extends @wordpress/browserslist-config" + ], + "scripts": { + "build:style": "node-sass style.scss style.css --output-style expanded && postcss -r style.css", + "build:style-editor": "node-sass style-editor.scss style-editor.css --output-style expanded && postcss -r style-editor.css", + "build:style-editor-customizer": "node-sass style-editor-customizer.scss style-editor-customizer.css --output-style expanded && postcss -r style-editor-customizer.css", + "build:rtl": "rtlcss style.css style-rtl.css", + "build:print": "node-sass print.scss print.css --output-style expanded && postcss -r print.css", + "build": "run-p \"build:*\"", + "watch": "chokidar \"**/*.scss\" -c \"npm run build\" --initial" + } +} diff --git a/wp-content/themes/twentynineteen/page.php b/wp-content/themes/twentynineteen/page.php new file mode 100644 index 0000000..6666edb --- /dev/null +++ b/wp-content/themes/twentynineteen/page.php @@ -0,0 +1,38 @@ + + +
            +
            + + + +
            +
            + +>> TABLE OF CONTENTS: +---------------------------------------------------------------- +# Margins +# Typography +# Page breaks +# Links +# Visibility +--------------------------------------------------------------*/ +@media print { + /* Margins */ + @page { + margin: 2cm; + } + .entry { + margin-top: 1em; + } + .entry .entry-header, .site-footer .site-info { + margin: 0; + } + /* Fonts */ + body { + font: 13pt Georgia, "Times New Roman", Times, serif; + line-height: 1.3; + background: #fff !important; + color: #000; + } + h1 { + font-size: 24pt; + } + h2, + h3, + h4, + .has-regular-font-size, + .has-large-font-size, + h2.author-title, + p.author-bio, + .comments-title, h3 { + font-size: 14pt; + margin-top: 25px; + } + /* Page breaks */ + a { + page-break-inside: avoid; + } + blockquote { + page-break-inside: avoid; + } + h1, + h2, + h3, + h4, + h5, + h6 { + page-break-after: avoid; + page-break-inside: avoid; + } + img { + page-break-inside: avoid; + page-break-after: avoid; + } + table, pre { + page-break-inside: avoid; + } + ul, ol, dl { + page-break-before: avoid; + } + /* Links */ + a:link, a:visited, a { + background: transparent; + font-weight: bold; + text-decoration: underline; + text-align: left; + } + a { + page-break-inside: avoid; + } + a[href^=http]:after { + content: " < " attr(href) "> "; + } + a:after > img { + content: ""; + } + article a[href^="#"]:after { + content: ""; + } + a:not(:local-link):after { + content: " < " attr(href) "> "; + } + /* Visibility */ + .main-navigation, + .site-title + .main-navigation, + .social-navigation, + .site-branding-container:before, + .entry .entry-title:before, + .entry-footer, + .author-description:before, + .post-navigation, + .widget-area, + .comment-form-flex, + .comment-reply, + .comment .comment-metadata .edit-link { + display: none; + } + .entry .entry-content .wp-block-button .wp-block-button__link, + .entry .entry-content .button { + color: #000; + background: none; + } + /* Site Header (With Featured Image) */ + .site-header.featured-image { + min-height: 0; + } + .site-header.featured-image .main-navigation a, + .site-header.featured-image .main-navigation a + svg, + .site-header.featured-image .social-navigation a, + .site-header.featured-image .site-title a, + .site-header.featured-image .site-featured-image a, + .site-header.featured-image .site-branding .site-title, + .site-header.featured-image .site-branding .site-description, + .site-header.featured-image .main-navigation a:after, + .site-header.featured-image .main-navigation .main-menu > li.menu-item-has-children:after, + .site-header.featured-image .main-navigation li, + .site-header.featured-image .social-navigation li, + .site-header.featured-image .entry-meta, + .site-header.featured-image .entry-title, + .site-header.featured-image#masthead .site-title a { + color: #000; + text-shadow: none; + } + .site-header.featured-image .site-featured-image .entry-header, + .site-header.featured-image .site-branding-container { + margin-top: 0; + margin-bottom: 0; + } + .site-header.featured-image .site-featured-image .post-thumbnail img { + position: relative; + height: initial; + width: initial; + object-fit: none; + min-width: 0; + min-height: 0; + max-width: 100%; + margin-top: 1rem; + } + /* Remove image filters from featured image */ + .image-filters-enabled *:after { + display: none !important; + } + .image-filters-enabled .site-header.featured-image .site-featured-image:before { + display: none; + } + .image-filters-enabled .site-header.featured-image .site-featured-image .post-thumbnail img { + filter: none; + } +} diff --git a/wp-content/themes/twentynineteen/print.scss b/wp-content/themes/twentynineteen/print.scss new file mode 100644 index 0000000..47976da --- /dev/null +++ b/wp-content/themes/twentynineteen/print.scss @@ -0,0 +1,198 @@ +/* +Theme Name: Twenty Nineteen + +Adding print support. The print styles are based on the the great work of +Andreas Hecht in https://www.jotform.com/blog/css-perfect-print-stylesheet-98272/. +*/ + +/*-------------------------------------------------------------- +>>> TABLE OF CONTENTS: +---------------------------------------------------------------- +# Margins +# Typography +# Page breaks +# Links +# Visibility +--------------------------------------------------------------*/ + +@media print { + + /* Margins */ + + @page { + margin: 2cm; + } + + .entry { + margin-top: 1em; + } + + .entry .entry-header, .site-footer .site-info { + margin: 0; + } + + /* Fonts */ + + body { + font: 13pt Georgia, "Times New Roman", Times, serif; + line-height: 1.3; + background: #fff !important; + color: #000; + } + + h1 { + font-size: 24pt; + } + + h2, + h3, + h4, + .has-regular-font-size, + .has-large-font-size, + h2.author-title, + p.author-bio, + .comments-title, h3 { + font-size: 14pt; + margin-top: 25px; + } + + /* Page breaks */ + + a { + page-break-inside: avoid + } + + blockquote { + page-break-inside: avoid; + } + + h1, + h2, + h3, + h4, + h5, + h6 { + page-break-after: avoid; + page-break-inside: avoid + } + + img { + page-break-inside: avoid; + page-break-after: avoid; + } + + table, pre { + page-break-inside: avoid; + } + + ul, ol, dl { + page-break-before: avoid; + } + + /* Links */ + + a:link, a:visited, a { + background: transparent; + font-weight: bold; + text-decoration: underline; + text-align: left; + } + + a { + page-break-inside: avoid; + } + + a[href^=http]:after { + content: " < " attr(href) "> "; + } + + a:after > img { + content: ""; + } + + article a[href^="#"]:after { + content: ""; + } + + a:not(:local-link):after { + content: " < " attr(href) "> "; + } + + /* Visibility */ + .main-navigation, + .site-title + .main-navigation, + .social-navigation, + .site-branding-container:before, + .entry .entry-title:before, + .entry-footer, + .author-description:before, + .post-navigation, + .widget-area, + .comment-form-flex, + .comment-reply, + .comment .comment-metadata .edit-link { + display: none; + } + + .entry .entry-content .wp-block-button .wp-block-button__link, + .entry .entry-content .button { + color: #000; + background: none; + } + + /* Site Header (With Featured Image) */ + .site-header.featured-image { + min-height: 0; + + .main-navigation a, + .main-navigation a + svg, + .social-navigation a, + .site-title a, + .site-featured-image a, + .site-branding .site-title, + .site-branding .site-description, + .main-navigation a:after, + .main-navigation .main-menu > li.menu-item-has-children:after, + .main-navigation li, + .social-navigation li, + .entry-meta, + .entry-title, + &#masthead .site-title a { + color: #000; + text-shadow: none; + } + + .site-featured-image .entry-header, + .site-branding-container { + margin-top: 0; + margin-bottom: 0; + } + + .site-featured-image .post-thumbnail img { + position: relative; + height: initial; + width: initial; + object-fit: none; + min-width: 0; + min-height: 0; + max-width: 100%; + margin-top: 1rem; + } + } + + /* Remove image filters from featured image */ + .image-filters-enabled { + + *:after { + display: none !important; + } + + .site-header.featured-image .site-featured-image:before { + display: none; + } + + .site-header.featured-image .site-featured-image .post-thumbnail img { + filter: none; + } + } +} \ No newline at end of file diff --git a/wp-content/themes/twentynineteen/readme.txt b/wp-content/themes/twentynineteen/readme.txt new file mode 100644 index 0000000..c871d92 --- /dev/null +++ b/wp-content/themes/twentynineteen/readme.txt @@ -0,0 +1,74 @@ +=== Twenty Nineteen === +Contributors: wordpressdotorg +Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, rtl-language-support, sticky-post, threaded-comments, translation-ready +Requires at least: 4.9.6 +Tested up to: 5.0 +Stable tag: 1.5 +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html + +Our 2019 default theme is designed to show off the power of the block editor. + +== Description == +Our 2019 default theme is designed to show off the power of the block editor. It features custom styles for all the default blocks, and is built so that what you see in the editor looks like what you'll see on your website. Twenty Nineteen is designed to be adaptable to a wide range of websites, whether you’re running a photo blog, launching a new business, or supporting a non-profit. Featuring ample whitespace and modern sans-serif headlines paired with classic serif body text, it's built to be beautiful on all screen sizes. + +For more information about Twenty Nineteen please go to https://wordpress.org/support/article/twenty-nineteen/. + +== Installation == + +1. In your admin panel, go to Appearance -> Themes and click the 'Add New' button. +2. Type in Twenty Nineteen in the search form and press the 'Enter' key on your keyboard. +3. Click on the 'Activate' button to use your new theme right away. +4. Go to https://wordpress.org/support/article/twenty-nineteen/ for a guide on how to customize this theme. +5. Navigate to Appearance > Customize in your admin panel and customize to taste. + +== Copyright == + +Twenty Nineteen WordPress Theme, Copyright 2018-2020 WordPress.org +Twenty Nineteen is distributed under the terms of the GNU GPL + +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 2 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. + +== Changelog == + += 1.5 = +* Released: March 31, 2020 + +https://codex.wordpress.org/Twenty_Nineteen_Theme_Changelog#Version_1.5 + += 1.4 = +* Released: May 7, 2019 + +https://codex.wordpress.org/Twenty_Nineteen_Theme_Changelog#Version_1.4 + += 1.3 = +* Released: February 21, 2019 + +https://codex.wordpress.org/Twenty_Nineteen_Theme_Changelog#Version_1.3 + += 1.2 = +* Released: January 9, 2019 + +https://codex.wordpress.org/Twenty_Nineteen_Theme_Changelog#Version_1.2 + += 1.1 = +* Released: December 19, 2018 + +https://codex.wordpress.org/Twenty_Nineteen_Theme_Changelog#Version_1.1 + += 1.0 = +* Released: December 6, 2018 + +Initial release + +== Resources == +* normalize.css, © 2012-2018 Nicolas Gallagher and Jonathan Neal, MIT +* Underscores, © 2012-2019 Automattic, Inc., GNU GPL v2 or later diff --git a/wp-content/themes/twentynineteen/sass/_normalize.scss b/wp-content/themes/twentynineteen/sass/_normalize.scss new file mode 100644 index 0000000..c5ad67a --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/_normalize.scss @@ -0,0 +1,341 @@ +/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ + +/* Document + ========================================================================== */ + +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ + +html { + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers. + */ + +body { + margin: 0; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/* Grouping content + ========================================================================== */ + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + +hr { + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +pre { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Remove the gray background on active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + +abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, +strong { + font-weight: bolder; +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +code, +kbd, +samp { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/** + * Add the correct font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove the border on images inside links in IE 10. + */ + +img { + border-style: none; +} + +/* Forms + ========================================================================== */ + +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ +} + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, +input { /* 1 */ + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + +button, +select { /* 1 */ + text-transform: none; +} + +/** + * Correct the inability to style clickable types in iOS and Safari. + */ + +button, +[type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +/** + * Remove the inner border and padding in Firefox. + */ + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Correct the padding in Firefox. + */ + +fieldset { + padding: 0.35em 0.75em 0.625em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + +legend { + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ +} + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + vertical-align: baseline; +} + +/** + * Remove the default vertical scrollbar in IE 10+. + */ + +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ + +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + +[type="search"] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ +} + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + +::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ +} + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ + +details { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Misc + ========================================================================== */ + +/** + * Add the correct display in IE 10+. + */ + +template { + display: none; +} + +/** + * Add the correct display in IE 10. + */ + +[hidden] { + display: none; +} diff --git a/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss b/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss new file mode 100644 index 0000000..e4b3134 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss @@ -0,0 +1,1032 @@ +/* !Block styles */ + + +// Default block margin and alignment rules. +// These are replicated inside of the Group block +// so that child blocks in there appear the same way. +.entry .entry-content > *, +.entry .entry-summary > *, +.entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *, +.entry .entry-content > .wp-block-group > .wp-block-group__inner-container > * { + margin: 32px 0; + max-width: 100%; + + @include postContentMaxWidth(); + + @include media(tablet) { + margin: 32px 0; + } + + &.alignwide { + margin-left: auto; + margin-right: auto; + clear: both; + + @include media(tablet) { + width: 100%; + max-width: 100%; + } + } + + &.alignfull { + position: relative; + left: -#{$size__spacing-unit }; + width: calc( 100% + (2 * #{$size__spacing-unit})); + max-width: calc( 100% + (2 * #{$size__spacing-unit})); + clear: both; + + @include media(tablet) { + margin-top: calc(2 * #{$size__spacing-unit}); + margin-bottom: calc(2 * #{$size__spacing-unit}); + left: calc( -12.5% - 75px ); + width: calc( 125% + 150px ); + max-width: calc( 125% + 150px ); + } + } + + &.alignleft { + /*rtl:ignore*/ + float: left; + max-width: calc(5 * (100vw / 12)); + margin-top: 0; + margin-left: 0; + /*rtl:ignore*/ + margin-right: $size__spacing-unit; + + @include media(tablet) { + max-width: calc(4 * (100vw / 12)); + /*rtl:ignore*/ + margin-right: calc(2 * #{$size__spacing-unit}); + } + } + + &.alignright { + /*rtl:ignore*/ + float: right; + max-width: calc(5 * (100vw / 12)); + margin-top: 0; + margin-right: 0; + /*rtl:ignore*/ + margin-left: $size__spacing-unit; + + @include media(tablet) { + max-width: calc(4 * (100vw / 12)); + margin-right: 0; + /*rtl:ignore*/ + margin-left: calc(2 * #{$size__spacing-unit}); + } + } + &.aligncenter { + margin-left: auto; + margin-right: auto; + + @include postContentMaxWidth(); + + @include media(tablet) { + margin-left: 0; + margin-right: 0; + } + } +} + +.entry .entry-content > *, +.entry .entry-summary > * { + + > *:first-child { + margin-top: 0; + } + + > *:last-child { + margin-bottom: 0; + } +} + +/* + * Unset nested content selector styles + * - Prevents layout styles from cascading too deeply + * - helps with plugin compatibility + */ +.entry .entry-content, +.entry .entry-summary { + + .entry-content, + .entry-summary, + .entry { + margin: inherit; + max-width: inherit; + padding: inherit; + + @include media(tablet) { + margin: inherit; + max-width: inherit; + padding: inherit; + } + } +} + +.entry .entry-content { + + //! Paragraphs + p.has-background { + padding: 20px 30px; + } + + //! Audio + .wp-block-audio { + + width: 100%; + + audio { + width: 100%; + } + + &.alignleft audio, + &.alignright audio { + + max-width: (0.33 * $mobile_width); + + @include media(tablet) { + max-width: (0.5 * $tablet_width); + } + + @include media(wide) { + max-width: (0.33 * $desktop_width); + } + } + } + + //! Video + .wp-block-video { + + video { + width: 100%; + } + } + + //! Button + .wp-block-button { + + .wp-block-button__link { + @include button-transition; + border: none; + font-size: $font__size-sm; + @include font-family( $font__heading ); + line-height: $font__line-height-heading; + box-sizing: border-box; + font-weight: bold; + text-decoration: none; + padding: ($size__spacing-unit * .76) $size__spacing-unit; + outline: none; + outline: none; + + &:not(.has-background) { + background-color: $color__background-button; + } + + &:not(.has-text-color) { + color: white; + } + + &:hover { + color: white; + background: $color__background-button-hover; + cursor: pointer; + } + + &:focus { + color: white; + background: $color__background-button-hover; + outline: thin dotted; + outline-offset: -4px; + } + } + + &:not(.is-style-squared) .wp-block-button__link { + border-radius: 5px; + } + + &.is-style-outline .wp-block-button__link, + &.is-style-outline .wp-block-button__link:focus, + &.is-style-outline .wp-block-button__link:active { + @include button-all-transition; + border-width: 2px; + border-style: solid; + + &:not(.has-background) { + background: transparent; + } + + &:not(.has-text-color) { + color: $color__background-button; + border-color: currentColor; + } + } + + &.is-style-outline .wp-block-button__link:hover { + color: white; + border-color: $color__background-button-hover; + &:not(.has-background) { + color: $color__background-button-hover; + } + } + } + + //! Latest posts, categories, archives + .wp-block-archives, + .wp-block-categories, + .wp-block-latest-posts { + padding: 0; + list-style: none; + + li > a { + @include font-family( $font__heading ); + font-size: calc(#{$font__size_base} * #{$font__size-ratio}); + font-weight: bold; + line-height: $font__line-height-heading; + text-decoration: none; + } + } + + .wp-block-archives, + .wp-block-categories { + + &.aligncenter { + text-align: center; + } + } + + //! Latest categories + .wp-block-categories { + + ul { + padding-top: ( .75 * $size__spacing-unit ); + } + + li ul { + list-style: none; + padding-left: 0; + } + + @include nestedSubMenuPadding(); + } + + //! Latest posts + .wp-block-latest-posts { + + .wp-block-latest-posts__post-date { + @include font-family( $font__heading ); + font-size: $font__size-xs; + color: $color__text-light; + line-height: 1.2; + } + + .wp-block-latest-posts__post-full-content, + .wp-block-latest-posts__post-excerpt { + margin-top: $size__spacing-unit; + margin-bottom: $size__spacing-unit; + } + + li { + padding-bottom: ( .5 * $size__spacing-unit ); + + &.menu-item-has-children, + &:last-child { + padding-bottom: 0; + } + + :not(:last-child) .wp-block-latest-posts__post-excerpt { + padding-bottom: ( .5 * $size__spacing-unit ); + } + } + + &.is-grid li { + border-top: 2px solid $color__border; + padding-top: (1 * $size__spacing-unit); + margin-bottom: (2 * $size__spacing-unit); + a { + &:after { + content: ''; + } + } + &:last-child { + margin-bottom: auto; + a:after { + content: ''; + } + } + } + } + + //! Latest preformatted text + .wp-block-preformatted { + font-size: $font__size-xs; + line-height: 1.8; + padding: $size__spacing-unit; + } + + //! Verse + .wp-block-verse { + @include font-family( $font__body ); + font-size: $font__size_base; + line-height: 1.8; + } + + //! Paragraphs + .has-drop-cap { + &:not(:focus):first-letter { + @include font-family( $font__heading ); + font-size: $font__size-xxxl; + line-height: 1; + font-weight: bold; + margin: 0 0.25em 0 0; + } + } + + //! Pullquote + .wp-block-pullquote { + border-color: transparent; + border-width: 2px; + padding: $size__spacing-unit; + + blockquote { + color: $color__text-main; + border: none; + margin-top: calc(4 * #{ $size__spacing-unit}); + margin-bottom: calc(4.33 * #{ $size__spacing-unit}); + margin-right: 0; + padding-left: 0; + } + + p { + font-size: $font__size-lg; + font-style: italic; + line-height: 1.3; + margin-bottom: 0.5em; + margin-top: 0.5em; + + em { + font-style: normal; + } + + @include media(tablet) { + font-size: $font__size-xl; + } + } + + cite { + display: inline-block; + @include font-family( $font__heading ); + line-height: 1.6; + text-transform: none; + color: $color__text-light; + + /* + * This requires a rem-based font size calculation instead of our normal em-based one, + * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. + */ + font-size: calc(1rem / (1.25 * #{$font__size-ratio})); + } + + &.alignleft, + &.alignright { + width: 100%; + padding: 0; + + blockquote { + margin: $size__spacing-unit 0; + padding: 0; + text-align: left; + max-width: 100%; + + p:first-child { + margin-top: 0; + } + } + } + + &.is-style-solid-color { + background-color: $color__link; + padding-left: 0; + padding-right: 0; + + @include media(tablet) { + padding-left: 10%; + padding-right: 10%; + } + + p { + font-size: $font__size-lg; + line-height: 1.3; + margin-bottom: 0.5em; + margin-top: 0.5em; + + @include media(tablet) { + font-size: $font__size-xl; + } + } + + a { + color: $color__background-body; + } + + cite { + color: inherit; + } + + blockquote { + max-width: 100%; + color: $color__background-body; + padding-left: 0; + margin-left: $size__spacing-unit; + margin-right: $size__spacing-unit; + + &.has-text-color p, + &.has-text-color a, + &.has-primary-color, + &.has-secondary-color, + &.has-dark-gray-color, + &.has-light-gray-color, + &.has-white-color { + color: inherit; + } + + @include media(tablet) { + margin-left: 0; + margin-right: 0; + } + } + + &.alignright, + &.alignleft { + + @include media(tablet) { + padding: $size__spacing-unit calc(2 * #{$size__spacing-unit}); + } + } + + &.alignfull { + + @include media(tablet) { + padding-left: calc(10% + 58px + (2 * #{$size__spacing-unit})); + padding-right: calc(10% + 58px + (2 * #{$size__spacing-unit})); + } + } + } + } + + //! Blockquote + .wp-block-quote { + + &:not(.is-large), + &:not(.is-style-large) { + border-width: 2px; + border-color: $color__link; + padding-top: 0; + padding-bottom: 0; + } + + p { + font-size: 1em; + font-style: normal; + line-height: 1.8; + } + + cite { + /* + * This requires a rem-based font size calculation instead of our normal em-based one, + * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. + */ + font-size: calc(1rem / (1.25 * #{$font__size-ratio})); + } + + &.is-large, + &.is-style-large { + margin: $size__spacing-unit 0; + padding: 0; + border-left: none; + + p { + font-size: $font__size-lg; + line-height: 1.4; + font-style: italic; + } + + cite, + footer { + /* + * This requires a rem-based font size calculation instead of our normal em-based one, + * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. + */ + font-size: calc(1rem / (1.25 * #{$font__size-ratio})); + } + + @include media(tablet) { + margin: $size__spacing-unit 0; + padding: $size__spacing-unit 0; + + p { + font-size: $font__size-lg; + } + } + } + } + + //! Image + .wp-block-image { + max-width: 100%; + + img { + display: block; + } + + // If an image does not have a left/center/right alignment, + // it's a direct child of .wp-block-img. If it has no other + // alignment added, we want to make sure the image does not + // extend beyond the width of the text column. + &:not(.alignwide):not(.alignfull) > img { + @include postContentMaxWidth(); + } + + .aligncenter { + + @include postContentMaxWidth(); + + @include media(tablet) { + margin: 0; + width: $size__site-tablet-content; + + img { + margin: 0 auto; + } + } + + @include media(desktop) { + width: $size__site-desktop-content; + + img { + margin: 0 auto; + } + } + } + + &.alignfull img { + width: 100vw; + max-width: calc( 100% + (2 * #{$size__spacing-unit})); + + @include media(tablet) { + max-width: calc( 125% + 150px ); + margin-left: auto; + margin-right: auto; + } + } + } + + //! Cover Image + .wp-block-cover-image, + .wp-block-cover { + position: relative; + min-height: 430px; + padding: $size__spacing-unit; + + @include media(tablet) { + padding: $size__spacing-unit 10%; + } + + .wp-block-cover-image-text, + .wp-block-cover-text, + h2 { + @include font-family( $font__heading ); + font-size: $font__size-lg; + font-weight: bold; + line-height: 1.25; + padding: 0; + color: #fff; + + @include media(tablet) { + font-size: $font__size-xl; + max-width: 100%; + } + } + + &.alignleft, + &.alignright { + width: 100%; + + @include media(tablet) { + padding: $size__spacing-unit calc(2 * #{$size__spacing-unit}); + } + } + + &.alignfull { + + .wp-block-cover-image-text, + .wp-block-cover-text, + h2 { + @include postContentMaxWidth(); + } + + @include media(tablet) { + padding-left: calc(10% + 58px + (2 * #{$size__spacing-unit})); + padding-right: calc(10% + 58px + (2 * #{$size__spacing-unit})); + + .wp-block-cover-image-text, + .wp-block-cover-text, + h2 { + padding: 0; + } + } + } + } + + //! Galleries + .wp-block-gallery { + list-style-type: none; + padding-left: 0; + + .blocks-gallery-image:last-child, + .blocks-gallery-item:last-child { + margin-bottom: 16px; + } + + figcaption a { + color: #fff; + } + } + + //! Captions + .wp-block-audio figcaption, + .wp-block-video figcaption, + .wp-block-image figcaption, + .wp-block-gallery .blocks-gallery-image figcaption, + .wp-block-gallery .blocks-gallery-item figcaption { + font-size: $font__size-xs; + @include font-family( $font__heading ); + line-height: $font__line-height-pre; + margin: 0; + padding: ( $size__spacing-unit * .5 ); + text-align: center; + } + + //! Separator + .wp-block-separator, + hr { + background-color: $color__text-light; + border: 0; + height: 2px; + margin-bottom: (2 * $size__spacing-unit); + margin-top: (2 * $size__spacing-unit); + max-width: 2.25em; + text-align: left; + + &.is-style-wide { + max-width: 100%; + @include postContentMaxWidth(); + } + + &.is-style-dots { + max-width: 100%; + @include postContentMaxWidth(); + background-color: inherit; + border: inherit; + height: inherit; + text-align: center; + + // Only apply the default dot color if there's no separator color specified. + &:not(.has-text-color):not(.has-background) { + color: $color__text-light; + } + + &:before { + font-size: $font__size-lg; + letter-spacing: $font__size-sm; + padding-left: $font__size-sm; + } + } + + /* Remove duplicate rule-line when a separator + * is followed by an H1, or H2 */ + & + h1, + & + h2 { + + &:before { + display: none; + } + } + } + + //! Twitter Embed + .wp-block-embed-twitter { + word-break: break-word; + } + + //! Table + .wp-block-table { + + th, + td { + border-color: $color__text-light; + } + } + + //! File + .wp-block-file { + @include font-family( $font__heading ); + + .wp-block-file__button { + display: table; + @include button-transition; + border: none; + border-radius: 5px; + background: $color__background-button; + font-size: $font__size-base; + @include font-family( $font__heading ); + line-height: $font__line-height-heading; + text-decoration: none; + font-weight: bold; + padding: ($size__spacing-unit * .75) $size__spacing-unit; + color: #fff; + margin-left: 0; + margin-top: calc(0.75 * #{$size__spacing-unit}); + + @include media(desktop) { + font-size: $font__size-base; + padding: ($size__spacing-unit * .875) ($size__spacing-unit * 1.5); + } + + &:hover { + background: $color__background-button-hover; + cursor: pointer; + } + + &:focus { + background: $color__background-button-hover; + outline: thin dotted; + outline-offset: -4px; + } + } + } + + //! Code + .wp-block-code { + border-radius: 0; + + code { + font-size: $font__size-md; + white-space: pre-wrap; + word-break: break-word; + } + } + + //! Columns + .wp-block-columns { + + .wp-block-column > * { + + &:first-child { + margin-top: 0; + } + + &:last-child { + margin-bottom: 0; + } + } + + // Ensure images do not expand beyond the column. + .wp-block-image > img:not(.alignwide):not(.alignfull), + .wp-block-image > figure { + + @include media(tablet) { + max-width: 100%; + } + + @include media(desktop) { + max-width: 100%; + } + } + + @include media(tablet) { + flex-wrap: nowrap; + + .wp-block-column:not(:first-child) { + margin-left: 32px; + } + } + } + + //! Group + .wp-block-group { + + // When the Group block is standard/wide, we need to prevent full-aligned + // child blocks from expanding out of their container. + &:not(.alignfull) > .wp-block-group__inner-container > .alignfull, + &:not(.alignfull) > .wp-block-group__inner-container > .wp-block-image > img { + + @include media(tablet) { + left: 0; + max-width: 100%; + } + } + + // The full-width Group block's inner container should mimic .entry-content styles. + &.alignfull > .wp-block-group__inner-container { + max-width: calc(100% - (2 * #{ $size__spacing-unit })); + margin: 0 $size__spacing-unit; + + @include media(tablet) { + max-width: 80%; + margin: 0 10%; + padding: 0 60px; + } + } + + // Group block with a colored background. + &.has-background { + padding: $size__spacing-unit; + margin-top: 0; + margin-bottom: 0; + + // Remove the top and bottom margins of inner blocks. + .wp-block-group__inner-container { + + > *:first-child { + margin-top: 0; + } + + > *:last-child { + margin-bottom: 0; + } + } + + // If the Group block is full-width, it does not need this extra padding. + &.alignfull { + padding-left: 0; + padding-right: 0; + + @include media(tablet) { + padding-top: $size__spacing-unit; + padding-bottom: $size__spacing-unit; + } + } + + // Full-aligned child blocks should take up the maximum width available in their container. + &:not(.alignfull) > .wp-block-group__inner-container > .alignfull { + width: 100%; + max-width: 100%; + + @include media(tablet) { + width: calc( 100% + #{$size__spacing-unit * 2} ); + max-width: calc( 100% + #{$size__spacing-unit * 2} ); + margin-left: -#{$size__spacing-unit}; + } + } + } + + } + + //! Latest Comments + .wp-block-latest-comments { + + .wp-block-latest-comments__comment-meta { + @include font-family( $font__heading ); + font-weight: bold; + + .wp-block-latest-comments__comment-date { + font-weight: normal; + } + } + + .wp-block-latest-comments__comment, + .wp-block-latest-comments__comment-date, + .wp-block-latest-comments__comment-excerpt p { + font-size: inherit; + } + + &.has-avatars { + + } + + &.has-dates { + + .wp-block-latest-comments__comment-date { + font-size: $font__size-xs; + } + } + + &.has-excerpts { + + } + } + + //! Font Sizes + .has-small-font-size { + font-size: $font__size-sm; + } + + .has-normal-font-size { + font-size: $font__size-md; + } + + .has-large-font-size { + font-size: $font__size-lg; + } + + .has-huge-font-size { + font-size: $font__size-xl; + } + + //! Custom background colors + .has-primary-background-color, + .has-secondary-background-color, + .has-dark-gray-background-color, + .has-light-gray-background-color { + + // Use white text against these backgrounds by default. + color: $color__background-body; + + > p, + > h1, + > h2, + > h3, + > h4, + > h5, + > h6, + > a { + color: $color__background-body; + } + } + + .has-white-background-color { + color: $color__text-main; + + // Use dark gray text against this background by default. + > p, + > h1, + > h2, + > h3, + > h4, + > h5, + > h6, + > a { + color: $color__text-main; + } + } + + .has-primary-background-color, + .wp-block-pullquote.is-style-solid-color.has-primary-background-color { + background-color: $color__link; + } + + .has-secondary-background-color, + .wp-block-pullquote.is-style-solid-color.has-secondary-background-color { + background-color: $color__border-link-hover; + } + + .has-dark-gray-background-color, + .wp-block-pullquote.is-style-solid-color.has-dark-gray-background-color { + background-color: $color__text-main; + } + + .has-light-gray-background-color, + .wp-block-pullquote.is-style-solid-color.has-light-gray-background-color { + background-color: $color__text-light; + } + + .has-white-background-color, + .wp-block-pullquote.is-style-solid-color.has-white-background-color { + background-color: #FFF; + } + + //! Custom foreground colors + .has-primary-color, + .wp-block-pullquote blockquote.has-primary-color, + .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color, + .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color > p { + color: $color__link; + } + + .has-secondary-color, + .wp-block-pullquote blockquote.has-secondary-color, + .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color, + .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color > p { + color: $color__border-link-hover; + } + + .has-dark-gray-color, + .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color, + .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color > p { + color: $color__text-main; + } + + .has-light-gray-color, + .wp-block-pullquote blockquote.has-light-gray-color, + .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color, + .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color > p { + color: $color__text-light; + } + + .has-white-color, + .wp-block-pullquote blockquote.has-white-color, + .wp-block-pullquote.is-style-solid-color blockquote.has-white-color { + color: #FFF; + } +} diff --git a/wp-content/themes/twentynineteen/sass/elements/_elements.scss b/wp-content/themes/twentynineteen/sass/elements/_elements.scss new file mode 100644 index 0000000..b1fad05 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/elements/_elements.scss @@ -0,0 +1,92 @@ +html { + box-sizing: border-box; +} + +::-moz-selection { + background-color: $color__background_selection; +} + +::selection { + background-color: $color__background_selection; +} + +*, +*:before, +*:after { + box-sizing: inherit; +} + +body { + background-color: $color__background-body; +} + +a { + @include link-transition; + color: $color__link; +} + +a:visited { + +} + +a:hover, +a:active { + color: $color__link-hover; + outline: 0; + text-decoration: none; +} + +a:focus { + outline: thin; + outline-style: dotted; + text-decoration: underline; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + clear: both; + margin: $size__spacing-unit 0; +} + +h1:not(.site-title), +h2 { + @include post-section-dash; +} + +hr { + background-color: $color__text-light; + border: 0; + height: 2px; +} + +@import "lists"; + +img { + height: auto; + max-width: 100%; + position: relative; +} + +figure { + margin: 0; +} + +blockquote { + border-left: 2px solid $color__link; + margin-left: 0; + padding: 0 0 0 $size__spacing-unit; + + > p { + margin: 0 0 $size__spacing-unit; + } + + cite { + color: $color__text-light; + } +} + +@import "tables"; diff --git a/wp-content/themes/twentynineteen/sass/elements/_lists.scss b/wp-content/themes/twentynineteen/sass/elements/_lists.scss new file mode 100644 index 0000000..1db7633 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/elements/_lists.scss @@ -0,0 +1,33 @@ +ul, +ol { + padding-left: ( 1 * $size__spacing-unit ); +} + +ul { + list-style: disc; + + ul { + list-style-type: circle; + } +} + +ol { + list-style: decimal; +} + +li { + line-height: $font__line-height-body; +} + +li > ul, +li > ol { + padding-left: ( 2 * $size__spacing-unit ); +} + +dt { + font-weight: bold; +} + +dd { + margin: 0 $size__spacing-unit $size__spacing-unit; +} diff --git a/wp-content/themes/twentynineteen/sass/elements/_tables.scss b/wp-content/themes/twentynineteen/sass/elements/_tables.scss new file mode 100644 index 0000000..0f653a5 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/elements/_tables.scss @@ -0,0 +1,13 @@ +table { + margin: 0 0 $size__spacing-unit; + border-collapse: collapse; + width: 100%; + @include font-family( $font__heading ); + + td, + th { + padding: 0.5em; + border: 1px solid $color__text-light; + word-break: break-all; + } +} diff --git a/wp-content/themes/twentynineteen/sass/forms/_buttons.scss b/wp-content/themes/twentynineteen/sass/forms/_buttons.scss new file mode 100644 index 0000000..f527a08 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/forms/_buttons.scss @@ -0,0 +1,37 @@ +.button, +button, +input[type="button"], +input[type="reset"], +input[type="submit"] { + + @include button-transition; + background: $color__background-button; + border: none; + border-radius: 5px; + box-sizing: border-box; + color: $color__background-body; + @include font-family( $font__heading ); + font-size: $font__size-sm; + font-weight: 700; + line-height: $font__line-height-heading; + outline: none; + padding: ( $size__spacing-unit * .76 ) $size__spacing-unit; + text-decoration: none; + vertical-align: bottom; + + &:hover { + background: $color__background-button-hover; + cursor: pointer; + } + + &:visited { + color: $color__background-body; + text-decoration: none; + } + + &:focus { + background: $color__background-button-hover; + outline: thin dotted; + outline-offset: -4px; + } +} diff --git a/wp-content/themes/twentynineteen/sass/forms/_fields.scss b/wp-content/themes/twentynineteen/sass/forms/_fields.scss new file mode 100644 index 0000000..448b707 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/forms/_fields.scss @@ -0,0 +1,58 @@ +input[type="text"], +input[type="email"], +input[type="url"], +input[type="password"], +input[type="search"], +input[type="number"], +input[type="tel"], +input[type="range"], +input[type="date"], +input[type="month"], +input[type="week"], +input[type="time"], +input[type="datetime"], +input[type="datetime-local"], +input[type="color"], +textarea { + -webkit-backface-visibility: hidden; + background: $color__background-input; + border: solid 1px $color__border; + box-sizing: border-box; + outline: none; + padding: #{.36 * $size__spacing-unit} #{.66 * $size__spacing-unit}; + -webkit-appearance: none; + outline-offset: 0; + border-radius: 0; + + &:focus { + border-color: $color__link; + outline: thin solid rgba( $color__link, 0.15 ); + outline-offset: -4px; + } +} + +input[type="search"] { + &::-webkit-search-decoration { + display: none; + } +} + +select { + +} + +textarea { + box-sizing: border-box; + display: block; + width: 100%; + max-width: 100%; + resize: vertical; +} + +form { + + p { + margin: $size__spacing-unit 0; + } + +} \ No newline at end of file diff --git a/wp-content/themes/twentynineteen/sass/forms/_forms.scss b/wp-content/themes/twentynineteen/sass/forms/_forms.scss new file mode 100644 index 0000000..2036ef9 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/forms/_forms.scss @@ -0,0 +1,3 @@ +@import "buttons"; + +@import "fields"; diff --git a/wp-content/themes/twentynineteen/sass/layout/_layout.scss b/wp-content/themes/twentynineteen/sass/layout/_layout.scss new file mode 100644 index 0000000..e0e2c76 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/layout/_layout.scss @@ -0,0 +1,11 @@ + +/** === Layout === */ + +#page { + width: 100%; +} + +.site-content { + overflow: hidden; +} + diff --git a/wp-content/themes/twentynineteen/sass/media/_captions.scss b/wp-content/themes/twentynineteen/sass/media/_captions.scss new file mode 100644 index 0000000..761eb2f --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/media/_captions.scss @@ -0,0 +1,32 @@ +.wp-caption { + margin-bottom: calc(1.5 * #{$size__spacing-unit}); + + &.aligncenter { + + @include media(tablet) { + position: relative; + left: calc( #{$size__site-tablet-content} / 2 ); + transform: translateX( -50% ); + } + + @include media(desktop) { + left: calc( #{$size__site-desktop-content} / 2 ); + } + } +} + +.wp-caption img[class*="wp-image-"] { + display: block; + margin-left: auto; + margin-right: auto; +} + +.wp-caption-text { + color: $color__text-light; + font-size: $font__size-xs; + @include font-family( $font__heading ); + line-height: $font__line-height-pre; + margin: 0; + padding: ( $size__spacing-unit * .5 ); + text-align: center; +} diff --git a/wp-content/themes/twentynineteen/sass/media/_galleries.scss b/wp-content/themes/twentynineteen/sass/media/_galleries.scss new file mode 100644 index 0000000..fbc0bb1 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/media/_galleries.scss @@ -0,0 +1,52 @@ +.gallery { + display: flex; + flex-flow: row wrap; + justify-content: center; + margin-bottom: calc(1.5 * #{$size__spacing-unit}); +} + +.gallery-item { + display: inline-block; + margin-right: 16px; + margin-bottom: 16px; + text-align: center; + vertical-align: top; + width: 100%; + + // Loops to enumerate the classes for gallery columns. + @for $i from 2 through 9 { + .gallery-columns-#{$i} & { + max-width: calc((100% - 16px * #{ $i - 1 }) / #{ $i }); + + &:nth-of-type(#{$i}n+#{$i}) { + margin-right: 0; + } + } + } + + &:last-of-type { + padding-right: 0; + } +} + +.gallery-caption { + display: block; + font-size: $font__size-xs; + @include font-family( $font__heading ); + line-height: $font__line-height-pre; + margin: 0; + padding: ( $size__spacing-unit * .5 ); +} + +.gallery-item > div > a { + display: block; + line-height: 0; + + // Accessibility + box-shadow: 0 0 0 0 transparent; + + &:focus { + box-shadow: 0 0 0 2px rgba( $color__link, 1 ); + } +} + diff --git a/wp-content/themes/twentynineteen/sass/media/_media.scss b/wp-content/themes/twentynineteen/sass/media/_media.scss new file mode 100644 index 0000000..3fba8c6 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/media/_media.scss @@ -0,0 +1,41 @@ +.page-content .wp-smiley, +.entry-content .wp-smiley, +.comment-content .wp-smiley { + border: none; + margin-bottom: 0; + margin-top: 0; + padding: 0; +} + +embed, +iframe, +object { + max-width: 100%; +} + +.custom-logo-link { + display: inline-block; +} + +.avatar { + border-radius: 100%; + display: block; + height: calc(2.25 * #{$size__spacing-unit}); + min-height: inherit; + width: calc(2.25 * #{$size__spacing-unit}); +} + +svg { + transition: fill $icon_transition ease-in-out; + fill: currentColor; +} + +/*-------------------------------------------------------------- +## Captions +--------------------------------------------------------------*/ +@import "captions"; + +/*-------------------------------------------------------------- +## Galleries +--------------------------------------------------------------*/ +@import "galleries"; diff --git a/wp-content/themes/twentynineteen/sass/mixins/_mixins-master.scss b/wp-content/themes/twentynineteen/sass/mixins/_mixins-master.scss new file mode 100644 index 0000000..16065f9 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/mixins/_mixins-master.scss @@ -0,0 +1,132 @@ +// Rem output with px fallback +@mixin font-size($sizeValue: 1) { + font-size: ($sizeValue * 16) * 1px; + font-size: $sizeValue * 1rem; +} + +// Center block +@mixin center-block { + display: block; + margin-left: auto; + margin-right: auto; +} + +// Clearfix +@mixin clearfix() { + content: ""; + display: table; + table-layout: fixed; +} + +// Clear after (not all clearfix need this also) +@mixin clearfix-after() { + clear: both; +} + +// Column width with margin +@mixin column-width($numberColumns: 3) { + width: map-get($columns, $numberColumns) - (($columns__margin * ($numberColumns - 1)) / $numberColumns); +} + +@mixin filter-duotone { + + &:before { + background: $color__link; + mix-blend-mode: screen; + opacity: 0.1; + z-index: 2; + } + + &:after { + background: $color__link; + mix-blend-mode: multiply; + opacity: .8; + z-index: 3; + + /* Browsers supporting mix-blend-mode don't need opacity < 1 */ + @supports (mix-blend-mode: multiply) { + opacity: 1; + } + } +} + +@mixin filter-grayscale { + + position: relative; + filter: grayscale(100%); + z-index: 1; + + &:after { + display: block; + width: 100%; + height: 100%; + z-index: 10; + } +} + +@mixin post-section-dash { + + &:before { + background: $color__text-light; + content: "\020"; + display: block; + height: 2px; + margin: $size__spacing-unit 0; + width: 1em; + } +} + +/* If we add the border using a regular CSS border, it won't look good on non-retina devices, + * since its edges can look jagged due to lack of antialiasing. In this case, we are several + * layers of box-shadow to add the border visually, which will render the border smoother. */ + +@mixin box-shadow( $size ) { + box-shadow: + 0 0 0 $size $color__text-light inset, // Original border. + 0 0 0 ($size + 1px) $color__text-light inset, // Antialiasing, inner edge. + 0 0 1px 0 rgba( $color__text-light, 0.7 ); // Antialiasing, outer edge. +} + +/* Calculates maximum width for post content */ +@mixin postContentMaxWidth() { + + @include media(tablet) { + max-width: $size__site-tablet-content; + } + + @include media(desktop) { + max-width: $size__site-desktop-content; + } +} + +/* Nested sub-menu padding: 10 levels deep */ +@mixin nestedSubMenuPadding() { + + ul { + counter-reset: submenu; + } + + ul > li > a::before { + font-family: $font__body; + font-weight: normal; + content: "\2013\00a0" counters(submenu, "\2013\00a0", none); + counter-increment: submenu + } +} + +/* Ensure all font family declarations come with non-latin fallbacks */ +@mixin font-family( $font_family: $font__body ) { + font-family: $font_family; + @extend %non-latin-fonts; +} + +/* Build our non-latin font styles */ +%non-latin-fonts { + @each $lang, $font__fallback in $font__fallbacks { + &:lang(#{$lang}) { + font-family: unquote( $font__fallback ); + } + } +} + +@import "utilities"; diff --git a/wp-content/themes/twentynineteen/sass/mixins/_utilities.scss b/wp-content/themes/twentynineteen/sass/mixins/_utilities.scss new file mode 100644 index 0000000..c753fe2 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/mixins/_utilities.scss @@ -0,0 +1,51 @@ + +@mixin media( $res ) { + @if mobile == $res { + @media only screen and (min-width: $mobile_width) { + @content; + } + } + + @if tablet == $res { + @media only screen and (min-width: $tablet_width) { + @content; + } + } + + @if desktop == $res { + @media only screen and (min-width: $desktop_width) { + @content; + } + } + + @if wide == $res { + @media only screen and (min-width: $wide_width) { + @content; + } + } +} + +@mixin link-transition( $attr: color ) { + transition: $attr $link_transition ease-in-out; +} + +@mixin button-transition() { + transition: background $button_transition ease-in-out; +} + +@mixin button-all-transition() { + transition: all $button_transition ease-in-out; +} + +@mixin background-transition() { + transition: background $background_transition ease-in-out; +} + +@mixin selection { + ::-moz-selection { + @content; + } + ::selection { + @content; + } +} diff --git a/wp-content/themes/twentynineteen/sass/modules/_accessibility.scss b/wp-content/themes/twentynineteen/sass/modules/_accessibility.scss new file mode 100644 index 0000000..e911942 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/modules/_accessibility.scss @@ -0,0 +1,38 @@ +/* Text meant only for screen readers. */ +.screen-reader-text { + border: 0; + clip: rect(1px, 1px, 1px, 1px); + clip-path: inset(50%); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute !important; + width: 1px; + word-wrap: normal !important; /* Many screen reader and browser combinations announce broken words as they would appear visually. */ + + &:focus { + background-color: $color__background-screen; + border-radius: 3px; + box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); + clip: auto !important; + clip-path: none; + color: $color__text-screen; + display: block; + font-size: 0.875rem; + font-weight: bold; + height: auto; + left: 5px; + line-height: normal; + padding: 15px 23px 14px; + text-decoration: none; + top: 5px; + width: auto; + z-index: 100000; /* Above WP toolbar. */ + } +} + +/* Do not show the outline on the skip link target. */ +#content[tabindex="-1"]:focus { + outline: 0; +} diff --git a/wp-content/themes/twentynineteen/sass/modules/_alignments.scss b/wp-content/themes/twentynineteen/sass/modules/_alignments.scss new file mode 100644 index 0000000..2fb584a --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/modules/_alignments.scss @@ -0,0 +1,28 @@ +.alignleft { + /*rtl:ignore*/ + float: left; + /*rtl:ignore*/ + margin-right: $size__spacing-unit; + + @include media(tablet) { + /*rtl:ignore*/ + margin-right: calc(2 * #{$size__spacing-unit}); + } +} + +.alignright { + /*rtl:ignore*/ + float: right; + /*rtl:ignore*/ + margin-left: $size__spacing-unit; + + @include media(tablet) { + /*rtl:ignore*/ + margin-left: calc(2 * #{$size__spacing-unit}); + } +} + +.aligncenter { + clear: both; + @include center-block; +} diff --git a/wp-content/themes/twentynineteen/sass/modules/_clearings.scss b/wp-content/themes/twentynineteen/sass/modules/_clearings.scss new file mode 100644 index 0000000..444b6b6 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/modules/_clearings.scss @@ -0,0 +1,23 @@ +.clear:before, +.clear:after, +.entry-content:before, +.entry-content:after, +.comment-content:before, +.comment-content:after, +.site-header:before, +.site-header:after, +.site-content:before, +.site-content:after, +.site-footer:before, +.site-footer:after { + @include clearfix; +} + +.clear:after, +.entry-content:after, +.comment-content:after, +.site-header:after, +.site-content:after, +.site-footer:after { + @include clearfix-after; +} diff --git a/wp-content/themes/twentynineteen/sass/navigation/_links.scss b/wp-content/themes/twentynineteen/sass/navigation/_links.scss new file mode 100644 index 0000000..cbee457 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/navigation/_links.scss @@ -0,0 +1,21 @@ +a { + + @include link-transition; + color: $color__link; + + &:visited { + color: $color__link-visited; + } + + &:hover, + &:active { + color: $color__link-hover; + outline: 0; + text-decoration: none; + } + + &:focus { + outline: thin dotted; + text-decoration: underline; + } +} diff --git a/wp-content/themes/twentynineteen/sass/navigation/_menu-footer-navigation.scss b/wp-content/themes/twentynineteen/sass/navigation/_menu-footer-navigation.scss new file mode 100644 index 0000000..afe6971 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/navigation/_menu-footer-navigation.scss @@ -0,0 +1,22 @@ +/** === Footer menu === */ + +.footer-navigation { + + display: inline; + + & > div { + display: inline; + } + + .footer-menu { + + display: inline; + padding-left: 0; + + li { + display: inline; + margin-right: 1rem; + } + } + +} \ No newline at end of file diff --git a/wp-content/themes/twentynineteen/sass/navigation/_menu-main-navigation.scss b/wp-content/themes/twentynineteen/sass/navigation/_menu-main-navigation.scss new file mode 100644 index 0000000..4bbd9cf --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/navigation/_menu-main-navigation.scss @@ -0,0 +1,506 @@ +/** === Main menu === */ + +.main-navigation { + + display: block; + margin-top: #{0.25 * $size__spacing-unit}; + + body.page & { + display: block; + } + + > div { + display: inline; + } + + /* Un-style buttons */ + button { + display: inline-block; + border: none; + padding: 0; + margin: 0; + font-family: $font__heading; + font-weight: 700; + line-height: $font__line-height-heading; + text-decoration: none; + background: transparent; + color: inherit; + cursor: pointer; + transition: + background 250ms ease-in-out, + transform 150ms ease; + -webkit-appearance: none; + -moz-appearance: none; + + &:hover, + &:focus { + background: transparent; + } + + &:focus { + outline: 1px solid transparent; + outline-offset: -4px; + } + + &:active { + transform: scale(0.99); + } + } + + .main-menu { + + display: inline-block; + margin: 0; + padding: 0; + + > li { + + color: $color__link; + display: inline; + position: relative; + + > a { + + font-weight: 700; + color: $color__link; + margin-right: #{0.5 * $size__spacing-unit}; + + + svg { + margin-right: #{0.5 * $size__spacing-unit}; + } + + &:hover, + &:hover + svg { + color: $color__link-hover; + } + } + + &.menu-item-has-children { + + display: inline-block; + position: inherit; + + @include media(tablet) { + position: relative; + } + + > a { + margin-right: #{0.125 * $size__spacing-unit}; + } + + & > a, + .menu-item-has-children > a { + + &:after { + content: ""; + display: none; + } + } + + .submenu-expand { + + display: inline-block; + margin-right: #{0.25 * $size__spacing-unit}; + + /* Priority+ Menu */ + &.main-menu-more-toggle { + + position: relative; + height: 24px; + line-height: $font__line-height-heading; + width: 24px; + padding: 0; + margin-left: #{0.5 * $size__spacing-unit}; + + svg { + height: 24px; + width: 24px; + top: #{-0.125 * $size__spacing-unit}; + vertical-align: text-bottom; + } + } + + .wp-customizer-unloading &, + &.is-empty { + display: none; + } + + svg { + position: relative; + top: 0.2rem; + } + } + } + + &:last-child > a, + &:last-child.menu-item-has-children .submenu-expand { + margin-right: 0; + } + } + } + + .sub-menu { + + background-color: $color__link; + color: $color__background-body; + list-style: none; + padding-left: 0; + + position: absolute; + opacity: 0; + left: -9999px; + z-index: 99999; + + @include media(tablet) { + width: auto; + min-width: -moz-max-content; + min-width: -webkit-max-content; + min-width: max-content; + } + + > li { + + display: block; + float: none; + position: relative; + + &.menu-item-has-children { + + .submenu-expand { + display: inline-block; + position: absolute; + width: calc( 24px + #{$size__spacing-unit} ); + right: 0; + top: calc( .125 * #{$size__spacing-unit} ); + bottom: 0; + color: white; + line-height: 1; + padding: calc( .5 * #{$size__spacing-unit} ); + + svg { + top: 0; + } + } + + .submenu-expand { + margin-right: 0; + } + + @include media(tablet) { + + .menu-item-has-children > a { + + &:after { + content: "\203a"; + } + } + } + } + + > a, + > .menu-item-link-return { + + color: $color__background-body; + display: block; + line-height: $font__line-height-heading; + text-shadow: none; + padding: calc( .5 * #{$size__spacing-unit} ) calc( 24px + #{$size__spacing-unit} ) calc( .5 * #{$size__spacing-unit} ) $size__spacing-unit; + white-space: nowrap; + + &:hover, + &:focus { + background: $color__link-hover; + + &:after { + background: $color__link-hover; + } + } + } + + > .menu-item-link-return { + width: 100%; + font-size: $font__size_base; + font-weight: normal; + text-align: left; + } + + > a:empty { + display: none; + } + + &.mobile-parent-nav-menu-item { + + display: none; + font-size: $font__size-sm; + font-weight: normal; + + svg { + position: relative; + top: 0.2rem; + margin-right: calc( .25 * #{$size__spacing-unit} ); + } + } + } + } + + /* + * Sub-menu styles + * + * :focus-within needs its own selector so other similar + * selectors don’t get ignored if a browser doesn’t recognize it + */ + .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu { + + display: block; + left: 0; + margin-top: 0; + opacity: 1; + width: auto; + min-width: 100%; + + + /* Non-mobile position */ + @include media(tablet) { + display: block; + margin-top: 0; + opacity: 1; + position: absolute; + left: 0; + right: auto; + top: auto; + bottom: auto; + height: auto; + min-width: -moz-max-content; + min-width: -webkit-max-content; + min-width: max-content; + transform: none; + } + + &.hidden-links { + left: 0; + width: 100%; + display: table; + position: absolute; + + @include media(tablet) { + right: 0; + left: auto; + display: block; + width: max-content; + } + } + + .submenu-expand { + display: none; + } + + .sub-menu { + display: block; + margin-top: inherit; + position: relative; + width: 100%; + left: 0; + opacity: 1; + + /* Non-mobile position */ + @include media(tablet) { + float: none; + max-width: 100%; + } + } + + /* Nested sub-menu dashes */ + .sub-menu { + counter-reset: submenu; + } + + .sub-menu > li > a::before { + font-family: $font__body; + font-weight: normal; + content: "\2013\00a0" counters(submenu, "\2013\00a0", none); + counter-increment: submenu + } + } + + .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu, + .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu, + .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu { + + display: block; + left: 0; + margin-top: 0; + opacity: 1; + width: auto; + min-width: 100%; + + + /* Non-mobile position */ + @include media(tablet) { + display: block; + float: none; + margin-top: 0; + opacity: 1; + position: absolute; + left: 0; + right: auto; + top: auto; + bottom: auto; + height: auto; + min-width: -moz-max-content; + min-width: -webkit-max-content; + min-width: max-content; + transform: none; + } + + &.hidden-links { + left: 0; + width: 100%; + display: table; + position: absolute; + + @include media(tablet) { + right: 0; + left: auto; + display: table; + width: max-content; + } + } + + .submenu-expand { + display: none; + } + + .sub-menu { + display: block; + margin-top: inherit; + position: relative; + width: 100%; + left: 0; + opacity: 1; + + /* Non-mobile position */ + @include media(tablet) { + float: none; + max-width: 100%; + } + } + + /* Nested sub-menu dashes */ + .sub-menu { + counter-reset: submenu; + } + + .sub-menu > li > a::before { + font-family: $font__body; + font-weight: normal; + content: "\2013\00a0" counters(submenu, "\2013\00a0", none); + counter-increment: submenu + } + } + + /** + * Fade-in animation for top-level submenus + */ + .main-menu > .menu-item-has-children:not(.off-canvas):hover > .sub-menu { + animation: fade_in 0.1s forwards; + } + + /** + * Off-canvas touch device styles + */ + .main-menu .menu-item-has-children.off-canvas .sub-menu { + + .submenu-expand .svg-icon { + transform: rotate(270deg); + } + + .sub-menu { + opacity: 0; + position: absolute; + z-index: 0; + transform: translateX(-100%); + } + + li:hover, + li:focus, + li > a:hover, + li > a:focus { + background-color: transparent; + } + + > li > a, + > li > .menu-item-link-return { + white-space: inherit; + } + + &.expanded-true { + + display: table; + margin-top: 0; + opacity: 1; + padding-left: 0; + + /* Mobile position */ + left: 0; + top: 0; + right: 0; + bottom: 0; + position: fixed; + z-index: 100000; /* Make sure appears above mobile admin bar */ + width: 100vw; + height: 100vh; + max-width: 100vw; + transform: translateX(+100%); + animation: slide_in_right 0.3s forwards; + + > .mobile-parent-nav-menu-item { + display: block; + } + + /* Prevent menu from being blocked by admin bar */ + .admin-bar & { + top: 46px; + height: calc( 100vh - 46px ); + + .sub-menu.expanded-true { + top: 0; + } + + /* WP core breakpoint */ + @media only screen and ( min-width: 782px ) { + top: 32px; + height: calc( 100vh - 32px ); + + .sub-menu.expanded-true { + top: 0; + } + } + } + } + } + + // Hide duplicate menu-more-link when re-loading a menu in the customizer + .main-menu-more { + &:nth-child(n+3) { + display: none; + } + } + +} + +/* Menu animation */ + +@keyframes slide_in_right { + 100% { + transform: translateX(0%); + } +} + +@keyframes fade_in { + from { + opacity: 0; + } + to { + opacity: 1; + } +} diff --git a/wp-content/themes/twentynineteen/sass/navigation/_menu-social-navigation.scss b/wp-content/themes/twentynineteen/sass/navigation/_menu-social-navigation.scss new file mode 100644 index 0000000..00724b5 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/navigation/_menu-social-navigation.scss @@ -0,0 +1,66 @@ +/* Social menu */ + +.social-navigation { + margin-top: calc(#{$size__spacing-unit} / 2 ); + text-align: left; + + ul.social-links-menu { + @include clearfix; + + display: inline-block; + margin: 0; + padding: 0; + + li { + display: inline-block; + vertical-align: bottom; + vertical-align: -webkit-baseline-middle; + list-style: none; + + &:nth-child(n+2) { + margin-left: 0.1em; + } + + a { + border-bottom: 1px solid transparent; + display: block; + color: $color__text-main; + margin-bottom: -1px; + transition: opacity $link_transition ease-in-out; + + &:hover, + &:active { + color: $color__text-main; + opacity: 0.6; + } + + &:focus { + color: $color__text-main; + opacity: 1; + border-bottom: 1px solid $color__text-main; + } + + svg { + display: block; + width: 32px; + height: 32px; + + // Prevent icons from jumping in Safari using hardware acceleration. + transform: translateZ(0); + + &#ui-icon-link { + transform: rotate(-45deg); + } + } + } + } + } +} + +.site-title + .social-navigation, +.site-description + .social-navigation { + + @include media(tablet) { + margin-top: calc(#{$size__spacing-unit} / 5 ); + } +} diff --git a/wp-content/themes/twentynineteen/sass/navigation/_navigation.scss b/wp-content/themes/twentynineteen/sass/navigation/_navigation.scss new file mode 100644 index 0000000..a4cf515 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/navigation/_navigation.scss @@ -0,0 +1,16 @@ +/*-------------------------------------------------------------- +## Links +--------------------------------------------------------------*/ +@import "links"; + +/*-------------------------------------------------------------- +## Menus +--------------------------------------------------------------*/ +@import "menu-main-navigation"; +@import "menu-social-navigation"; +@import "menu-footer-navigation"; + +/*-------------------------------------------------------------- +## Next / Previous +--------------------------------------------------------------*/ +@import "next-previous"; diff --git a/wp-content/themes/twentynineteen/sass/navigation/_next-previous.scss b/wp-content/themes/twentynineteen/sass/navigation/_next-previous.scss new file mode 100644 index 0000000..b2a4c1d --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/navigation/_next-previous.scss @@ -0,0 +1,201 @@ +/* Next/Previous navigation */ + +// Singular navigation +.post-navigation { + + margin: calc(3 * 1rem) 0; + + @include media(tablet) { + margin: calc(3 * 1rem) $size__site-margins; + max-width: calc(6 * (100vw / 12)); + } + + @include media(desktop) { + margin: calc(3 * 1rem) 0; + max-width: 100%; + } + + .nav-links { + + margin: 0 $size__spacing-unit; + max-width: 100%; + display: flex; + flex-direction: column; + + @include media(tablet) { + margin: 0; + } + + @include media(desktop) { + flex-direction: row; + margin: 0 $size__site-margins; + max-width: $size__site-desktop-content; + } + + a { + .meta-nav { + color: $color__text-light; + user-select: none; + + &:before, + &:after { + display: none; + content: "—"; + width: 2em; + color: $color__text-light; + height: 1em; + } + } + + .post-title { + hyphens: auto; + } + + &:hover { + color: $color__link-hover; + } + } + + .nav-previous, + .nav-next { + + @include media(desktop) { + min-width: calc(50% - 2 * #{$size__spacing-unit}); + } + } + + .nav-previous { + order: 2; + + @include media(desktop) { + order: 1; + } + + + .nav-next { + margin-bottom: $size__spacing-unit; + } + + .meta-nav { + &:before { + display: inline; + } + } + } + + .nav-next { + order: 1; + + @include media(desktop) { + order: 2; + padding-left: $size__spacing-unit; + } + + .meta-nav { + &:after { + display: inline; + } + } + } + } +} + +// Index/archive navigation +.pagination { + + .nav-links { + + display: flex; + flex-wrap: wrap; + padding: 0 calc(.5 * #{$size__spacing-unit}); + + + & > * { + padding: calc(.5 * #{$size__spacing-unit}); + + &.dots, + &.prev { + padding-left: 0; + } + + &.dots, + &.next { + padding-right: 0; + } + } + + a:focus { + text-decoration: underline; + outline-offset: -1px; + + &.prev, + &.next { + text-decoration: none; + + .nav-prev-text, + .nav-next-text { + text-decoration: underline; + } + } + } + + .nav-next-text, + .nav-prev-text { + display: none; + } + + @include media(tablet) { + + margin-left: $size__site-margins; + padding: 0; + + .prev, + .next { + + & > * { + display: inline-block; + vertical-align: text-bottom; + } + } + + & > * { + padding: $size__spacing-unit; + } + } + } +} + +// Comments navigation +.comment-navigation { + + .nav-links { + display: flex; + flex-direction: row; + } + + .nav-previous, + .nav-next { + min-width: 50%; + width: 100%; + @include font-family( $font__heading ); + font-weight: bold; + + .secondary-text { + display: none; + + @include media(tablet) { + display: inline; + } + } + + svg { + vertical-align: middle; + position: relative; + margin: 0 -0.35em; + top: -1px; + } + } + + .nav-next { + text-align: right; + } +} diff --git a/wp-content/themes/twentynineteen/sass/site/_site.scss b/wp-content/themes/twentynineteen/sass/site/_site.scss new file mode 100644 index 0000000..692244f --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/site/_site.scss @@ -0,0 +1,27 @@ + +/*-------------------------------------------------------------- +## Header +--------------------------------------------------------------*/ +@import "header/site-header"; +@import "header/site-featured-image"; + +/*-------------------------------------------------------------- +## Posts and pages +--------------------------------------------------------------*/ +@import "primary/posts-and-pages"; + +/*-------------------------------------------------------------- +## Comments +--------------------------------------------------------------*/ +@import "primary/comments"; + +/*-------------------------------------------------------------- +## Archives +--------------------------------------------------------------*/ +@import "primary/archives"; + +/*-------------------------------------------------------------- +## Footer +--------------------------------------------------------------*/ +@import "footer/site-footer"; + diff --git a/wp-content/themes/twentynineteen/sass/site/footer/_site-footer.scss b/wp-content/themes/twentynineteen/sass/site/footer/_site-footer.scss new file mode 100644 index 0000000..4e13794 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/site/footer/_site-footer.scss @@ -0,0 +1,53 @@ +/* Site footer */ + +#colophon { + + .widget-area, + .site-info { + margin: calc(2 * #{$size__spacing-unit}) $size__spacing-unit; + + @include media(tablet) { + margin: calc(3 * #{$size__spacing-unit}) $size__site-margins; + } + } + + .widget-column { + display: flex; + flex-wrap: wrap; + .widget { + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + width: 100%; + word-wrap: break-word; + @include media(desktop) { + margin-right: calc(3 * #{$size__spacing-unit}); + width: calc(50% - (3 * #{$size__spacing-unit})); + } + } + } + + .site-info { + color: $color__text-light; + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + word-wrap: break-word; + + a { + color: inherit; + + &:hover { + text-decoration: none; + color: $color__link; + } + } + + .imprint, + .privacy-policy-link { + margin-right: $size__spacing-unit; + } + } +} \ No newline at end of file diff --git a/wp-content/themes/twentynineteen/sass/site/header/_site-featured-image.scss b/wp-content/themes/twentynineteen/sass/site/header/_site-featured-image.scss new file mode 100644 index 0000000..5e67aa2 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/site/header/_site-featured-image.scss @@ -0,0 +1,301 @@ +// Featured image styles + +.site-header.featured-image { + + /* Hide overflow for overflowing featured image */ + overflow: hidden; + + /* Need relative positioning to properly align layers. */ + position: relative; + + /* Add text shadow to text, to increase readability. */ + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); + + /* Set white text color when featured image is set. */ + .site-branding .site-title, + .site-branding .site-description, + .main-navigation a:after, + .main-navigation .main-menu > li.menu-item-has-children:after, + .main-navigation li, + .social-navigation li, + .entry-meta, + .entry-title { + color: $color__background-body; + } + + .main-navigation a, + .main-navigation a + svg, + .social-navigation a, + .site-title a, + .site-featured-image a { + color: $color__background-body; + transition: opacity $link_transition ease-in-out; + + &:hover, + &:active, + &:hover + svg, + &:active + svg { + color: $color__background-body; + opacity: 0.6; + } + + &:focus, + &:focus + svg { + color: $color__background-body; + } + } + + .main-navigation .sub-menu a { + opacity: inherit; + } + + /* add focus state to social media icons */ + .social-navigation a { + &:focus { + color: $color__background-body; + opacity: 1; + border-bottom: 1px solid $color__background-body; + } + } + + .social-navigation svg, + .site-featured-image svg { + /* Use -webkit- only if supporting: Chrome < 54, iOS < 9.3, Android < 4.4.4 */ + -webkit-filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35) ); + filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35) ); + } + + /* Entry header */ + .site-featured-image { + + /* First layer: grayscale. */ + .post-thumbnail img { + height: auto; + left: 50%; + max-width: 1000%; + min-height: 100%; + min-width: 100vw; + position: absolute; + top: 50%; + transform: translateX(-50%) translateY(-50%); + width: auto; + z-index: 1; + + @supports ( object-fit: cover ) { + height: 100%; + left: 0; + object-fit: cover; + top: 0; + transform: none; + width: 100%; + } + + /* When image filters are active, make it grayscale to colorize it blue. */ + .image-filters-enabled & { + filter: grayscale(100%); + } + } + + .entry-header { + + margin-top: calc( 4 * #{$size__spacing-unit}); + margin-bottom: 0; + margin-left: 0; + margin-right: 0; + + @include media (tablet) { + + margin-left: $size__site-margins; + margin-right: $size__site-margins; + } + + .entry-title { + + &:before { + background: $color__background-body; + } + } + + /* Entry meta */ + + .entry-meta { + + font-weight: 500; + + > span { + + margin-right: $size__spacing-unit; + display: inline-block; + + &:last-child { + margin-right: 0; + } + } + + a { + + @include link-transition; + color: currentColor; + + &:hover { + text-decoration: none; + } + } + + .svg-icon { + position: relative; + display: inline-block; + vertical-align: middle; + margin-right: 0.5em; + } + + .discussion-avatar-list { + display: none; + } + } + + &.has-discussion { + + @include media (tablet) { + + .entry-meta { + display: flex; + position: relative; + } + + .entry-title { + padding-right: calc(1 * (100vw / 12) + #{$size__spacing-unit}); + } + + .entry-meta .comment-count { + position: absolute; + right: 0; + } + + .entry-meta .discussion-avatar-list { + display: block; + position: absolute; + bottom: 100%; + } + } + } + } + } + + /* Custom Logo Link */ + + .custom-logo-link { + + background: $color__background-body; + box-shadow: 0 0 0 0 rgba($color__background-body, 0); + + &:hover, + &:active, + &:focus { + box-shadow: 0 0 0 2px rgba($color__background-body, 1); + } + } + + /* Make sure important elements are above pseudo elements used for effects. */ + .site-branding { + position: relative; + z-index: 10; + } + + .site-featured-image .entry-header { + position: relative; + z-index: 9; + } + + /* Set up image filter layer positioning */ + .site-branding-container:after, + .site-featured-image:before, + .site-featured-image:after, + &:after { + display: block; + position: absolute; + top: 0; left: 0; + content: "\020"; + width: 100%; + height: 100%; + } + + /* Background & Effects */ + /* Shared background settings between pseudo elements. */ + background-position: center; + background-repeat: no-repeat; + background-size: cover; + + /* The intensity of each blend mode is controlled via layer opacity. */ + + /* Second layer: screen. */ + .image-filters-enabled & .site-featured-image:before { + background: $color__link; + mix-blend-mode: screen; + opacity: 0.1; + } + + /* Third layer: multiply. */ + /* When image filters are inactive, a black overlay is added. */ + .site-featured-image:after { + background: #000; + mix-blend-mode: multiply; + opacity: .7; + + /* When image filters are active, a blue overlay is added. */ + .image-filters-enabled & { + background: $color__link; + opacity: .8; + z-index: 3; + + /* Browsers supporting mix-blend-mode don't need opacity < 1 */ + @supports (mix-blend-mode: multiply) { + opacity: 1; + } + } + } + + /* Fourth layer: overlay. */ + .image-filters-enabled & .site-branding-container:after { + background: rgba(0, 0, 0, 0.35); + mix-blend-mode: overlay; + opacity: 0.5; + z-index: 4; + + /* Browsers supporting mix-blend-mode can have a light overlay */ + @supports (mix-blend-mode: overlay) { + background: rgba($color__background-body, 0.35); + } + } + + /* Fifth layer: readability overlay */ + &:after { + background: #000; + /** + * Add a transition to the readability overlay, to add a subtle + * but smooth effect when resizing the screen. + */ + transition: opacity 1200ms ease-in-out; + opacity: 0.7; + z-index: 5; + + /* When image filters are active, a blue overlay is added. */ + .image-filters-enabled & { + background: mix($color__link, black, 12%); + opacity: 0.38; + + @include media(tablet) { + opacity: 0.18; + } + } + } + + + ::-moz-selection { + background: rgba($color__background-body, 0.17); + } + + ::selection { + background: rgba($color__background-body, 0.17); + } +} diff --git a/wp-content/themes/twentynineteen/sass/site/header/_site-header.scss b/wp-content/themes/twentynineteen/sass/site/header/_site-header.scss new file mode 100644 index 0000000..3f723ba --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/site/header/_site-header.scss @@ -0,0 +1,139 @@ +// Site header + +.site-header { + padding: 1em; + + &.featured-image { + display: flex; + flex-direction: column; + justify-content: space-between; + min-height: 90vh; + + .site-branding-container { + margin-bottom: auto; + } + } + + @include media(tablet) { + margin: 0; + padding: 3rem 0; + + &.featured-image { + min-height: 100vh; + margin-bottom: 3rem; + } + } +} + +// Site branding + +.site-branding { + + color: $color__text-light; + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + position: relative; + word-wrap: break-word; + + @include media(tablet) { + margin: 0 $size__site-margins; + } +} + +// Site logo + +.site-logo { + + position: relative; + z-index: 999; + margin-bottom: calc(.66 * #{$size__spacing-unit}); + + @include media(tablet) { + margin-bottom: 0; + position: absolute; + right: calc(100% + (1.25 * #{$size__spacing-unit})); + top: 4px; // Accounts for box-shadow widths + z-index: 999; + } + + .custom-logo-link { + border-radius: 100%; + box-sizing: content-box; + box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); + display: block; + width: 50px; + height: 50px; + overflow: hidden; + transition: box-shadow $background_transition ease-in-out; + + .custom-logo { + min-height: inherit; + } + + &:hover, + &:active, + &:focus { + box-shadow: 0 0 0 2px rgba(0, 0, 0, 1); + } + + @include media(tablet) { + width: 64px; + height: 64px; + } + } +} + +// Site title + +.site-title { + margin: auto; + display: inline; + color: $color__text-main; + + a { + color: $color__text-main; + + &:link, + &:visited { + color: $color__text-main; + } + + &:hover { + color: $color__text-hover; + } + } + + .featured-image & { + margin: 0; + + @include media(tablet) { + display: inline-block; + } + } + + /* When there is no description set, make sure navigation appears below title. */ + + .main-navigation { + display: block; + } + + @include media(tablet) { + display: inline; + } + + &:not(:empty) + .site-description:not(:empty):before { + content: "\2014"; + margin: 0 .2em; + } +} + +// Site description + +.site-description { + + display: inline; + color: $color__text-light; + font-weight: normal; + margin: 0; +} diff --git a/wp-content/themes/twentynineteen/sass/site/primary/_archives.scss b/wp-content/themes/twentynineteen/sass/site/primary/_archives.scss new file mode 100644 index 0000000..a3cb801 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/site/primary/_archives.scss @@ -0,0 +1,65 @@ +.archive .page-header, +.search .page-header, +.error404 .page-header { + + margin: $size__spacing-unit $size__spacing-unit calc(3 * #{$size__spacing-unit}); + + @include media(tablet) { + margin: 0 $size__site-margins calc(3 * #{$size__spacing-unit}); + } + + .page-title { + + color: $color__text-light; + display: inline; + letter-spacing: normal; + + &:before { + display: none; + } + } + + .search-term, + .page-description { + display: inherit; + clear: both; + } +} + +.archive .page-header .page-description, +.search .page-header .page-description { + display: block; + color: $color__text-main; + font-size: 1em; +} + +.hfeed .entry .entry-header { + + @include media(tablet) { + margin: calc(3 * #{$size__spacing-unit}) $size__site-margins calc(#{ $size__spacing-unit } / 2); + } +} + +/* 404 & Not found */ + +.error-404.not-found, +.no-results.not-found { + + .page-content { + + margin: calc(3 * #{$size__spacing-unit}) #{$size__spacing-unit}; + + @include media(tablet) { + margin: calc(3 * #{$size__spacing-unit}) $size__site-margins calc(#{ $size__spacing-unit } / 2); + } + } + + .search-submit { + vertical-align: middle; + margin: $size__spacing-unit 0; + } + + .search-field { + width: 100%; + } +} diff --git a/wp-content/themes/twentynineteen/sass/site/primary/_comments.scss b/wp-content/themes/twentynineteen/sass/site/primary/_comments.scss new file mode 100644 index 0000000..ec9fb12 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/site/primary/_comments.scss @@ -0,0 +1,405 @@ +.comment-content a { + word-wrap: break-word; +} + +.bypostauthor { + display: block; +} + +.comments-area { + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + margin: calc(2 * #{$size__spacing-unit}) $size__spacing-unit; + word-wrap: break-word; + @include postContentMaxWidth(); + + @include media(tablet) { + margin: calc(3 * #{$size__spacing-unit}) $size__site-margins; + } + + & > * { + margin-top: calc(2 * #{$size__spacing-unit}); + margin-bottom: calc(2 * #{$size__spacing-unit}); + + @include media(tablet) { + margin-top: calc(3 * #{$size__spacing-unit}); + margin-bottom: calc(3 * #{$size__spacing-unit}); + } + } + + /* Add extra margin when the comments section is located immediately after the + * post itself (this happens on pages). + */ + .entry + & { + margin-top: calc(3 * #{$size__spacing-unit}); + } + + .comments-title-wrap { + + @include media(tablet) { + align-items: baseline; + display: flex; + justify-content: space-between; + } + + .comments-title { + @include post-section-dash; + margin: 0; + + @include media(tablet) { + flex: 1 0 calc(3 * (100vw / 12)); + } + } + + .discussion-meta { + @include media(tablet) { + flex: 0 0 calc(2 * (100vw / 12)); + margin-left: #{$size__spacing-unit}; + } + } + } +} + +#comment { + max-width: 100%; + box-sizing: border-box; +} + +#respond { + position: relative; + + .comment-user-avatar { + margin: $size__spacing-unit 0 -#{$size__spacing-unit}; + } + + .comment .comment-form { + padding-left: 0; + } + + > small { + display: block; + font-size: $font__size_base; + position: absolute; + left: calc(#{$size__spacing-unit} + 100%); + top: calc(-3.5 * #{$size__spacing-unit}); + width: calc(100vw / 12 ); + } +} + +#comments { + + > .comments-title:last-child { + display: none; + } +} + +.comment-form-flex { + display: flex; + flex-direction: column; + + .comments-title { + display: none; + margin: 0; + order: 1; + } + + #respond { + order: 2; + + + .comments-title { + display: block; + } + } +} + +.comment-list { + list-style: none; + padding: 0; + + .children { + margin: 0; + padding: 0 0 0 $size__spacing-unit; + } + + > .comment:first-child { + margin-top: 0; + } + + .pingback, + .trackback { + + .comment-body { + color: $color__text-light; + @include font-family( $font__heading ); + font-size: $font__size-xs; + font-weight: 500; + margin-top: $size__spacing-unit; + margin-bottom: $size__spacing-unit; + + a:not(.comment-edit-link) { + font-weight: bold; + font-size: $font__size-base / (1 * $font__size-ratio); + line-height: 1.5; + padding-right: #{0.5 * $size__spacing-unit}; + display: block; + } + + .comment-edit-link { + color: $color__text-light; + @include font-family( $font__heading ); + font-weight: 500; + } + } + } +} + +.comment-reply { + + #respond + & { + display: none; + } + + .comment-reply-link { + display: inline-block; + } +} + +.comment { + list-style: none; + position: relative; + + @include media(tablet) { + padding-left: calc(.5 * (#{$size__spacing-unit} + calc(100vw / 12 ))); + + &.depth-1, + .children { + padding-left: 0; + } + + &.depth-1 { + margin-left: calc(3.25 * #{$size__spacing-unit}); + } + } + + .comment-body { + margin: calc(2 * #{$size__spacing-unit}) 0 0; + } + + + .comment-meta { + position: relative; + } + + .comment-author { + + .avatar { + float: left; + margin-right: $size__spacing-unit; + position: relative; + + @include media(tablet) { + float: inherit; + margin-right: inherit; + position: absolute; + top: 0; + right: calc(100% + #{$size__spacing-unit}); + } + } + + .fn { + position: relative; + display: block; + + a { + color: inherit; + + &:hover { + color: $color__link-hover; + } + } + } + + .post-author-badge { + border-radius: 100%; + display: block; + height: 18px; + position: absolute; + background: lighten( $color__link, 8% ); + right: calc(100% - #{$size__spacing-unit * 2.5}); + top: -3px; + width: 18px; + + @include media(tablet) { + right: calc(100% + #{$size__spacing-unit * .75}); + } + + svg { + width: inherit; + height: inherit; + display: block; + fill: white; + transform: scale(0.875); + } + } + } + + .comment-metadata { + + > a, + .comment-edit-link { + display: inline; + font-weight: 500; + color: $color__text-light; + vertical-align: baseline; + + time { + vertical-align: baseline; + } + + &:hover { + color: $color__link-hover; + text-decoration: none; + } + } + + > * { + display: inline-block; + } + + .edit-link-sep { + color: $color__text-light; + margin: 0 0.2em; + vertical-align: baseline; + } + + .edit-link { + color: $color__text-light; + + svg { + transform: scale(0.8); + vertical-align: baseline; + margin-right: 0.1em; + } + } + + .comment-edit-link { + position: relative; + padding-left: $size__spacing-unit; + margin-left: -#{$size__spacing-unit}; + z-index: 1; + + &:hover { + color: $color__link; + } + } + } + + .comment-content { + + margin: $size__spacing-unit 0; + + @include media(desktop) { + padding-right: $size__spacing-unit; + } + + > *:first-child { + margin-top: 0; + } + + > *:last-child { + margin-bottom: 0; + } + + blockquote { + margin-left: 0; + } + + a { + text-decoration: underline; + + &:hover { + text-decoration: none; + } + } + } +} + +.comment-reply-link, +#cancel-comment-reply-link { + font-weight: 500; + + &:hover { + color: $color__link-hover; + } +} + +.discussion-avatar-list { + @include clearfix; + + margin: 0; + padding: 0; + + li { + position: relative; + list-style: none; + margin: 0 -8px 0 0; + padding: 0; + float: left; + } + + .comment-user-avatar { + + img { + height: calc(1.5 * #{$size__spacing-unit}); + width: calc(1.5 * #{$size__spacing-unit}); + } + } +} + +.discussion-meta { + + .discussion-meta-info { + margin: 0; + + .svg-icon { + vertical-align: middle; + fill: currentColor; + transform: scale( 0.6 ) scaleX(-1) translateY(-0.1em); + margin-left: -#{.25 * $size__spacing-unit}; // Align icon with avatars above. + } + } + +} + +.comment-form { + + .comment-notes, + label { + @include font-family( $font__heading ); + font-size: $font__size-xs; + color: $color__text-light; + } + + .comment-form-author, + .comment-form-email { + @include media(tablet) { + width: calc(50% - #{$size__spacing-unit / 2}); + float: left; + } + } + + .comment-form-email { + @include media(tablet) { + margin-left: $size__spacing-unit; + } + } + + input[name="author"], + input[name="email"], + input[name="url"] { + display: block; + width: 100%; + } +} diff --git a/wp-content/themes/twentynineteen/sass/site/primary/_posts-and-pages.scss b/wp-content/themes/twentynineteen/sass/site/primary/_posts-and-pages.scss new file mode 100644 index 0000000..ce1c6f2 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/site/primary/_posts-and-pages.scss @@ -0,0 +1,304 @@ +.sticky { + display: block; +} + +.sticky-post { + background: $color__background-button; + color: #fff; + display: inline-block; + font-weight: bold; + line-height: 1; + padding: .25rem; + position: absolute; + text-transform: uppercase; + top: -$size__spacing-unit; + z-index: 1; +} + +.updated:not(.published) { + display: none; +} + +.page-links { + clear: both; + margin: 0 0 calc(1.5 * #{$size__spacing-unit}); +} + +.entry { + + margin-top: calc(6 * #{$size__spacing-unit}); + + &:first-of-type { + margin-top: 0; + } + + .entry-header { + + margin: calc(3 * #{ $size__spacing-unit}) $size__spacing-unit $size__spacing-unit; + position: relative; + + @include media(tablet) { + margin: calc(3 * #{ $size__spacing-unit}) $size__site-margins $size__spacing-unit; + } + } + + .entry-title { + + @include post-section-dash; + margin: 0; + + a { + color: inherit; + + &:hover { + color: $color__text-hover; + } + } + } + + .entry-meta, + .entry-footer { + + color: $color__text-light; + font-weight: 500; + + > span { + + margin-right: $size__spacing-unit; + display: inline-block; + + &:last-child { + margin-right: 0; + } + } + + a { + + @include link-transition; + color: currentColor; + + &:hover { + text-decoration: none; + color: $color__link; + } + } + + .svg-icon { + position: relative; + display: inline-block; + vertical-align: middle; + margin-right: 0.5em; + } + } + + .entry-meta { + margin: $size__spacing-unit 0; + } + + .entry-footer { + + margin: calc(2 * #{$size__spacing-unit}) $size__spacing-unit $size__spacing-unit; + + @include media(tablet) { + margin: $size__spacing-unit $size__site-margins calc(3 * #{$size__spacing-unit}); + max-width: $size__site-tablet-content; + } + + @include media(tablet) { + max-width: $size__site-desktop-content; + } + } + + .post-thumbnail { + + margin: $size__spacing-unit; + + @include media(tablet) { + margin: $size__spacing-unit $size__site-margins; + } + + &:focus { + outline: none; + } + + .post-thumbnail-inner { + display: block; + + img { + position: relative; + display: block; + width: 100%; + } + } + } + + .image-filters-enabled & { + + .post-thumbnail { + position: relative; + display: block; + + .post-thumbnail-inner { + filter: grayscale(100%); + + &:after { + background: rgba(0, 0, 0, 0.35); + content: ""; + display: block; + height: 100%; + opacity: .5; + pointer-events: none; + position: absolute; + top: 0; + width: 100%; + z-index: 4; + + @supports (mix-blend-mode: multiply) { + display: none; + } + } + } + + &:before, + &:after { + position: absolute; + display: block; + width: 100%; + height: 100%; + top: 0; left: 0; + content: "\020"; + pointer-events: none; + } + + @include filter-duotone; + + } + } + + .entry-content, + .entry-summary { + max-width: calc(100% - (2 * #{ $size__spacing-unit })); + margin: 0 $size__spacing-unit; + + @include media(tablet) { + max-width: 80%; + margin: 0 10%; + padding: 0 60px; + } + } + + .entry-content { + + p { + word-wrap: break-word; + } + + .more-link { + @include link-transition; + display: inline; + color: inherit; + + &:after { + content: "\02192"; + display: inline-block; + margin-left: 0.5em; + } + + &:hover { + color: $color__link; + text-decoration: none; + } + } + + a { + text-decoration: underline; + + &.button, + &:hover { + text-decoration: none; + } + + &.button { + display: inline-block; + } + + &.button:hover { + background: $color__background-button-hover; + color: $color__background-body; + cursor: pointer; + } + } + + // Overwrite iframe embeds that have inline styles. + > iframe[style] { + + margin: 32px 0 !important; + max-width: 100% !important; + + @include media(tablet) { + max-width: $size__site-tablet-content !important; + } + + @include media(desktop) { + max-width: $size__site-desktop-content !important; + } + } + + // Page links + .page-links a { + margin: calc(0.5 * #{$size__spacing-unit}); + text-decoration: none; + } + + // Classic editor audio embeds. + .wp-audio-shortcode { + max-width: calc(100vw - (2 * #{ $size__spacing-unit })); + + @include media(tablet) { + max-width: $size__site-tablet-content; + } + + @include media(desktop) { + max-width: $size__site-desktop-content; + } + } + } +} + +/* Author description */ + +.author-bio { + margin: calc(2 * #{$size__spacing-unit}) $size__spacing-unit $size__spacing-unit; + + @include postContentMaxWidth(); + + @include media(tablet) { + margin: calc(3 * #{$size__spacing-unit}) $size__site-margins; + } + + @include media(desktop) { + margin: calc(3 * #{$size__spacing-unit}) $size__site-margins; + } + + .author-title { + @include post-section-dash; + display: inline; + } + + .author-description { + + display: inline; + color: $color__text-light; + font-size: $font__size-md; + line-height: $font__line-height-heading; + + .author-link { + display: inline-block; + + &:hover { + color: $color__link-hover; + text-decoration: none; + } + } + } +} diff --git a/wp-content/themes/twentynineteen/sass/site/secondary/_widgets.scss b/wp-content/themes/twentynineteen/sass/site/secondary/_widgets.scss new file mode 100644 index 0000000..7ade14c --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/site/secondary/_widgets.scss @@ -0,0 +1,102 @@ +.widget { + margin: 0 0 #{$size__spacing-unit}; + + /* Make sure select elements fit in widgets. */ + select { + max-width: 100%; + } + + a { + color: $color__link; + + &:hover { + color: $color__link-hover; + } + } +} + +.widget_archive, +.widget_categories, +.widget_meta, +.widget_nav_menu, +.widget_pages, +.widget_recent_comments, +.widget_recent_entries, +.widget_rss { + + ul { + padding: 0; + list-style: none; + + li { + color: $color__text-light; + @include font-family( $font__heading ); + font-size: calc(#{$font__size_base} * #{$font__size-ratio}); + font-weight: 700; + line-height: $font__line-height-heading; + margin-top: #{0.5 * $size__spacing-unit}; + margin-bottom: #{0.5 * $size__spacing-unit}; + } + + @include nestedSubMenuPadding(); + } +} + +.widget_tag_cloud { + + .tagcloud { + @include font-family( $font__heading ); + font-weight: 700; + } +} + + +.widget_search { + + .search-field { + width: 100%; + + @include media(mobile) { + width: auto; + } + } + + .search-submit { + display: block; + margin-top: $size__spacing-unit; + } +} + +.widget_calendar .calendar_wrap { + text-align: center; + + table td, + table th { + border: none; + } + + a { + text-decoration: underline; + } + + .wp-calendar-table { + margin-bottom: 0; + } + + .wp-calendar-nav { + margin: 0 0 $size__spacing-unit; + display: table; + width: 100%; + @include font-family( $font__heading ); + + span { + display: table-cell; + padding: 0.5em; + } + } + + .wp-calendar-nav-prev, + .wp-calendar-nav-next { + width: 40%; + } +} \ No newline at end of file diff --git a/wp-content/themes/twentynineteen/sass/typography/_copy.scss b/wp-content/themes/twentynineteen/sass/typography/_copy.scss new file mode 100644 index 0000000..bfbd0fe --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/typography/_copy.scss @@ -0,0 +1,62 @@ +p { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +dfn, +cite, +em, +i { + font-style: italic; +} + +blockquote { + + cite { + font-size: $font__size-xs; + font-style: normal; + @include font-family( $font__heading ); + } +} + +pre { + font-size: $font__size-sm; + font-family: $font__pre; + line-height: $font__line-height-body; + overflow: auto; +} + +code, +kbd, +tt, +var { + font-size: $font__size-sm; + font-family: $font__code; +} + +abbr, acronym { + border-bottom: 1px dotted #666; + cursor: help; +} + +mark, +ins { + background: #fff9c0; + text-decoration: none; +} + +big { + font-size: 125%; +} + +a { + text-decoration: none; + + &:hover { + text-decoration: none; + } + + &:focus { + text-decoration: underline; + } +} diff --git a/wp-content/themes/twentynineteen/sass/typography/_headings.scss b/wp-content/themes/twentynineteen/sass/typography/_headings.scss new file mode 100644 index 0000000..21ea2e4 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/typography/_headings.scss @@ -0,0 +1,164 @@ +.author-description .author-link, +.comment-metadata, +.comment-reply-link, +.comments-title, +.comment-author .fn, +.discussion-meta-info, +.entry-meta, +.entry-footer, +.main-navigation, +.no-comments, +.not-found .page-title, +.error-404 .page-title, +.post-navigation .post-title, +.page-links, +.page-description, +.pagination .nav-links, +.sticky-post, +.site-title, +.site-info, +#cancel-comment-reply-link, +h1, +h2, +h3, +h4, +h5, +h6 { + @include font-family( $font__heading ); +} + +.main-navigation, +.page-description, +.author-description .author-link, +.not-found .page-title, +.error-404 .page-title, +.post-navigation .post-title, +.pagination .nav-links, +.comments-title, +.comment-author .fn, +.no-comments, +.site-title, +h1, +h2, +h3, +h4, +h5, +h6 { + font-weight: 700; + letter-spacing: -0.02em; + line-height: $font__line-height-heading; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.page-title { + @include font-family( $font__body ); +} + +.site-branding, +.main-navigation ul.main-menu > li, +.social-navigation, +.author-description .author-bio, +.nav-links { + line-height: 1.25; +} + +h1 { + font-size: $font__size-xl; + + @include media(tablet) { + font-size: $font__size-xxl; + } +} + +.entry-title, +.not-found .page-title, +.error-404 .page-title, +.has-larger-font-size, +h2 { + font-size: $font__size-lg; + + @include media(tablet) { + font-size: $font__size-xl; + } +} + +.has-regular-font-size, +.has-large-font-size, +.comments-title, +h3 { + font-size: $font__size-lg; +} + +.site-title, +.site-description, +.main-navigation, +.nav-links, +.page-title, +.page-description, +.comment-author .fn, +.no-comments, +h2.author-title, +p.author-bio, +h4 { + font-size: $font__size-md; +} + +.pagination .nav-links, +.comment-content, +h5 { + font-size: $font__size-sm; +} + +.entry-meta, +.entry-footer, +.discussion-meta-info, +.site-info, +.has-small-font-size, +.comment-reply-link, +.comment-metadata, +.comment-notes, +.sticky-post, +#cancel-comment-reply-link, +img:after, +h6 { + font-size: $font__size-xs; +} + +.site-title, +.page-title { + font-weight: normal; +} + +.page-description, +.page-links a { + font-weight: bold; +} + +.site-description { + letter-spacing: -0.01em; +} + +.post-navigation .post-title, +.entry-title, +.not-found .page-title, +.error-404 .page-title, +.comments-title, +blockquote { + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + word-break: break-word; + word-wrap: break-word; +} + +/* Do not hyphenate entry title on tablet view and bigger. */ +.entry-title { + @include media(tablet) { + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; + } +} diff --git a/wp-content/themes/twentynineteen/sass/typography/_typography.scss b/wp-content/themes/twentynineteen/sass/typography/_typography.scss new file mode 100644 index 0000000..055b7a6 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/typography/_typography.scss @@ -0,0 +1,32 @@ + +html { + font-size: $font__size_base; +} + +body { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + color: $color__text-main; + @include font-family( $font__body ); + font-weight: 400; + font-size: 1em; + line-height: $font__line-height-body; + margin: 0; + text-rendering: optimizeLegibility; +} + +button, +input, +select, +optgroup, +textarea { + color: $color__text-main; + @include font-family( $font__body ); + font-weight: 400; + line-height: $font__line-height-body; + text-rendering: optimizeLegibility; +} + +@import "headings"; + +@import "copy"; diff --git a/wp-content/themes/twentynineteen/sass/variables-site/_colors.scss b/wp-content/themes/twentynineteen/sass/variables-site/_colors.scss new file mode 100644 index 0000000..989daa0 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/variables-site/_colors.scss @@ -0,0 +1,34 @@ + +// Backgrounds +$color__background-body: #fff; +$color__background-input: #fff; +$color__background-screen: #f1f1f1; +$color__background-hr: #ccc; +$color__background-button: #0073aa; +$color__background-button-hover: #111; +$color__background-pre: #eee; +$color__background-ins: #fff9c0; +$color__background_selection: mix( $color__background-body, $color__background-button, 75% ); // lighten( salmon, 22.5% ); // lighten( #0999d4, 48% ); + +// Text +$color__text-main: #111; +$color__text-light: #767676; +$color__text-hover: lighten( #111, 22.5% ); +$color__text-screen: #21759b; +$color__text-input: #666; +$color__text-input-focus: #111; + +// Links +$color__link: #0073aa; +$color__link-visited: #0073aa; +$color__link-hover: darken( $color__link, 10% ); + +// Borders +$color__border: #ccc; +$color__border-link: #0073aa; +$color__border-link-hover: darken( $color__link, 10% ); +$color__border-button: #ccc #ccc #bbb; +$color__border-button-hover: #ccc #bbb #aaa; +$color__border-button-focus: #aaa #bbb #bbb; +$color__border-input: $color__border; +$color__border-abbr: #666; diff --git a/wp-content/themes/twentynineteen/sass/variables-site/_columns.scss b/wp-content/themes/twentynineteen/sass/variables-site/_columns.scss new file mode 100644 index 0000000..6bd29bc --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/variables-site/_columns.scss @@ -0,0 +1,16 @@ +$columns: ( + 1: calc(1 * (100vw / 12)), + 2: calc(2 * (100vw / 12)), + 3: calc(3 * (100vw / 12)), + 4: calc(4 * (100vw / 12)), + 5: calc(5 * (100vw / 12)), + 6: calc(6 * (100vw / 12)), + 7: calc(7 * (100vw / 12)), + 8: calc(8 * (100vw / 12)), + 9: calc(9 * (100vw / 12)), + 10: calc(10 * (100vw / 12)), + 11: calc(11 * (100vw / 12)), + 12: calc(12 * (100vw / 12)) +); + +$columns__margin: $size__spacing-unit; diff --git a/wp-content/themes/twentynineteen/sass/variables-site/_fonts.scss b/wp-content/themes/twentynineteen/sass/variables-site/_fonts.scss new file mode 100644 index 0000000..59ab20b --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/variables-site/_fonts.scss @@ -0,0 +1,83 @@ +/* + * Chrome renders extra-wide   characters for the Hoefler Text font. + * This results in a jumping cursor when typing in both the Classic and block + * editors. The following font-face override fixes the issue by manually inserting + * a custom font that includes just a Hoefler Text space replacement for that + * character instead. + */ +@font-face { + font-family: 'NonBreakingSpaceOverride'; + src: url(data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAAAMoAA0AAAAACDQAAALTAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGh4GYACCahEICjx3CywAATYCJANUBCAFhiEHgWwbXQfILgpsY+rQRRARwyAs6uL7pxzYhxEE+32b3aeHmifR6tklkS9hiZA0ewkqGRJE+H7/+6378ASViK/PGeavqJyOzsceKi1s3BCiQsiOdn1r/RBgIJYEgCUhbm/8/8/h4saPssnTNkkiWUBrTRtjmQSajw3Ui3pZ3LYDPD+XG2C3JA/yKAS8/rU5eNfuGqRf4eNNgV4YAlIIgxglEkWe6FYpq10+wi3g+/nUgvgPFczNrz/RsTgVm/zfbPuHZlsuQECxuyqBcQwKFBjFgKO8AqP4bAN9tFJtnM9xPcbNjeXS/x1wY/xU52f5W/X1+9cnH4YwKIaoRRAkUkj/YlAAeF/624foiIDBgBmgQBeGAyhBljUPZUm/l2dTvmpqcBDUOHdbPZWd8JsBAsGr4w8/EDn82/bUPx4eh0YNrQTBuHO2FjQEAGBwK0DeI37DpQVqdERS4gZBhpeUhWCfLFz7J99aEBgsJCHvUGAdAPp4IADDCAPCEFMGpMZ9AQpTfQtQGhLbGVBZFV8BaqNyP68oTZgHNj3M8kBPfXTTC9t90UuzYhy9ciH0grVlOcqyCytisvbsERsEYztiznR0WCrmTksJwbSNK6fd1Rvr25I9oLvctUoEbNOmXJbqgYgPXEHJ82IUsrCnpkxh23F1rfZ2zcRnJYoXtauB3VTFkFXQg3uoZYD5qE0kdjDtoDoF1h2bulGmev5HbYhbrjtohQSRI4aNOkffIcT+d3v6atpaYh3JvPoQsztCcqvaBkppDSPcQ3bw3KaCBo1f5CJWTZEgW3LjLofYg51MaVezrx8xZitYbQ9KYeoRaqQdVLwSEfrKXLK1otCWOKNdR/YwYAfon5Yk8O2MJfSD10dPGA5PIJJQMkah0ugMJiv6x4Dm7LEa8xnrRGGGLAg4sAlbsA07sAt76DOsXKO3hIjtIlpnnFrt1qW4kh6NhS83P/6HB/fl1SMAAA==) format('woff2'), + url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUQAA0AAAAACDQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAE9AAAABwAAAAchf5yU0dERUYAAATYAAAAHAAAAB4AJwAbT1MvMgAAAaAAAABJAAAAYJAcgU5jbWFwAAACIAAAAF4AAAFqUUxBZ2dhc3AAAATQAAAACAAAAAgAAAAQZ2x5ZgAAApAAAAAyAAAAPL0n8y9oZWFkAAABMAAAADAAAAA2Fi93Z2hoZWEAAAFgAAAAHQAAACQOSgWaaG10eAAAAewAAAAzAAAAVC7TAQBsb2NhAAACgAAAABAAAAAsAOQBAm1heHAAAAGAAAAAHQAAACAAWQALbmFtZQAAAsQAAAF6AAADIYvD/Adwb3N0AAAEQAAAAI4AAADsapk2o3jaY2BkYGAA4ov5mwzj+W2+MnCzXwCKMNzgCBSB0LfbQDQ7AxuI4mBgAlEAFKQIRHjaY2BkYGD3+NvCwMDBAALsDAyMDKhAFAA3+wH3AAAAeNpjYGRgYBBl4GBgYgABEMnIABJzAPMZAAVmAGUAAAB42mNgZlJhnMDAysDCKsKygYGBYRqEZtrDYMT4D8gHSmEHjgUFOQwODAqqf9g9/rYwMLB7MNUAhRlBcsxBrMlASoGBEQAj8QtyAAAAeNrjYGBkAAGmWQwMjO8gmBnIZ2NA0ExAzNjAAFYJVn0ASBsD6VAIDZb7AtELAgANIgb9AHjaY2BgYGaAYBkGRgYQSAHyGMF8FgYPIM3HwMHAxMDGoMCwQIFLQV8hXvXP//9AcRCfAcb///h/ygPW+w/vb7olBjUHCTCyMcAFGZmABBO6AogThgZgIUsXAEDcEzcAAHjaY2BgECMCyoEgACZaAed42mNgYmRgYGBnYGNgYAZSDJqMgorCgoqCjECRXwwNrCAKSP5mAAFGBiRgyAAAi/YFBQAAeNqtkc1OwkAUhU/5M25cEhcsZick0AwlBJq6MWwgJkAgYV/KAA2lJeUn+hY+gktXvpKv4dLTMqKycGHsTZNv7px7z50ZAFd4hYHjdw1Ls4EiHjVncIFnzVnc4F1zDkWjrzmPW+NNcwGlzIRKI3fJlUyrEjZQxb3mDH2fNGfRx4vmHKqG0JzHg6E0F9DOlFBGBxUI1GEzLNT4S0aLuTtsGAEUuYcQHkyg3KmIum1bNUvKlrjbbAIleqHHnS4iSudpQcySMYtdFiXlAxzSbAwfMxK6kZoHKhbjjespMTioOPZnzI+4ucCeTVyKMVKLfeAS6vSWaTinuZwzyy/Dc7vaed+6KaV0kukdPUk6yOcctZPvvxxqksq2lEW8RvHjMEO2FCl/zy6p3NEm0R9OFSafJdldc4QVeyaaObMBO0/5cCaa6d9Ggyubxire+lEojscdjoWUR1xGOy8KD8mG2ZLO2l2paDc3A39qmU2z2W5YNv5+u79e6QfGJY/hAAB42m3NywrCMBQE0DupWp/1AYI7/6DEaLQu66Mrd35BKUWKJSlFv1+rue4cGM7shgR981qSon+ZNwUJ8iDgoYU2OvDRRQ99DDDECAHGmGCKmf80hZSx/Kik/LliFbtmN6xmt+yOjdg9GztV4tROnRwX/Bsaaw51nt4Lc7tWaZYHp/MlzKx51LZs5htNri+2AAAAAQAB//8AD3jaY2BkYGDgAWIxIGZiYARCESBmAfMYAAR6AEMAAAABAAAAANXtRbgAAAAA2AhRFAAAAADYCNuG) format('woff'); + +} + +// Font and typographic variables + +$font__body: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; +$font__heading: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; +$font__fallbacks: ( + /* Arabic */ + ar: 'Tahoma, Arial, sans-serif', + ary: 'Tahoma, Arial, sans-serif', + azb: 'Tahoma, Arial, sans-serif', + ckb: 'Tahoma, Arial, sans-serif', + fa-IR: 'Tahoma, Arial, sans-serif', + haz: 'Tahoma, Arial, sans-serif', + ps: 'Tahoma, Arial, sans-serif', + /* Cyrillic */ + be: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif', + bg-BG: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif', + kk: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif', + mk-MK: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif', + mn: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif', + ru-RU: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif', + sah: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif', + sr-RS: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif', + tt-RU: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif', + uk: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif', + /* Chinese (Hong Kong) */ + zh-HK: '-apple-system, BlinkMacSystemFont, "PingFang HK", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif', + /* Chinese (Taiwan) */ + zh-TW: '-apple-system, BlinkMacSystemFont, "PingFang TC", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif', + /* Chinese (China) */ + zh-CN: '-apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif', + /* Devanagari */ + bn-BD: 'Arial, sans-serif', + hi-IN: 'Arial, sans-serif', + mr: 'Arial, sans-serif', + ne-NP: 'Arial, sans-serif', + /* Greek */ + el: '"Helvetica Neue", Helvetica, Arial, sans-serif', + /* Gujarati */ + gu: 'Arial, sans-serif', + /* Hebrew */ + he-IL: '"Arial Hebrew", Arial, sans-serif', + /* Japanese */ + ja: '-apple-system, BlinkMacSystemFont, "Hiragino Sans", Meiryo, "Helvetica Neue", sans-serif', + /* Korean */ + ko-KR: '"Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif', + /* Thai */ + th: '"Sukhumvit Set", "Helvetica Neue", helvetica, arial, sans-serif', + /* Vietnamese */ + vi: '"Libre Franklin", sans-serif', +); +$font__code: Menlo, monaco, Consolas, Lucida Console, monospace; +$font__pre: "Courier 10 Pitch", Courier, monospace; + +$font__size_base: 22px; +$font__size-ratio: 1.125; + +$font__size-xxs: 1em / (1.5 * $font__size-ratio); +$font__size-xs: 1em / (1.25 * $font__size-ratio); +$font__size-sm: 1em / (1 * $font__size-ratio); +$font__size-md: 1em * (1 * $font__size-ratio); +$font__size-lg: 1em * (1.5 * $font__size-ratio); +$font__size-xl: 1em * (2 * $font__size-ratio); +$font__size-xxl: 1em * (2.5 * $font__size-ratio); +$font__size-xxxl: 1em * (3 * $font__size-ratio); + +$font__line-height-body: 1.8; +$font__line-height-pre: 1.6; +$font__line-height-heading: 1.2; +$font__line-height-double: 2 * $font__line-height-heading; \ No newline at end of file diff --git a/wp-content/themes/twentynineteen/sass/variables-site/_structure.scss b/wp-content/themes/twentynineteen/sass/variables-site/_structure.scss new file mode 100644 index 0000000..dc62145 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/variables-site/_structure.scss @@ -0,0 +1,16 @@ +// Responsive widths. + +$size__spacing-unit: 1rem; +$size__site-main: 100%; +$size__site-sidebar: 25%; +$size__site-margins: calc(10% + 60px); +$size__site-tablet-content: calc(8 * (100vw / 12) - 28px); +$size__site-desktop-content: calc(6 * (100vw / 12) - 28px); + +// Responsive widths. + +$mobile_width: 600px; +$tablet_width: 768px; +$desktop_width: 1168px; +$wide_width: 1379px; + diff --git a/wp-content/themes/twentynineteen/sass/variables-site/_transitions.scss b/wp-content/themes/twentynineteen/sass/variables-site/_transitions.scss new file mode 100644 index 0000000..f0eebbd --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/variables-site/_transitions.scss @@ -0,0 +1,6 @@ +// Transition timeouts. + +$link_transition: 110ms; +$icon_transition: 120ms; +$button_transition: 150ms; +$background_transition: 200ms; \ No newline at end of file diff --git a/wp-content/themes/twentynineteen/sass/variables-site/_variables-site.scss b/wp-content/themes/twentynineteen/sass/variables-site/_variables-site.scss new file mode 100644 index 0000000..9d527f9 --- /dev/null +++ b/wp-content/themes/twentynineteen/sass/variables-site/_variables-site.scss @@ -0,0 +1,5 @@ +@import "colors"; +@import "fonts"; +@import "structure"; +@import "columns"; +@import "transitions"; diff --git a/wp-content/themes/twentynineteen/screenshot.png b/wp-content/themes/twentynineteen/screenshot.png new file mode 100644 index 0000000..7dc53c5 Binary files /dev/null and b/wp-content/themes/twentynineteen/screenshot.png differ diff --git a/wp-content/themes/twentynineteen/search.php b/wp-content/themes/twentynineteen/search.php new file mode 100644 index 0000000..6c8f0e1 --- /dev/null +++ b/wp-content/themes/twentynineteen/search.php @@ -0,0 +1,56 @@ + + +
            +
            + + + + + + +
            +
            + + + +
            +
            + + sprintf( __( 'Published in%s', 'twentynineteen' ), '%title' ), + ) + ); + } elseif ( is_singular( 'post' ) ) { + // Previous/next post navigation. + the_post_navigation( + array( + 'next_text' => ' ' . + '' . __( 'Next post:', 'twentynineteen' ) . '
            ' . + '%title', + 'prev_text' => ' ' . + '' . __( 'Previous post:', 'twentynineteen' ) . '
            ' . + '%title', + ) + ); + } + + // If comments are open or we have at least one comment, load up the comment template. + if ( comments_open() || get_comments_number() ) { + comments_template(); + } + + endwhile; // End the loop. + ?> + +
            +
            + + a:lang(ar), +.wp-block-categories li > a:lang(ar), +.wp-block-latest-posts li > a:lang(ar), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ar), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ar), .wp-caption dd:lang(ar), .wp-block-freeform blockquote cite:lang(ar) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(ary), h1:lang(ary), +h2:lang(ary), +h3:lang(ary), +h4:lang(ary), +h5:lang(ary), +h6:lang(ary), figcaption:lang(ary), +.gallery-caption:lang(ary), .editor-post-title__block .editor-post-title__input:lang(ary), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(ary), .wp-block-paragraph.has-drop-cap:lang(ary):not(:focus)::first-letter, .wp-block-table:lang(ary), .wp-block-cover h2:lang(ary), +.wp-block-cover .wp-block-cover-text:lang(ary), .wp-block-button .wp-block-button__link:lang(ary), .wp-block-quote cite:lang(ary), +.wp-block-quote footer:lang(ary), +.wp-block-quote .wp-block-quote__citation:lang(ary), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(ary), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(ary), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(ary), .wp-block-file:lang(ary), ul.wp-block-archives li > a:lang(ary), +.wp-block-categories li > a:lang(ary), +.wp-block-latest-posts li > a:lang(ary), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ary), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ary), .wp-caption dd:lang(ary), .wp-block-freeform blockquote cite:lang(ary) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(azb), h1:lang(azb), +h2:lang(azb), +h3:lang(azb), +h4:lang(azb), +h5:lang(azb), +h6:lang(azb), figcaption:lang(azb), +.gallery-caption:lang(azb), .editor-post-title__block .editor-post-title__input:lang(azb), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(azb), .wp-block-paragraph.has-drop-cap:lang(azb):not(:focus)::first-letter, .wp-block-table:lang(azb), .wp-block-cover h2:lang(azb), +.wp-block-cover .wp-block-cover-text:lang(azb), .wp-block-button .wp-block-button__link:lang(azb), .wp-block-quote cite:lang(azb), +.wp-block-quote footer:lang(azb), +.wp-block-quote .wp-block-quote__citation:lang(azb), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(azb), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(azb), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(azb), .wp-block-file:lang(azb), ul.wp-block-archives li > a:lang(azb), +.wp-block-categories li > a:lang(azb), +.wp-block-latest-posts li > a:lang(azb), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(azb), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(azb), .wp-caption dd:lang(azb), .wp-block-freeform blockquote cite:lang(azb) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(ckb), h1:lang(ckb), +h2:lang(ckb), +h3:lang(ckb), +h4:lang(ckb), +h5:lang(ckb), +h6:lang(ckb), figcaption:lang(ckb), +.gallery-caption:lang(ckb), .editor-post-title__block .editor-post-title__input:lang(ckb), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(ckb), .wp-block-paragraph.has-drop-cap:lang(ckb):not(:focus)::first-letter, .wp-block-table:lang(ckb), .wp-block-cover h2:lang(ckb), +.wp-block-cover .wp-block-cover-text:lang(ckb), .wp-block-button .wp-block-button__link:lang(ckb), .wp-block-quote cite:lang(ckb), +.wp-block-quote footer:lang(ckb), +.wp-block-quote .wp-block-quote__citation:lang(ckb), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(ckb), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(ckb), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(ckb), .wp-block-file:lang(ckb), ul.wp-block-archives li > a:lang(ckb), +.wp-block-categories li > a:lang(ckb), +.wp-block-latest-posts li > a:lang(ckb), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ckb), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ckb), .wp-caption dd:lang(ckb), .wp-block-freeform blockquote cite:lang(ckb) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(fa-IR), h1:lang(fa-IR), +h2:lang(fa-IR), +h3:lang(fa-IR), +h4:lang(fa-IR), +h5:lang(fa-IR), +h6:lang(fa-IR), figcaption:lang(fa-IR), +.gallery-caption:lang(fa-IR), .editor-post-title__block .editor-post-title__input:lang(fa-IR), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(fa-IR), .wp-block-paragraph.has-drop-cap:lang(fa-IR):not(:focus)::first-letter, .wp-block-table:lang(fa-IR), .wp-block-cover h2:lang(fa-IR), +.wp-block-cover .wp-block-cover-text:lang(fa-IR), .wp-block-button .wp-block-button__link:lang(fa-IR), .wp-block-quote cite:lang(fa-IR), +.wp-block-quote footer:lang(fa-IR), +.wp-block-quote .wp-block-quote__citation:lang(fa-IR), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(fa-IR), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(fa-IR), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(fa-IR), .wp-block-file:lang(fa-IR), ul.wp-block-archives li > a:lang(fa-IR), +.wp-block-categories li > a:lang(fa-IR), +.wp-block-latest-posts li > a:lang(fa-IR), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(fa-IR), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(fa-IR), .wp-caption dd:lang(fa-IR), .wp-block-freeform blockquote cite:lang(fa-IR) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(haz), h1:lang(haz), +h2:lang(haz), +h3:lang(haz), +h4:lang(haz), +h5:lang(haz), +h6:lang(haz), figcaption:lang(haz), +.gallery-caption:lang(haz), .editor-post-title__block .editor-post-title__input:lang(haz), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(haz), .wp-block-paragraph.has-drop-cap:lang(haz):not(:focus)::first-letter, .wp-block-table:lang(haz), .wp-block-cover h2:lang(haz), +.wp-block-cover .wp-block-cover-text:lang(haz), .wp-block-button .wp-block-button__link:lang(haz), .wp-block-quote cite:lang(haz), +.wp-block-quote footer:lang(haz), +.wp-block-quote .wp-block-quote__citation:lang(haz), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(haz), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(haz), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(haz), .wp-block-file:lang(haz), ul.wp-block-archives li > a:lang(haz), +.wp-block-categories li > a:lang(haz), +.wp-block-latest-posts li > a:lang(haz), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(haz), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(haz), .wp-caption dd:lang(haz), .wp-block-freeform blockquote cite:lang(haz) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(ps), h1:lang(ps), +h2:lang(ps), +h3:lang(ps), +h4:lang(ps), +h5:lang(ps), +h6:lang(ps), figcaption:lang(ps), +.gallery-caption:lang(ps), .editor-post-title__block .editor-post-title__input:lang(ps), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(ps), .wp-block-paragraph.has-drop-cap:lang(ps):not(:focus)::first-letter, .wp-block-table:lang(ps), .wp-block-cover h2:lang(ps), +.wp-block-cover .wp-block-cover-text:lang(ps), .wp-block-button .wp-block-button__link:lang(ps), .wp-block-quote cite:lang(ps), +.wp-block-quote footer:lang(ps), +.wp-block-quote .wp-block-quote__citation:lang(ps), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(ps), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(ps), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(ps), .wp-block-file:lang(ps), ul.wp-block-archives li > a:lang(ps), +.wp-block-categories li > a:lang(ps), +.wp-block-latest-posts li > a:lang(ps), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ps), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ps), .wp-caption dd:lang(ps), .wp-block-freeform blockquote cite:lang(ps) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(be), h1:lang(be), +h2:lang(be), +h3:lang(be), +h4:lang(be), +h5:lang(be), +h6:lang(be), figcaption:lang(be), +.gallery-caption:lang(be), .editor-post-title__block .editor-post-title__input:lang(be), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(be), .wp-block-paragraph.has-drop-cap:lang(be):not(:focus)::first-letter, .wp-block-table:lang(be), .wp-block-cover h2:lang(be), +.wp-block-cover .wp-block-cover-text:lang(be), .wp-block-button .wp-block-button__link:lang(be), .wp-block-quote cite:lang(be), +.wp-block-quote footer:lang(be), +.wp-block-quote .wp-block-quote__citation:lang(be), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(be), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(be), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(be), .wp-block-file:lang(be), ul.wp-block-archives li > a:lang(be), +.wp-block-categories li > a:lang(be), +.wp-block-latest-posts li > a:lang(be), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(be), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(be), .wp-caption dd:lang(be), .wp-block-freeform blockquote cite:lang(be) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(bg-BG), h1:lang(bg-BG), +h2:lang(bg-BG), +h3:lang(bg-BG), +h4:lang(bg-BG), +h5:lang(bg-BG), +h6:lang(bg-BG), figcaption:lang(bg-BG), +.gallery-caption:lang(bg-BG), .editor-post-title__block .editor-post-title__input:lang(bg-BG), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(bg-BG), .wp-block-paragraph.has-drop-cap:lang(bg-BG):not(:focus)::first-letter, .wp-block-table:lang(bg-BG), .wp-block-cover h2:lang(bg-BG), +.wp-block-cover .wp-block-cover-text:lang(bg-BG), .wp-block-button .wp-block-button__link:lang(bg-BG), .wp-block-quote cite:lang(bg-BG), +.wp-block-quote footer:lang(bg-BG), +.wp-block-quote .wp-block-quote__citation:lang(bg-BG), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(bg-BG), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(bg-BG), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(bg-BG), .wp-block-file:lang(bg-BG), ul.wp-block-archives li > a:lang(bg-BG), +.wp-block-categories li > a:lang(bg-BG), +.wp-block-latest-posts li > a:lang(bg-BG), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(bg-BG), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(bg-BG), .wp-caption dd:lang(bg-BG), .wp-block-freeform blockquote cite:lang(bg-BG) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(kk), h1:lang(kk), +h2:lang(kk), +h3:lang(kk), +h4:lang(kk), +h5:lang(kk), +h6:lang(kk), figcaption:lang(kk), +.gallery-caption:lang(kk), .editor-post-title__block .editor-post-title__input:lang(kk), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(kk), .wp-block-paragraph.has-drop-cap:lang(kk):not(:focus)::first-letter, .wp-block-table:lang(kk), .wp-block-cover h2:lang(kk), +.wp-block-cover .wp-block-cover-text:lang(kk), .wp-block-button .wp-block-button__link:lang(kk), .wp-block-quote cite:lang(kk), +.wp-block-quote footer:lang(kk), +.wp-block-quote .wp-block-quote__citation:lang(kk), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(kk), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(kk), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(kk), .wp-block-file:lang(kk), ul.wp-block-archives li > a:lang(kk), +.wp-block-categories li > a:lang(kk), +.wp-block-latest-posts li > a:lang(kk), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(kk), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(kk), .wp-caption dd:lang(kk), .wp-block-freeform blockquote cite:lang(kk) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(mk-MK), h1:lang(mk-MK), +h2:lang(mk-MK), +h3:lang(mk-MK), +h4:lang(mk-MK), +h5:lang(mk-MK), +h6:lang(mk-MK), figcaption:lang(mk-MK), +.gallery-caption:lang(mk-MK), .editor-post-title__block .editor-post-title__input:lang(mk-MK), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(mk-MK), .wp-block-paragraph.has-drop-cap:lang(mk-MK):not(:focus)::first-letter, .wp-block-table:lang(mk-MK), .wp-block-cover h2:lang(mk-MK), +.wp-block-cover .wp-block-cover-text:lang(mk-MK), .wp-block-button .wp-block-button__link:lang(mk-MK), .wp-block-quote cite:lang(mk-MK), +.wp-block-quote footer:lang(mk-MK), +.wp-block-quote .wp-block-quote__citation:lang(mk-MK), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(mk-MK), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(mk-MK), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(mk-MK), .wp-block-file:lang(mk-MK), ul.wp-block-archives li > a:lang(mk-MK), +.wp-block-categories li > a:lang(mk-MK), +.wp-block-latest-posts li > a:lang(mk-MK), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(mk-MK), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(mk-MK), .wp-caption dd:lang(mk-MK), .wp-block-freeform blockquote cite:lang(mk-MK) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(mn), h1:lang(mn), +h2:lang(mn), +h3:lang(mn), +h4:lang(mn), +h5:lang(mn), +h6:lang(mn), figcaption:lang(mn), +.gallery-caption:lang(mn), .editor-post-title__block .editor-post-title__input:lang(mn), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(mn), .wp-block-paragraph.has-drop-cap:lang(mn):not(:focus)::first-letter, .wp-block-table:lang(mn), .wp-block-cover h2:lang(mn), +.wp-block-cover .wp-block-cover-text:lang(mn), .wp-block-button .wp-block-button__link:lang(mn), .wp-block-quote cite:lang(mn), +.wp-block-quote footer:lang(mn), +.wp-block-quote .wp-block-quote__citation:lang(mn), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(mn), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(mn), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(mn), .wp-block-file:lang(mn), ul.wp-block-archives li > a:lang(mn), +.wp-block-categories li > a:lang(mn), +.wp-block-latest-posts li > a:lang(mn), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(mn), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(mn), .wp-caption dd:lang(mn), .wp-block-freeform blockquote cite:lang(mn) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(ru-RU), h1:lang(ru-RU), +h2:lang(ru-RU), +h3:lang(ru-RU), +h4:lang(ru-RU), +h5:lang(ru-RU), +h6:lang(ru-RU), figcaption:lang(ru-RU), +.gallery-caption:lang(ru-RU), .editor-post-title__block .editor-post-title__input:lang(ru-RU), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(ru-RU), .wp-block-paragraph.has-drop-cap:lang(ru-RU):not(:focus)::first-letter, .wp-block-table:lang(ru-RU), .wp-block-cover h2:lang(ru-RU), +.wp-block-cover .wp-block-cover-text:lang(ru-RU), .wp-block-button .wp-block-button__link:lang(ru-RU), .wp-block-quote cite:lang(ru-RU), +.wp-block-quote footer:lang(ru-RU), +.wp-block-quote .wp-block-quote__citation:lang(ru-RU), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(ru-RU), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(ru-RU), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(ru-RU), .wp-block-file:lang(ru-RU), ul.wp-block-archives li > a:lang(ru-RU), +.wp-block-categories li > a:lang(ru-RU), +.wp-block-latest-posts li > a:lang(ru-RU), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ru-RU), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ru-RU), .wp-caption dd:lang(ru-RU), .wp-block-freeform blockquote cite:lang(ru-RU) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(sah), h1:lang(sah), +h2:lang(sah), +h3:lang(sah), +h4:lang(sah), +h5:lang(sah), +h6:lang(sah), figcaption:lang(sah), +.gallery-caption:lang(sah), .editor-post-title__block .editor-post-title__input:lang(sah), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(sah), .wp-block-paragraph.has-drop-cap:lang(sah):not(:focus)::first-letter, .wp-block-table:lang(sah), .wp-block-cover h2:lang(sah), +.wp-block-cover .wp-block-cover-text:lang(sah), .wp-block-button .wp-block-button__link:lang(sah), .wp-block-quote cite:lang(sah), +.wp-block-quote footer:lang(sah), +.wp-block-quote .wp-block-quote__citation:lang(sah), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(sah), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(sah), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(sah), .wp-block-file:lang(sah), ul.wp-block-archives li > a:lang(sah), +.wp-block-categories li > a:lang(sah), +.wp-block-latest-posts li > a:lang(sah), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(sah), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(sah), .wp-caption dd:lang(sah), .wp-block-freeform blockquote cite:lang(sah) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(sr-RS), h1:lang(sr-RS), +h2:lang(sr-RS), +h3:lang(sr-RS), +h4:lang(sr-RS), +h5:lang(sr-RS), +h6:lang(sr-RS), figcaption:lang(sr-RS), +.gallery-caption:lang(sr-RS), .editor-post-title__block .editor-post-title__input:lang(sr-RS), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(sr-RS), .wp-block-paragraph.has-drop-cap:lang(sr-RS):not(:focus)::first-letter, .wp-block-table:lang(sr-RS), .wp-block-cover h2:lang(sr-RS), +.wp-block-cover .wp-block-cover-text:lang(sr-RS), .wp-block-button .wp-block-button__link:lang(sr-RS), .wp-block-quote cite:lang(sr-RS), +.wp-block-quote footer:lang(sr-RS), +.wp-block-quote .wp-block-quote__citation:lang(sr-RS), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(sr-RS), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(sr-RS), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(sr-RS), .wp-block-file:lang(sr-RS), ul.wp-block-archives li > a:lang(sr-RS), +.wp-block-categories li > a:lang(sr-RS), +.wp-block-latest-posts li > a:lang(sr-RS), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(sr-RS), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(sr-RS), .wp-caption dd:lang(sr-RS), .wp-block-freeform blockquote cite:lang(sr-RS) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(tt-RU), h1:lang(tt-RU), +h2:lang(tt-RU), +h3:lang(tt-RU), +h4:lang(tt-RU), +h5:lang(tt-RU), +h6:lang(tt-RU), figcaption:lang(tt-RU), +.gallery-caption:lang(tt-RU), .editor-post-title__block .editor-post-title__input:lang(tt-RU), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(tt-RU), .wp-block-paragraph.has-drop-cap:lang(tt-RU):not(:focus)::first-letter, .wp-block-table:lang(tt-RU), .wp-block-cover h2:lang(tt-RU), +.wp-block-cover .wp-block-cover-text:lang(tt-RU), .wp-block-button .wp-block-button__link:lang(tt-RU), .wp-block-quote cite:lang(tt-RU), +.wp-block-quote footer:lang(tt-RU), +.wp-block-quote .wp-block-quote__citation:lang(tt-RU), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(tt-RU), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(tt-RU), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(tt-RU), .wp-block-file:lang(tt-RU), ul.wp-block-archives li > a:lang(tt-RU), +.wp-block-categories li > a:lang(tt-RU), +.wp-block-latest-posts li > a:lang(tt-RU), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(tt-RU), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(tt-RU), .wp-caption dd:lang(tt-RU), .wp-block-freeform blockquote cite:lang(tt-RU) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(uk), h1:lang(uk), +h2:lang(uk), +h3:lang(uk), +h4:lang(uk), +h5:lang(uk), +h6:lang(uk), figcaption:lang(uk), +.gallery-caption:lang(uk), .editor-post-title__block .editor-post-title__input:lang(uk), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(uk), .wp-block-paragraph.has-drop-cap:lang(uk):not(:focus)::first-letter, .wp-block-table:lang(uk), .wp-block-cover h2:lang(uk), +.wp-block-cover .wp-block-cover-text:lang(uk), .wp-block-button .wp-block-button__link:lang(uk), .wp-block-quote cite:lang(uk), +.wp-block-quote footer:lang(uk), +.wp-block-quote .wp-block-quote__citation:lang(uk), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(uk), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(uk), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(uk), .wp-block-file:lang(uk), ul.wp-block-archives li > a:lang(uk), +.wp-block-categories li > a:lang(uk), +.wp-block-latest-posts li > a:lang(uk), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(uk), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(uk), .wp-caption dd:lang(uk), .wp-block-freeform blockquote cite:lang(uk) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(zh-HK), h1:lang(zh-HK), +h2:lang(zh-HK), +h3:lang(zh-HK), +h4:lang(zh-HK), +h5:lang(zh-HK), +h6:lang(zh-HK), figcaption:lang(zh-HK), +.gallery-caption:lang(zh-HK), .editor-post-title__block .editor-post-title__input:lang(zh-HK), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(zh-HK), .wp-block-paragraph.has-drop-cap:lang(zh-HK):not(:focus)::first-letter, .wp-block-table:lang(zh-HK), .wp-block-cover h2:lang(zh-HK), +.wp-block-cover .wp-block-cover-text:lang(zh-HK), .wp-block-button .wp-block-button__link:lang(zh-HK), .wp-block-quote cite:lang(zh-HK), +.wp-block-quote footer:lang(zh-HK), +.wp-block-quote .wp-block-quote__citation:lang(zh-HK), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(zh-HK), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(zh-HK), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(zh-HK), .wp-block-file:lang(zh-HK), ul.wp-block-archives li > a:lang(zh-HK), +.wp-block-categories li > a:lang(zh-HK), +.wp-block-latest-posts li > a:lang(zh-HK), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(zh-HK), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(zh-HK), .wp-caption dd:lang(zh-HK), .wp-block-freeform blockquote cite:lang(zh-HK) { + font-family: -apple-system, BlinkMacSystemFont, "PingFang HK", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif; +} + +body:lang(zh-TW), h1:lang(zh-TW), +h2:lang(zh-TW), +h3:lang(zh-TW), +h4:lang(zh-TW), +h5:lang(zh-TW), +h6:lang(zh-TW), figcaption:lang(zh-TW), +.gallery-caption:lang(zh-TW), .editor-post-title__block .editor-post-title__input:lang(zh-TW), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(zh-TW), .wp-block-paragraph.has-drop-cap:lang(zh-TW):not(:focus)::first-letter, .wp-block-table:lang(zh-TW), .wp-block-cover h2:lang(zh-TW), +.wp-block-cover .wp-block-cover-text:lang(zh-TW), .wp-block-button .wp-block-button__link:lang(zh-TW), .wp-block-quote cite:lang(zh-TW), +.wp-block-quote footer:lang(zh-TW), +.wp-block-quote .wp-block-quote__citation:lang(zh-TW), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(zh-TW), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(zh-TW), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(zh-TW), .wp-block-file:lang(zh-TW), ul.wp-block-archives li > a:lang(zh-TW), +.wp-block-categories li > a:lang(zh-TW), +.wp-block-latest-posts li > a:lang(zh-TW), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(zh-TW), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(zh-TW), .wp-caption dd:lang(zh-TW), .wp-block-freeform blockquote cite:lang(zh-TW) { + font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif; +} + +body:lang(zh-CN), h1:lang(zh-CN), +h2:lang(zh-CN), +h3:lang(zh-CN), +h4:lang(zh-CN), +h5:lang(zh-CN), +h6:lang(zh-CN), figcaption:lang(zh-CN), +.gallery-caption:lang(zh-CN), .editor-post-title__block .editor-post-title__input:lang(zh-CN), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(zh-CN), .wp-block-paragraph.has-drop-cap:lang(zh-CN):not(:focus)::first-letter, .wp-block-table:lang(zh-CN), .wp-block-cover h2:lang(zh-CN), +.wp-block-cover .wp-block-cover-text:lang(zh-CN), .wp-block-button .wp-block-button__link:lang(zh-CN), .wp-block-quote cite:lang(zh-CN), +.wp-block-quote footer:lang(zh-CN), +.wp-block-quote .wp-block-quote__citation:lang(zh-CN), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(zh-CN), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(zh-CN), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(zh-CN), .wp-block-file:lang(zh-CN), ul.wp-block-archives li > a:lang(zh-CN), +.wp-block-categories li > a:lang(zh-CN), +.wp-block-latest-posts li > a:lang(zh-CN), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(zh-CN), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(zh-CN), .wp-caption dd:lang(zh-CN), .wp-block-freeform blockquote cite:lang(zh-CN) { + font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif; +} + +body:lang(bn-BD), h1:lang(bn-BD), +h2:lang(bn-BD), +h3:lang(bn-BD), +h4:lang(bn-BD), +h5:lang(bn-BD), +h6:lang(bn-BD), figcaption:lang(bn-BD), +.gallery-caption:lang(bn-BD), .editor-post-title__block .editor-post-title__input:lang(bn-BD), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(bn-BD), .wp-block-paragraph.has-drop-cap:lang(bn-BD):not(:focus)::first-letter, .wp-block-table:lang(bn-BD), .wp-block-cover h2:lang(bn-BD), +.wp-block-cover .wp-block-cover-text:lang(bn-BD), .wp-block-button .wp-block-button__link:lang(bn-BD), .wp-block-quote cite:lang(bn-BD), +.wp-block-quote footer:lang(bn-BD), +.wp-block-quote .wp-block-quote__citation:lang(bn-BD), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(bn-BD), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(bn-BD), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(bn-BD), .wp-block-file:lang(bn-BD), ul.wp-block-archives li > a:lang(bn-BD), +.wp-block-categories li > a:lang(bn-BD), +.wp-block-latest-posts li > a:lang(bn-BD), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(bn-BD), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(bn-BD), .wp-caption dd:lang(bn-BD), .wp-block-freeform blockquote cite:lang(bn-BD) { + font-family: Arial, sans-serif; +} + +body:lang(hi-IN), h1:lang(hi-IN), +h2:lang(hi-IN), +h3:lang(hi-IN), +h4:lang(hi-IN), +h5:lang(hi-IN), +h6:lang(hi-IN), figcaption:lang(hi-IN), +.gallery-caption:lang(hi-IN), .editor-post-title__block .editor-post-title__input:lang(hi-IN), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(hi-IN), .wp-block-paragraph.has-drop-cap:lang(hi-IN):not(:focus)::first-letter, .wp-block-table:lang(hi-IN), .wp-block-cover h2:lang(hi-IN), +.wp-block-cover .wp-block-cover-text:lang(hi-IN), .wp-block-button .wp-block-button__link:lang(hi-IN), .wp-block-quote cite:lang(hi-IN), +.wp-block-quote footer:lang(hi-IN), +.wp-block-quote .wp-block-quote__citation:lang(hi-IN), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(hi-IN), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(hi-IN), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(hi-IN), .wp-block-file:lang(hi-IN), ul.wp-block-archives li > a:lang(hi-IN), +.wp-block-categories li > a:lang(hi-IN), +.wp-block-latest-posts li > a:lang(hi-IN), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(hi-IN), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(hi-IN), .wp-caption dd:lang(hi-IN), .wp-block-freeform blockquote cite:lang(hi-IN) { + font-family: Arial, sans-serif; +} + +body:lang(mr), h1:lang(mr), +h2:lang(mr), +h3:lang(mr), +h4:lang(mr), +h5:lang(mr), +h6:lang(mr), figcaption:lang(mr), +.gallery-caption:lang(mr), .editor-post-title__block .editor-post-title__input:lang(mr), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(mr), .wp-block-paragraph.has-drop-cap:lang(mr):not(:focus)::first-letter, .wp-block-table:lang(mr), .wp-block-cover h2:lang(mr), +.wp-block-cover .wp-block-cover-text:lang(mr), .wp-block-button .wp-block-button__link:lang(mr), .wp-block-quote cite:lang(mr), +.wp-block-quote footer:lang(mr), +.wp-block-quote .wp-block-quote__citation:lang(mr), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(mr), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(mr), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(mr), .wp-block-file:lang(mr), ul.wp-block-archives li > a:lang(mr), +.wp-block-categories li > a:lang(mr), +.wp-block-latest-posts li > a:lang(mr), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(mr), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(mr), .wp-caption dd:lang(mr), .wp-block-freeform blockquote cite:lang(mr) { + font-family: Arial, sans-serif; +} + +body:lang(ne-NP), h1:lang(ne-NP), +h2:lang(ne-NP), +h3:lang(ne-NP), +h4:lang(ne-NP), +h5:lang(ne-NP), +h6:lang(ne-NP), figcaption:lang(ne-NP), +.gallery-caption:lang(ne-NP), .editor-post-title__block .editor-post-title__input:lang(ne-NP), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(ne-NP), .wp-block-paragraph.has-drop-cap:lang(ne-NP):not(:focus)::first-letter, .wp-block-table:lang(ne-NP), .wp-block-cover h2:lang(ne-NP), +.wp-block-cover .wp-block-cover-text:lang(ne-NP), .wp-block-button .wp-block-button__link:lang(ne-NP), .wp-block-quote cite:lang(ne-NP), +.wp-block-quote footer:lang(ne-NP), +.wp-block-quote .wp-block-quote__citation:lang(ne-NP), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(ne-NP), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(ne-NP), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(ne-NP), .wp-block-file:lang(ne-NP), ul.wp-block-archives li > a:lang(ne-NP), +.wp-block-categories li > a:lang(ne-NP), +.wp-block-latest-posts li > a:lang(ne-NP), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ne-NP), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ne-NP), .wp-caption dd:lang(ne-NP), .wp-block-freeform blockquote cite:lang(ne-NP) { + font-family: Arial, sans-serif; +} + +body:lang(el), h1:lang(el), +h2:lang(el), +h3:lang(el), +h4:lang(el), +h5:lang(el), +h6:lang(el), figcaption:lang(el), +.gallery-caption:lang(el), .editor-post-title__block .editor-post-title__input:lang(el), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(el), .wp-block-paragraph.has-drop-cap:lang(el):not(:focus)::first-letter, .wp-block-table:lang(el), .wp-block-cover h2:lang(el), +.wp-block-cover .wp-block-cover-text:lang(el), .wp-block-button .wp-block-button__link:lang(el), .wp-block-quote cite:lang(el), +.wp-block-quote footer:lang(el), +.wp-block-quote .wp-block-quote__citation:lang(el), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(el), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(el), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(el), .wp-block-file:lang(el), ul.wp-block-archives li > a:lang(el), +.wp-block-categories li > a:lang(el), +.wp-block-latest-posts li > a:lang(el), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(el), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(el), .wp-caption dd:lang(el), .wp-block-freeform blockquote cite:lang(el) { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +body:lang(gu), h1:lang(gu), +h2:lang(gu), +h3:lang(gu), +h4:lang(gu), +h5:lang(gu), +h6:lang(gu), figcaption:lang(gu), +.gallery-caption:lang(gu), .editor-post-title__block .editor-post-title__input:lang(gu), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(gu), .wp-block-paragraph.has-drop-cap:lang(gu):not(:focus)::first-letter, .wp-block-table:lang(gu), .wp-block-cover h2:lang(gu), +.wp-block-cover .wp-block-cover-text:lang(gu), .wp-block-button .wp-block-button__link:lang(gu), .wp-block-quote cite:lang(gu), +.wp-block-quote footer:lang(gu), +.wp-block-quote .wp-block-quote__citation:lang(gu), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(gu), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(gu), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(gu), .wp-block-file:lang(gu), ul.wp-block-archives li > a:lang(gu), +.wp-block-categories li > a:lang(gu), +.wp-block-latest-posts li > a:lang(gu), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(gu), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(gu), .wp-caption dd:lang(gu), .wp-block-freeform blockquote cite:lang(gu) { + font-family: Arial, sans-serif; +} + +body:lang(he-IL), h1:lang(he-IL), +h2:lang(he-IL), +h3:lang(he-IL), +h4:lang(he-IL), +h5:lang(he-IL), +h6:lang(he-IL), figcaption:lang(he-IL), +.gallery-caption:lang(he-IL), .editor-post-title__block .editor-post-title__input:lang(he-IL), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(he-IL), .wp-block-paragraph.has-drop-cap:lang(he-IL):not(:focus)::first-letter, .wp-block-table:lang(he-IL), .wp-block-cover h2:lang(he-IL), +.wp-block-cover .wp-block-cover-text:lang(he-IL), .wp-block-button .wp-block-button__link:lang(he-IL), .wp-block-quote cite:lang(he-IL), +.wp-block-quote footer:lang(he-IL), +.wp-block-quote .wp-block-quote__citation:lang(he-IL), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(he-IL), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(he-IL), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(he-IL), .wp-block-file:lang(he-IL), ul.wp-block-archives li > a:lang(he-IL), +.wp-block-categories li > a:lang(he-IL), +.wp-block-latest-posts li > a:lang(he-IL), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(he-IL), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(he-IL), .wp-caption dd:lang(he-IL), .wp-block-freeform blockquote cite:lang(he-IL) { + font-family: "Arial Hebrew", Arial, sans-serif; +} + +body:lang(ja), h1:lang(ja), +h2:lang(ja), +h3:lang(ja), +h4:lang(ja), +h5:lang(ja), +h6:lang(ja), figcaption:lang(ja), +.gallery-caption:lang(ja), .editor-post-title__block .editor-post-title__input:lang(ja), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(ja), .wp-block-paragraph.has-drop-cap:lang(ja):not(:focus)::first-letter, .wp-block-table:lang(ja), .wp-block-cover h2:lang(ja), +.wp-block-cover .wp-block-cover-text:lang(ja), .wp-block-button .wp-block-button__link:lang(ja), .wp-block-quote cite:lang(ja), +.wp-block-quote footer:lang(ja), +.wp-block-quote .wp-block-quote__citation:lang(ja), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(ja), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(ja), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(ja), .wp-block-file:lang(ja), ul.wp-block-archives li > a:lang(ja), +.wp-block-categories li > a:lang(ja), +.wp-block-latest-posts li > a:lang(ja), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ja), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ja), .wp-caption dd:lang(ja), .wp-block-freeform blockquote cite:lang(ja) { + font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", Meiryo, "Helvetica Neue", sans-serif; +} + +body:lang(ko-KR), h1:lang(ko-KR), +h2:lang(ko-KR), +h3:lang(ko-KR), +h4:lang(ko-KR), +h5:lang(ko-KR), +h6:lang(ko-KR), figcaption:lang(ko-KR), +.gallery-caption:lang(ko-KR), .editor-post-title__block .editor-post-title__input:lang(ko-KR), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(ko-KR), .wp-block-paragraph.has-drop-cap:lang(ko-KR):not(:focus)::first-letter, .wp-block-table:lang(ko-KR), .wp-block-cover h2:lang(ko-KR), +.wp-block-cover .wp-block-cover-text:lang(ko-KR), .wp-block-button .wp-block-button__link:lang(ko-KR), .wp-block-quote cite:lang(ko-KR), +.wp-block-quote footer:lang(ko-KR), +.wp-block-quote .wp-block-quote__citation:lang(ko-KR), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(ko-KR), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(ko-KR), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(ko-KR), .wp-block-file:lang(ko-KR), ul.wp-block-archives li > a:lang(ko-KR), +.wp-block-categories li > a:lang(ko-KR), +.wp-block-latest-posts li > a:lang(ko-KR), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ko-KR), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ko-KR), .wp-caption dd:lang(ko-KR), .wp-block-freeform blockquote cite:lang(ko-KR) { + font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; +} + +body:lang(th), h1:lang(th), +h2:lang(th), +h3:lang(th), +h4:lang(th), +h5:lang(th), +h6:lang(th), figcaption:lang(th), +.gallery-caption:lang(th), .editor-post-title__block .editor-post-title__input:lang(th), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(th), .wp-block-paragraph.has-drop-cap:lang(th):not(:focus)::first-letter, .wp-block-table:lang(th), .wp-block-cover h2:lang(th), +.wp-block-cover .wp-block-cover-text:lang(th), .wp-block-button .wp-block-button__link:lang(th), .wp-block-quote cite:lang(th), +.wp-block-quote footer:lang(th), +.wp-block-quote .wp-block-quote__citation:lang(th), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(th), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(th), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(th), .wp-block-file:lang(th), ul.wp-block-archives li > a:lang(th), +.wp-block-categories li > a:lang(th), +.wp-block-latest-posts li > a:lang(th), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(th), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(th), .wp-caption dd:lang(th), .wp-block-freeform blockquote cite:lang(th) { + font-family: "Sukhumvit Set", "Helvetica Neue", helvetica, arial, sans-serif; +} + +body:lang(vi), h1:lang(vi), +h2:lang(vi), +h3:lang(vi), +h4:lang(vi), +h5:lang(vi), +h6:lang(vi), figcaption:lang(vi), +.gallery-caption:lang(vi), .editor-post-title__block .editor-post-title__input:lang(vi), .block-editor-default-block-appender textarea.block-editor-default-block-appender__content:lang(vi), .wp-block-paragraph.has-drop-cap:lang(vi):not(:focus)::first-letter, .wp-block-table:lang(vi), .wp-block-cover h2:lang(vi), +.wp-block-cover .wp-block-cover-text:lang(vi), .wp-block-button .wp-block-button__link:lang(vi), .wp-block-quote cite:lang(vi), +.wp-block-quote footer:lang(vi), +.wp-block-quote .wp-block-quote__citation:lang(vi), .wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation:lang(vi), +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation:lang(vi), +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation:lang(vi), .wp-block-file:lang(vi), ul.wp-block-archives li > a:lang(vi), +.wp-block-categories li > a:lang(vi), +.wp-block-latest-posts li > a:lang(vi), .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(vi), .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(vi), .wp-caption dd:lang(vi), .wp-block-freeform blockquote cite:lang(vi) { + font-family: "Libre Franklin", sans-serif; +} + +/** === Editor Frame === */ +body .wp-block[data-align="full"] { + width: calc(100% + 28px); + max-width: calc(100% + 28px); +} + +@media only screen and (min-width: 600px) { + body .wp-block[data-align="full"] { + width: calc( 100% + 116px); + max-width: calc( 100% + 115px); + } +} + +@media only screen and (min-width: 768px) { + body .editor-writing-flow { + max-width: 80%; + margin: 0 10%; + } + body .editor-default-block-appender, + body .editor-block-list__block { + margin-left: 0; + margin-right: 0; + } + body .wp-block[data-align="wide"] { + width: 100%; + } + body .wp-block[data-align="right"] { + max-width: 125%; + } +} + +/** === Content Width === */ +.wp-block { + max-width: 100%; +} + +@media only screen and (min-width: 768px) { + .wp-block { + width: calc(8 * (100vw / 12)); + } +} + +@media only screen and (min-width: 1168px) { + .wp-block { + width: calc(6 * (100vw / 12 )); + } +} + +.wp-block .wp-block { + width: 100%; +} + +/** === Base Typography === */ +body { + font-size: 22px; + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + line-height: 1.8; + color: #111; +} + +p { + font-size: 22px; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-weight: 700; +} + +h1 { + font-size: 2.25em; +} + +h1:before { + background: #767676; + content: "\020"; + display: block; + height: 2px; + margin: 1rem 0; + width: 1em; +} + +@media only screen and (min-width: 768px) { + h1 { + font-size: 2.8125em; + } +} + +h2 { + font-size: 1.6875em; +} + +h2:before { + background: #767676; + content: "\020"; + display: block; + height: 2px; + margin: 1rem 0; + width: 1em; +} + +@media only screen and (min-width: 768px) { + h2 { + font-size: 2.25em; + } +} + +h3 { + font-size: 1.6875em; +} + +h4 { + font-size: 1.125em; +} + +h5 { + font-size: 0.88889em; +} + +h6 { + font-size: 0.71111em; +} + +a { + transition: color 110ms ease-in-out; + color: #0073aa; +} + +a:hover, a:active { + color: #005177; + outline: 0; + text-decoration: none; +} + +a:focus { + outline: 0; + text-decoration: underline; +} + +.has-primary-background-color, +.has-secondary-background-color, +.has-dark-gray-background-color, +.has-light-gray-background-color { + color: #fff; +} + +.has-primary-background-color p, +.has-primary-background-color h1, +.has-primary-background-color h2, +.has-primary-background-color h3, +.has-primary-background-color h4, +.has-primary-background-color h5, +.has-primary-background-color h6, +.has-primary-background-color a, +.has-secondary-background-color p, +.has-secondary-background-color h1, +.has-secondary-background-color h2, +.has-secondary-background-color h3, +.has-secondary-background-color h4, +.has-secondary-background-color h5, +.has-secondary-background-color h6, +.has-secondary-background-color a, +.has-dark-gray-background-color p, +.has-dark-gray-background-color h1, +.has-dark-gray-background-color h2, +.has-dark-gray-background-color h3, +.has-dark-gray-background-color h4, +.has-dark-gray-background-color h5, +.has-dark-gray-background-color h6, +.has-dark-gray-background-color a, +.has-light-gray-background-color p, +.has-light-gray-background-color h1, +.has-light-gray-background-color h2, +.has-light-gray-background-color h3, +.has-light-gray-background-color h4, +.has-light-gray-background-color h5, +.has-light-gray-background-color h6, +.has-light-gray-background-color a { + color: #fff; +} + +.has-white-background-color { + color: #111; +} + +.has-white-background-color p, +.has-white-background-color h1, +.has-white-background-color h2, +.has-white-background-color h3, +.has-white-background-color h4, +.has-white-background-color h5, +.has-white-background-color h6, +.has-white-background-color a { + color: #111; +} + +figcaption, +.gallery-caption { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.71111em; + line-height: 1.6; + color: #767676; +} + +/** === Post Title === */ +.editor-post-title__block:before { + background: #767676; + content: "\020"; + display: block; + height: 2px; + margin: 1rem 0; + width: 1em; +} + +.editor-post-title__block:before { + width: 2.8125em; + margin-top: 0; + margin-bottom: 0; + margin-left: 1rem; + position: relative; + top: 0.5em; +} + +@media only screen and (min-width: 600px) { + .editor-post-title__block:before { + margin-left: 0; + } +} + +.editor-post-title__block .editor-post-title__input { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 2.8125em; + font-weight: 700; +} + +/** === Default Appender === */ +.block-editor-default-block-appender textarea.block-editor-default-block-appender__content { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-size: 22px; +} + +/** === Heading === */ +.wp-block-heading strong { + font-weight: bolder; +} + +/** === Paragraph === */ +.wp-block-paragraph.has-drop-cap:not(:focus)::first-letter { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 3.375em; + line-height: 1; + font-weight: bold; + margin: 0 0.25em 0 0; +} + +/** === Table === */ +.wp-block-table { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; +} + +/** === Cover === */ +.wp-block-cover h2, +.wp-block-cover .wp-block-cover-text { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 1.6875em; + font-weight: bold; + line-height: 1.4; + padding-left: 1rem; + padding-right: 1rem; +} + +.wp-block-cover h2 strong, +.wp-block-cover .wp-block-cover-text strong { + font-weight: bolder; +} + +@media only screen and (min-width: 768px) { + .wp-block-cover h2, + .wp-block-cover .wp-block-cover-text { + margin-left: auto; + margin-right: auto; + padding: 0; + } +} + +@media only screen and (min-width: 768px) { + .wp-block-cover { + padding-left: 10%; + padding-right: 10%; + } + .wp-block-cover h2, + .wp-block-cover .wp-block-cover-text { + font-size: 2.25em; + } +} + +.wp-block[data-type="core/cover"][data-align="left"] .editor-block-list__block-edit, +.wp-block[data-type="core/cover"][data-align="right"] .editor-block-list__block-edit { + width: calc(4 * (100vw / 12)); +} + +.wp-block[data-type="core/cover"][data-align="left"] .wp-block-cover, +.wp-block[data-type="core/cover"][data-align="right"] .wp-block-cover { + width: 100%; + max-width: 100%; + padding: calc(1.375 * 1rem); +} + +.wp-block[data-type="core/cover"][data-align="left"] .wp-block-cover p, +.wp-block[data-type="core/cover"][data-align="right"] .wp-block-cover p { + padding-left: 0; + padding-right: 0; +} + +@media only screen and (min-width: 768px) { + .wp-block[data-type="core/cover"][data-align="left"] .wp-block-cover, + .wp-block[data-type="core/cover"][data-align="right"] .wp-block-cover { + padding: calc(2.75 * 1rem) calc(2.75 * 1rem) calc(3.125 * 1rem); + } +} + +@media only screen and (min-width: 768px) { + .wp-block[data-type="core/cover"][data-align="wide"] h2, + .wp-block[data-type="core/cover"][data-align="wide"] .wp-block-cover-text, + .wp-block[data-type="core/cover"][data-align="full"] h2, + .wp-block[data-type="core/cover"][data-align="full"] .wp-block-cover-text { + max-width: calc(8 * (100vw / 12)); + } +} + +@media only screen and (min-width: 1168px) { + .wp-block[data-type="core/cover"][data-align="wide"] h2, + .wp-block[data-type="core/cover"][data-align="wide"] .wp-block-cover-text, + .wp-block[data-type="core/cover"][data-align="full"] h2, + .wp-block[data-type="core/cover"][data-align="full"] .wp-block-cover-text { + max-width: calc(6 * (100vw / 12)); + } +} + +@media only screen and (min-width: 768px) { + .wp-block[data-type="core/cover"][data-align="full"] .wp-block-cover { + padding-left: calc(10% + 64px); + padding-right: calc(10% + 64px); + } +} + +/** === Gallery === */ +.wp-block-gallery .blocks-gallery-image figcaption, +.wp-block-gallery .blocks-gallery-item figcaption, +.wp-block-gallery .gallery-item .gallery-caption { + font-size: 0.71111em; + line-height: 1.6; +} + +/** === Button === */ +.wp-block-button .wp-block-button__link { + line-height: 1.8; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.88889em; + font-weight: bold; +} + +.wp-block-button:not(.is-style-outline) .wp-block-button__link { + background: #0073aa; +} + +.wp-block-button:not(.is-style-squared) .wp-block-button__link { + border-radius: 5px; +} + +.wp-block-button.is-style-outline, .wp-block-button.is-style-outline:hover, .wp-block-button.is-style-outline:focus, .wp-block-button.is-style-outline:active { + background: transparent; + color: #0073aa; +} + +.wp-block-button.is-style-outline .wp-block-button__link, .wp-block-button.is-style-outline:hover .wp-block-button__link, .wp-block-button.is-style-outline:focus .wp-block-button__link, .wp-block-button.is-style-outline:active .wp-block-button__link { + background: transparent; +} + +.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color), .wp-block-button.is-style-outline:hover .wp-block-button__link:not(.has-text-color), .wp-block-button.is-style-outline:focus .wp-block-button__link:not(.has-text-color), .wp-block-button.is-style-outline:active .wp-block-button__link:not(.has-text-color) { + color: #0073aa; +} + +/** === Blockquote === */ +.wp-block-quote:not(.is-large):not(.is-style-large) { + border-width: 2px; + border-color: #0073aa; +} + +.wp-block-quote.is-large, .wp-block-quote.is-style-large { + margin-top: 2.8125em; + margin-bottom: 2.8125em; +} + +.wp-block-quote.is-large p, +.wp-block-quote.is-style-large p { + font-size: 1.6875em; + line-height: 1.3; + margin-bottom: 0.5em; + margin-top: 0.5em; +} + +.wp-block-quote cite, +.wp-block-quote footer, +.wp-block-quote .wp-block-quote__citation { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.71111em; + line-height: 1.6; + color: #767676; +} + +/** === Pullquote === */ +.wp-block-pullquote { + border-color: transparent; + border-width: 2px; + color: #000; +} + +.wp-block-pullquote blockquote { + margin-top: calc(3 * 1rem); + margin-bottom: calc(3.33 * 1rem); + hyphens: auto; + word-break: break-word; +} + +.wp-block-pullquote:not(.is-style-solid-color) .wp-block-pullquote__citation { + color: #767676; +} + +.wp-block-pullquote.is-style-solid-color blockquote { + width: calc(100% - (2 * 1rem)); + max-width: calc( 100% - (2 * 1rem)); +} + +.wp-block-pullquote.is-style-solid-color blockquote a, +.wp-block-pullquote.is-style-solid-color blockquote.has-text-color p, +.wp-block-pullquote.is-style-solid-color blockquote.has-text-color a { + color: inherit; +} + +.wp-block-pullquote.is-style-solid-color blockquote:not(.has-text-color) { + color: #fff; +} + +@media only screen and (min-width: 768px) { + .wp-block-pullquote.is-style-solid-color blockquote { + max-width: 80%; + } +} + +.wp-block-pullquote.is-style-solid-color:not(.has-background-color) { + background-color: #0073aa; +} + +.wp-block[data-type="core/pullquote"] blockquote > .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before, +.wp-block[data-type="core/pullquote"] blockquote > .editor-rich-text p, +.wp-block[data-type="core/pullquote"] p, +.wp-block[data-type="core/pullquote"][data-align="left"] blockquote > .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before, +.wp-block[data-type="core/pullquote"][data-align="left"] blockquote > .editor-rich-text p, +.wp-block[data-type="core/pullquote"][data-align="left"] p, +.wp-block[data-type="core/pullquote"][data-align="right"] blockquote > .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before, +.wp-block[data-type="core/pullquote"][data-align="right"] blockquote > .editor-rich-text p, +.wp-block[data-type="core/pullquote"][data-align="right"] p { + font-size: 1.6875em; + font-style: italic; + line-height: 1.3; + margin-bottom: 0.5em; + margin-top: 0.5em; +} + +@media only screen and (min-width: 768px) { + .wp-block[data-type="core/pullquote"] blockquote > .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before, + .wp-block[data-type="core/pullquote"] blockquote > .editor-rich-text p, + .wp-block[data-type="core/pullquote"] p, + .wp-block[data-type="core/pullquote"][data-align="left"] blockquote > .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before, + .wp-block[data-type="core/pullquote"][data-align="left"] blockquote > .editor-rich-text p, + .wp-block[data-type="core/pullquote"][data-align="left"] p, + .wp-block[data-type="core/pullquote"][data-align="right"] blockquote > .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before, + .wp-block[data-type="core/pullquote"][data-align="right"] blockquote > .editor-rich-text p, + .wp-block[data-type="core/pullquote"][data-align="right"] p { + font-size: 2.25em; + } +} + +.wp-block[data-type="core/pullquote"] .wp-block-pullquote__citation, +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation, +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.71111em; + line-height: 1.6; + text-transform: none; +} + +.wp-block[data-type="core/pullquote"] em, +.wp-block[data-type="core/pullquote"][data-align="left"] em, +.wp-block[data-type="core/pullquote"][data-align="right"] em { + font-style: normal; +} + +.wp-block[data-type="core/pullquote"][data-align="left"] .editor-block-list__block-edit, +.wp-block[data-type="core/pullquote"][data-align="right"] .editor-block-list__block-edit { + width: calc(4 * (100vw / 12)); + max-width: 50%; +} + +.wp-block[data-type="core/pullquote"][data-align="left"] .editor-block-list__block-edit .wp-block-pullquote:not(.is-style-solid-color), +.wp-block[data-type="core/pullquote"][data-align="right"] .editor-block-list__block-edit .wp-block-pullquote:not(.is-style-solid-color) { + padding: 0; +} + +.wp-block[data-type="core/pullquote"][data-align="left"] .editor-block-list__block-edit .wp-block-pullquote.is-style-solid-color, +.wp-block[data-type="core/pullquote"][data-align="right"] .editor-block-list__block-edit .wp-block-pullquote.is-style-solid-color { + padding: 1em; +} + +.wp-block[data-type="core/pullquote"][data-align="left"] blockquote > .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before, +.wp-block[data-type="core/pullquote"][data-align="left"] blockquote > .editor-rich-text p, +.wp-block[data-type="core/pullquote"][data-align="left"] p, +.wp-block[data-type="core/pullquote"][data-align="left"] .wp-block-pullquote__citation, +.wp-block[data-type="core/pullquote"][data-align="right"] blockquote > .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before, +.wp-block[data-type="core/pullquote"][data-align="right"] blockquote > .editor-rich-text p, +.wp-block[data-type="core/pullquote"][data-align="right"] p, +.wp-block[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citation { + text-align: left; +} + +@media only screen and (min-width: 768px) { + .wp-block[data-type="core/pullquote"][data-align="full"] .wp-block-pullquote blockquote { + max-width: calc(80% - 128px); + } +} + +/** === File === */ +.wp-block-file { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; +} + +.wp-block-file .wp-block-file__textlink { + text-decoration: underline; + color: #0073aa; +} + +.wp-block-file .wp-block-file__textlink:hover { + color: #005177; + text-decoration: none; +} + +.wp-block-file .wp-block-file__button { + display: table; + line-height: 1.8; + font-size: 0.88889em; + font-weight: bold; + background-color: #0073aa; + border-radius: 5px; +} + +.wp-block-file .wp-block-file__button-richtext-wrapper { + display: block; + margin-top: calc(0.75 * 1rem); + margin-left: 0; +} + +/** === Verse === */ +.wp-block-verse, +.wp-block-verse pre { + padding: 0; +} + +/** === Code === */ +.wp-block-code { + border-radius: 0; +} + +/** === Table === */ +.wp-block-table td, .wp-block-table th { + border-color: #767676; +} + +/** === Separator === */ +.wp-block-separator:not(.is-style-dots) { + background-color: #767676; + height: 2px; +} + +.wp-block-separator:not(.is-style-wide):not(.is-style-dots) { + width: 2.25em; + margin-left: 0; +} + +.wp-block-separator.is-style-dots { + color: #767676; +} + +.wp-block-separator.is-style-dots:before { + font-size: 1.6875em; + letter-spacing: calc(2 * 1rem); + padding-left: calc(2 * 1rem); +} + +/* Remove duplicate rule-line when a separator + * is followed by an H1, or H2 */ +.wp-block[data-type="core/separator"] + .wp-block[data-type="core/heading"] h1:before, +.wp-block[data-type="core/separator"] + .wp-block[data-type="core/heading"] h2:before { + display: none; +} + +/** === Latest Posts, Archives, Categories === */ +ul.wp-block-archives, +.wp-block-categories, +.wp-block-latest-posts { + padding: 0; + list-style-type: none; +} + +ul.wp-block-archives ul, +.wp-block-categories ul, +.wp-block-latest-posts ul { + padding: 0; + list-style-type: none; +} + +ul.wp-block-archives li > a, +.wp-block-categories li > a, +.wp-block-latest-posts li > a { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: calc(22px * 1.125); + font-weight: bold; + line-height: 1.2; + text-decoration: none; +} + +ul.wp-block-archives li ul, +.wp-block-categories li ul, +.wp-block-latest-posts li ul { + padding-left: 1rem; +} + +.wp-block-categories ul { + padding-top: 0.75rem; +} + +.wp-block-categories ul ul { + counter-reset: submenu; +} + +.wp-block-categories ul ul > li > a::before { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: normal; + content: "– " counters(submenu, "– ", none); + counter-increment: submenu; +} + +.wp-block-categories li ul { + list-style: none; + padding-left: 0; + margin-bottom: -0.75rem; +} + +/** === Latest Posts === */ +.wp-block-latest-posts .wp-block-latest-posts__post-date { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.71111em; + color: #767676; + line-height: 1.2; +} + +.wp-block-latest-posts .wp-block-latest-posts__post-full-content, +.wp-block-latest-posts .wp-block-latest-posts__post-excerpt { + margin-top: 22px; + margin-bottom: 22px; +} + +.wp-block-latest-posts .wp-block-latest-posts__post-full-content > div > p:first-child, +.wp-block-latest-posts .wp-block-latest-posts__post-excerpt > div > p:first-child { + margin-top: 22px; +} + +.wp-block-latest-posts li { + padding-bottom: 0.5rem; +} + +.wp-block-latest-posts li.menu-item-has-children, .wp-block-latest-posts li:last-child { + padding-bottom: 0; +} + +.wp-block-latest-posts li :not(:last-child) .wp-block-latest-posts__post-excerpt { + padding-bottom: 0.5rem; +} + +.wp-block-latest-posts.is-grid li { + border-top: 2px solid #ccc; + padding-top: 1rem; + margin-bottom: 2rem; +} + +.wp-block-latest-posts.is-grid li a:after { + content: ''; +} + +.wp-block-latest-posts.is-grid li:last-child { + margin-bottom: auto; +} + +.wp-block-latest-posts.is-grid li:last-child a:after { + content: ''; +} + +/** === Latest Comments === */ +.wp-block-latest-comments .wp-block-latest-comments__comment-meta { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-weight: bold; +} + +.wp-block-latest-comments .wp-block-latest-comments__comment-meta .wp-block-latest-comments__comment-date { + font-weight: normal; +} + +.wp-block-latest-comments .wp-block-latest-comments__comment, +.wp-block-latest-comments .wp-block-latest-comments__comment-date, +.wp-block-latest-comments .wp-block-latest-comments__comment-excerpt p { + font-size: inherit; +} + +.wp-block-latest-comments .wp-block-latest-comments__comment-date { + font-size: 0.71111em; +} + +/** === Classic Editor === */ +/* Properly center-align captions in the classic-editor block */ +.wp-caption dd { + color: #767676; + font-size: 0.71111em; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + line-height: 1.6; + margin: 0; + padding: 0.5rem; + text-align: left; + text-align: center; + -webkit-margin-start: 0px; + margin-inline-start: 0px; +} + +.wp-block-freeform { + /* Add style for galleries in classic-editor block */ +} + +.wp-block-freeform blockquote { + border-left: 2px solid #0073aa; +} + +.wp-block-freeform blockquote cite { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.71111em; + font-style: normal; + line-height: 1.6; + color: #767676; +} + +/** === Group Block === */ +.wp-block[data-type="core/group"] > .wp-block-group > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align="full"] { + margin-left: 0; + margin-right: 0; +} + +.wp-block[data-type="core/group"] > .wp-block-group.has-background { + padding: 22px; +} + +.wp-block[data-type="core/group"] > .wp-block-group.has-background > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align="full"] { + margin-left: -22px; + width: calc(100% + 44px); + max-width: calc(100% + 44px); +} + +@media only screen and (min-width: 768px) { + .wp-block[data-type="core/group"][data-align="wide"] > .is-block-content > .wp-block-group > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block:not([data-align="wide"]):not([data-align="full"]) { + width: calc(8 * (100vw / 12)); + } +} + +@media only screen and (min-width: 1168px) { + .wp-block[data-type="core/group"][data-align="wide"] > .is-block-content > .wp-block-group > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block:not([data-align="wide"]):not([data-align="full"]) { + width: calc(6 * (100vw / 12 )); + } +} + +.wp-block[data-type="core/group"][data-align="wide"] > .is-block-content > .wp-block-group > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align="full"] { + padding-left: 0; + padding-right: 0; +} + +@media only screen and (min-width: 768px) { + .wp-block[data-type="core/group"][data-align="wide"] > .is-block-content > .wp-block-group.has-background > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block:not([data-align="wide"]):not([data-align="full"]) { + width: calc(8 * (100vw / 12) - 44px); + } +} + +@media only screen and (min-width: 1168px) { + .wp-block[data-type="core/group"][data-align="wide"] > .is-block-content > .wp-block-group.has-background > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block:not([data-align="wide"]):not([data-align="full"]) { + width: calc(6 * (100vw / 12 ) - 44px); + } +} + +@media only screen and (min-width: 600px) { + .wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout { + padding-left: 46px; + padding-right: 46px; + } +} + +@media only screen and (min-width: 768px) { + .wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout { + width: 80%; + margin-left: 10%; + margin-right: 10%; + padding-left: 48px; + padding-right: 48px; + } +} + +.wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block:not([data-align="full"]) { + max-width: calc(100vw - (2 * 1rem)); +} + +@media only screen and (min-width: 768px) { + .wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block:not([data-align="full"]) { + max-width: calc(8 * (100vw / 12)); + } +} + +@media only screen and (min-width: 1168px) { + .wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block:not([data-align="full"]) { + max-width: calc(6 * (100vw / 12)); + } +} + +@media only screen and (min-width: 768px) { + .wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align="right"] { + max-width: 125%; + } +} + +@media only screen and (min-width: 768px) { + .wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align="wide"] { + width: calc(100% + 4px); + max-width: calc(100% + 4px); + } +} + +.wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align=full] { + max-width: calc(100vw + (2 * 1rem)); +} + +@media only screen and (min-width: 600px) { + .wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align=full] { + width: calc(100% + 92px); + left: -46px; + } +} + +@media only screen and (min-width: 768px) { + .wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align=full] { + left: calc(-12.5% - 58px); + width: calc(125% + 120px); + max-width: calc(125% + 119px); + } +} + +.wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group.has-background { + padding: 22px 0; +} + +@media only screen and (min-width: 600px) { + .wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group.has-background { + padding-left: 0; + padding-right: 0; + } +} + +.wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group.has-background > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align="full"] { + margin-left: 0; + width: 100%; +} + +@media only screen and (min-width: 600px) { + .wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group.has-background > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align="full"] { + width: calc(100% + 92px); + } +} + +@media only screen and (min-width: 768px) { + .wp-block[data-type="core/group"][data-align="full"] > .is-block-content > .wp-block-group.has-background > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align="full"] { + width: calc(125% + 120px); + } +} diff --git a/wp-content/themes/twentynineteen/style-editor.scss b/wp-content/themes/twentynineteen/style-editor.scss new file mode 100644 index 0000000..b5c422f --- /dev/null +++ b/wp-content/themes/twentynineteen/style-editor.scss @@ -0,0 +1,943 @@ +/*! +Twenty Nineteen Editor Styles +*/ + +/** === Includes === */ + +@import "sass/variables-site/variables-site"; +@import "sass/mixins/mixins-master"; + +/** === Editor Frame === */ + +body { + + .wp-block[data-align="full"] { + width: calc(100% + 28px); + max-width: calc(100% + 28px); + } + + @include media(mobile) { + + .wp-block[data-align="full"] { + width: calc( 100% + 116px ); + max-width: calc( 100% + 115px ); + } + } + + @include media(tablet) { + + .editor-writing-flow { + max-width: 80%; + margin: 0 10%; + } + + .editor-default-block-appender, + .editor-block-list__block { + margin-left: 0; + margin-right: 0; + } + + .wp-block[data-align="wide"] { + width: 100%; + } + + .wp-block[data-align="right"] { + max-width: 125%; + } + } +} + +/** === Content Width === */ + +.wp-block { + max-width: 100%; + + @include media(tablet) { + width: calc(8 * (100vw / 12)); + } + + @include media(desktop) { + width: calc(6 * (100vw / 12 )); + } + + // Only the top level blocks need specific widths, therefore override for every nested block. + .wp-block { + width: 100%; + } +} + +/** === Base Typography === */ + +body { + font-size: $font__size_base; + @include font-family( $font__body ); + line-height: $font__line-height-body; + color: $color__text-main; +} + +p { + font-size: $font__size_base; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + @include font-family( $font__heading ); + font-weight: 700; +} + +h1 { + font-size: $font__size-xl; + @include post-section-dash; + + @include media(tablet) { + font-size: $font__size-xxl; + } +} + +h2 { + font-size: $font__size-lg; + @include post-section-dash; + + @include media(tablet) { + font-size: $font__size-xl; + } +} + +h3 { + font-size: $font__size-lg; +} + +h4 { + font-size: $font__size-md; +} + +h5 { + font-size: $font__size-sm; +} + +h6 { + font-size: $font__size-xs; +} + +a { + @include link-transition; + color: $color__link; + + *:visited { + + } + + &:hover, + &:active { + color: $color__link-hover; + outline: 0; + text-decoration: none; + } + + &:focus { + outline: 0; + text-decoration: underline; + } +} + +// Use white text against these backgrounds by default. +.has-primary-background-color, +.has-secondary-background-color, +.has-dark-gray-background-color, +.has-light-gray-background-color { + color: $color__background-body; + + p, + h1, + h2, + h3, + h4, + h5, + h6, + a { + color: $color__background-body; + } +} + +// Use dark gray text against this background by default. +.has-white-background-color { + color: $color__text-main; + + p, + h1, + h2, + h3, + h4, + h5, + h6, + a { + color: $color__text-main; + } +} + +figcaption, +.gallery-caption { + @include font-family( $font__heading ); + font-size: $font__size-xs; + line-height: 1.6; + color: $color__text-light; +} + +/** === Post Title === */ + +.editor-post-title__block { + @include post-section-dash; + + &:before { + width: $font__size-xxl; + margin-top: 0; + margin-bottom: 0; + margin-left: 1rem; + position: relative; + top: 0.5em; + + @include media(mobile) { + margin-left: 0; + } + } + + .editor-post-title__input { + @include font-family( $font__heading ); + font-size: $font__size-xxl; + font-weight: 700; + } +} + +/** === Default Appender === */ + +.block-editor-default-block-appender textarea.block-editor-default-block-appender__content { + @include font-family( $font__body ); + font-size: $font__size_base; +} + +/** === Heading === */ + +.wp-block-heading { + strong { + font-weight: bolder; + } +} +/** === Paragraph === */ + +.wp-block-paragraph { + + &.has-drop-cap:not(:focus)::first-letter { + @include font-family( $font__heading ); + font-size: $font__size-xxxl; + line-height: 1; + font-weight: bold; + margin: 0 0.25em 0 0; + } +} + +/** === Table === */ + +.wp-block-table { + @include font-family( $font__heading ); +} + +/** === Cover === */ + +.wp-block-cover { + + h2, + .wp-block-cover-text { + @include font-family( $font__heading ); + font-size: $font__size-lg; + font-weight: bold; + line-height: 1.4; + padding-left: $size__spacing-unit; + padding-right: $size__spacing-unit; + + strong { + font-weight: bolder; + } + + @include media(tablet) { + margin-left: auto; + margin-right: auto; + padding: 0; + } + } + + @include media(tablet) { + padding-left: 10%; + padding-right: 10%; + + h2, + .wp-block-cover-text { + font-size: $font__size-xl; + } + } +} + +.wp-block[data-type="core/cover"][data-align="left"], +.wp-block[data-type="core/cover"][data-align="right"] { + + .editor-block-list__block-edit { + width: calc(4 * (100vw / 12)); + } + + .wp-block-cover { + width: 100%; + max-width: 100%; + padding: calc(1.375 * #{$size__spacing-unit}); + + p { + padding-left: 0; + padding-right: 0; + } + + @include media(tablet) { + padding: calc(2.75 * #{$size__spacing-unit}) calc(2.75 * #{$size__spacing-unit}) calc(3.125 * #{$size__spacing-unit}); + } + } +} + +.wp-block[data-type="core/cover"][data-align="wide"], +.wp-block[data-type="core/cover"][data-align="full"] { + + @include media(tablet) { + + h2, + .wp-block-cover-text { + max-width: calc(8 * (100vw / 12)); + } + } + + @include media(desktop) { + + h2, + .wp-block-cover-text { + max-width: calc(6 * (100vw / 12)); + } + } +} + +.wp-block[data-type="core/cover"][data-align="full"] { + + @include media(tablet) { + + .wp-block-cover { + padding-left: calc(10% + 64px); + padding-right: calc(10% + 64px); + } + } +} + +/** === Gallery === */ + +.wp-block-gallery { + + .blocks-gallery-image figcaption, + .blocks-gallery-item figcaption, + .gallery-item .gallery-caption { + font-size: $font__size-xs; + line-height: 1.6; + } +} + +/** === Button === */ + +.wp-block-button { + + .wp-block-button__link { + line-height: 1.8; + @include font-family( $font__heading ); + font-size: $font__size-sm; + font-weight: bold; + } + + &:not(.is-style-outline) .wp-block-button__link { + background: $color__background-button; + } + + &:not(.is-style-squared) .wp-block-button__link { + border-radius: 5px; + } + + &.is-style-outline, + &.is-style-outline:hover, + &.is-style-outline:focus, + &.is-style-outline:active { + background: transparent; + color: $color__background-button; + + .wp-block-button__link { + background: transparent; + + &:not(.has-text-color) { + color: $color__background-button; + } + } + } +} + +/** === Blockquote === */ + +.wp-block-quote { + + &:not(.is-large):not(.is-style-large) { + border-width: 2px; + border-color: $color__link; + } + + &.is-large, + &.is-style-large { + margin-top: $font__size-xxl; + margin-bottom: $font__size-xxl; + } + + &.is-large p, + &.is-style-large p { + font-size: $font__size-lg; + line-height: 1.3; + margin-bottom: 0.5em; + margin-top: 0.5em; + } + + cite, + footer, + .wp-block-quote__citation { + @include font-family( $font__heading ); + font-size: $font__size-xs; + line-height: 1.6; + color: $color__text-light; + } +} + +/** === Pullquote === */ + +.wp-block-pullquote { + border-color: transparent; + border-width: 2px; + color: #000; + + blockquote { + margin-top: calc(3 * #{ $size__spacing-unit}); + margin-bottom: calc(3.33 * #{ $size__spacing-unit}); + hyphens: auto; + word-break: break-word; + } + + &:not(.is-style-solid-color) .wp-block-pullquote__citation { + color: $color__text-light; + } + + &.is-style-solid-color { + + blockquote { + width: calc(100% - (2 * #{ $size__spacing-unit})); + max-width: calc( 100% - (2 * #{ $size__spacing-unit})); + + a, + &.has-text-color p, + &.has-text-color a { + color: inherit; + } + + &:not(.has-text-color) { + color: $color__background-body; + } + + @include media(tablet) { + max-width: 80%; + } + } + + &:not(.has-background-color) { + background-color: $color__link; + } + } +} + +.wp-block[data-type="core/pullquote"], +.wp-block[data-type="core/pullquote"][data-align="left"], +.wp-block[data-type="core/pullquote"][data-align="right"] { + + blockquote > .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before, + blockquote > .editor-rich-text p, + p { + font-size: $font__size-lg; + font-style: italic; + line-height: 1.3; + margin-bottom: 0.5em; + margin-top: 0.5em; + + @include media(tablet) { + font-size: $font__size-xl; + } + } + + .wp-block-pullquote__citation { + @include font-family( $font__heading ); + font-size: $font__size-xs; + line-height: 1.6; + text-transform: none; + } + + em { + font-style: normal; + } +} + +.wp-block[data-type="core/pullquote"][data-align="left"], +.wp-block[data-type="core/pullquote"][data-align="right"] { + + .editor-block-list__block-edit { + width: calc(4 * (100vw / 12)); + max-width: 50%; + + .wp-block-pullquote:not(.is-style-solid-color) { + padding: 0; + } + + .wp-block-pullquote.is-style-solid-color { + padding: 1em; + } + } + + blockquote > .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before, + blockquote > .editor-rich-text p, + p, + .wp-block-pullquote__citation { + text-align: left; + } +} + +.wp-block[data-type="core/pullquote"][data-align="full"] { + + @include media(tablet) { + + .wp-block-pullquote blockquote { + max-width: calc(80% - 128px); + } + } +} + + +/** === File === */ + +.wp-block-file { + @include font-family( $font__heading ); + + .wp-block-file__textlink { + text-decoration: underline; + color: $color__link; + + &:hover { + color: $color__link-hover; + text-decoration: none; + } + } + + .wp-block-file__button { + display: table; + line-height: 1.8; + font-size: $font__size-sm; + font-weight: bold; + background-color: $color__link; + border-radius: 5px; + } + + .wp-block-file__button-richtext-wrapper { + display: block; + margin-top: calc(0.75 * #{$size__spacing-unit}); + margin-left: 0; + } + +} + +/** === Verse === */ + +.wp-block-verse, +.wp-block-verse pre { + padding: 0; +} + +/** === Code === */ + +.wp-block-code { + border-radius: 0; +} + +/** === Table === */ + +.wp-block-table { + + td, th { + border-color: $color__text-light; + } +} + +/** === Separator === */ + +.wp-block-separator { + + &:not(.is-style-dots) { + background-color: $color__text-light; + height: 2px; + } + + &:not(.is-style-wide):not(.is-style-dots) { + width: $font__size-xl; + margin-left: 0; + } + + &.is-style-dots { + color: $color__text-light; + } + + &.is-style-dots:before { + font-size: $font__size-lg; + letter-spacing: calc(2 * #{$size__spacing-unit}); + padding-left: calc(2 * #{$size__spacing-unit}); + } +} + +/* Remove duplicate rule-line when a separator + * is followed by an H1, or H2 */ +.wp-block[data-type="core/separator"] + .wp-block[data-type="core/heading"] h1:before, +.wp-block[data-type="core/separator"] + .wp-block[data-type="core/heading"] h2:before { + display: none; +} + +/** === Latest Posts, Archives, Categories === */ + +ul.wp-block-archives, +.wp-block-categories, +.wp-block-latest-posts { + padding: 0; + list-style-type: none; + + ul { + padding: 0; + list-style-type: none; + } + + li { + + > a { + @include font-family( $font__heading ); + font-size: calc(#{$font__size_base} * #{$font__size-ratio}); + font-weight: bold; + line-height: $font__line-height-heading; + text-decoration: none; + } + + ul { + padding-left: $size__spacing-unit; + } + } +} + +.wp-block-categories { + + ul { + padding-top: ( .75 * $size__spacing-unit ); + @include nestedSubMenuPadding(); + } + + li ul { + list-style: none; + padding-left: 0; + margin-bottom: ( -.75 * $size__spacing-unit ); + } + +} + +/** === Latest Posts === */ +.wp-block-latest-posts { + + .wp-block-latest-posts__post-date { + @include font-family( $font__heading ); + font-size: $font__size-xs; + color: $color__text-light; + line-height: 1.2; + } + + .wp-block-latest-posts__post-full-content, + .wp-block-latest-posts__post-excerpt { + margin-top: $font__size_base; + margin-bottom: $font__size_base; + + > div > p:first-child { + margin-top: $font__size_base; + } + } + + li { + padding-bottom: ( .5 * $size__spacing-unit ); + + &.menu-item-has-children, + &:last-child { + padding-bottom: 0; + } + + :not(:last-child) .wp-block-latest-posts__post-excerpt { + padding-bottom: ( .5 * $size__spacing-unit ); + } + } + + &.is-grid { + li { + border-top: 2px solid $color__border; + padding-top: (1 * $size__spacing-unit); + margin-bottom: (2 * $size__spacing-unit); + a { + &:after { + content: ''; + } + } + &:last-child { + margin-bottom: auto; + a:after { + content: ''; + } + } + } + } +} + +/** === Latest Comments === */ + +.wp-block-latest-comments { + + .wp-block-latest-comments__comment-meta { + @include font-family( $font__heading ); + font-weight: bold; + + .wp-block-latest-comments__comment-date { + font-weight: normal; + } + } + + .wp-block-latest-comments__comment, + .wp-block-latest-comments__comment-date, + .wp-block-latest-comments__comment-excerpt p { + font-size: inherit; + } + + .wp-block-latest-comments__comment-date { + font-size: $font__size-xs; + } +} + +/** === Classic Editor === */ + +/* Properly center-align captions in the classic-editor block */ +.wp-caption { + dd { + color: $color__text-light; + font-size: $font__size-xs; + @include font-family( $font__heading ); + line-height: $font__line-height-pre; + margin: 0; + padding: ( $size__spacing-unit * .5 ); + text-align: left; + text-align: center; + -webkit-margin-start: 0px; + margin-inline-start: 0px; + } +} + +.wp-block-freeform { + + /* Add style for galleries in classic-editor block */ + blockquote { + border-left: 2px solid $color__link; + + cite { + @include font-family( $font__heading ); + font-size: $font__size-xs; + font-style: normal; + line-height: 1.6; + color: $color__text-light; + } + } +} + +/** === Group Block === */ + +// This matches the 22px value for 1rem that used on the front end. +// It must be specified in pixels for the editor, since the root font +// size is different here. +$group-block-background__padding: $font__size_base; + +.wp-block[data-type="core/group"] { + + // Group block base styles + > .wp-block-group { + + // Child: Full alignment + > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align="full"] { + margin-left: 0; + margin-right: 0; + } + } + + // Group block with background color + > .wp-block-group.has-background { + padding: $group-block-background__padding; + + // Child: Full alignment + > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align="full"] { + margin-left: -$group-block-background__padding; + width: calc(100% + #{$group-block-background__padding * 2}); + max-width: calc(100% + #{$group-block-background__padding * 2}); + } + } + + // Wide and full alignments + &[data-align="wide"] > .is-block-content { + + // Group block base styles. + > .wp-block-group { + + // Child blocks: Default alignments + > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block:not([data-align="wide"]):not([data-align="full"]) { + @include media(tablet) { + width: calc(8 * (100vw / 12)); + } + + @include media(desktop) { + width: calc(6 * (100vw / 12 )); + } + } + + // Child blocks: Full alignment + > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align="full"] { + padding-left: 0; + padding-right: 0; + } + } + + // Group block with background color + > .wp-block-group.has-background { + + // Child blocks: Default alignments + > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block:not([data-align="wide"]):not([data-align="full"]) { + @include media(tablet) { + width: calc(8 * (100vw / 12) - #{$group-block-background__padding * 2}); + } + + @include media(desktop) { + width: calc(6 * (100vw / 12 ) - #{$group-block-background__padding * 2}); + } + } + } + } + + // Full alignment + &[data-align="full"] { + + // Group block base styles + > .is-block-content > .wp-block-group { + + // Margins & padding are added to this container to mimic + // the style + spacing of the .editor-writing-flow global + // container. This way, child items sync up with the placement + // and size of other top-level blocks. + > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout { + + @include media(mobile) { + padding-left: 46px; + padding-right: 46px; + } + + // 2px of extra padding are added to each side here + // To better match up with the spacing of the whole + // document. + @include media(tablet) { + width: 80%; + margin-left: 10%; + margin-right: 10%; + padding-left: 48px; + padding-right: 48px; + } + + // Child blocks: All alignments except full + > .wp-block:not([data-align="full"]) { + max-width: calc(100vw - (2 * 1rem)); + + @include media(tablet) { + max-width: calc(8 * (100vw / 12)); + } + + @include media(desktop) { + max-width: calc(6 * (100vw / 12)); + } + } + + // Child blocks: Right alignments + > .wp-block[data-align="right"] { + + @include media(tablet) { + max-width: 125%; + } + } + + // Child blocks: Wide alignments + > .wp-block[data-align="wide"] { + + @include media(tablet) { + width: calc(100% + 4px); + max-width: calc(100% + 4px); + } + } + + // Child blocks: Full alignments + > .wp-block[data-align=full] { + max-width: calc(100vw + (2 * 1rem)); + + @include media(mobile) { + width: calc(100% + 92px); + left: -46px; + } + + @include media(tablet) { + left: calc(-12.5% - 58px); + width: calc(125% + 120px); + max-width: calc(125% + 119px); + } + } + } + } + + // Group block with background color + > .is-block-content > .wp-block-group.has-background { + + // When the Group block is full width, we can remove the left/right padding + // and let this inherit the + padding: $group-block-background__padding 0; + + @include media(mobile) { + padding-left: 0; + padding-right: 0; + } + + // Child blocks: Full alignment + > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block[data-align="full"] { + margin-left: 0; + width: 100%; + + @include media(mobile) { + width: calc(100% + 92px); + } + + @include media(tablet) { + width: calc(125% + 120px); + } + } + } + } +} diff --git a/wp-content/themes/twentynineteen/style-rtl.css b/wp-content/themes/twentynineteen/style-rtl.css new file mode 100644 index 0000000..892bc1e --- /dev/null +++ b/wp-content/themes/twentynineteen/style-rtl.css @@ -0,0 +1,6513 @@ +@charset "UTF-8"; +/* +Theme Name: Twenty Nineteen +Theme URI: https://wordpress.org/themes/twentynineteen/ +Author: the WordPress team +Author URI: https://wordpress.org/ +Description: Our 2019 default theme is designed to show off the power of the block editor. It features custom styles for all the default blocks, and is built so that what you see in the editor looks like what you'll see on your website. Twenty Nineteen is designed to be adaptable to a wide range of websites, whether you’re running a photo blog, launching a new business, or supporting a non-profit. Featuring ample whitespace and modern sans-serif headlines paired with classic serif body text, it's built to be beautiful on all screen sizes. +Requires at least: 4.9.6 +Requires PHP: 5.2.4 +Version: 1.5 +License: GNU General Public License v2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html +Text Domain: twentynineteen +Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, rtl-language-support, sticky-post, threaded-comments, translation-ready + +This theme, like WordPress, is licensed under the GPL. +Use it to make something cool, have fun, and share what you've learned with others. + +Twenty Nineteen is based on Underscores https://underscores.me/, (C) 2012-2019 Automattic, Inc. +Underscores is distributed under the terms of the GNU GPL v2 or later. + +Normalizing styles have been helped along thanks to the fine work of +Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/ +*/ +/*-------------------------------------------------------------- +>>> TABLE OF CONTENTS: +---------------------------------------------------------------- +# Variables +# Normalize +# Typography + ## Headings + ## Copy +# Elements + ## Lists + ## Tables +# Forms + ## Buttons + ## Fields +# Navigation + ## Links + ## Menus + ## Next & Previous +# Accessibility +# Alignments +# Clearings +# Layout +# Widgets +# Content + ## Archives + ## Posts and pages + ## Comments +# Blocks +# Media + ## Captions + ## Galleries +--------------------------------------------------------------*/ +/* + * Chrome renders extra-wide   characters for the Hoefler Text font. + * This results in a jumping cursor when typing in both the Classic and block + * editors. The following font-face override fixes the issue by manually inserting + * a custom font that includes just a Hoefler Text space replacement for that + * character instead. + */ +@font-face { + font-family: 'NonBreakingSpaceOverride'; + src: url(data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAAAMoAA0AAAAACDQAAALTAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGh4GYACCahEICjx3CywAATYCJANUBCAFhiEHgWwbXQfILgpsY+rQRRARwyAs6uL7pxzYhxEE+32b3aeHmifR6tklkS9hiZA0ewkqGRJE+H7/+6378ASViK/PGeavqJyOzsceKi1s3BCiQsiOdn1r/RBgIJYEgCUhbm/8/8/h4saPssnTNkkiWUBrTRtjmQSajw3Ui3pZ3LYDPD+XG2C3JA/yKAS8/rU5eNfuGqRf4eNNgV4YAlIIgxglEkWe6FYpq10+wi3g+/nUgvgPFczNrz/RsTgVm/zfbPuHZlsuQECxuyqBcQwKFBjFgKO8AqP4bAN9tFJtnM9xPcbNjeXS/x1wY/xU52f5W/X1+9cnH4YwKIaoRRAkUkj/YlAAeF/624foiIDBgBmgQBeGAyhBljUPZUm/l2dTvmpqcBDUOHdbPZWd8JsBAsGr4w8/EDn82/bUPx4eh0YNrQTBuHO2FjQEAGBwK0DeI37DpQVqdERS4gZBhpeUhWCfLFz7J99aEBgsJCHvUGAdAPp4IADDCAPCEFMGpMZ9AQpTfQtQGhLbGVBZFV8BaqNyP68oTZgHNj3M8kBPfXTTC9t90UuzYhy9ciH0grVlOcqyCytisvbsERsEYztiznR0WCrmTksJwbSNK6fd1Rvr25I9oLvctUoEbNOmXJbqgYgPXEHJ82IUsrCnpkxh23F1rfZ2zcRnJYoXtauB3VTFkFXQg3uoZYD5qE0kdjDtoDoF1h2bulGmev5HbYhbrjtohQSRI4aNOkffIcT+d3v6atpaYh3JvPoQsztCcqvaBkppDSPcQ3bw3KaCBo1f5CJWTZEgW3LjLofYg51MaVezrx8xZitYbQ9KYeoRaqQdVLwSEfrKXLK1otCWOKNdR/YwYAfon5Yk8O2MJfSD10dPGA5PIJJQMkah0ugMJiv6x4Dm7LEa8xnrRGGGLAg4sAlbsA07sAt76DOsXKO3hIjtIlpnnFrt1qW4kh6NhS83P/6HB/fl1SMAAA==) format("woff2"), url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUQAA0AAAAACDQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAE9AAAABwAAAAchf5yU0dERUYAAATYAAAAHAAAAB4AJwAbT1MvMgAAAaAAAABJAAAAYJAcgU5jbWFwAAACIAAAAF4AAAFqUUxBZ2dhc3AAAATQAAAACAAAAAgAAAAQZ2x5ZgAAApAAAAAyAAAAPL0n8y9oZWFkAAABMAAAADAAAAA2Fi93Z2hoZWEAAAFgAAAAHQAAACQOSgWaaG10eAAAAewAAAAzAAAAVC7TAQBsb2NhAAACgAAAABAAAAAsAOQBAm1heHAAAAGAAAAAHQAAACAAWQALbmFtZQAAAsQAAAF6AAADIYvD/Adwb3N0AAAEQAAAAI4AAADsapk2o3jaY2BkYGAA4ov5mwzj+W2+MnCzXwCKMNzgCBSB0LfbQDQ7AxuI4mBgAlEAFKQIRHjaY2BkYGD3+NvCwMDBAALsDAyMDKhAFAA3+wH3AAAAeNpjYGRgYBBl4GBgYgABEMnIABJzAPMZAAVmAGUAAAB42mNgZlJhnMDAysDCKsKygYGBYRqEZtrDYMT4D8gHSmEHjgUFOQwODAqqf9g9/rYwMLB7MNUAhRlBcsxBrMlASoGBEQAj8QtyAAAAeNrjYGBkAAGmWQwMjO8gmBnIZ2NA0ExAzNjAAFYJVn0ASBsD6VAIDZb7AtELAgANIgb9AHjaY2BgYGaAYBkGRgYQSAHyGMF8FgYPIM3HwMHAxMDGoMCwQIFLQV8hXvXP//9AcRCfAcb///h/ygPW+w/vb7olBjUHCTCyMcAFGZmABBO6AogThgZgIUsXAEDcEzcAAHjaY2BgECMCyoEgACZaAed42mNgYmRgYGBnYGNgYAZSDJqMgorCgoqCjECRXwwNrCAKSP5mAAFGBiRgyAAAi/YFBQAAeNqtkc1OwkAUhU/5M25cEhcsZick0AwlBJq6MWwgJkAgYV/KAA2lJeUn+hY+gktXvpKv4dLTMqKycGHsTZNv7px7z50ZAFd4hYHjdw1Ls4EiHjVncIFnzVnc4F1zDkWjrzmPW+NNcwGlzIRKI3fJlUyrEjZQxb3mDH2fNGfRx4vmHKqG0JzHg6E0F9DOlFBGBxUI1GEzLNT4S0aLuTtsGAEUuYcQHkyg3KmIum1bNUvKlrjbbAIleqHHnS4iSudpQcySMYtdFiXlAxzSbAwfMxK6kZoHKhbjjespMTioOPZnzI+4ucCeTVyKMVKLfeAS6vSWaTinuZwzyy/Dc7vaed+6KaV0kukdPUk6yOcctZPvvxxqksq2lEW8RvHjMEO2FCl/zy6p3NEm0R9OFSafJdldc4QVeyaaObMBO0/5cCaa6d9Ggyubxire+lEojscdjoWUR1xGOy8KD8mG2ZLO2l2paDc3A39qmU2z2W5YNv5+u79e6QfGJY/hAAB42m3NywrCMBQE0DupWp/1AYI7/6DEaLQu66Mrd35BKUWKJSlFv1+rue4cGM7shgR981qSon+ZNwUJ8iDgoYU2OvDRRQ99DDDECAHGmGCKmf80hZSx/Kik/LliFbtmN6xmt+yOjdg9GztV4tROnRwX/Bsaaw51nt4Lc7tWaZYHp/MlzKx51LZs5htNri+2AAAAAQAB//8AD3jaY2BkYGDgAWIxIGZiYARCESBmAfMYAAR6AEMAAAABAAAAANXtRbgAAAAA2AhRFAAAAADYCNuG) format("woff"); +} + +/* If we add the border using a regular CSS border, it won't look good on non-retina devices, + * since its edges can look jagged due to lack of antialiasing. In this case, we are several + * layers of box-shadow to add the border visually, which will render the border smoother. */ +/* Calculates maximum width for post content */ +/* Nested sub-menu padding: 10 levels deep */ +/* Ensure all font family declarations come with non-latin fallbacks */ +/* Build our non-latin font styles */ +body:lang(ar), button:lang(ar), +input:lang(ar), +select:lang(ar), +optgroup:lang(ar), +textarea:lang(ar), .author-description .author-link:lang(ar), +.comment-metadata:lang(ar), +.comment-reply-link:lang(ar), +.comments-title:lang(ar), +.comment-author .fn:lang(ar), +.discussion-meta-info:lang(ar), +.entry-meta:lang(ar), +.entry-footer:lang(ar), +.main-navigation:lang(ar), +.no-comments:lang(ar), +.not-found .page-title:lang(ar), +.error-404 .page-title:lang(ar), +.post-navigation .post-title:lang(ar), +.page-links:lang(ar), +.page-description:lang(ar), +.pagination .nav-links:lang(ar), +.sticky-post:lang(ar), +.site-title:lang(ar), +.site-info:lang(ar), +#cancel-comment-reply-link:lang(ar), +h1:lang(ar), +h2:lang(ar), +h3:lang(ar), +h4:lang(ar), +h5:lang(ar), +h6:lang(ar), .page-title:lang(ar), blockquote cite:lang(ar), table:lang(ar), .button:lang(ar), +input:lang(ar)[type="button"], +input:lang(ar)[type="reset"], +input:lang(ar)[type="submit"], .comment-navigation .nav-previous:lang(ar), +.comment-navigation .nav-next:lang(ar), .comment-list .pingback .comment-body:lang(ar), +.comment-list .trackback .comment-body:lang(ar), .comment-list .pingback .comment-body .comment-edit-link:lang(ar), +.comment-list .trackback .comment-body .comment-edit-link:lang(ar), .comment-form .comment-notes:lang(ar), +.comment-form label:lang(ar), .widget_archive ul li:lang(ar), +.widget_categories ul li:lang(ar), +.widget_meta ul li:lang(ar), +.widget_nav_menu ul li:lang(ar), +.widget_pages ul li:lang(ar), +.widget_recent_comments ul li:lang(ar), +.widget_recent_entries ul li:lang(ar), +.widget_rss ul li:lang(ar), .widget_tag_cloud .tagcloud:lang(ar), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ar), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ar), .entry .entry-content .wp-block-archives li > a:lang(ar), +.entry .entry-content .wp-block-categories li > a:lang(ar), +.entry .entry-content .wp-block-latest-posts li > a:lang(ar), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ar), .entry .entry-content .wp-block-verse:lang(ar), .entry .entry-content .has-drop-cap:lang(ar):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ar), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ar), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ar), +.entry .entry-content .wp-block-cover-image h2:lang(ar), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ar), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ar), +.entry .entry-content .wp-block-cover h2:lang(ar), .entry .entry-content .wp-block-audio figcaption:lang(ar), +.entry .entry-content .wp-block-video figcaption:lang(ar), +.entry .entry-content .wp-block-image figcaption:lang(ar), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ar), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ar), .entry .entry-content .wp-block-file:lang(ar), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ar), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ar), .wp-caption-text:lang(ar), .gallery-caption:lang(ar) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(ary), button:lang(ary), +input:lang(ary), +select:lang(ary), +optgroup:lang(ary), +textarea:lang(ary), .author-description .author-link:lang(ary), +.comment-metadata:lang(ary), +.comment-reply-link:lang(ary), +.comments-title:lang(ary), +.comment-author .fn:lang(ary), +.discussion-meta-info:lang(ary), +.entry-meta:lang(ary), +.entry-footer:lang(ary), +.main-navigation:lang(ary), +.no-comments:lang(ary), +.not-found .page-title:lang(ary), +.error-404 .page-title:lang(ary), +.post-navigation .post-title:lang(ary), +.page-links:lang(ary), +.page-description:lang(ary), +.pagination .nav-links:lang(ary), +.sticky-post:lang(ary), +.site-title:lang(ary), +.site-info:lang(ary), +#cancel-comment-reply-link:lang(ary), +h1:lang(ary), +h2:lang(ary), +h3:lang(ary), +h4:lang(ary), +h5:lang(ary), +h6:lang(ary), .page-title:lang(ary), blockquote cite:lang(ary), table:lang(ary), .button:lang(ary), +input:lang(ary)[type="button"], +input:lang(ary)[type="reset"], +input:lang(ary)[type="submit"], .comment-navigation .nav-previous:lang(ary), +.comment-navigation .nav-next:lang(ary), .comment-list .pingback .comment-body:lang(ary), +.comment-list .trackback .comment-body:lang(ary), .comment-list .pingback .comment-body .comment-edit-link:lang(ary), +.comment-list .trackback .comment-body .comment-edit-link:lang(ary), .comment-form .comment-notes:lang(ary), +.comment-form label:lang(ary), .widget_archive ul li:lang(ary), +.widget_categories ul li:lang(ary), +.widget_meta ul li:lang(ary), +.widget_nav_menu ul li:lang(ary), +.widget_pages ul li:lang(ary), +.widget_recent_comments ul li:lang(ary), +.widget_recent_entries ul li:lang(ary), +.widget_rss ul li:lang(ary), .widget_tag_cloud .tagcloud:lang(ary), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ary), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ary), .entry .entry-content .wp-block-archives li > a:lang(ary), +.entry .entry-content .wp-block-categories li > a:lang(ary), +.entry .entry-content .wp-block-latest-posts li > a:lang(ary), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ary), .entry .entry-content .wp-block-verse:lang(ary), .entry .entry-content .has-drop-cap:lang(ary):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ary), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ary), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ary), +.entry .entry-content .wp-block-cover-image h2:lang(ary), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ary), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ary), +.entry .entry-content .wp-block-cover h2:lang(ary), .entry .entry-content .wp-block-audio figcaption:lang(ary), +.entry .entry-content .wp-block-video figcaption:lang(ary), +.entry .entry-content .wp-block-image figcaption:lang(ary), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ary), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ary), .entry .entry-content .wp-block-file:lang(ary), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ary), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ary), .wp-caption-text:lang(ary), .gallery-caption:lang(ary) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(azb), button:lang(azb), +input:lang(azb), +select:lang(azb), +optgroup:lang(azb), +textarea:lang(azb), .author-description .author-link:lang(azb), +.comment-metadata:lang(azb), +.comment-reply-link:lang(azb), +.comments-title:lang(azb), +.comment-author .fn:lang(azb), +.discussion-meta-info:lang(azb), +.entry-meta:lang(azb), +.entry-footer:lang(azb), +.main-navigation:lang(azb), +.no-comments:lang(azb), +.not-found .page-title:lang(azb), +.error-404 .page-title:lang(azb), +.post-navigation .post-title:lang(azb), +.page-links:lang(azb), +.page-description:lang(azb), +.pagination .nav-links:lang(azb), +.sticky-post:lang(azb), +.site-title:lang(azb), +.site-info:lang(azb), +#cancel-comment-reply-link:lang(azb), +h1:lang(azb), +h2:lang(azb), +h3:lang(azb), +h4:lang(azb), +h5:lang(azb), +h6:lang(azb), .page-title:lang(azb), blockquote cite:lang(azb), table:lang(azb), .button:lang(azb), +input:lang(azb)[type="button"], +input:lang(azb)[type="reset"], +input:lang(azb)[type="submit"], .comment-navigation .nav-previous:lang(azb), +.comment-navigation .nav-next:lang(azb), .comment-list .pingback .comment-body:lang(azb), +.comment-list .trackback .comment-body:lang(azb), .comment-list .pingback .comment-body .comment-edit-link:lang(azb), +.comment-list .trackback .comment-body .comment-edit-link:lang(azb), .comment-form .comment-notes:lang(azb), +.comment-form label:lang(azb), .widget_archive ul li:lang(azb), +.widget_categories ul li:lang(azb), +.widget_meta ul li:lang(azb), +.widget_nav_menu ul li:lang(azb), +.widget_pages ul li:lang(azb), +.widget_recent_comments ul li:lang(azb), +.widget_recent_entries ul li:lang(azb), +.widget_rss ul li:lang(azb), .widget_tag_cloud .tagcloud:lang(azb), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(azb), .entry .entry-content .wp-block-button .wp-block-button__link:lang(azb), .entry .entry-content .wp-block-archives li > a:lang(azb), +.entry .entry-content .wp-block-categories li > a:lang(azb), +.entry .entry-content .wp-block-latest-posts li > a:lang(azb), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(azb), .entry .entry-content .wp-block-verse:lang(azb), .entry .entry-content .has-drop-cap:lang(azb):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(azb), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(azb), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(azb), +.entry .entry-content .wp-block-cover-image h2:lang(azb), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(azb), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(azb), +.entry .entry-content .wp-block-cover h2:lang(azb), .entry .entry-content .wp-block-audio figcaption:lang(azb), +.entry .entry-content .wp-block-video figcaption:lang(azb), +.entry .entry-content .wp-block-image figcaption:lang(azb), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(azb), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(azb), .entry .entry-content .wp-block-file:lang(azb), .entry .entry-content .wp-block-file .wp-block-file__button:lang(azb), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(azb), .wp-caption-text:lang(azb), .gallery-caption:lang(azb) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(ckb), button:lang(ckb), +input:lang(ckb), +select:lang(ckb), +optgroup:lang(ckb), +textarea:lang(ckb), .author-description .author-link:lang(ckb), +.comment-metadata:lang(ckb), +.comment-reply-link:lang(ckb), +.comments-title:lang(ckb), +.comment-author .fn:lang(ckb), +.discussion-meta-info:lang(ckb), +.entry-meta:lang(ckb), +.entry-footer:lang(ckb), +.main-navigation:lang(ckb), +.no-comments:lang(ckb), +.not-found .page-title:lang(ckb), +.error-404 .page-title:lang(ckb), +.post-navigation .post-title:lang(ckb), +.page-links:lang(ckb), +.page-description:lang(ckb), +.pagination .nav-links:lang(ckb), +.sticky-post:lang(ckb), +.site-title:lang(ckb), +.site-info:lang(ckb), +#cancel-comment-reply-link:lang(ckb), +h1:lang(ckb), +h2:lang(ckb), +h3:lang(ckb), +h4:lang(ckb), +h5:lang(ckb), +h6:lang(ckb), .page-title:lang(ckb), blockquote cite:lang(ckb), table:lang(ckb), .button:lang(ckb), +input:lang(ckb)[type="button"], +input:lang(ckb)[type="reset"], +input:lang(ckb)[type="submit"], .comment-navigation .nav-previous:lang(ckb), +.comment-navigation .nav-next:lang(ckb), .comment-list .pingback .comment-body:lang(ckb), +.comment-list .trackback .comment-body:lang(ckb), .comment-list .pingback .comment-body .comment-edit-link:lang(ckb), +.comment-list .trackback .comment-body .comment-edit-link:lang(ckb), .comment-form .comment-notes:lang(ckb), +.comment-form label:lang(ckb), .widget_archive ul li:lang(ckb), +.widget_categories ul li:lang(ckb), +.widget_meta ul li:lang(ckb), +.widget_nav_menu ul li:lang(ckb), +.widget_pages ul li:lang(ckb), +.widget_recent_comments ul li:lang(ckb), +.widget_recent_entries ul li:lang(ckb), +.widget_rss ul li:lang(ckb), .widget_tag_cloud .tagcloud:lang(ckb), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ckb), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ckb), .entry .entry-content .wp-block-archives li > a:lang(ckb), +.entry .entry-content .wp-block-categories li > a:lang(ckb), +.entry .entry-content .wp-block-latest-posts li > a:lang(ckb), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ckb), .entry .entry-content .wp-block-verse:lang(ckb), .entry .entry-content .has-drop-cap:lang(ckb):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ckb), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ckb), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ckb), +.entry .entry-content .wp-block-cover-image h2:lang(ckb), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ckb), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ckb), +.entry .entry-content .wp-block-cover h2:lang(ckb), .entry .entry-content .wp-block-audio figcaption:lang(ckb), +.entry .entry-content .wp-block-video figcaption:lang(ckb), +.entry .entry-content .wp-block-image figcaption:lang(ckb), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ckb), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ckb), .entry .entry-content .wp-block-file:lang(ckb), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ckb), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ckb), .wp-caption-text:lang(ckb), .gallery-caption:lang(ckb) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(fa-IR), button:lang(fa-IR), +input:lang(fa-IR), +select:lang(fa-IR), +optgroup:lang(fa-IR), +textarea:lang(fa-IR), .author-description .author-link:lang(fa-IR), +.comment-metadata:lang(fa-IR), +.comment-reply-link:lang(fa-IR), +.comments-title:lang(fa-IR), +.comment-author .fn:lang(fa-IR), +.discussion-meta-info:lang(fa-IR), +.entry-meta:lang(fa-IR), +.entry-footer:lang(fa-IR), +.main-navigation:lang(fa-IR), +.no-comments:lang(fa-IR), +.not-found .page-title:lang(fa-IR), +.error-404 .page-title:lang(fa-IR), +.post-navigation .post-title:lang(fa-IR), +.page-links:lang(fa-IR), +.page-description:lang(fa-IR), +.pagination .nav-links:lang(fa-IR), +.sticky-post:lang(fa-IR), +.site-title:lang(fa-IR), +.site-info:lang(fa-IR), +#cancel-comment-reply-link:lang(fa-IR), +h1:lang(fa-IR), +h2:lang(fa-IR), +h3:lang(fa-IR), +h4:lang(fa-IR), +h5:lang(fa-IR), +h6:lang(fa-IR), .page-title:lang(fa-IR), blockquote cite:lang(fa-IR), table:lang(fa-IR), .button:lang(fa-IR), +input:lang(fa-IR)[type="button"], +input:lang(fa-IR)[type="reset"], +input:lang(fa-IR)[type="submit"], .comment-navigation .nav-previous:lang(fa-IR), +.comment-navigation .nav-next:lang(fa-IR), .comment-list .pingback .comment-body:lang(fa-IR), +.comment-list .trackback .comment-body:lang(fa-IR), .comment-list .pingback .comment-body .comment-edit-link:lang(fa-IR), +.comment-list .trackback .comment-body .comment-edit-link:lang(fa-IR), .comment-form .comment-notes:lang(fa-IR), +.comment-form label:lang(fa-IR), .widget_archive ul li:lang(fa-IR), +.widget_categories ul li:lang(fa-IR), +.widget_meta ul li:lang(fa-IR), +.widget_nav_menu ul li:lang(fa-IR), +.widget_pages ul li:lang(fa-IR), +.widget_recent_comments ul li:lang(fa-IR), +.widget_recent_entries ul li:lang(fa-IR), +.widget_rss ul li:lang(fa-IR), .widget_tag_cloud .tagcloud:lang(fa-IR), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(fa-IR), .entry .entry-content .wp-block-button .wp-block-button__link:lang(fa-IR), .entry .entry-content .wp-block-archives li > a:lang(fa-IR), +.entry .entry-content .wp-block-categories li > a:lang(fa-IR), +.entry .entry-content .wp-block-latest-posts li > a:lang(fa-IR), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(fa-IR), .entry .entry-content .wp-block-verse:lang(fa-IR), .entry .entry-content .has-drop-cap:lang(fa-IR):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(fa-IR), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(fa-IR), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(fa-IR), +.entry .entry-content .wp-block-cover-image h2:lang(fa-IR), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(fa-IR), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(fa-IR), +.entry .entry-content .wp-block-cover h2:lang(fa-IR), .entry .entry-content .wp-block-audio figcaption:lang(fa-IR), +.entry .entry-content .wp-block-video figcaption:lang(fa-IR), +.entry .entry-content .wp-block-image figcaption:lang(fa-IR), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(fa-IR), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(fa-IR), .entry .entry-content .wp-block-file:lang(fa-IR), .entry .entry-content .wp-block-file .wp-block-file__button:lang(fa-IR), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(fa-IR), .wp-caption-text:lang(fa-IR), .gallery-caption:lang(fa-IR) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(haz), button:lang(haz), +input:lang(haz), +select:lang(haz), +optgroup:lang(haz), +textarea:lang(haz), .author-description .author-link:lang(haz), +.comment-metadata:lang(haz), +.comment-reply-link:lang(haz), +.comments-title:lang(haz), +.comment-author .fn:lang(haz), +.discussion-meta-info:lang(haz), +.entry-meta:lang(haz), +.entry-footer:lang(haz), +.main-navigation:lang(haz), +.no-comments:lang(haz), +.not-found .page-title:lang(haz), +.error-404 .page-title:lang(haz), +.post-navigation .post-title:lang(haz), +.page-links:lang(haz), +.page-description:lang(haz), +.pagination .nav-links:lang(haz), +.sticky-post:lang(haz), +.site-title:lang(haz), +.site-info:lang(haz), +#cancel-comment-reply-link:lang(haz), +h1:lang(haz), +h2:lang(haz), +h3:lang(haz), +h4:lang(haz), +h5:lang(haz), +h6:lang(haz), .page-title:lang(haz), blockquote cite:lang(haz), table:lang(haz), .button:lang(haz), +input:lang(haz)[type="button"], +input:lang(haz)[type="reset"], +input:lang(haz)[type="submit"], .comment-navigation .nav-previous:lang(haz), +.comment-navigation .nav-next:lang(haz), .comment-list .pingback .comment-body:lang(haz), +.comment-list .trackback .comment-body:lang(haz), .comment-list .pingback .comment-body .comment-edit-link:lang(haz), +.comment-list .trackback .comment-body .comment-edit-link:lang(haz), .comment-form .comment-notes:lang(haz), +.comment-form label:lang(haz), .widget_archive ul li:lang(haz), +.widget_categories ul li:lang(haz), +.widget_meta ul li:lang(haz), +.widget_nav_menu ul li:lang(haz), +.widget_pages ul li:lang(haz), +.widget_recent_comments ul li:lang(haz), +.widget_recent_entries ul li:lang(haz), +.widget_rss ul li:lang(haz), .widget_tag_cloud .tagcloud:lang(haz), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(haz), .entry .entry-content .wp-block-button .wp-block-button__link:lang(haz), .entry .entry-content .wp-block-archives li > a:lang(haz), +.entry .entry-content .wp-block-categories li > a:lang(haz), +.entry .entry-content .wp-block-latest-posts li > a:lang(haz), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(haz), .entry .entry-content .wp-block-verse:lang(haz), .entry .entry-content .has-drop-cap:lang(haz):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(haz), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(haz), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(haz), +.entry .entry-content .wp-block-cover-image h2:lang(haz), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(haz), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(haz), +.entry .entry-content .wp-block-cover h2:lang(haz), .entry .entry-content .wp-block-audio figcaption:lang(haz), +.entry .entry-content .wp-block-video figcaption:lang(haz), +.entry .entry-content .wp-block-image figcaption:lang(haz), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(haz), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(haz), .entry .entry-content .wp-block-file:lang(haz), .entry .entry-content .wp-block-file .wp-block-file__button:lang(haz), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(haz), .wp-caption-text:lang(haz), .gallery-caption:lang(haz) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(ps), button:lang(ps), +input:lang(ps), +select:lang(ps), +optgroup:lang(ps), +textarea:lang(ps), .author-description .author-link:lang(ps), +.comment-metadata:lang(ps), +.comment-reply-link:lang(ps), +.comments-title:lang(ps), +.comment-author .fn:lang(ps), +.discussion-meta-info:lang(ps), +.entry-meta:lang(ps), +.entry-footer:lang(ps), +.main-navigation:lang(ps), +.no-comments:lang(ps), +.not-found .page-title:lang(ps), +.error-404 .page-title:lang(ps), +.post-navigation .post-title:lang(ps), +.page-links:lang(ps), +.page-description:lang(ps), +.pagination .nav-links:lang(ps), +.sticky-post:lang(ps), +.site-title:lang(ps), +.site-info:lang(ps), +#cancel-comment-reply-link:lang(ps), +h1:lang(ps), +h2:lang(ps), +h3:lang(ps), +h4:lang(ps), +h5:lang(ps), +h6:lang(ps), .page-title:lang(ps), blockquote cite:lang(ps), table:lang(ps), .button:lang(ps), +input:lang(ps)[type="button"], +input:lang(ps)[type="reset"], +input:lang(ps)[type="submit"], .comment-navigation .nav-previous:lang(ps), +.comment-navigation .nav-next:lang(ps), .comment-list .pingback .comment-body:lang(ps), +.comment-list .trackback .comment-body:lang(ps), .comment-list .pingback .comment-body .comment-edit-link:lang(ps), +.comment-list .trackback .comment-body .comment-edit-link:lang(ps), .comment-form .comment-notes:lang(ps), +.comment-form label:lang(ps), .widget_archive ul li:lang(ps), +.widget_categories ul li:lang(ps), +.widget_meta ul li:lang(ps), +.widget_nav_menu ul li:lang(ps), +.widget_pages ul li:lang(ps), +.widget_recent_comments ul li:lang(ps), +.widget_recent_entries ul li:lang(ps), +.widget_rss ul li:lang(ps), .widget_tag_cloud .tagcloud:lang(ps), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ps), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ps), .entry .entry-content .wp-block-archives li > a:lang(ps), +.entry .entry-content .wp-block-categories li > a:lang(ps), +.entry .entry-content .wp-block-latest-posts li > a:lang(ps), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ps), .entry .entry-content .wp-block-verse:lang(ps), .entry .entry-content .has-drop-cap:lang(ps):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ps), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ps), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ps), +.entry .entry-content .wp-block-cover-image h2:lang(ps), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ps), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ps), +.entry .entry-content .wp-block-cover h2:lang(ps), .entry .entry-content .wp-block-audio figcaption:lang(ps), +.entry .entry-content .wp-block-video figcaption:lang(ps), +.entry .entry-content .wp-block-image figcaption:lang(ps), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ps), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ps), .entry .entry-content .wp-block-file:lang(ps), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ps), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ps), .wp-caption-text:lang(ps), .gallery-caption:lang(ps) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(be), button:lang(be), +input:lang(be), +select:lang(be), +optgroup:lang(be), +textarea:lang(be), .author-description .author-link:lang(be), +.comment-metadata:lang(be), +.comment-reply-link:lang(be), +.comments-title:lang(be), +.comment-author .fn:lang(be), +.discussion-meta-info:lang(be), +.entry-meta:lang(be), +.entry-footer:lang(be), +.main-navigation:lang(be), +.no-comments:lang(be), +.not-found .page-title:lang(be), +.error-404 .page-title:lang(be), +.post-navigation .post-title:lang(be), +.page-links:lang(be), +.page-description:lang(be), +.pagination .nav-links:lang(be), +.sticky-post:lang(be), +.site-title:lang(be), +.site-info:lang(be), +#cancel-comment-reply-link:lang(be), +h1:lang(be), +h2:lang(be), +h3:lang(be), +h4:lang(be), +h5:lang(be), +h6:lang(be), .page-title:lang(be), blockquote cite:lang(be), table:lang(be), .button:lang(be), +input:lang(be)[type="button"], +input:lang(be)[type="reset"], +input:lang(be)[type="submit"], .comment-navigation .nav-previous:lang(be), +.comment-navigation .nav-next:lang(be), .comment-list .pingback .comment-body:lang(be), +.comment-list .trackback .comment-body:lang(be), .comment-list .pingback .comment-body .comment-edit-link:lang(be), +.comment-list .trackback .comment-body .comment-edit-link:lang(be), .comment-form .comment-notes:lang(be), +.comment-form label:lang(be), .widget_archive ul li:lang(be), +.widget_categories ul li:lang(be), +.widget_meta ul li:lang(be), +.widget_nav_menu ul li:lang(be), +.widget_pages ul li:lang(be), +.widget_recent_comments ul li:lang(be), +.widget_recent_entries ul li:lang(be), +.widget_rss ul li:lang(be), .widget_tag_cloud .tagcloud:lang(be), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(be), .entry .entry-content .wp-block-button .wp-block-button__link:lang(be), .entry .entry-content .wp-block-archives li > a:lang(be), +.entry .entry-content .wp-block-categories li > a:lang(be), +.entry .entry-content .wp-block-latest-posts li > a:lang(be), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(be), .entry .entry-content .wp-block-verse:lang(be), .entry .entry-content .has-drop-cap:lang(be):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(be), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(be), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(be), +.entry .entry-content .wp-block-cover-image h2:lang(be), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(be), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(be), +.entry .entry-content .wp-block-cover h2:lang(be), .entry .entry-content .wp-block-audio figcaption:lang(be), +.entry .entry-content .wp-block-video figcaption:lang(be), +.entry .entry-content .wp-block-image figcaption:lang(be), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(be), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(be), .entry .entry-content .wp-block-file:lang(be), .entry .entry-content .wp-block-file .wp-block-file__button:lang(be), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(be), .wp-caption-text:lang(be), .gallery-caption:lang(be) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(bg-BG), button:lang(bg-BG), +input:lang(bg-BG), +select:lang(bg-BG), +optgroup:lang(bg-BG), +textarea:lang(bg-BG), .author-description .author-link:lang(bg-BG), +.comment-metadata:lang(bg-BG), +.comment-reply-link:lang(bg-BG), +.comments-title:lang(bg-BG), +.comment-author .fn:lang(bg-BG), +.discussion-meta-info:lang(bg-BG), +.entry-meta:lang(bg-BG), +.entry-footer:lang(bg-BG), +.main-navigation:lang(bg-BG), +.no-comments:lang(bg-BG), +.not-found .page-title:lang(bg-BG), +.error-404 .page-title:lang(bg-BG), +.post-navigation .post-title:lang(bg-BG), +.page-links:lang(bg-BG), +.page-description:lang(bg-BG), +.pagination .nav-links:lang(bg-BG), +.sticky-post:lang(bg-BG), +.site-title:lang(bg-BG), +.site-info:lang(bg-BG), +#cancel-comment-reply-link:lang(bg-BG), +h1:lang(bg-BG), +h2:lang(bg-BG), +h3:lang(bg-BG), +h4:lang(bg-BG), +h5:lang(bg-BG), +h6:lang(bg-BG), .page-title:lang(bg-BG), blockquote cite:lang(bg-BG), table:lang(bg-BG), .button:lang(bg-BG), +input:lang(bg-BG)[type="button"], +input:lang(bg-BG)[type="reset"], +input:lang(bg-BG)[type="submit"], .comment-navigation .nav-previous:lang(bg-BG), +.comment-navigation .nav-next:lang(bg-BG), .comment-list .pingback .comment-body:lang(bg-BG), +.comment-list .trackback .comment-body:lang(bg-BG), .comment-list .pingback .comment-body .comment-edit-link:lang(bg-BG), +.comment-list .trackback .comment-body .comment-edit-link:lang(bg-BG), .comment-form .comment-notes:lang(bg-BG), +.comment-form label:lang(bg-BG), .widget_archive ul li:lang(bg-BG), +.widget_categories ul li:lang(bg-BG), +.widget_meta ul li:lang(bg-BG), +.widget_nav_menu ul li:lang(bg-BG), +.widget_pages ul li:lang(bg-BG), +.widget_recent_comments ul li:lang(bg-BG), +.widget_recent_entries ul li:lang(bg-BG), +.widget_rss ul li:lang(bg-BG), .widget_tag_cloud .tagcloud:lang(bg-BG), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(bg-BG), .entry .entry-content .wp-block-button .wp-block-button__link:lang(bg-BG), .entry .entry-content .wp-block-archives li > a:lang(bg-BG), +.entry .entry-content .wp-block-categories li > a:lang(bg-BG), +.entry .entry-content .wp-block-latest-posts li > a:lang(bg-BG), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(bg-BG), .entry .entry-content .wp-block-verse:lang(bg-BG), .entry .entry-content .has-drop-cap:lang(bg-BG):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(bg-BG), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(bg-BG), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(bg-BG), +.entry .entry-content .wp-block-cover-image h2:lang(bg-BG), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(bg-BG), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(bg-BG), +.entry .entry-content .wp-block-cover h2:lang(bg-BG), .entry .entry-content .wp-block-audio figcaption:lang(bg-BG), +.entry .entry-content .wp-block-video figcaption:lang(bg-BG), +.entry .entry-content .wp-block-image figcaption:lang(bg-BG), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(bg-BG), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(bg-BG), .entry .entry-content .wp-block-file:lang(bg-BG), .entry .entry-content .wp-block-file .wp-block-file__button:lang(bg-BG), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(bg-BG), .wp-caption-text:lang(bg-BG), .gallery-caption:lang(bg-BG) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(kk), button:lang(kk), +input:lang(kk), +select:lang(kk), +optgroup:lang(kk), +textarea:lang(kk), .author-description .author-link:lang(kk), +.comment-metadata:lang(kk), +.comment-reply-link:lang(kk), +.comments-title:lang(kk), +.comment-author .fn:lang(kk), +.discussion-meta-info:lang(kk), +.entry-meta:lang(kk), +.entry-footer:lang(kk), +.main-navigation:lang(kk), +.no-comments:lang(kk), +.not-found .page-title:lang(kk), +.error-404 .page-title:lang(kk), +.post-navigation .post-title:lang(kk), +.page-links:lang(kk), +.page-description:lang(kk), +.pagination .nav-links:lang(kk), +.sticky-post:lang(kk), +.site-title:lang(kk), +.site-info:lang(kk), +#cancel-comment-reply-link:lang(kk), +h1:lang(kk), +h2:lang(kk), +h3:lang(kk), +h4:lang(kk), +h5:lang(kk), +h6:lang(kk), .page-title:lang(kk), blockquote cite:lang(kk), table:lang(kk), .button:lang(kk), +input:lang(kk)[type="button"], +input:lang(kk)[type="reset"], +input:lang(kk)[type="submit"], .comment-navigation .nav-previous:lang(kk), +.comment-navigation .nav-next:lang(kk), .comment-list .pingback .comment-body:lang(kk), +.comment-list .trackback .comment-body:lang(kk), .comment-list .pingback .comment-body .comment-edit-link:lang(kk), +.comment-list .trackback .comment-body .comment-edit-link:lang(kk), .comment-form .comment-notes:lang(kk), +.comment-form label:lang(kk), .widget_archive ul li:lang(kk), +.widget_categories ul li:lang(kk), +.widget_meta ul li:lang(kk), +.widget_nav_menu ul li:lang(kk), +.widget_pages ul li:lang(kk), +.widget_recent_comments ul li:lang(kk), +.widget_recent_entries ul li:lang(kk), +.widget_rss ul li:lang(kk), .widget_tag_cloud .tagcloud:lang(kk), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(kk), .entry .entry-content .wp-block-button .wp-block-button__link:lang(kk), .entry .entry-content .wp-block-archives li > a:lang(kk), +.entry .entry-content .wp-block-categories li > a:lang(kk), +.entry .entry-content .wp-block-latest-posts li > a:lang(kk), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(kk), .entry .entry-content .wp-block-verse:lang(kk), .entry .entry-content .has-drop-cap:lang(kk):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(kk), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(kk), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(kk), +.entry .entry-content .wp-block-cover-image h2:lang(kk), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(kk), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(kk), +.entry .entry-content .wp-block-cover h2:lang(kk), .entry .entry-content .wp-block-audio figcaption:lang(kk), +.entry .entry-content .wp-block-video figcaption:lang(kk), +.entry .entry-content .wp-block-image figcaption:lang(kk), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(kk), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(kk), .entry .entry-content .wp-block-file:lang(kk), .entry .entry-content .wp-block-file .wp-block-file__button:lang(kk), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(kk), .wp-caption-text:lang(kk), .gallery-caption:lang(kk) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(mk-MK), button:lang(mk-MK), +input:lang(mk-MK), +select:lang(mk-MK), +optgroup:lang(mk-MK), +textarea:lang(mk-MK), .author-description .author-link:lang(mk-MK), +.comment-metadata:lang(mk-MK), +.comment-reply-link:lang(mk-MK), +.comments-title:lang(mk-MK), +.comment-author .fn:lang(mk-MK), +.discussion-meta-info:lang(mk-MK), +.entry-meta:lang(mk-MK), +.entry-footer:lang(mk-MK), +.main-navigation:lang(mk-MK), +.no-comments:lang(mk-MK), +.not-found .page-title:lang(mk-MK), +.error-404 .page-title:lang(mk-MK), +.post-navigation .post-title:lang(mk-MK), +.page-links:lang(mk-MK), +.page-description:lang(mk-MK), +.pagination .nav-links:lang(mk-MK), +.sticky-post:lang(mk-MK), +.site-title:lang(mk-MK), +.site-info:lang(mk-MK), +#cancel-comment-reply-link:lang(mk-MK), +h1:lang(mk-MK), +h2:lang(mk-MK), +h3:lang(mk-MK), +h4:lang(mk-MK), +h5:lang(mk-MK), +h6:lang(mk-MK), .page-title:lang(mk-MK), blockquote cite:lang(mk-MK), table:lang(mk-MK), .button:lang(mk-MK), +input:lang(mk-MK)[type="button"], +input:lang(mk-MK)[type="reset"], +input:lang(mk-MK)[type="submit"], .comment-navigation .nav-previous:lang(mk-MK), +.comment-navigation .nav-next:lang(mk-MK), .comment-list .pingback .comment-body:lang(mk-MK), +.comment-list .trackback .comment-body:lang(mk-MK), .comment-list .pingback .comment-body .comment-edit-link:lang(mk-MK), +.comment-list .trackback .comment-body .comment-edit-link:lang(mk-MK), .comment-form .comment-notes:lang(mk-MK), +.comment-form label:lang(mk-MK), .widget_archive ul li:lang(mk-MK), +.widget_categories ul li:lang(mk-MK), +.widget_meta ul li:lang(mk-MK), +.widget_nav_menu ul li:lang(mk-MK), +.widget_pages ul li:lang(mk-MK), +.widget_recent_comments ul li:lang(mk-MK), +.widget_recent_entries ul li:lang(mk-MK), +.widget_rss ul li:lang(mk-MK), .widget_tag_cloud .tagcloud:lang(mk-MK), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(mk-MK), .entry .entry-content .wp-block-button .wp-block-button__link:lang(mk-MK), .entry .entry-content .wp-block-archives li > a:lang(mk-MK), +.entry .entry-content .wp-block-categories li > a:lang(mk-MK), +.entry .entry-content .wp-block-latest-posts li > a:lang(mk-MK), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(mk-MK), .entry .entry-content .wp-block-verse:lang(mk-MK), .entry .entry-content .has-drop-cap:lang(mk-MK):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(mk-MK), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(mk-MK), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(mk-MK), +.entry .entry-content .wp-block-cover-image h2:lang(mk-MK), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(mk-MK), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(mk-MK), +.entry .entry-content .wp-block-cover h2:lang(mk-MK), .entry .entry-content .wp-block-audio figcaption:lang(mk-MK), +.entry .entry-content .wp-block-video figcaption:lang(mk-MK), +.entry .entry-content .wp-block-image figcaption:lang(mk-MK), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(mk-MK), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(mk-MK), .entry .entry-content .wp-block-file:lang(mk-MK), .entry .entry-content .wp-block-file .wp-block-file__button:lang(mk-MK), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(mk-MK), .wp-caption-text:lang(mk-MK), .gallery-caption:lang(mk-MK) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(mn), button:lang(mn), +input:lang(mn), +select:lang(mn), +optgroup:lang(mn), +textarea:lang(mn), .author-description .author-link:lang(mn), +.comment-metadata:lang(mn), +.comment-reply-link:lang(mn), +.comments-title:lang(mn), +.comment-author .fn:lang(mn), +.discussion-meta-info:lang(mn), +.entry-meta:lang(mn), +.entry-footer:lang(mn), +.main-navigation:lang(mn), +.no-comments:lang(mn), +.not-found .page-title:lang(mn), +.error-404 .page-title:lang(mn), +.post-navigation .post-title:lang(mn), +.page-links:lang(mn), +.page-description:lang(mn), +.pagination .nav-links:lang(mn), +.sticky-post:lang(mn), +.site-title:lang(mn), +.site-info:lang(mn), +#cancel-comment-reply-link:lang(mn), +h1:lang(mn), +h2:lang(mn), +h3:lang(mn), +h4:lang(mn), +h5:lang(mn), +h6:lang(mn), .page-title:lang(mn), blockquote cite:lang(mn), table:lang(mn), .button:lang(mn), +input:lang(mn)[type="button"], +input:lang(mn)[type="reset"], +input:lang(mn)[type="submit"], .comment-navigation .nav-previous:lang(mn), +.comment-navigation .nav-next:lang(mn), .comment-list .pingback .comment-body:lang(mn), +.comment-list .trackback .comment-body:lang(mn), .comment-list .pingback .comment-body .comment-edit-link:lang(mn), +.comment-list .trackback .comment-body .comment-edit-link:lang(mn), .comment-form .comment-notes:lang(mn), +.comment-form label:lang(mn), .widget_archive ul li:lang(mn), +.widget_categories ul li:lang(mn), +.widget_meta ul li:lang(mn), +.widget_nav_menu ul li:lang(mn), +.widget_pages ul li:lang(mn), +.widget_recent_comments ul li:lang(mn), +.widget_recent_entries ul li:lang(mn), +.widget_rss ul li:lang(mn), .widget_tag_cloud .tagcloud:lang(mn), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(mn), .entry .entry-content .wp-block-button .wp-block-button__link:lang(mn), .entry .entry-content .wp-block-archives li > a:lang(mn), +.entry .entry-content .wp-block-categories li > a:lang(mn), +.entry .entry-content .wp-block-latest-posts li > a:lang(mn), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(mn), .entry .entry-content .wp-block-verse:lang(mn), .entry .entry-content .has-drop-cap:lang(mn):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(mn), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(mn), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(mn), +.entry .entry-content .wp-block-cover-image h2:lang(mn), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(mn), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(mn), +.entry .entry-content .wp-block-cover h2:lang(mn), .entry .entry-content .wp-block-audio figcaption:lang(mn), +.entry .entry-content .wp-block-video figcaption:lang(mn), +.entry .entry-content .wp-block-image figcaption:lang(mn), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(mn), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(mn), .entry .entry-content .wp-block-file:lang(mn), .entry .entry-content .wp-block-file .wp-block-file__button:lang(mn), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(mn), .wp-caption-text:lang(mn), .gallery-caption:lang(mn) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(ru-RU), button:lang(ru-RU), +input:lang(ru-RU), +select:lang(ru-RU), +optgroup:lang(ru-RU), +textarea:lang(ru-RU), .author-description .author-link:lang(ru-RU), +.comment-metadata:lang(ru-RU), +.comment-reply-link:lang(ru-RU), +.comments-title:lang(ru-RU), +.comment-author .fn:lang(ru-RU), +.discussion-meta-info:lang(ru-RU), +.entry-meta:lang(ru-RU), +.entry-footer:lang(ru-RU), +.main-navigation:lang(ru-RU), +.no-comments:lang(ru-RU), +.not-found .page-title:lang(ru-RU), +.error-404 .page-title:lang(ru-RU), +.post-navigation .post-title:lang(ru-RU), +.page-links:lang(ru-RU), +.page-description:lang(ru-RU), +.pagination .nav-links:lang(ru-RU), +.sticky-post:lang(ru-RU), +.site-title:lang(ru-RU), +.site-info:lang(ru-RU), +#cancel-comment-reply-link:lang(ru-RU), +h1:lang(ru-RU), +h2:lang(ru-RU), +h3:lang(ru-RU), +h4:lang(ru-RU), +h5:lang(ru-RU), +h6:lang(ru-RU), .page-title:lang(ru-RU), blockquote cite:lang(ru-RU), table:lang(ru-RU), .button:lang(ru-RU), +input:lang(ru-RU)[type="button"], +input:lang(ru-RU)[type="reset"], +input:lang(ru-RU)[type="submit"], .comment-navigation .nav-previous:lang(ru-RU), +.comment-navigation .nav-next:lang(ru-RU), .comment-list .pingback .comment-body:lang(ru-RU), +.comment-list .trackback .comment-body:lang(ru-RU), .comment-list .pingback .comment-body .comment-edit-link:lang(ru-RU), +.comment-list .trackback .comment-body .comment-edit-link:lang(ru-RU), .comment-form .comment-notes:lang(ru-RU), +.comment-form label:lang(ru-RU), .widget_archive ul li:lang(ru-RU), +.widget_categories ul li:lang(ru-RU), +.widget_meta ul li:lang(ru-RU), +.widget_nav_menu ul li:lang(ru-RU), +.widget_pages ul li:lang(ru-RU), +.widget_recent_comments ul li:lang(ru-RU), +.widget_recent_entries ul li:lang(ru-RU), +.widget_rss ul li:lang(ru-RU), .widget_tag_cloud .tagcloud:lang(ru-RU), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ru-RU), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ru-RU), .entry .entry-content .wp-block-archives li > a:lang(ru-RU), +.entry .entry-content .wp-block-categories li > a:lang(ru-RU), +.entry .entry-content .wp-block-latest-posts li > a:lang(ru-RU), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ru-RU), .entry .entry-content .wp-block-verse:lang(ru-RU), .entry .entry-content .has-drop-cap:lang(ru-RU):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ru-RU), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ru-RU), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ru-RU), +.entry .entry-content .wp-block-cover-image h2:lang(ru-RU), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ru-RU), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ru-RU), +.entry .entry-content .wp-block-cover h2:lang(ru-RU), .entry .entry-content .wp-block-audio figcaption:lang(ru-RU), +.entry .entry-content .wp-block-video figcaption:lang(ru-RU), +.entry .entry-content .wp-block-image figcaption:lang(ru-RU), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ru-RU), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ru-RU), .entry .entry-content .wp-block-file:lang(ru-RU), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ru-RU), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ru-RU), .wp-caption-text:lang(ru-RU), .gallery-caption:lang(ru-RU) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(sah), button:lang(sah), +input:lang(sah), +select:lang(sah), +optgroup:lang(sah), +textarea:lang(sah), .author-description .author-link:lang(sah), +.comment-metadata:lang(sah), +.comment-reply-link:lang(sah), +.comments-title:lang(sah), +.comment-author .fn:lang(sah), +.discussion-meta-info:lang(sah), +.entry-meta:lang(sah), +.entry-footer:lang(sah), +.main-navigation:lang(sah), +.no-comments:lang(sah), +.not-found .page-title:lang(sah), +.error-404 .page-title:lang(sah), +.post-navigation .post-title:lang(sah), +.page-links:lang(sah), +.page-description:lang(sah), +.pagination .nav-links:lang(sah), +.sticky-post:lang(sah), +.site-title:lang(sah), +.site-info:lang(sah), +#cancel-comment-reply-link:lang(sah), +h1:lang(sah), +h2:lang(sah), +h3:lang(sah), +h4:lang(sah), +h5:lang(sah), +h6:lang(sah), .page-title:lang(sah), blockquote cite:lang(sah), table:lang(sah), .button:lang(sah), +input:lang(sah)[type="button"], +input:lang(sah)[type="reset"], +input:lang(sah)[type="submit"], .comment-navigation .nav-previous:lang(sah), +.comment-navigation .nav-next:lang(sah), .comment-list .pingback .comment-body:lang(sah), +.comment-list .trackback .comment-body:lang(sah), .comment-list .pingback .comment-body .comment-edit-link:lang(sah), +.comment-list .trackback .comment-body .comment-edit-link:lang(sah), .comment-form .comment-notes:lang(sah), +.comment-form label:lang(sah), .widget_archive ul li:lang(sah), +.widget_categories ul li:lang(sah), +.widget_meta ul li:lang(sah), +.widget_nav_menu ul li:lang(sah), +.widget_pages ul li:lang(sah), +.widget_recent_comments ul li:lang(sah), +.widget_recent_entries ul li:lang(sah), +.widget_rss ul li:lang(sah), .widget_tag_cloud .tagcloud:lang(sah), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(sah), .entry .entry-content .wp-block-button .wp-block-button__link:lang(sah), .entry .entry-content .wp-block-archives li > a:lang(sah), +.entry .entry-content .wp-block-categories li > a:lang(sah), +.entry .entry-content .wp-block-latest-posts li > a:lang(sah), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(sah), .entry .entry-content .wp-block-verse:lang(sah), .entry .entry-content .has-drop-cap:lang(sah):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(sah), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(sah), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(sah), +.entry .entry-content .wp-block-cover-image h2:lang(sah), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(sah), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(sah), +.entry .entry-content .wp-block-cover h2:lang(sah), .entry .entry-content .wp-block-audio figcaption:lang(sah), +.entry .entry-content .wp-block-video figcaption:lang(sah), +.entry .entry-content .wp-block-image figcaption:lang(sah), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(sah), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(sah), .entry .entry-content .wp-block-file:lang(sah), .entry .entry-content .wp-block-file .wp-block-file__button:lang(sah), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(sah), .wp-caption-text:lang(sah), .gallery-caption:lang(sah) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(sr-RS), button:lang(sr-RS), +input:lang(sr-RS), +select:lang(sr-RS), +optgroup:lang(sr-RS), +textarea:lang(sr-RS), .author-description .author-link:lang(sr-RS), +.comment-metadata:lang(sr-RS), +.comment-reply-link:lang(sr-RS), +.comments-title:lang(sr-RS), +.comment-author .fn:lang(sr-RS), +.discussion-meta-info:lang(sr-RS), +.entry-meta:lang(sr-RS), +.entry-footer:lang(sr-RS), +.main-navigation:lang(sr-RS), +.no-comments:lang(sr-RS), +.not-found .page-title:lang(sr-RS), +.error-404 .page-title:lang(sr-RS), +.post-navigation .post-title:lang(sr-RS), +.page-links:lang(sr-RS), +.page-description:lang(sr-RS), +.pagination .nav-links:lang(sr-RS), +.sticky-post:lang(sr-RS), +.site-title:lang(sr-RS), +.site-info:lang(sr-RS), +#cancel-comment-reply-link:lang(sr-RS), +h1:lang(sr-RS), +h2:lang(sr-RS), +h3:lang(sr-RS), +h4:lang(sr-RS), +h5:lang(sr-RS), +h6:lang(sr-RS), .page-title:lang(sr-RS), blockquote cite:lang(sr-RS), table:lang(sr-RS), .button:lang(sr-RS), +input:lang(sr-RS)[type="button"], +input:lang(sr-RS)[type="reset"], +input:lang(sr-RS)[type="submit"], .comment-navigation .nav-previous:lang(sr-RS), +.comment-navigation .nav-next:lang(sr-RS), .comment-list .pingback .comment-body:lang(sr-RS), +.comment-list .trackback .comment-body:lang(sr-RS), .comment-list .pingback .comment-body .comment-edit-link:lang(sr-RS), +.comment-list .trackback .comment-body .comment-edit-link:lang(sr-RS), .comment-form .comment-notes:lang(sr-RS), +.comment-form label:lang(sr-RS), .widget_archive ul li:lang(sr-RS), +.widget_categories ul li:lang(sr-RS), +.widget_meta ul li:lang(sr-RS), +.widget_nav_menu ul li:lang(sr-RS), +.widget_pages ul li:lang(sr-RS), +.widget_recent_comments ul li:lang(sr-RS), +.widget_recent_entries ul li:lang(sr-RS), +.widget_rss ul li:lang(sr-RS), .widget_tag_cloud .tagcloud:lang(sr-RS), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(sr-RS), .entry .entry-content .wp-block-button .wp-block-button__link:lang(sr-RS), .entry .entry-content .wp-block-archives li > a:lang(sr-RS), +.entry .entry-content .wp-block-categories li > a:lang(sr-RS), +.entry .entry-content .wp-block-latest-posts li > a:lang(sr-RS), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(sr-RS), .entry .entry-content .wp-block-verse:lang(sr-RS), .entry .entry-content .has-drop-cap:lang(sr-RS):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(sr-RS), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(sr-RS), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(sr-RS), +.entry .entry-content .wp-block-cover-image h2:lang(sr-RS), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(sr-RS), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(sr-RS), +.entry .entry-content .wp-block-cover h2:lang(sr-RS), .entry .entry-content .wp-block-audio figcaption:lang(sr-RS), +.entry .entry-content .wp-block-video figcaption:lang(sr-RS), +.entry .entry-content .wp-block-image figcaption:lang(sr-RS), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(sr-RS), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(sr-RS), .entry .entry-content .wp-block-file:lang(sr-RS), .entry .entry-content .wp-block-file .wp-block-file__button:lang(sr-RS), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(sr-RS), .wp-caption-text:lang(sr-RS), .gallery-caption:lang(sr-RS) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(tt-RU), button:lang(tt-RU), +input:lang(tt-RU), +select:lang(tt-RU), +optgroup:lang(tt-RU), +textarea:lang(tt-RU), .author-description .author-link:lang(tt-RU), +.comment-metadata:lang(tt-RU), +.comment-reply-link:lang(tt-RU), +.comments-title:lang(tt-RU), +.comment-author .fn:lang(tt-RU), +.discussion-meta-info:lang(tt-RU), +.entry-meta:lang(tt-RU), +.entry-footer:lang(tt-RU), +.main-navigation:lang(tt-RU), +.no-comments:lang(tt-RU), +.not-found .page-title:lang(tt-RU), +.error-404 .page-title:lang(tt-RU), +.post-navigation .post-title:lang(tt-RU), +.page-links:lang(tt-RU), +.page-description:lang(tt-RU), +.pagination .nav-links:lang(tt-RU), +.sticky-post:lang(tt-RU), +.site-title:lang(tt-RU), +.site-info:lang(tt-RU), +#cancel-comment-reply-link:lang(tt-RU), +h1:lang(tt-RU), +h2:lang(tt-RU), +h3:lang(tt-RU), +h4:lang(tt-RU), +h5:lang(tt-RU), +h6:lang(tt-RU), .page-title:lang(tt-RU), blockquote cite:lang(tt-RU), table:lang(tt-RU), .button:lang(tt-RU), +input:lang(tt-RU)[type="button"], +input:lang(tt-RU)[type="reset"], +input:lang(tt-RU)[type="submit"], .comment-navigation .nav-previous:lang(tt-RU), +.comment-navigation .nav-next:lang(tt-RU), .comment-list .pingback .comment-body:lang(tt-RU), +.comment-list .trackback .comment-body:lang(tt-RU), .comment-list .pingback .comment-body .comment-edit-link:lang(tt-RU), +.comment-list .trackback .comment-body .comment-edit-link:lang(tt-RU), .comment-form .comment-notes:lang(tt-RU), +.comment-form label:lang(tt-RU), .widget_archive ul li:lang(tt-RU), +.widget_categories ul li:lang(tt-RU), +.widget_meta ul li:lang(tt-RU), +.widget_nav_menu ul li:lang(tt-RU), +.widget_pages ul li:lang(tt-RU), +.widget_recent_comments ul li:lang(tt-RU), +.widget_recent_entries ul li:lang(tt-RU), +.widget_rss ul li:lang(tt-RU), .widget_tag_cloud .tagcloud:lang(tt-RU), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(tt-RU), .entry .entry-content .wp-block-button .wp-block-button__link:lang(tt-RU), .entry .entry-content .wp-block-archives li > a:lang(tt-RU), +.entry .entry-content .wp-block-categories li > a:lang(tt-RU), +.entry .entry-content .wp-block-latest-posts li > a:lang(tt-RU), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(tt-RU), .entry .entry-content .wp-block-verse:lang(tt-RU), .entry .entry-content .has-drop-cap:lang(tt-RU):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(tt-RU), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(tt-RU), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(tt-RU), +.entry .entry-content .wp-block-cover-image h2:lang(tt-RU), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(tt-RU), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(tt-RU), +.entry .entry-content .wp-block-cover h2:lang(tt-RU), .entry .entry-content .wp-block-audio figcaption:lang(tt-RU), +.entry .entry-content .wp-block-video figcaption:lang(tt-RU), +.entry .entry-content .wp-block-image figcaption:lang(tt-RU), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(tt-RU), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(tt-RU), .entry .entry-content .wp-block-file:lang(tt-RU), .entry .entry-content .wp-block-file .wp-block-file__button:lang(tt-RU), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(tt-RU), .wp-caption-text:lang(tt-RU), .gallery-caption:lang(tt-RU) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(uk), button:lang(uk), +input:lang(uk), +select:lang(uk), +optgroup:lang(uk), +textarea:lang(uk), .author-description .author-link:lang(uk), +.comment-metadata:lang(uk), +.comment-reply-link:lang(uk), +.comments-title:lang(uk), +.comment-author .fn:lang(uk), +.discussion-meta-info:lang(uk), +.entry-meta:lang(uk), +.entry-footer:lang(uk), +.main-navigation:lang(uk), +.no-comments:lang(uk), +.not-found .page-title:lang(uk), +.error-404 .page-title:lang(uk), +.post-navigation .post-title:lang(uk), +.page-links:lang(uk), +.page-description:lang(uk), +.pagination .nav-links:lang(uk), +.sticky-post:lang(uk), +.site-title:lang(uk), +.site-info:lang(uk), +#cancel-comment-reply-link:lang(uk), +h1:lang(uk), +h2:lang(uk), +h3:lang(uk), +h4:lang(uk), +h5:lang(uk), +h6:lang(uk), .page-title:lang(uk), blockquote cite:lang(uk), table:lang(uk), .button:lang(uk), +input:lang(uk)[type="button"], +input:lang(uk)[type="reset"], +input:lang(uk)[type="submit"], .comment-navigation .nav-previous:lang(uk), +.comment-navigation .nav-next:lang(uk), .comment-list .pingback .comment-body:lang(uk), +.comment-list .trackback .comment-body:lang(uk), .comment-list .pingback .comment-body .comment-edit-link:lang(uk), +.comment-list .trackback .comment-body .comment-edit-link:lang(uk), .comment-form .comment-notes:lang(uk), +.comment-form label:lang(uk), .widget_archive ul li:lang(uk), +.widget_categories ul li:lang(uk), +.widget_meta ul li:lang(uk), +.widget_nav_menu ul li:lang(uk), +.widget_pages ul li:lang(uk), +.widget_recent_comments ul li:lang(uk), +.widget_recent_entries ul li:lang(uk), +.widget_rss ul li:lang(uk), .widget_tag_cloud .tagcloud:lang(uk), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(uk), .entry .entry-content .wp-block-button .wp-block-button__link:lang(uk), .entry .entry-content .wp-block-archives li > a:lang(uk), +.entry .entry-content .wp-block-categories li > a:lang(uk), +.entry .entry-content .wp-block-latest-posts li > a:lang(uk), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(uk), .entry .entry-content .wp-block-verse:lang(uk), .entry .entry-content .has-drop-cap:lang(uk):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(uk), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(uk), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(uk), +.entry .entry-content .wp-block-cover-image h2:lang(uk), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(uk), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(uk), +.entry .entry-content .wp-block-cover h2:lang(uk), .entry .entry-content .wp-block-audio figcaption:lang(uk), +.entry .entry-content .wp-block-video figcaption:lang(uk), +.entry .entry-content .wp-block-image figcaption:lang(uk), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(uk), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(uk), .entry .entry-content .wp-block-file:lang(uk), .entry .entry-content .wp-block-file .wp-block-file__button:lang(uk), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(uk), .wp-caption-text:lang(uk), .gallery-caption:lang(uk) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(zh-HK), button:lang(zh-HK), +input:lang(zh-HK), +select:lang(zh-HK), +optgroup:lang(zh-HK), +textarea:lang(zh-HK), .author-description .author-link:lang(zh-HK), +.comment-metadata:lang(zh-HK), +.comment-reply-link:lang(zh-HK), +.comments-title:lang(zh-HK), +.comment-author .fn:lang(zh-HK), +.discussion-meta-info:lang(zh-HK), +.entry-meta:lang(zh-HK), +.entry-footer:lang(zh-HK), +.main-navigation:lang(zh-HK), +.no-comments:lang(zh-HK), +.not-found .page-title:lang(zh-HK), +.error-404 .page-title:lang(zh-HK), +.post-navigation .post-title:lang(zh-HK), +.page-links:lang(zh-HK), +.page-description:lang(zh-HK), +.pagination .nav-links:lang(zh-HK), +.sticky-post:lang(zh-HK), +.site-title:lang(zh-HK), +.site-info:lang(zh-HK), +#cancel-comment-reply-link:lang(zh-HK), +h1:lang(zh-HK), +h2:lang(zh-HK), +h3:lang(zh-HK), +h4:lang(zh-HK), +h5:lang(zh-HK), +h6:lang(zh-HK), .page-title:lang(zh-HK), blockquote cite:lang(zh-HK), table:lang(zh-HK), .button:lang(zh-HK), +input:lang(zh-HK)[type="button"], +input:lang(zh-HK)[type="reset"], +input:lang(zh-HK)[type="submit"], .comment-navigation .nav-previous:lang(zh-HK), +.comment-navigation .nav-next:lang(zh-HK), .comment-list .pingback .comment-body:lang(zh-HK), +.comment-list .trackback .comment-body:lang(zh-HK), .comment-list .pingback .comment-body .comment-edit-link:lang(zh-HK), +.comment-list .trackback .comment-body .comment-edit-link:lang(zh-HK), .comment-form .comment-notes:lang(zh-HK), +.comment-form label:lang(zh-HK), .widget_archive ul li:lang(zh-HK), +.widget_categories ul li:lang(zh-HK), +.widget_meta ul li:lang(zh-HK), +.widget_nav_menu ul li:lang(zh-HK), +.widget_pages ul li:lang(zh-HK), +.widget_recent_comments ul li:lang(zh-HK), +.widget_recent_entries ul li:lang(zh-HK), +.widget_rss ul li:lang(zh-HK), .widget_tag_cloud .tagcloud:lang(zh-HK), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(zh-HK), .entry .entry-content .wp-block-button .wp-block-button__link:lang(zh-HK), .entry .entry-content .wp-block-archives li > a:lang(zh-HK), +.entry .entry-content .wp-block-categories li > a:lang(zh-HK), +.entry .entry-content .wp-block-latest-posts li > a:lang(zh-HK), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(zh-HK), .entry .entry-content .wp-block-verse:lang(zh-HK), .entry .entry-content .has-drop-cap:lang(zh-HK):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(zh-HK), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(zh-HK), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(zh-HK), +.entry .entry-content .wp-block-cover-image h2:lang(zh-HK), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(zh-HK), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(zh-HK), +.entry .entry-content .wp-block-cover h2:lang(zh-HK), .entry .entry-content .wp-block-audio figcaption:lang(zh-HK), +.entry .entry-content .wp-block-video figcaption:lang(zh-HK), +.entry .entry-content .wp-block-image figcaption:lang(zh-HK), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(zh-HK), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(zh-HK), .entry .entry-content .wp-block-file:lang(zh-HK), .entry .entry-content .wp-block-file .wp-block-file__button:lang(zh-HK), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(zh-HK), .wp-caption-text:lang(zh-HK), .gallery-caption:lang(zh-HK) { + font-family: -apple-system, BlinkMacSystemFont, "PingFang HK", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif; +} + +body:lang(zh-TW), button:lang(zh-TW), +input:lang(zh-TW), +select:lang(zh-TW), +optgroup:lang(zh-TW), +textarea:lang(zh-TW), .author-description .author-link:lang(zh-TW), +.comment-metadata:lang(zh-TW), +.comment-reply-link:lang(zh-TW), +.comments-title:lang(zh-TW), +.comment-author .fn:lang(zh-TW), +.discussion-meta-info:lang(zh-TW), +.entry-meta:lang(zh-TW), +.entry-footer:lang(zh-TW), +.main-navigation:lang(zh-TW), +.no-comments:lang(zh-TW), +.not-found .page-title:lang(zh-TW), +.error-404 .page-title:lang(zh-TW), +.post-navigation .post-title:lang(zh-TW), +.page-links:lang(zh-TW), +.page-description:lang(zh-TW), +.pagination .nav-links:lang(zh-TW), +.sticky-post:lang(zh-TW), +.site-title:lang(zh-TW), +.site-info:lang(zh-TW), +#cancel-comment-reply-link:lang(zh-TW), +h1:lang(zh-TW), +h2:lang(zh-TW), +h3:lang(zh-TW), +h4:lang(zh-TW), +h5:lang(zh-TW), +h6:lang(zh-TW), .page-title:lang(zh-TW), blockquote cite:lang(zh-TW), table:lang(zh-TW), .button:lang(zh-TW), +input:lang(zh-TW)[type="button"], +input:lang(zh-TW)[type="reset"], +input:lang(zh-TW)[type="submit"], .comment-navigation .nav-previous:lang(zh-TW), +.comment-navigation .nav-next:lang(zh-TW), .comment-list .pingback .comment-body:lang(zh-TW), +.comment-list .trackback .comment-body:lang(zh-TW), .comment-list .pingback .comment-body .comment-edit-link:lang(zh-TW), +.comment-list .trackback .comment-body .comment-edit-link:lang(zh-TW), .comment-form .comment-notes:lang(zh-TW), +.comment-form label:lang(zh-TW), .widget_archive ul li:lang(zh-TW), +.widget_categories ul li:lang(zh-TW), +.widget_meta ul li:lang(zh-TW), +.widget_nav_menu ul li:lang(zh-TW), +.widget_pages ul li:lang(zh-TW), +.widget_recent_comments ul li:lang(zh-TW), +.widget_recent_entries ul li:lang(zh-TW), +.widget_rss ul li:lang(zh-TW), .widget_tag_cloud .tagcloud:lang(zh-TW), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(zh-TW), .entry .entry-content .wp-block-button .wp-block-button__link:lang(zh-TW), .entry .entry-content .wp-block-archives li > a:lang(zh-TW), +.entry .entry-content .wp-block-categories li > a:lang(zh-TW), +.entry .entry-content .wp-block-latest-posts li > a:lang(zh-TW), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(zh-TW), .entry .entry-content .wp-block-verse:lang(zh-TW), .entry .entry-content .has-drop-cap:lang(zh-TW):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(zh-TW), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(zh-TW), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(zh-TW), +.entry .entry-content .wp-block-cover-image h2:lang(zh-TW), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(zh-TW), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(zh-TW), +.entry .entry-content .wp-block-cover h2:lang(zh-TW), .entry .entry-content .wp-block-audio figcaption:lang(zh-TW), +.entry .entry-content .wp-block-video figcaption:lang(zh-TW), +.entry .entry-content .wp-block-image figcaption:lang(zh-TW), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(zh-TW), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(zh-TW), .entry .entry-content .wp-block-file:lang(zh-TW), .entry .entry-content .wp-block-file .wp-block-file__button:lang(zh-TW), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(zh-TW), .wp-caption-text:lang(zh-TW), .gallery-caption:lang(zh-TW) { + font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif; +} + +body:lang(zh-CN), button:lang(zh-CN), +input:lang(zh-CN), +select:lang(zh-CN), +optgroup:lang(zh-CN), +textarea:lang(zh-CN), .author-description .author-link:lang(zh-CN), +.comment-metadata:lang(zh-CN), +.comment-reply-link:lang(zh-CN), +.comments-title:lang(zh-CN), +.comment-author .fn:lang(zh-CN), +.discussion-meta-info:lang(zh-CN), +.entry-meta:lang(zh-CN), +.entry-footer:lang(zh-CN), +.main-navigation:lang(zh-CN), +.no-comments:lang(zh-CN), +.not-found .page-title:lang(zh-CN), +.error-404 .page-title:lang(zh-CN), +.post-navigation .post-title:lang(zh-CN), +.page-links:lang(zh-CN), +.page-description:lang(zh-CN), +.pagination .nav-links:lang(zh-CN), +.sticky-post:lang(zh-CN), +.site-title:lang(zh-CN), +.site-info:lang(zh-CN), +#cancel-comment-reply-link:lang(zh-CN), +h1:lang(zh-CN), +h2:lang(zh-CN), +h3:lang(zh-CN), +h4:lang(zh-CN), +h5:lang(zh-CN), +h6:lang(zh-CN), .page-title:lang(zh-CN), blockquote cite:lang(zh-CN), table:lang(zh-CN), .button:lang(zh-CN), +input:lang(zh-CN)[type="button"], +input:lang(zh-CN)[type="reset"], +input:lang(zh-CN)[type="submit"], .comment-navigation .nav-previous:lang(zh-CN), +.comment-navigation .nav-next:lang(zh-CN), .comment-list .pingback .comment-body:lang(zh-CN), +.comment-list .trackback .comment-body:lang(zh-CN), .comment-list .pingback .comment-body .comment-edit-link:lang(zh-CN), +.comment-list .trackback .comment-body .comment-edit-link:lang(zh-CN), .comment-form .comment-notes:lang(zh-CN), +.comment-form label:lang(zh-CN), .widget_archive ul li:lang(zh-CN), +.widget_categories ul li:lang(zh-CN), +.widget_meta ul li:lang(zh-CN), +.widget_nav_menu ul li:lang(zh-CN), +.widget_pages ul li:lang(zh-CN), +.widget_recent_comments ul li:lang(zh-CN), +.widget_recent_entries ul li:lang(zh-CN), +.widget_rss ul li:lang(zh-CN), .widget_tag_cloud .tagcloud:lang(zh-CN), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(zh-CN), .entry .entry-content .wp-block-button .wp-block-button__link:lang(zh-CN), .entry .entry-content .wp-block-archives li > a:lang(zh-CN), +.entry .entry-content .wp-block-categories li > a:lang(zh-CN), +.entry .entry-content .wp-block-latest-posts li > a:lang(zh-CN), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(zh-CN), .entry .entry-content .wp-block-verse:lang(zh-CN), .entry .entry-content .has-drop-cap:lang(zh-CN):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(zh-CN), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(zh-CN), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(zh-CN), +.entry .entry-content .wp-block-cover-image h2:lang(zh-CN), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(zh-CN), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(zh-CN), +.entry .entry-content .wp-block-cover h2:lang(zh-CN), .entry .entry-content .wp-block-audio figcaption:lang(zh-CN), +.entry .entry-content .wp-block-video figcaption:lang(zh-CN), +.entry .entry-content .wp-block-image figcaption:lang(zh-CN), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(zh-CN), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(zh-CN), .entry .entry-content .wp-block-file:lang(zh-CN), .entry .entry-content .wp-block-file .wp-block-file__button:lang(zh-CN), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(zh-CN), .wp-caption-text:lang(zh-CN), .gallery-caption:lang(zh-CN) { + font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif; +} + +body:lang(bn-BD), button:lang(bn-BD), +input:lang(bn-BD), +select:lang(bn-BD), +optgroup:lang(bn-BD), +textarea:lang(bn-BD), .author-description .author-link:lang(bn-BD), +.comment-metadata:lang(bn-BD), +.comment-reply-link:lang(bn-BD), +.comments-title:lang(bn-BD), +.comment-author .fn:lang(bn-BD), +.discussion-meta-info:lang(bn-BD), +.entry-meta:lang(bn-BD), +.entry-footer:lang(bn-BD), +.main-navigation:lang(bn-BD), +.no-comments:lang(bn-BD), +.not-found .page-title:lang(bn-BD), +.error-404 .page-title:lang(bn-BD), +.post-navigation .post-title:lang(bn-BD), +.page-links:lang(bn-BD), +.page-description:lang(bn-BD), +.pagination .nav-links:lang(bn-BD), +.sticky-post:lang(bn-BD), +.site-title:lang(bn-BD), +.site-info:lang(bn-BD), +#cancel-comment-reply-link:lang(bn-BD), +h1:lang(bn-BD), +h2:lang(bn-BD), +h3:lang(bn-BD), +h4:lang(bn-BD), +h5:lang(bn-BD), +h6:lang(bn-BD), .page-title:lang(bn-BD), blockquote cite:lang(bn-BD), table:lang(bn-BD), .button:lang(bn-BD), +input:lang(bn-BD)[type="button"], +input:lang(bn-BD)[type="reset"], +input:lang(bn-BD)[type="submit"], .comment-navigation .nav-previous:lang(bn-BD), +.comment-navigation .nav-next:lang(bn-BD), .comment-list .pingback .comment-body:lang(bn-BD), +.comment-list .trackback .comment-body:lang(bn-BD), .comment-list .pingback .comment-body .comment-edit-link:lang(bn-BD), +.comment-list .trackback .comment-body .comment-edit-link:lang(bn-BD), .comment-form .comment-notes:lang(bn-BD), +.comment-form label:lang(bn-BD), .widget_archive ul li:lang(bn-BD), +.widget_categories ul li:lang(bn-BD), +.widget_meta ul li:lang(bn-BD), +.widget_nav_menu ul li:lang(bn-BD), +.widget_pages ul li:lang(bn-BD), +.widget_recent_comments ul li:lang(bn-BD), +.widget_recent_entries ul li:lang(bn-BD), +.widget_rss ul li:lang(bn-BD), .widget_tag_cloud .tagcloud:lang(bn-BD), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(bn-BD), .entry .entry-content .wp-block-button .wp-block-button__link:lang(bn-BD), .entry .entry-content .wp-block-archives li > a:lang(bn-BD), +.entry .entry-content .wp-block-categories li > a:lang(bn-BD), +.entry .entry-content .wp-block-latest-posts li > a:lang(bn-BD), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(bn-BD), .entry .entry-content .wp-block-verse:lang(bn-BD), .entry .entry-content .has-drop-cap:lang(bn-BD):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(bn-BD), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(bn-BD), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(bn-BD), +.entry .entry-content .wp-block-cover-image h2:lang(bn-BD), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(bn-BD), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(bn-BD), +.entry .entry-content .wp-block-cover h2:lang(bn-BD), .entry .entry-content .wp-block-audio figcaption:lang(bn-BD), +.entry .entry-content .wp-block-video figcaption:lang(bn-BD), +.entry .entry-content .wp-block-image figcaption:lang(bn-BD), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(bn-BD), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(bn-BD), .entry .entry-content .wp-block-file:lang(bn-BD), .entry .entry-content .wp-block-file .wp-block-file__button:lang(bn-BD), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(bn-BD), .wp-caption-text:lang(bn-BD), .gallery-caption:lang(bn-BD) { + font-family: Arial, sans-serif; +} + +body:lang(hi-IN), button:lang(hi-IN), +input:lang(hi-IN), +select:lang(hi-IN), +optgroup:lang(hi-IN), +textarea:lang(hi-IN), .author-description .author-link:lang(hi-IN), +.comment-metadata:lang(hi-IN), +.comment-reply-link:lang(hi-IN), +.comments-title:lang(hi-IN), +.comment-author .fn:lang(hi-IN), +.discussion-meta-info:lang(hi-IN), +.entry-meta:lang(hi-IN), +.entry-footer:lang(hi-IN), +.main-navigation:lang(hi-IN), +.no-comments:lang(hi-IN), +.not-found .page-title:lang(hi-IN), +.error-404 .page-title:lang(hi-IN), +.post-navigation .post-title:lang(hi-IN), +.page-links:lang(hi-IN), +.page-description:lang(hi-IN), +.pagination .nav-links:lang(hi-IN), +.sticky-post:lang(hi-IN), +.site-title:lang(hi-IN), +.site-info:lang(hi-IN), +#cancel-comment-reply-link:lang(hi-IN), +h1:lang(hi-IN), +h2:lang(hi-IN), +h3:lang(hi-IN), +h4:lang(hi-IN), +h5:lang(hi-IN), +h6:lang(hi-IN), .page-title:lang(hi-IN), blockquote cite:lang(hi-IN), table:lang(hi-IN), .button:lang(hi-IN), +input:lang(hi-IN)[type="button"], +input:lang(hi-IN)[type="reset"], +input:lang(hi-IN)[type="submit"], .comment-navigation .nav-previous:lang(hi-IN), +.comment-navigation .nav-next:lang(hi-IN), .comment-list .pingback .comment-body:lang(hi-IN), +.comment-list .trackback .comment-body:lang(hi-IN), .comment-list .pingback .comment-body .comment-edit-link:lang(hi-IN), +.comment-list .trackback .comment-body .comment-edit-link:lang(hi-IN), .comment-form .comment-notes:lang(hi-IN), +.comment-form label:lang(hi-IN), .widget_archive ul li:lang(hi-IN), +.widget_categories ul li:lang(hi-IN), +.widget_meta ul li:lang(hi-IN), +.widget_nav_menu ul li:lang(hi-IN), +.widget_pages ul li:lang(hi-IN), +.widget_recent_comments ul li:lang(hi-IN), +.widget_recent_entries ul li:lang(hi-IN), +.widget_rss ul li:lang(hi-IN), .widget_tag_cloud .tagcloud:lang(hi-IN), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(hi-IN), .entry .entry-content .wp-block-button .wp-block-button__link:lang(hi-IN), .entry .entry-content .wp-block-archives li > a:lang(hi-IN), +.entry .entry-content .wp-block-categories li > a:lang(hi-IN), +.entry .entry-content .wp-block-latest-posts li > a:lang(hi-IN), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(hi-IN), .entry .entry-content .wp-block-verse:lang(hi-IN), .entry .entry-content .has-drop-cap:lang(hi-IN):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(hi-IN), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(hi-IN), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(hi-IN), +.entry .entry-content .wp-block-cover-image h2:lang(hi-IN), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(hi-IN), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(hi-IN), +.entry .entry-content .wp-block-cover h2:lang(hi-IN), .entry .entry-content .wp-block-audio figcaption:lang(hi-IN), +.entry .entry-content .wp-block-video figcaption:lang(hi-IN), +.entry .entry-content .wp-block-image figcaption:lang(hi-IN), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(hi-IN), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(hi-IN), .entry .entry-content .wp-block-file:lang(hi-IN), .entry .entry-content .wp-block-file .wp-block-file__button:lang(hi-IN), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(hi-IN), .wp-caption-text:lang(hi-IN), .gallery-caption:lang(hi-IN) { + font-family: Arial, sans-serif; +} + +body:lang(mr), button:lang(mr), +input:lang(mr), +select:lang(mr), +optgroup:lang(mr), +textarea:lang(mr), .author-description .author-link:lang(mr), +.comment-metadata:lang(mr), +.comment-reply-link:lang(mr), +.comments-title:lang(mr), +.comment-author .fn:lang(mr), +.discussion-meta-info:lang(mr), +.entry-meta:lang(mr), +.entry-footer:lang(mr), +.main-navigation:lang(mr), +.no-comments:lang(mr), +.not-found .page-title:lang(mr), +.error-404 .page-title:lang(mr), +.post-navigation .post-title:lang(mr), +.page-links:lang(mr), +.page-description:lang(mr), +.pagination .nav-links:lang(mr), +.sticky-post:lang(mr), +.site-title:lang(mr), +.site-info:lang(mr), +#cancel-comment-reply-link:lang(mr), +h1:lang(mr), +h2:lang(mr), +h3:lang(mr), +h4:lang(mr), +h5:lang(mr), +h6:lang(mr), .page-title:lang(mr), blockquote cite:lang(mr), table:lang(mr), .button:lang(mr), +input:lang(mr)[type="button"], +input:lang(mr)[type="reset"], +input:lang(mr)[type="submit"], .comment-navigation .nav-previous:lang(mr), +.comment-navigation .nav-next:lang(mr), .comment-list .pingback .comment-body:lang(mr), +.comment-list .trackback .comment-body:lang(mr), .comment-list .pingback .comment-body .comment-edit-link:lang(mr), +.comment-list .trackback .comment-body .comment-edit-link:lang(mr), .comment-form .comment-notes:lang(mr), +.comment-form label:lang(mr), .widget_archive ul li:lang(mr), +.widget_categories ul li:lang(mr), +.widget_meta ul li:lang(mr), +.widget_nav_menu ul li:lang(mr), +.widget_pages ul li:lang(mr), +.widget_recent_comments ul li:lang(mr), +.widget_recent_entries ul li:lang(mr), +.widget_rss ul li:lang(mr), .widget_tag_cloud .tagcloud:lang(mr), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(mr), .entry .entry-content .wp-block-button .wp-block-button__link:lang(mr), .entry .entry-content .wp-block-archives li > a:lang(mr), +.entry .entry-content .wp-block-categories li > a:lang(mr), +.entry .entry-content .wp-block-latest-posts li > a:lang(mr), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(mr), .entry .entry-content .wp-block-verse:lang(mr), .entry .entry-content .has-drop-cap:lang(mr):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(mr), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(mr), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(mr), +.entry .entry-content .wp-block-cover-image h2:lang(mr), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(mr), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(mr), +.entry .entry-content .wp-block-cover h2:lang(mr), .entry .entry-content .wp-block-audio figcaption:lang(mr), +.entry .entry-content .wp-block-video figcaption:lang(mr), +.entry .entry-content .wp-block-image figcaption:lang(mr), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(mr), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(mr), .entry .entry-content .wp-block-file:lang(mr), .entry .entry-content .wp-block-file .wp-block-file__button:lang(mr), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(mr), .wp-caption-text:lang(mr), .gallery-caption:lang(mr) { + font-family: Arial, sans-serif; +} + +body:lang(ne-NP), button:lang(ne-NP), +input:lang(ne-NP), +select:lang(ne-NP), +optgroup:lang(ne-NP), +textarea:lang(ne-NP), .author-description .author-link:lang(ne-NP), +.comment-metadata:lang(ne-NP), +.comment-reply-link:lang(ne-NP), +.comments-title:lang(ne-NP), +.comment-author .fn:lang(ne-NP), +.discussion-meta-info:lang(ne-NP), +.entry-meta:lang(ne-NP), +.entry-footer:lang(ne-NP), +.main-navigation:lang(ne-NP), +.no-comments:lang(ne-NP), +.not-found .page-title:lang(ne-NP), +.error-404 .page-title:lang(ne-NP), +.post-navigation .post-title:lang(ne-NP), +.page-links:lang(ne-NP), +.page-description:lang(ne-NP), +.pagination .nav-links:lang(ne-NP), +.sticky-post:lang(ne-NP), +.site-title:lang(ne-NP), +.site-info:lang(ne-NP), +#cancel-comment-reply-link:lang(ne-NP), +h1:lang(ne-NP), +h2:lang(ne-NP), +h3:lang(ne-NP), +h4:lang(ne-NP), +h5:lang(ne-NP), +h6:lang(ne-NP), .page-title:lang(ne-NP), blockquote cite:lang(ne-NP), table:lang(ne-NP), .button:lang(ne-NP), +input:lang(ne-NP)[type="button"], +input:lang(ne-NP)[type="reset"], +input:lang(ne-NP)[type="submit"], .comment-navigation .nav-previous:lang(ne-NP), +.comment-navigation .nav-next:lang(ne-NP), .comment-list .pingback .comment-body:lang(ne-NP), +.comment-list .trackback .comment-body:lang(ne-NP), .comment-list .pingback .comment-body .comment-edit-link:lang(ne-NP), +.comment-list .trackback .comment-body .comment-edit-link:lang(ne-NP), .comment-form .comment-notes:lang(ne-NP), +.comment-form label:lang(ne-NP), .widget_archive ul li:lang(ne-NP), +.widget_categories ul li:lang(ne-NP), +.widget_meta ul li:lang(ne-NP), +.widget_nav_menu ul li:lang(ne-NP), +.widget_pages ul li:lang(ne-NP), +.widget_recent_comments ul li:lang(ne-NP), +.widget_recent_entries ul li:lang(ne-NP), +.widget_rss ul li:lang(ne-NP), .widget_tag_cloud .tagcloud:lang(ne-NP), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ne-NP), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ne-NP), .entry .entry-content .wp-block-archives li > a:lang(ne-NP), +.entry .entry-content .wp-block-categories li > a:lang(ne-NP), +.entry .entry-content .wp-block-latest-posts li > a:lang(ne-NP), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ne-NP), .entry .entry-content .wp-block-verse:lang(ne-NP), .entry .entry-content .has-drop-cap:lang(ne-NP):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ne-NP), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ne-NP), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ne-NP), +.entry .entry-content .wp-block-cover-image h2:lang(ne-NP), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ne-NP), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ne-NP), +.entry .entry-content .wp-block-cover h2:lang(ne-NP), .entry .entry-content .wp-block-audio figcaption:lang(ne-NP), +.entry .entry-content .wp-block-video figcaption:lang(ne-NP), +.entry .entry-content .wp-block-image figcaption:lang(ne-NP), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ne-NP), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ne-NP), .entry .entry-content .wp-block-file:lang(ne-NP), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ne-NP), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ne-NP), .wp-caption-text:lang(ne-NP), .gallery-caption:lang(ne-NP) { + font-family: Arial, sans-serif; +} + +body:lang(el), button:lang(el), +input:lang(el), +select:lang(el), +optgroup:lang(el), +textarea:lang(el), .author-description .author-link:lang(el), +.comment-metadata:lang(el), +.comment-reply-link:lang(el), +.comments-title:lang(el), +.comment-author .fn:lang(el), +.discussion-meta-info:lang(el), +.entry-meta:lang(el), +.entry-footer:lang(el), +.main-navigation:lang(el), +.no-comments:lang(el), +.not-found .page-title:lang(el), +.error-404 .page-title:lang(el), +.post-navigation .post-title:lang(el), +.page-links:lang(el), +.page-description:lang(el), +.pagination .nav-links:lang(el), +.sticky-post:lang(el), +.site-title:lang(el), +.site-info:lang(el), +#cancel-comment-reply-link:lang(el), +h1:lang(el), +h2:lang(el), +h3:lang(el), +h4:lang(el), +h5:lang(el), +h6:lang(el), .page-title:lang(el), blockquote cite:lang(el), table:lang(el), .button:lang(el), +input:lang(el)[type="button"], +input:lang(el)[type="reset"], +input:lang(el)[type="submit"], .comment-navigation .nav-previous:lang(el), +.comment-navigation .nav-next:lang(el), .comment-list .pingback .comment-body:lang(el), +.comment-list .trackback .comment-body:lang(el), .comment-list .pingback .comment-body .comment-edit-link:lang(el), +.comment-list .trackback .comment-body .comment-edit-link:lang(el), .comment-form .comment-notes:lang(el), +.comment-form label:lang(el), .widget_archive ul li:lang(el), +.widget_categories ul li:lang(el), +.widget_meta ul li:lang(el), +.widget_nav_menu ul li:lang(el), +.widget_pages ul li:lang(el), +.widget_recent_comments ul li:lang(el), +.widget_recent_entries ul li:lang(el), +.widget_rss ul li:lang(el), .widget_tag_cloud .tagcloud:lang(el), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(el), .entry .entry-content .wp-block-button .wp-block-button__link:lang(el), .entry .entry-content .wp-block-archives li > a:lang(el), +.entry .entry-content .wp-block-categories li > a:lang(el), +.entry .entry-content .wp-block-latest-posts li > a:lang(el), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(el), .entry .entry-content .wp-block-verse:lang(el), .entry .entry-content .has-drop-cap:lang(el):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(el), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(el), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(el), +.entry .entry-content .wp-block-cover-image h2:lang(el), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(el), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(el), +.entry .entry-content .wp-block-cover h2:lang(el), .entry .entry-content .wp-block-audio figcaption:lang(el), +.entry .entry-content .wp-block-video figcaption:lang(el), +.entry .entry-content .wp-block-image figcaption:lang(el), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(el), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(el), .entry .entry-content .wp-block-file:lang(el), .entry .entry-content .wp-block-file .wp-block-file__button:lang(el), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(el), .wp-caption-text:lang(el), .gallery-caption:lang(el) { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +body:lang(gu), button:lang(gu), +input:lang(gu), +select:lang(gu), +optgroup:lang(gu), +textarea:lang(gu), .author-description .author-link:lang(gu), +.comment-metadata:lang(gu), +.comment-reply-link:lang(gu), +.comments-title:lang(gu), +.comment-author .fn:lang(gu), +.discussion-meta-info:lang(gu), +.entry-meta:lang(gu), +.entry-footer:lang(gu), +.main-navigation:lang(gu), +.no-comments:lang(gu), +.not-found .page-title:lang(gu), +.error-404 .page-title:lang(gu), +.post-navigation .post-title:lang(gu), +.page-links:lang(gu), +.page-description:lang(gu), +.pagination .nav-links:lang(gu), +.sticky-post:lang(gu), +.site-title:lang(gu), +.site-info:lang(gu), +#cancel-comment-reply-link:lang(gu), +h1:lang(gu), +h2:lang(gu), +h3:lang(gu), +h4:lang(gu), +h5:lang(gu), +h6:lang(gu), .page-title:lang(gu), blockquote cite:lang(gu), table:lang(gu), .button:lang(gu), +input:lang(gu)[type="button"], +input:lang(gu)[type="reset"], +input:lang(gu)[type="submit"], .comment-navigation .nav-previous:lang(gu), +.comment-navigation .nav-next:lang(gu), .comment-list .pingback .comment-body:lang(gu), +.comment-list .trackback .comment-body:lang(gu), .comment-list .pingback .comment-body .comment-edit-link:lang(gu), +.comment-list .trackback .comment-body .comment-edit-link:lang(gu), .comment-form .comment-notes:lang(gu), +.comment-form label:lang(gu), .widget_archive ul li:lang(gu), +.widget_categories ul li:lang(gu), +.widget_meta ul li:lang(gu), +.widget_nav_menu ul li:lang(gu), +.widget_pages ul li:lang(gu), +.widget_recent_comments ul li:lang(gu), +.widget_recent_entries ul li:lang(gu), +.widget_rss ul li:lang(gu), .widget_tag_cloud .tagcloud:lang(gu), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(gu), .entry .entry-content .wp-block-button .wp-block-button__link:lang(gu), .entry .entry-content .wp-block-archives li > a:lang(gu), +.entry .entry-content .wp-block-categories li > a:lang(gu), +.entry .entry-content .wp-block-latest-posts li > a:lang(gu), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(gu), .entry .entry-content .wp-block-verse:lang(gu), .entry .entry-content .has-drop-cap:lang(gu):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(gu), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(gu), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(gu), +.entry .entry-content .wp-block-cover-image h2:lang(gu), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(gu), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(gu), +.entry .entry-content .wp-block-cover h2:lang(gu), .entry .entry-content .wp-block-audio figcaption:lang(gu), +.entry .entry-content .wp-block-video figcaption:lang(gu), +.entry .entry-content .wp-block-image figcaption:lang(gu), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(gu), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(gu), .entry .entry-content .wp-block-file:lang(gu), .entry .entry-content .wp-block-file .wp-block-file__button:lang(gu), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(gu), .wp-caption-text:lang(gu), .gallery-caption:lang(gu) { + font-family: Arial, sans-serif; +} + +body:lang(he-IL), button:lang(he-IL), +input:lang(he-IL), +select:lang(he-IL), +optgroup:lang(he-IL), +textarea:lang(he-IL), .author-description .author-link:lang(he-IL), +.comment-metadata:lang(he-IL), +.comment-reply-link:lang(he-IL), +.comments-title:lang(he-IL), +.comment-author .fn:lang(he-IL), +.discussion-meta-info:lang(he-IL), +.entry-meta:lang(he-IL), +.entry-footer:lang(he-IL), +.main-navigation:lang(he-IL), +.no-comments:lang(he-IL), +.not-found .page-title:lang(he-IL), +.error-404 .page-title:lang(he-IL), +.post-navigation .post-title:lang(he-IL), +.page-links:lang(he-IL), +.page-description:lang(he-IL), +.pagination .nav-links:lang(he-IL), +.sticky-post:lang(he-IL), +.site-title:lang(he-IL), +.site-info:lang(he-IL), +#cancel-comment-reply-link:lang(he-IL), +h1:lang(he-IL), +h2:lang(he-IL), +h3:lang(he-IL), +h4:lang(he-IL), +h5:lang(he-IL), +h6:lang(he-IL), .page-title:lang(he-IL), blockquote cite:lang(he-IL), table:lang(he-IL), .button:lang(he-IL), +input:lang(he-IL)[type="button"], +input:lang(he-IL)[type="reset"], +input:lang(he-IL)[type="submit"], .comment-navigation .nav-previous:lang(he-IL), +.comment-navigation .nav-next:lang(he-IL), .comment-list .pingback .comment-body:lang(he-IL), +.comment-list .trackback .comment-body:lang(he-IL), .comment-list .pingback .comment-body .comment-edit-link:lang(he-IL), +.comment-list .trackback .comment-body .comment-edit-link:lang(he-IL), .comment-form .comment-notes:lang(he-IL), +.comment-form label:lang(he-IL), .widget_archive ul li:lang(he-IL), +.widget_categories ul li:lang(he-IL), +.widget_meta ul li:lang(he-IL), +.widget_nav_menu ul li:lang(he-IL), +.widget_pages ul li:lang(he-IL), +.widget_recent_comments ul li:lang(he-IL), +.widget_recent_entries ul li:lang(he-IL), +.widget_rss ul li:lang(he-IL), .widget_tag_cloud .tagcloud:lang(he-IL), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(he-IL), .entry .entry-content .wp-block-button .wp-block-button__link:lang(he-IL), .entry .entry-content .wp-block-archives li > a:lang(he-IL), +.entry .entry-content .wp-block-categories li > a:lang(he-IL), +.entry .entry-content .wp-block-latest-posts li > a:lang(he-IL), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(he-IL), .entry .entry-content .wp-block-verse:lang(he-IL), .entry .entry-content .has-drop-cap:lang(he-IL):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(he-IL), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(he-IL), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(he-IL), +.entry .entry-content .wp-block-cover-image h2:lang(he-IL), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(he-IL), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(he-IL), +.entry .entry-content .wp-block-cover h2:lang(he-IL), .entry .entry-content .wp-block-audio figcaption:lang(he-IL), +.entry .entry-content .wp-block-video figcaption:lang(he-IL), +.entry .entry-content .wp-block-image figcaption:lang(he-IL), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(he-IL), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(he-IL), .entry .entry-content .wp-block-file:lang(he-IL), .entry .entry-content .wp-block-file .wp-block-file__button:lang(he-IL), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(he-IL), .wp-caption-text:lang(he-IL), .gallery-caption:lang(he-IL) { + font-family: "Arial Hebrew", Arial, sans-serif; +} + +body:lang(ja), button:lang(ja), +input:lang(ja), +select:lang(ja), +optgroup:lang(ja), +textarea:lang(ja), .author-description .author-link:lang(ja), +.comment-metadata:lang(ja), +.comment-reply-link:lang(ja), +.comments-title:lang(ja), +.comment-author .fn:lang(ja), +.discussion-meta-info:lang(ja), +.entry-meta:lang(ja), +.entry-footer:lang(ja), +.main-navigation:lang(ja), +.no-comments:lang(ja), +.not-found .page-title:lang(ja), +.error-404 .page-title:lang(ja), +.post-navigation .post-title:lang(ja), +.page-links:lang(ja), +.page-description:lang(ja), +.pagination .nav-links:lang(ja), +.sticky-post:lang(ja), +.site-title:lang(ja), +.site-info:lang(ja), +#cancel-comment-reply-link:lang(ja), +h1:lang(ja), +h2:lang(ja), +h3:lang(ja), +h4:lang(ja), +h5:lang(ja), +h6:lang(ja), .page-title:lang(ja), blockquote cite:lang(ja), table:lang(ja), .button:lang(ja), +input:lang(ja)[type="button"], +input:lang(ja)[type="reset"], +input:lang(ja)[type="submit"], .comment-navigation .nav-previous:lang(ja), +.comment-navigation .nav-next:lang(ja), .comment-list .pingback .comment-body:lang(ja), +.comment-list .trackback .comment-body:lang(ja), .comment-list .pingback .comment-body .comment-edit-link:lang(ja), +.comment-list .trackback .comment-body .comment-edit-link:lang(ja), .comment-form .comment-notes:lang(ja), +.comment-form label:lang(ja), .widget_archive ul li:lang(ja), +.widget_categories ul li:lang(ja), +.widget_meta ul li:lang(ja), +.widget_nav_menu ul li:lang(ja), +.widget_pages ul li:lang(ja), +.widget_recent_comments ul li:lang(ja), +.widget_recent_entries ul li:lang(ja), +.widget_rss ul li:lang(ja), .widget_tag_cloud .tagcloud:lang(ja), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ja), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ja), .entry .entry-content .wp-block-archives li > a:lang(ja), +.entry .entry-content .wp-block-categories li > a:lang(ja), +.entry .entry-content .wp-block-latest-posts li > a:lang(ja), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ja), .entry .entry-content .wp-block-verse:lang(ja), .entry .entry-content .has-drop-cap:lang(ja):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ja), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ja), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ja), +.entry .entry-content .wp-block-cover-image h2:lang(ja), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ja), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ja), +.entry .entry-content .wp-block-cover h2:lang(ja), .entry .entry-content .wp-block-audio figcaption:lang(ja), +.entry .entry-content .wp-block-video figcaption:lang(ja), +.entry .entry-content .wp-block-image figcaption:lang(ja), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ja), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ja), .entry .entry-content .wp-block-file:lang(ja), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ja), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ja), .wp-caption-text:lang(ja), .gallery-caption:lang(ja) { + font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", Meiryo, "Helvetica Neue", sans-serif; +} + +body:lang(ko-KR), button:lang(ko-KR), +input:lang(ko-KR), +select:lang(ko-KR), +optgroup:lang(ko-KR), +textarea:lang(ko-KR), .author-description .author-link:lang(ko-KR), +.comment-metadata:lang(ko-KR), +.comment-reply-link:lang(ko-KR), +.comments-title:lang(ko-KR), +.comment-author .fn:lang(ko-KR), +.discussion-meta-info:lang(ko-KR), +.entry-meta:lang(ko-KR), +.entry-footer:lang(ko-KR), +.main-navigation:lang(ko-KR), +.no-comments:lang(ko-KR), +.not-found .page-title:lang(ko-KR), +.error-404 .page-title:lang(ko-KR), +.post-navigation .post-title:lang(ko-KR), +.page-links:lang(ko-KR), +.page-description:lang(ko-KR), +.pagination .nav-links:lang(ko-KR), +.sticky-post:lang(ko-KR), +.site-title:lang(ko-KR), +.site-info:lang(ko-KR), +#cancel-comment-reply-link:lang(ko-KR), +h1:lang(ko-KR), +h2:lang(ko-KR), +h3:lang(ko-KR), +h4:lang(ko-KR), +h5:lang(ko-KR), +h6:lang(ko-KR), .page-title:lang(ko-KR), blockquote cite:lang(ko-KR), table:lang(ko-KR), .button:lang(ko-KR), +input:lang(ko-KR)[type="button"], +input:lang(ko-KR)[type="reset"], +input:lang(ko-KR)[type="submit"], .comment-navigation .nav-previous:lang(ko-KR), +.comment-navigation .nav-next:lang(ko-KR), .comment-list .pingback .comment-body:lang(ko-KR), +.comment-list .trackback .comment-body:lang(ko-KR), .comment-list .pingback .comment-body .comment-edit-link:lang(ko-KR), +.comment-list .trackback .comment-body .comment-edit-link:lang(ko-KR), .comment-form .comment-notes:lang(ko-KR), +.comment-form label:lang(ko-KR), .widget_archive ul li:lang(ko-KR), +.widget_categories ul li:lang(ko-KR), +.widget_meta ul li:lang(ko-KR), +.widget_nav_menu ul li:lang(ko-KR), +.widget_pages ul li:lang(ko-KR), +.widget_recent_comments ul li:lang(ko-KR), +.widget_recent_entries ul li:lang(ko-KR), +.widget_rss ul li:lang(ko-KR), .widget_tag_cloud .tagcloud:lang(ko-KR), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ko-KR), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ko-KR), .entry .entry-content .wp-block-archives li > a:lang(ko-KR), +.entry .entry-content .wp-block-categories li > a:lang(ko-KR), +.entry .entry-content .wp-block-latest-posts li > a:lang(ko-KR), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ko-KR), .entry .entry-content .wp-block-verse:lang(ko-KR), .entry .entry-content .has-drop-cap:lang(ko-KR):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ko-KR), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ko-KR), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ko-KR), +.entry .entry-content .wp-block-cover-image h2:lang(ko-KR), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ko-KR), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ko-KR), +.entry .entry-content .wp-block-cover h2:lang(ko-KR), .entry .entry-content .wp-block-audio figcaption:lang(ko-KR), +.entry .entry-content .wp-block-video figcaption:lang(ko-KR), +.entry .entry-content .wp-block-image figcaption:lang(ko-KR), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ko-KR), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ko-KR), .entry .entry-content .wp-block-file:lang(ko-KR), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ko-KR), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ko-KR), .wp-caption-text:lang(ko-KR), .gallery-caption:lang(ko-KR) { + font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; +} + +body:lang(th), button:lang(th), +input:lang(th), +select:lang(th), +optgroup:lang(th), +textarea:lang(th), .author-description .author-link:lang(th), +.comment-metadata:lang(th), +.comment-reply-link:lang(th), +.comments-title:lang(th), +.comment-author .fn:lang(th), +.discussion-meta-info:lang(th), +.entry-meta:lang(th), +.entry-footer:lang(th), +.main-navigation:lang(th), +.no-comments:lang(th), +.not-found .page-title:lang(th), +.error-404 .page-title:lang(th), +.post-navigation .post-title:lang(th), +.page-links:lang(th), +.page-description:lang(th), +.pagination .nav-links:lang(th), +.sticky-post:lang(th), +.site-title:lang(th), +.site-info:lang(th), +#cancel-comment-reply-link:lang(th), +h1:lang(th), +h2:lang(th), +h3:lang(th), +h4:lang(th), +h5:lang(th), +h6:lang(th), .page-title:lang(th), blockquote cite:lang(th), table:lang(th), .button:lang(th), +input:lang(th)[type="button"], +input:lang(th)[type="reset"], +input:lang(th)[type="submit"], .comment-navigation .nav-previous:lang(th), +.comment-navigation .nav-next:lang(th), .comment-list .pingback .comment-body:lang(th), +.comment-list .trackback .comment-body:lang(th), .comment-list .pingback .comment-body .comment-edit-link:lang(th), +.comment-list .trackback .comment-body .comment-edit-link:lang(th), .comment-form .comment-notes:lang(th), +.comment-form label:lang(th), .widget_archive ul li:lang(th), +.widget_categories ul li:lang(th), +.widget_meta ul li:lang(th), +.widget_nav_menu ul li:lang(th), +.widget_pages ul li:lang(th), +.widget_recent_comments ul li:lang(th), +.widget_recent_entries ul li:lang(th), +.widget_rss ul li:lang(th), .widget_tag_cloud .tagcloud:lang(th), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(th), .entry .entry-content .wp-block-button .wp-block-button__link:lang(th), .entry .entry-content .wp-block-archives li > a:lang(th), +.entry .entry-content .wp-block-categories li > a:lang(th), +.entry .entry-content .wp-block-latest-posts li > a:lang(th), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(th), .entry .entry-content .wp-block-verse:lang(th), .entry .entry-content .has-drop-cap:lang(th):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(th), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(th), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(th), +.entry .entry-content .wp-block-cover-image h2:lang(th), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(th), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(th), +.entry .entry-content .wp-block-cover h2:lang(th), .entry .entry-content .wp-block-audio figcaption:lang(th), +.entry .entry-content .wp-block-video figcaption:lang(th), +.entry .entry-content .wp-block-image figcaption:lang(th), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(th), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(th), .entry .entry-content .wp-block-file:lang(th), .entry .entry-content .wp-block-file .wp-block-file__button:lang(th), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(th), .wp-caption-text:lang(th), .gallery-caption:lang(th) { + font-family: "Sukhumvit Set", "Helvetica Neue", helvetica, arial, sans-serif; +} + +body:lang(vi), button:lang(vi), +input:lang(vi), +select:lang(vi), +optgroup:lang(vi), +textarea:lang(vi), .author-description .author-link:lang(vi), +.comment-metadata:lang(vi), +.comment-reply-link:lang(vi), +.comments-title:lang(vi), +.comment-author .fn:lang(vi), +.discussion-meta-info:lang(vi), +.entry-meta:lang(vi), +.entry-footer:lang(vi), +.main-navigation:lang(vi), +.no-comments:lang(vi), +.not-found .page-title:lang(vi), +.error-404 .page-title:lang(vi), +.post-navigation .post-title:lang(vi), +.page-links:lang(vi), +.page-description:lang(vi), +.pagination .nav-links:lang(vi), +.sticky-post:lang(vi), +.site-title:lang(vi), +.site-info:lang(vi), +#cancel-comment-reply-link:lang(vi), +h1:lang(vi), +h2:lang(vi), +h3:lang(vi), +h4:lang(vi), +h5:lang(vi), +h6:lang(vi), .page-title:lang(vi), blockquote cite:lang(vi), table:lang(vi), .button:lang(vi), +input:lang(vi)[type="button"], +input:lang(vi)[type="reset"], +input:lang(vi)[type="submit"], .comment-navigation .nav-previous:lang(vi), +.comment-navigation .nav-next:lang(vi), .comment-list .pingback .comment-body:lang(vi), +.comment-list .trackback .comment-body:lang(vi), .comment-list .pingback .comment-body .comment-edit-link:lang(vi), +.comment-list .trackback .comment-body .comment-edit-link:lang(vi), .comment-form .comment-notes:lang(vi), +.comment-form label:lang(vi), .widget_archive ul li:lang(vi), +.widget_categories ul li:lang(vi), +.widget_meta ul li:lang(vi), +.widget_nav_menu ul li:lang(vi), +.widget_pages ul li:lang(vi), +.widget_recent_comments ul li:lang(vi), +.widget_recent_entries ul li:lang(vi), +.widget_rss ul li:lang(vi), .widget_tag_cloud .tagcloud:lang(vi), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(vi), .entry .entry-content .wp-block-button .wp-block-button__link:lang(vi), .entry .entry-content .wp-block-archives li > a:lang(vi), +.entry .entry-content .wp-block-categories li > a:lang(vi), +.entry .entry-content .wp-block-latest-posts li > a:lang(vi), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(vi), .entry .entry-content .wp-block-verse:lang(vi), .entry .entry-content .has-drop-cap:lang(vi):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(vi), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(vi), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(vi), +.entry .entry-content .wp-block-cover-image h2:lang(vi), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(vi), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(vi), +.entry .entry-content .wp-block-cover h2:lang(vi), .entry .entry-content .wp-block-audio figcaption:lang(vi), +.entry .entry-content .wp-block-video figcaption:lang(vi), +.entry .entry-content .wp-block-image figcaption:lang(vi), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(vi), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(vi), .entry .entry-content .wp-block-file:lang(vi), .entry .entry-content .wp-block-file .wp-block-file__button:lang(vi), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(vi), .wp-caption-text:lang(vi), .gallery-caption:lang(vi) { + font-family: "Libre Franklin", sans-serif; +} + +/* Normalize */ +/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ +/* Document + ========================================================================== */ +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ +html { + line-height: 1.15; + /* 1 */ + -webkit-text-size-adjust: 100%; + /* 2 */ +} + +/* Sections + ========================================================================== */ +/** + * Remove the margin in all browsers. + */ +body { + margin: 0; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/* Grouping content + ========================================================================== */ +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ +hr { + box-sizing: content-box; + /* 1 */ + height: 0; + /* 1 */ + overflow: visible; + /* 2 */ +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ +pre { + font-family: monospace, monospace; + /* 1 */ + font-size: 1em; + /* 2 */ +} + +/* Text-level semantics + ========================================================================== */ +/** + * Remove the gray background on active links in IE 10. + */ +a { + background-color: transparent; +} + +/** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ +abbr[title] { + border-bottom: none; + /* 1 */ + text-decoration: underline; + /* 2 */ + text-decoration: underline dotted; + /* 2 */ +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ +b, +strong { + font-weight: bolder; +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ +code, +kbd, +samp { + font-family: monospace, monospace; + /* 1 */ + font-size: 1em; + /* 2 */ +} + +/** + * Add the correct font size in all browsers. + */ +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ +/** + * Remove the border on images inside links in IE 10. + */ +img { + border-style: none; +} + +/* Forms + ========================================================================== */ +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ +button, +input, +optgroup, +select, +textarea { + font-family: inherit; + /* 1 */ + font-size: 100%; + /* 1 */ + line-height: 1.15; + /* 1 */ + margin: 0; + /* 2 */ +} + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ +button, +input { + /* 1 */ + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ +button, +select { + /* 1 */ + text-transform: none; +} + +/** + * Correct the inability to style clickable types in iOS and Safari. + */ +button, +[type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +/** + * Remove the inner border and padding in Firefox. + */ +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Correct the padding in Firefox. + */ +fieldset { + padding: 0.35em 0.75em 0.625em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ +legend { + box-sizing: border-box; + /* 1 */ + color: inherit; + /* 2 */ + display: table; + /* 1 */ + max-width: 100%; + /* 1 */ + padding: 0; + /* 3 */ + white-space: normal; + /* 1 */ +} + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ +progress { + vertical-align: baseline; +} + +/** + * Remove the default vertical scrollbar in IE 10+. + */ +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ +} + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ +[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + outline-offset: -2px; + /* 2 */ +} + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ +::-webkit-file-upload-button { + -webkit-appearance: button; + /* 1 */ + font: inherit; + /* 2 */ +} + +/* Interactive + ========================================================================== */ +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ +details { + display: block; +} + +/* + * Add the correct display in all browsers. + */ +summary { + display: list-item; +} + +/* Misc + ========================================================================== */ +/** + * Add the correct display in IE 10+. + */ +template { + display: none; +} + +/** + * Add the correct display in IE 10. + */ +[hidden] { + display: none; +} + +/* Typography */ +html { + font-size: 22px; +} + +body { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + color: #111; + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: 400; + font-size: 1em; + line-height: 1.8; + margin: 0; + text-rendering: optimizeLegibility; +} + +button, +input, +select, +optgroup, +textarea { + color: #111; + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: 400; + line-height: 1.8; + text-rendering: optimizeLegibility; +} + +.author-description .author-link, +.comment-metadata, +.comment-reply-link, +.comments-title, +.comment-author .fn, +.discussion-meta-info, +.entry-meta, +.entry-footer, +.main-navigation, +.no-comments, +.not-found .page-title, +.error-404 .page-title, +.post-navigation .post-title, +.page-links, +.page-description, +.pagination .nav-links, +.sticky-post, +.site-title, +.site-info, +#cancel-comment-reply-link, +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; +} + +.main-navigation, +.page-description, +.author-description .author-link, +.not-found .page-title, +.error-404 .page-title, +.post-navigation .post-title, +.pagination .nav-links, +.comments-title, +.comment-author .fn, +.no-comments, +.site-title, +h1, +h2, +h3, +h4, +h5, +h6 { + font-weight: 700; + letter-spacing: -0.02em; + line-height: 1.2; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.page-title { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; +} + +.site-branding, +.main-navigation ul.main-menu > li, +.social-navigation, +.author-description .author-bio, +.nav-links { + line-height: 1.25; +} + +h1 { + font-size: 2.25em; +} + +@media only screen and (min-width: 768px) { + h1 { + font-size: 2.8125em; + } +} + +.entry-title, +.not-found .page-title, +.error-404 .page-title, +.has-larger-font-size, +h2 { + font-size: 1.6875em; +} + +@media only screen and (min-width: 768px) { + .entry-title, + .not-found .page-title, + .error-404 .page-title, + .has-larger-font-size, + h2 { + font-size: 2.25em; + } +} + +.has-regular-font-size, +.has-large-font-size, +.comments-title, +h3 { + font-size: 1.6875em; +} + +.site-title, +.site-description, +.main-navigation, +.nav-links, +.page-title, +.page-description, +.comment-author .fn, +.no-comments, +h2.author-title, +p.author-bio, +h4 { + font-size: 1.125em; +} + +.pagination .nav-links, +.comment-content, +h5 { + font-size: 0.88889em; +} + +.entry-meta, +.entry-footer, +.discussion-meta-info, +.site-info, +.has-small-font-size, +.comment-reply-link, +.comment-metadata, +.comment-notes, +.sticky-post, +#cancel-comment-reply-link, +img:after, +h6 { + font-size: 0.71111em; +} + +.site-title, +.page-title { + font-weight: normal; +} + +.page-description, +.page-links a { + font-weight: bold; +} + +.site-description { + letter-spacing: -0.01em; +} + +.post-navigation .post-title, +.entry-title, +.not-found .page-title, +.error-404 .page-title, +.comments-title, +blockquote { + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + word-break: break-word; + word-wrap: break-word; +} + +/* Do not hyphenate entry title on tablet view and bigger. */ +@media only screen and (min-width: 768px) { + .entry-title { + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; + } +} + +p { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +dfn, +cite, +em, +i { + font-style: italic; +} + +blockquote cite { + font-size: 0.71111em; + font-style: normal; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; +} + +pre { + font-size: 0.88889em; + font-family: "Courier 10 Pitch", Courier, monospace; + line-height: 1.8; + overflow: auto; +} + +code, +kbd, +tt, +var { + font-size: 0.88889em; + font-family: Menlo, monaco, Consolas, Lucida Console, monospace; +} + +abbr, acronym { + border-bottom: 1px dotted #666; + cursor: help; +} + +mark, +ins { + background: #fff9c0; + text-decoration: none; +} + +big { + font-size: 125%; +} + +a { + text-decoration: none; +} + +a:hover { + text-decoration: none; +} + +a:focus { + text-decoration: underline; +} + +/* Elements */ +html { + box-sizing: border-box; +} + +::-moz-selection { + background-color: #bfdcea; +} + +::selection { + background-color: #bfdcea; +} + +*, +*:before, +*:after { + box-sizing: inherit; +} + +body { + background-color: #fff; +} + +a { + transition: color 110ms ease-in-out; + color: #0073aa; +} + +a:hover, +a:active { + color: #005177; + outline: 0; + text-decoration: none; +} + +a:focus { + outline: thin; + outline-style: dotted; + text-decoration: underline; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + clear: both; + margin: 1rem 0; +} + +h1:not(.site-title):before, +h2:before { + background: #767676; + content: "\020"; + display: block; + height: 2px; + margin: 1rem 0; + width: 1em; +} + +hr { + background-color: #767676; + border: 0; + height: 2px; +} + +ul, +ol { + padding-right: 1rem; +} + +ul { + list-style: disc; +} + +ul ul { + list-style-type: circle; +} + +ol { + list-style: decimal; +} + +li { + line-height: 1.8; +} + +li > ul, +li > ol { + padding-right: 2rem; +} + +dt { + font-weight: bold; +} + +dd { + margin: 0 1rem 1rem; +} + +img { + height: auto; + max-width: 100%; + position: relative; +} + +figure { + margin: 0; +} + +blockquote { + border-right: 2px solid #0073aa; + margin-right: 0; + padding: 0 1rem 0 0; +} + +blockquote > p { + margin: 0 0 1rem; +} + +blockquote cite { + color: #767676; +} + +table { + margin: 0 0 1rem; + border-collapse: collapse; + width: 100%; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; +} + +table td, +table th { + padding: 0.5em; + border: 1px solid #767676; + word-break: break-all; +} + +/* Forms */ +.button, +button, +input[type="button"], +input[type="reset"], +input[type="submit"] { + transition: background 150ms ease-in-out; + background: #0073aa; + border: none; + border-radius: 5px; + box-sizing: border-box; + color: #fff; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.88889em; + font-weight: 700; + line-height: 1.2; + outline: none; + padding: 0.76rem 1rem; + text-decoration: none; + vertical-align: bottom; +} + +.button:hover, +button:hover, +input[type="button"]:hover, +input[type="reset"]:hover, +input[type="submit"]:hover { + background: #111; + cursor: pointer; +} + +.button:visited, +button:visited, +input[type="button"]:visited, +input[type="reset"]:visited, +input[type="submit"]:visited { + color: #fff; + text-decoration: none; +} + +.button:focus, +button:focus, +input[type="button"]:focus, +input[type="reset"]:focus, +input[type="submit"]:focus { + background: #111; + outline: thin dotted; + outline-offset: -4px; +} + +input[type="text"], +input[type="email"], +input[type="url"], +input[type="password"], +input[type="search"], +input[type="number"], +input[type="tel"], +input[type="range"], +input[type="date"], +input[type="month"], +input[type="week"], +input[type="time"], +input[type="datetime"], +input[type="datetime-local"], +input[type="color"], +textarea { + -webkit-backface-visibility: hidden; + background: #fff; + border: solid 1px #ccc; + box-sizing: border-box; + outline: none; + padding: 0.36rem 0.66rem; + -webkit-appearance: none; + outline-offset: 0; + border-radius: 0; +} + +input[type="text"]:focus, +input[type="email"]:focus, +input[type="url"]:focus, +input[type="password"]:focus, +input[type="search"]:focus, +input[type="number"]:focus, +input[type="tel"]:focus, +input[type="range"]:focus, +input[type="date"]:focus, +input[type="month"]:focus, +input[type="week"]:focus, +input[type="time"]:focus, +input[type="datetime"]:focus, +input[type="datetime-local"]:focus, +input[type="color"]:focus, +textarea:focus { + border-color: #0073aa; + outline: thin solid rgba(0, 115, 170, 0.15); + outline-offset: -4px; +} + +input[type="search"]::-webkit-search-decoration { + display: none; +} + +textarea { + box-sizing: border-box; + display: block; + width: 100%; + max-width: 100%; + resize: vertical; +} + +form p { + margin: 1rem 0; +} + +/* Navigation */ +/*-------------------------------------------------------------- +## Links +--------------------------------------------------------------*/ +a { + transition: color 110ms ease-in-out; + color: #0073aa; +} + +a:visited { + color: #0073aa; +} + +a:hover, +a:active { + color: #005177; + outline: 0; + text-decoration: none; +} + +a:focus { + outline: thin dotted; + text-decoration: underline; +} + +/*-------------------------------------------------------------- +## Menus +--------------------------------------------------------------*/ +/** === Main menu === */ +.main-navigation { + display: block; + margin-top: 0.25rem; + /* Un-style buttons */ + /* + * Sub-menu styles + * + * :focus-within needs its own selector so other similar + * selectors don’t get ignored if a browser doesn’t recognize it + */ + /** + * Fade-in animation for top-level submenus + */ + /** + * Off-canvas touch device styles + */ +} + +body.page .main-navigation { + display: block; +} + +.main-navigation > div { + display: inline; +} + +.main-navigation button { + display: inline-block; + border: none; + padding: 0; + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-weight: 700; + line-height: 1.2; + text-decoration: none; + background: transparent; + color: inherit; + cursor: pointer; + transition: background 250ms ease-in-out, + transform 150ms ease; + -webkit-appearance: none; + -moz-appearance: none; +} + +.main-navigation button:hover, .main-navigation button:focus { + background: transparent; +} + +.main-navigation button:focus { + outline: 1px solid transparent; + outline-offset: -4px; +} + +.main-navigation button:active { + transform: scale(0.99); +} + +.main-navigation .main-menu { + display: inline-block; + margin: 0; + padding: 0; +} + +.main-navigation .main-menu > li { + color: #0073aa; + display: inline; + position: relative; +} + +.main-navigation .main-menu > li > a { + font-weight: 700; + color: #0073aa; + margin-left: 0.5rem; +} + +.main-navigation .main-menu > li > a + svg { + margin-left: 0.5rem; +} + +.main-navigation .main-menu > li > a:hover, +.main-navigation .main-menu > li > a:hover + svg { + color: #005177; +} + +.main-navigation .main-menu > li.menu-item-has-children { + display: inline-block; + position: inherit; +} + +@media only screen and (min-width: 768px) { + .main-navigation .main-menu > li.menu-item-has-children { + position: relative; + } +} + +.main-navigation .main-menu > li.menu-item-has-children > a { + margin-left: 0.125rem; +} + +.main-navigation .main-menu > li.menu-item-has-children > a:after, +.main-navigation .main-menu > li.menu-item-has-children .menu-item-has-children > a:after { + content: ""; + display: none; +} + +.main-navigation .main-menu > li.menu-item-has-children .submenu-expand { + display: inline-block; + margin-left: 0.25rem; + /* Priority+ Menu */ +} + +.main-navigation .main-menu > li.menu-item-has-children .submenu-expand.main-menu-more-toggle { + position: relative; + height: 24px; + line-height: 1.2; + width: 24px; + padding: 0; + margin-right: 0.5rem; +} + +.main-navigation .main-menu > li.menu-item-has-children .submenu-expand.main-menu-more-toggle svg { + height: 24px; + width: 24px; + top: -0.125rem; + vertical-align: text-bottom; +} + +.wp-customizer-unloading .main-navigation .main-menu > li.menu-item-has-children .submenu-expand, .main-navigation .main-menu > li.menu-item-has-children .submenu-expand.is-empty { + display: none; +} + +.main-navigation .main-menu > li.menu-item-has-children .submenu-expand svg { + position: relative; + top: 0.2rem; +} + +.main-navigation .main-menu > li:last-child > a, +.main-navigation .main-menu > li:last-child.menu-item-has-children .submenu-expand { + margin-left: 0; +} + +.main-navigation .sub-menu { + background-color: #0073aa; + color: #fff; + list-style: none; + padding-right: 0; + position: absolute; + opacity: 0; + right: -9999px; + z-index: 99999; +} + +@media only screen and (min-width: 768px) { + .main-navigation .sub-menu { + width: auto; + min-width: -moz-max-content; + min-width: -webkit-max-content; + min-width: max-content; + } +} + +.main-navigation .sub-menu > li { + display: block; + float: none; + position: relative; +} + +.main-navigation .sub-menu > li.menu-item-has-children .submenu-expand { + display: inline-block; + position: absolute; + width: calc( 24px + 1rem); + left: 0; + top: calc( .125 * 1rem); + bottom: 0; + color: white; + line-height: 1; + padding: calc( .5 * 1rem); +} + +.main-navigation .sub-menu > li.menu-item-has-children .submenu-expand svg { + top: 0; +} + +.main-navigation .sub-menu > li.menu-item-has-children .submenu-expand { + margin-left: 0; +} + +@media only screen and (min-width: 768px) { + .main-navigation .sub-menu > li.menu-item-has-children .menu-item-has-children > a:after { + content: "\203a"; + } +} + +.main-navigation .sub-menu > li > a, +.main-navigation .sub-menu > li > .menu-item-link-return { + color: #fff; + display: block; + line-height: 1.2; + text-shadow: none; + padding: calc( .5 * 1rem) 1rem calc( .5 * 1rem) calc( 24px + 1rem); + white-space: nowrap; +} + +.main-navigation .sub-menu > li > a:hover, .main-navigation .sub-menu > li > a:focus, +.main-navigation .sub-menu > li > .menu-item-link-return:hover, +.main-navigation .sub-menu > li > .menu-item-link-return:focus { + background: #005177; +} + +.main-navigation .sub-menu > li > a:hover:after, .main-navigation .sub-menu > li > a:focus:after, +.main-navigation .sub-menu > li > .menu-item-link-return:hover:after, +.main-navigation .sub-menu > li > .menu-item-link-return:focus:after { + background: #005177; +} + +.main-navigation .sub-menu > li > .menu-item-link-return { + width: 100%; + font-size: 22px; + font-weight: normal; + text-align: right; +} + +.main-navigation .sub-menu > li > a:empty { + display: none; +} + +.main-navigation .sub-menu > li.mobile-parent-nav-menu-item { + display: none; + font-size: 0.88889em; + font-weight: normal; +} + +.main-navigation .sub-menu > li.mobile-parent-nav-menu-item svg { + position: relative; + top: 0.2rem; + margin-left: calc( .25 * 1rem); +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu { + display: block; + right: 0; + margin-top: 0; + opacity: 1; + width: auto; + min-width: 100%; + /* Non-mobile position */ + /* Nested sub-menu dashes */ +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu { + display: block; + right: 0; + margin-top: 0; + opacity: 1; + width: auto; + min-width: 100%; + /* Non-mobile position */ + /* Nested sub-menu dashes */ +} + +@media only screen and (min-width: 768px) { + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu { + display: block; + margin-top: 0; + opacity: 1; + position: absolute; + right: 0; + left: auto; + top: auto; + bottom: auto; + height: auto; + min-width: -moz-max-content; + min-width: -webkit-max-content; + min-width: max-content; + transform: none; + } + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu { + display: block; + margin-top: 0; + opacity: 1; + position: absolute; + right: 0; + left: auto; + top: auto; + bottom: auto; + height: auto; + min-width: -moz-max-content; + min-width: -webkit-max-content; + min-width: max-content; + transform: none; + } +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu.hidden-links { + right: 0; + width: 100%; + display: table; + position: absolute; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu.hidden-links { + right: 0; + width: 100%; + display: table; + position: absolute; +} + +@media only screen and (min-width: 768px) { + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu.hidden-links { + left: 0; + right: auto; + display: block; + width: max-content; + } + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu.hidden-links { + left: 0; + right: auto; + display: block; + width: max-content; + } +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu .submenu-expand { + display: none; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu .submenu-expand { + display: none; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu .sub-menu { + display: block; + margin-top: inherit; + position: relative; + width: 100%; + right: 0; + opacity: 1; + /* Non-mobile position */ +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu .sub-menu { + display: block; + margin-top: inherit; + position: relative; + width: 100%; + right: 0; + opacity: 1; + /* Non-mobile position */ +} + +@media only screen and (min-width: 768px) { + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu .sub-menu { + float: none; + max-width: 100%; + } + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu .sub-menu { + float: none; + max-width: 100%; + } +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu .sub-menu { + counter-reset: submenu; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu .sub-menu { + counter-reset: submenu; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu .sub-menu > li > a::before { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: normal; + content: "– " counters(submenu, "– ", none); + counter-increment: submenu; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu .sub-menu > li > a::before { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: normal; + content: "– " counters(submenu, "– ", none); + counter-increment: submenu; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu, +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu, +.main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu { + display: block; + right: 0; + margin-top: 0; + opacity: 1; + width: auto; + min-width: 100%; + /* Non-mobile position */ + /* Nested sub-menu dashes */ +} + +@media only screen and (min-width: 768px) { + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu, + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu, + .main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu { + display: block; + float: none; + margin-top: 0; + opacity: 1; + position: absolute; + right: 0; + left: auto; + top: auto; + bottom: auto; + height: auto; + min-width: -moz-max-content; + min-width: -webkit-max-content; + min-width: max-content; + transform: none; + } +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu.hidden-links, +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu.hidden-links, +.main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu.hidden-links { + right: 0; + width: 100%; + display: table; + position: absolute; +} + +@media only screen and (min-width: 768px) { + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu.hidden-links, + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu.hidden-links, + .main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu.hidden-links { + left: 0; + right: auto; + display: table; + width: max-content; + } +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu .submenu-expand, +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu .submenu-expand, +.main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu .submenu-expand { + display: none; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu .sub-menu, +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu .sub-menu, +.main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu .sub-menu { + display: block; + margin-top: inherit; + position: relative; + width: 100%; + right: 0; + opacity: 1; + /* Non-mobile position */ +} + +@media only screen and (min-width: 768px) { + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu .sub-menu, + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu .sub-menu, + .main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu .sub-menu { + float: none; + max-width: 100%; + } +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu .sub-menu, +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu .sub-menu, +.main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu .sub-menu { + counter-reset: submenu; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu .sub-menu > li > a::before, +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu .sub-menu > li > a::before, +.main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu .sub-menu > li > a::before { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: normal; + content: "– " counters(submenu, "– ", none); + counter-increment: submenu; +} + +.main-navigation .main-menu > .menu-item-has-children:not(.off-canvas):hover > .sub-menu { + animation: fade_in 0.1s forwards; +} + +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu .submenu-expand .svg-icon { + transform: rotate(-270deg); +} + +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu .sub-menu { + opacity: 0; + position: absolute; + z-index: 0; + transform: translateX(100%); +} + +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu li:hover, +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu li:focus, +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu li > a:hover, +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu li > a:focus { + background-color: transparent; +} + +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu > li > a, +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu > li > .menu-item-link-return { + white-space: inherit; +} + +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu.expanded-true { + display: table; + margin-top: 0; + opacity: 1; + padding-right: 0; + /* Mobile position */ + right: 0; + top: 0; + left: 0; + bottom: 0; + position: fixed; + z-index: 100000; + /* Make sure appears above mobile admin bar */ + width: 100vw; + height: 100vh; + max-width: 100vw; + transform: translateX(-100%); + animation: slide_in_right 0.3s forwards; + /* Prevent menu from being blocked by admin bar */ +} + +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu.expanded-true > .mobile-parent-nav-menu-item { + display: block; +} + +.admin-bar .main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu.expanded-true { + top: 46px; + height: calc( 100vh - 46px); + /* WP core breakpoint */ +} + +.admin-bar .main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu.expanded-true .sub-menu.expanded-true { + top: 0; +} + +@media only screen and (min-width: 782px) { + .admin-bar .main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu.expanded-true { + top: 32px; + height: calc( 100vh - 32px); + } + .admin-bar .main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu.expanded-true .sub-menu.expanded-true { + top: 0; + } +} + +.main-navigation .main-menu-more:nth-child(n+3) { + display: none; +} + +/* Menu animation */ +@keyframes slide_in_right { + 100% { + transform: translateX(0%); + } +} + +@keyframes fade_in { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +/* Social menu */ +.social-navigation { + margin-top: calc(1rem / 2); + text-align: right; +} + +.social-navigation ul.social-links-menu { + content: ""; + display: table; + table-layout: fixed; + display: inline-block; + margin: 0; + padding: 0; +} + +.social-navigation ul.social-links-menu li { + display: inline-block; + vertical-align: bottom; + vertical-align: -webkit-baseline-middle; + list-style: none; +} + +.social-navigation ul.social-links-menu li:nth-child(n+2) { + margin-right: 0.1em; +} + +.social-navigation ul.social-links-menu li a { + border-bottom: 1px solid transparent; + display: block; + color: #111; + margin-bottom: -1px; + transition: opacity 110ms ease-in-out; +} + +.social-navigation ul.social-links-menu li a:hover, .social-navigation ul.social-links-menu li a:active { + color: #111; + opacity: 0.6; +} + +.social-navigation ul.social-links-menu li a:focus { + color: #111; + opacity: 1; + border-bottom: 1px solid #111; +} + +.social-navigation ul.social-links-menu li a svg { + display: block; + width: 32px; + height: 32px; + transform: translateZ(0); +} + +.social-navigation ul.social-links-menu li a svg#ui-icon-link { + transform: rotate(45deg); +} + +@media only screen and (min-width: 768px) { + .site-title + .social-navigation, + .site-description + .social-navigation { + margin-top: calc(1rem / 5); + } +} + +/** === Footer menu === */ +.footer-navigation { + display: inline; +} + +.footer-navigation > div { + display: inline; +} + +.footer-navigation .footer-menu { + display: inline; + padding-right: 0; +} + +.footer-navigation .footer-menu li { + display: inline; + margin-left: 1rem; +} + +/*-------------------------------------------------------------- +## Next / Previous +--------------------------------------------------------------*/ +/* Next/Previous navigation */ +.post-navigation { + margin: calc(3 * 1rem) 0; +} + +@media only screen and (min-width: 768px) { + .post-navigation { + margin: calc(3 * 1rem) calc(10% + 60px); + max-width: calc(6 * (100vw / 12)); + } +} + +@media only screen and (min-width: 1168px) { + .post-navigation { + margin: calc(3 * 1rem) 0; + max-width: 100%; + } +} + +.post-navigation .nav-links { + margin: 0 1rem; + max-width: 100%; + display: flex; + flex-direction: column; +} + +@media only screen and (min-width: 768px) { + .post-navigation .nav-links { + margin: 0; + } +} + +@media only screen and (min-width: 1168px) { + .post-navigation .nav-links { + flex-direction: row; + margin: 0 calc(10% + 60px); + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +.post-navigation .nav-links a .meta-nav { + color: #767676; + user-select: none; +} + +.post-navigation .nav-links a .meta-nav:before, .post-navigation .nav-links a .meta-nav:after { + display: none; + content: "—"; + width: 2em; + color: #767676; + height: 1em; +} + +.post-navigation .nav-links a .post-title { + hyphens: auto; +} + +.post-navigation .nav-links a:hover { + color: #005177; +} + +@media only screen and (min-width: 1168px) { + .post-navigation .nav-links .nav-previous, + .post-navigation .nav-links .nav-next { + min-width: calc(50% - 2 * 1rem); + } +} + +.post-navigation .nav-links .nav-previous { + order: 2; +} + +@media only screen and (min-width: 1168px) { + .post-navigation .nav-links .nav-previous { + order: 1; + } +} + +.post-navigation .nav-links .nav-previous + .nav-next { + margin-bottom: 1rem; +} + +.post-navigation .nav-links .nav-previous .meta-nav:before { + display: inline; +} + +.post-navigation .nav-links .nav-next { + order: 1; +} + +@media only screen and (min-width: 1168px) { + .post-navigation .nav-links .nav-next { + order: 2; + padding-right: 1rem; + } +} + +.post-navigation .nav-links .nav-next .meta-nav:after { + display: inline; +} + +.pagination .nav-links { + display: flex; + flex-wrap: wrap; + padding: 0 calc(.5 * 1rem); +} + +.pagination .nav-links > * { + padding: calc(.5 * 1rem); +} + +.pagination .nav-links > *.dots, .pagination .nav-links > *.prev { + padding-right: 0; +} + +.pagination .nav-links > *.dots, .pagination .nav-links > *.next { + padding-left: 0; +} + +.pagination .nav-links a:focus { + text-decoration: underline; + outline-offset: -1px; +} + +.pagination .nav-links a:focus.prev, .pagination .nav-links a:focus.next { + text-decoration: none; +} + +.pagination .nav-links a:focus.prev .nav-prev-text, +.pagination .nav-links a:focus.prev .nav-next-text, .pagination .nav-links a:focus.next .nav-prev-text, +.pagination .nav-links a:focus.next .nav-next-text { + text-decoration: underline; +} + +.pagination .nav-links .nav-next-text, +.pagination .nav-links .nav-prev-text { + display: none; +} + +@media only screen and (min-width: 768px) { + .pagination .nav-links { + margin-right: calc(10% + 60px); + padding: 0; + } + .pagination .nav-links .prev > *, + .pagination .nav-links .next > * { + display: inline-block; + vertical-align: text-bottom; + } + .pagination .nav-links > * { + padding: 1rem; + } +} + +.comment-navigation .nav-links { + display: flex; + flex-direction: row; +} + +.comment-navigation .nav-previous, +.comment-navigation .nav-next { + min-width: 50%; + width: 100%; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-weight: bold; +} + +.comment-navigation .nav-previous .secondary-text, +.comment-navigation .nav-next .secondary-text { + display: none; +} + +@media only screen and (min-width: 768px) { + .comment-navigation .nav-previous .secondary-text, + .comment-navigation .nav-next .secondary-text { + display: inline; + } +} + +.comment-navigation .nav-previous svg, +.comment-navigation .nav-next svg { + vertical-align: middle; + position: relative; + margin: 0 -0.35em; + top: -1px; +} + +.comment-navigation .nav-next { + text-align: left; +} + +/* Accessibility */ +/* Text meant only for screen readers. */ +.screen-reader-text { + border: 0; + clip: rect(1px, 1px, 1px, 1px); + clip-path: inset(50%); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute !important; + width: 1px; + word-wrap: normal !important; + /* Many screen reader and browser combinations announce broken words as they would appear visually. */ +} + +.screen-reader-text:focus { + background-color: #f1f1f1; + border-radius: 3px; + box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); + clip: auto !important; + clip-path: none; + color: #21759b; + display: block; + font-size: 0.875rem; + font-weight: bold; + height: auto; + right: 5px; + line-height: normal; + padding: 15px 23px 14px; + text-decoration: none; + top: 5px; + width: auto; + z-index: 100000; + /* Above WP toolbar. */ +} + +/* Do not show the outline on the skip link target. */ +#content[tabindex="-1"]:focus { + outline: 0; +} + +/* Alignments */ +.alignleft { + float: left; + margin-right: 1rem; +} + +@media only screen and (min-width: 768px) { + .alignleft { + margin-right: calc(2 * 1rem); + } +} + +.alignright { + float: right; + margin-left: 1rem; +} + +@media only screen and (min-width: 768px) { + .alignright { + margin-left: calc(2 * 1rem); + } +} + +.aligncenter { + clear: both; + display: block; + margin-right: auto; + margin-left: auto; +} + +/* Clearings */ +.clear:before, +.clear:after, +.entry-content:before, +.entry-content:after, +.comment-content:before, +.comment-content:after, +.site-header:before, +.site-header:after, +.site-content:before, +.site-content:after, +.site-footer:before, +.site-footer:after { + content: ""; + display: table; + table-layout: fixed; +} + +.clear:after, +.entry-content:after, +.comment-content:after, +.site-header:after, +.site-content:after, +.site-footer:after { + clear: both; +} + +/* Layout */ +/** === Layout === */ +#page { + width: 100%; +} + +.site-content { + overflow: hidden; +} + +/* Content */ +/*-------------------------------------------------------------- +## Header +--------------------------------------------------------------*/ +.site-header { + padding: 1em; +} + +.site-header.featured-image { + display: flex; + flex-direction: column; + justify-content: space-between; + min-height: 90vh; +} + +.site-header.featured-image .site-branding-container { + margin-bottom: auto; +} + +@media only screen and (min-width: 768px) { + .site-header { + margin: 0; + padding: 3rem 0; + } + .site-header.featured-image { + min-height: 100vh; + margin-bottom: 3rem; + } +} + +.site-branding { + color: #767676; + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + position: relative; + word-wrap: break-word; +} + +@media only screen and (min-width: 768px) { + .site-branding { + margin: 0 calc(10% + 60px); + } +} + +.site-logo { + position: relative; + z-index: 999; + margin-bottom: calc(.66 * 1rem); +} + +@media only screen and (min-width: 768px) { + .site-logo { + margin-bottom: 0; + position: absolute; + left: calc(100% + (1.25 * 1rem)); + top: 4px; + z-index: 999; + } +} + +.site-logo .custom-logo-link { + border-radius: 100%; + box-sizing: content-box; + box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); + display: block; + width: 50px; + height: 50px; + overflow: hidden; + transition: box-shadow 200ms ease-in-out; +} + +.site-logo .custom-logo-link .custom-logo { + min-height: inherit; +} + +.site-logo .custom-logo-link:hover, .site-logo .custom-logo-link:active, .site-logo .custom-logo-link:focus { + box-shadow: 0 0 0 2px black; +} + +@media only screen and (min-width: 768px) { + .site-logo .custom-logo-link { + width: 64px; + height: 64px; + } +} + +.site-title { + margin: auto; + display: inline; + color: #111; + /* When there is no description set, make sure navigation appears below title. */ +} + +.site-title a { + color: #111; +} + +.site-title a:link, .site-title a:visited { + color: #111; +} + +.site-title a:hover { + color: #4a4a4a; +} + +.featured-image .site-title { + margin: 0; +} + +@media only screen and (min-width: 768px) { + .featured-image .site-title { + display: inline-block; + } +} + +.site-title + .main-navigation { + display: block; +} + +@media only screen and (min-width: 768px) { + .site-title { + display: inline; + } +} + +.site-title:not(:empty) + .site-description:not(:empty):before { + content: "\2014"; + margin: 0 .2em; +} + +.site-description { + display: inline; + color: #767676; + font-weight: normal; + margin: 0; +} + +.site-header.featured-image { + /* Hide overflow for overflowing featured image */ + overflow: hidden; + /* Need relative positioning to properly align layers. */ + position: relative; + /* Add text shadow to text, to increase readability. */ + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); + /* Set white text color when featured image is set. */ + /* add focus state to social media icons */ + /* Entry header */ + /* Custom Logo Link */ + /* Make sure important elements are above pseudo elements used for effects. */ + /* Set up image filter layer positioning */ + /* Background & Effects */ + /* Shared background settings between pseudo elements. */ + background-position: center; + background-repeat: no-repeat; + background-size: cover; + /* The intensity of each blend mode is controlled via layer opacity. */ + /* Second layer: screen. */ + /* Third layer: multiply. */ + /* When image filters are inactive, a black overlay is added. */ + /* Fourth layer: overlay. */ + /* Fifth layer: readability overlay */ +} + +.site-header.featured-image .site-branding .site-title, +.site-header.featured-image .site-branding .site-description, +.site-header.featured-image .main-navigation a:after, +.site-header.featured-image .main-navigation .main-menu > li.menu-item-has-children:after, +.site-header.featured-image .main-navigation li, +.site-header.featured-image .social-navigation li, +.site-header.featured-image .entry-meta, +.site-header.featured-image .entry-title { + color: #fff; +} + +.site-header.featured-image .main-navigation a, +.site-header.featured-image .main-navigation a + svg, +.site-header.featured-image .social-navigation a, +.site-header.featured-image .site-title a, +.site-header.featured-image .site-featured-image a { + color: #fff; + transition: opacity 110ms ease-in-out; +} + +.site-header.featured-image .main-navigation a:hover, .site-header.featured-image .main-navigation a:active, +.site-header.featured-image .main-navigation a:hover + svg, +.site-header.featured-image .main-navigation a:active + svg, +.site-header.featured-image .main-navigation a + svg:hover, +.site-header.featured-image .main-navigation a + svg:active, +.site-header.featured-image .main-navigation a + svg:hover + svg, +.site-header.featured-image .main-navigation a + svg:active + svg, +.site-header.featured-image .social-navigation a:hover, +.site-header.featured-image .social-navigation a:active, +.site-header.featured-image .social-navigation a:hover + svg, +.site-header.featured-image .social-navigation a:active + svg, +.site-header.featured-image .site-title a:hover, +.site-header.featured-image .site-title a:active, +.site-header.featured-image .site-title a:hover + svg, +.site-header.featured-image .site-title a:active + svg, +.site-header.featured-image .site-featured-image a:hover, +.site-header.featured-image .site-featured-image a:active, +.site-header.featured-image .site-featured-image a:hover + svg, +.site-header.featured-image .site-featured-image a:active + svg { + color: #fff; + opacity: 0.6; +} + +.site-header.featured-image .main-navigation a:focus, +.site-header.featured-image .main-navigation a:focus + svg, +.site-header.featured-image .main-navigation a + svg:focus, +.site-header.featured-image .main-navigation a + svg:focus + svg, +.site-header.featured-image .social-navigation a:focus, +.site-header.featured-image .social-navigation a:focus + svg, +.site-header.featured-image .site-title a:focus, +.site-header.featured-image .site-title a:focus + svg, +.site-header.featured-image .site-featured-image a:focus, +.site-header.featured-image .site-featured-image a:focus + svg { + color: #fff; +} + +.site-header.featured-image .main-navigation .sub-menu a { + opacity: inherit; +} + +.site-header.featured-image .social-navigation a:focus { + color: #fff; + opacity: 1; + border-bottom: 1px solid #fff; +} + +.site-header.featured-image .social-navigation svg, +.site-header.featured-image .site-featured-image svg { + /* Use -webkit- only if supporting: Chrome < 54, iOS < 9.3, Android < 4.4.4 */ + -webkit-filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); + filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); +} + +.site-header.featured-image .site-featured-image { + /* First layer: grayscale. */ +} + +.site-header.featured-image .site-featured-image .post-thumbnail img { + height: auto; + right: 50%; + max-width: 1000%; + min-height: 100%; + min-width: 100vw; + position: absolute; + top: 50%; + transform: translateX(50%) translateY(-50%); + width: auto; + z-index: 1; + /* When image filters are active, make it grayscale to colorize it blue. */ +} + +@supports (object-fit: cover) { + .site-header.featured-image .site-featured-image .post-thumbnail img { + height: 100%; + right: 0; + object-fit: cover; + top: 0; + transform: none; + width: 100%; + } +} + +.image-filters-enabled .site-header.featured-image .site-featured-image .post-thumbnail img { + filter: grayscale(100%); +} + +.site-header.featured-image .site-featured-image .entry-header { + margin-top: calc( 4 * 1rem); + margin-bottom: 0; + margin-right: 0; + margin-left: 0; + /* Entry meta */ +} + +@media only screen and (min-width: 768px) { + .site-header.featured-image .site-featured-image .entry-header { + margin-right: calc(10% + 60px); + margin-left: calc(10% + 60px); + } +} + +.site-header.featured-image .site-featured-image .entry-header .entry-title:before { + background: #fff; +} + +.site-header.featured-image .site-featured-image .entry-header .entry-meta { + font-weight: 500; +} + +.site-header.featured-image .site-featured-image .entry-header .entry-meta > span { + margin-left: 1rem; + display: inline-block; +} + +.site-header.featured-image .site-featured-image .entry-header .entry-meta > span:last-child { + margin-left: 0; +} + +.site-header.featured-image .site-featured-image .entry-header .entry-meta a { + transition: color 110ms ease-in-out; + color: currentColor; +} + +.site-header.featured-image .site-featured-image .entry-header .entry-meta a:hover { + text-decoration: none; +} + +.site-header.featured-image .site-featured-image .entry-header .entry-meta .svg-icon { + position: relative; + display: inline-block; + vertical-align: middle; + margin-left: 0.5em; +} + +.site-header.featured-image .site-featured-image .entry-header .entry-meta .discussion-avatar-list { + display: none; +} + +@media only screen and (min-width: 768px) { + .site-header.featured-image .site-featured-image .entry-header.has-discussion .entry-meta { + display: flex; + position: relative; + } + .site-header.featured-image .site-featured-image .entry-header.has-discussion .entry-title { + padding-left: calc(1 * (100vw / 12) + 1rem); + } + .site-header.featured-image .site-featured-image .entry-header.has-discussion .entry-meta .comment-count { + position: absolute; + left: 0; + } + .site-header.featured-image .site-featured-image .entry-header.has-discussion .entry-meta .discussion-avatar-list { + display: block; + position: absolute; + bottom: 100%; + } +} + +.site-header.featured-image .custom-logo-link { + background: #fff; + box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); +} + +.site-header.featured-image .custom-logo-link:hover, .site-header.featured-image .custom-logo-link:active, .site-header.featured-image .custom-logo-link:focus { + box-shadow: 0 0 0 2px white; +} + +.site-header.featured-image .site-branding { + position: relative; + z-index: 10; +} + +.site-header.featured-image .site-featured-image .entry-header { + position: relative; + z-index: 9; +} + +.site-header.featured-image .site-branding-container:after, +.site-header.featured-image .site-featured-image:before, +.site-header.featured-image .site-featured-image:after, .site-header.featured-image:after { + display: block; + position: absolute; + top: 0; + right: 0; + content: "\020"; + width: 100%; + height: 100%; +} + +.image-filters-enabled .site-header.featured-image .site-featured-image:before { + background: #0073aa; + mix-blend-mode: screen; + opacity: 0.1; +} + +.site-header.featured-image .site-featured-image:after { + background: #000; + mix-blend-mode: multiply; + opacity: .7; + /* When image filters are active, a blue overlay is added. */ +} + +.image-filters-enabled .site-header.featured-image .site-featured-image:after { + background: #0073aa; + opacity: .8; + z-index: 3; + /* Browsers supporting mix-blend-mode don't need opacity < 1 */ +} + +@supports (mix-blend-mode: multiply) { + .image-filters-enabled .site-header.featured-image .site-featured-image:after { + opacity: 1; + } +} + +.image-filters-enabled .site-header.featured-image .site-branding-container:after { + background: rgba(0, 0, 0, 0.35); + mix-blend-mode: overlay; + opacity: 0.5; + z-index: 4; + /* Browsers supporting mix-blend-mode can have a light overlay */ +} + +@supports (mix-blend-mode: overlay) { + .image-filters-enabled .site-header.featured-image .site-branding-container:after { + background: rgba(255, 255, 255, 0.35); + } +} + +.site-header.featured-image:after { + background: #000; + /** + * Add a transition to the readability overlay, to add a subtle + * but smooth effect when resizing the screen. + */ + transition: opacity 1200ms ease-in-out; + opacity: 0.7; + z-index: 5; + /* When image filters are active, a blue overlay is added. */ +} + +.image-filters-enabled .site-header.featured-image:after { + background: #000e14; + opacity: 0.38; +} + +@media only screen and (min-width: 768px) { + .image-filters-enabled .site-header.featured-image:after { + opacity: 0.18; + } +} + +.site-header.featured-image ::-moz-selection { + background: rgba(255, 255, 255, 0.17); +} + +.site-header.featured-image ::selection { + background: rgba(255, 255, 255, 0.17); +} + +/*-------------------------------------------------------------- +## Posts and pages +--------------------------------------------------------------*/ +.sticky { + display: block; +} + +.sticky-post { + background: #0073aa; + color: #fff; + display: inline-block; + font-weight: bold; + line-height: 1; + padding: .25rem; + position: absolute; + text-transform: uppercase; + top: -1rem; + z-index: 1; +} + +.updated:not(.published) { + display: none; +} + +.page-links { + clear: both; + margin: 0 0 calc(1.5 * 1rem); +} + +.entry { + margin-top: calc(6 * 1rem); +} + +.entry:first-of-type { + margin-top: 0; +} + +.entry .entry-header { + margin: calc(3 * 1rem) 1rem 1rem; + position: relative; +} + +@media only screen and (min-width: 768px) { + .entry .entry-header { + margin: calc(3 * 1rem) calc(10% + 60px) 1rem; + } +} + +.entry .entry-title { + margin: 0; +} + +.entry .entry-title:before { + background: #767676; + content: "\020"; + display: block; + height: 2px; + margin: 1rem 0; + width: 1em; +} + +.entry .entry-title a { + color: inherit; +} + +.entry .entry-title a:hover { + color: #4a4a4a; +} + +.entry .entry-meta, +.entry .entry-footer { + color: #767676; + font-weight: 500; +} + +.entry .entry-meta > span, +.entry .entry-footer > span { + margin-left: 1rem; + display: inline-block; +} + +.entry .entry-meta > span:last-child, +.entry .entry-footer > span:last-child { + margin-left: 0; +} + +.entry .entry-meta a, +.entry .entry-footer a { + transition: color 110ms ease-in-out; + color: currentColor; +} + +.entry .entry-meta a:hover, +.entry .entry-footer a:hover { + text-decoration: none; + color: #0073aa; +} + +.entry .entry-meta .svg-icon, +.entry .entry-footer .svg-icon { + position: relative; + display: inline-block; + vertical-align: middle; + margin-left: 0.5em; +} + +.entry .entry-meta { + margin: 1rem 0; +} + +.entry .entry-footer { + margin: calc(2 * 1rem) 1rem 1rem; +} + +@media only screen and (min-width: 768px) { + .entry .entry-footer { + margin: 1rem calc(10% + 60px) calc(3 * 1rem); + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-footer { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +.entry .post-thumbnail { + margin: 1rem; +} + +@media only screen and (min-width: 768px) { + .entry .post-thumbnail { + margin: 1rem calc(10% + 60px); + } +} + +.entry .post-thumbnail:focus { + outline: none; +} + +.entry .post-thumbnail .post-thumbnail-inner { + display: block; +} + +.entry .post-thumbnail .post-thumbnail-inner img { + position: relative; + display: block; + width: 100%; +} + +.image-filters-enabled .entry .post-thumbnail { + position: relative; + display: block; +} + +.image-filters-enabled .entry .post-thumbnail .post-thumbnail-inner { + filter: grayscale(100%); +} + +.image-filters-enabled .entry .post-thumbnail .post-thumbnail-inner:after { + background: rgba(0, 0, 0, 0.35); + content: ""; + display: block; + height: 100%; + opacity: .5; + pointer-events: none; + position: absolute; + top: 0; + width: 100%; + z-index: 4; +} + +@supports (mix-blend-mode: multiply) { + .image-filters-enabled .entry .post-thumbnail .post-thumbnail-inner:after { + display: none; + } +} + +.image-filters-enabled .entry .post-thumbnail:before, .image-filters-enabled .entry .post-thumbnail:after { + position: absolute; + display: block; + width: 100%; + height: 100%; + top: 0; + right: 0; + content: "\020"; + pointer-events: none; +} + +.image-filters-enabled .entry .post-thumbnail:before { + background: #0073aa; + mix-blend-mode: screen; + opacity: 0.1; + z-index: 2; +} + +.image-filters-enabled .entry .post-thumbnail:after { + background: #0073aa; + mix-blend-mode: multiply; + opacity: .8; + z-index: 3; + /* Browsers supporting mix-blend-mode don't need opacity < 1 */ +} + +@supports (mix-blend-mode: multiply) { + .image-filters-enabled .entry .post-thumbnail:after { + opacity: 1; + } +} + +.entry .entry-content, +.entry .entry-summary { + max-width: calc(100% - (2 * 1rem)); + margin: 0 1rem; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content, + .entry .entry-summary { + max-width: 80%; + margin: 0 10%; + padding: 0 60px; + } +} + +.entry .entry-content p { + word-wrap: break-word; +} + +.entry .entry-content .more-link { + transition: color 110ms ease-in-out; + display: inline; + color: inherit; +} + +.entry .entry-content .more-link:after { + content: "\02192"; + display: inline-block; + margin-right: 0.5em; +} + +.entry .entry-content .more-link:hover { + color: #0073aa; + text-decoration: none; +} + +.entry .entry-content a { + text-decoration: underline; +} + +.entry .entry-content a.button, .entry .entry-content a:hover { + text-decoration: none; +} + +.entry .entry-content a.button { + display: inline-block; +} + +.entry .entry-content a.button:hover { + background: #111; + color: #fff; + cursor: pointer; +} + +.entry .entry-content > iframe[style] { + margin: 32px 0 !important; + max-width: 100% !important; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > iframe[style] { + max-width: calc(8 * (100vw / 12) - 28px) !important; + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content > iframe[style] { + max-width: calc(6 * (100vw / 12) - 28px) !important; + } +} + +.entry .entry-content .page-links a { + margin: calc(0.5 * 1rem); + text-decoration: none; +} + +.entry .entry-content .wp-audio-shortcode { + max-width: calc(100vw - (2 * 1rem)); +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-audio-shortcode { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-audio-shortcode { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +/* Author description */ +.author-bio { + margin: calc(2 * 1rem) 1rem 1rem; +} + +@media only screen and (min-width: 768px) { + .author-bio { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .author-bio { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .author-bio { + margin: calc(3 * 1rem) calc(10% + 60px); + } +} + +@media only screen and (min-width: 1168px) { + .author-bio { + margin: calc(3 * 1rem) calc(10% + 60px); + } +} + +.author-bio .author-title { + display: inline; +} + +.author-bio .author-title:before { + background: #767676; + content: "\020"; + display: block; + height: 2px; + margin: 1rem 0; + width: 1em; +} + +.author-bio .author-description { + display: inline; + color: #767676; + font-size: 1.125em; + line-height: 1.2; +} + +.author-bio .author-description .author-link { + display: inline-block; +} + +.author-bio .author-description .author-link:hover { + color: #005177; + text-decoration: none; +} + +/*-------------------------------------------------------------- +## Comments +--------------------------------------------------------------*/ +.comment-content a { + word-wrap: break-word; +} + +.bypostauthor { + display: block; +} + +.comments-area { + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + margin: calc(2 * 1rem) 1rem; + word-wrap: break-word; + /* Add extra margin when the comments section is located immediately after the + * post itself (this happens on pages). + */ +} + +@media only screen and (min-width: 768px) { + .comments-area { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .comments-area { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .comments-area { + margin: calc(3 * 1rem) calc(10% + 60px); + } +} + +.comments-area > * { + margin-top: calc(2 * 1rem); + margin-bottom: calc(2 * 1rem); +} + +@media only screen and (min-width: 768px) { + .comments-area > * { + margin-top: calc(3 * 1rem); + margin-bottom: calc(3 * 1rem); + } +} + +.entry + .comments-area { + margin-top: calc(3 * 1rem); +} + +@media only screen and (min-width: 768px) { + .comments-area .comments-title-wrap { + align-items: baseline; + display: flex; + justify-content: space-between; + } +} + +.comments-area .comments-title-wrap .comments-title { + margin: 0; +} + +.comments-area .comments-title-wrap .comments-title:before { + background: #767676; + content: "\020"; + display: block; + height: 2px; + margin: 1rem 0; + width: 1em; +} + +@media only screen and (min-width: 768px) { + .comments-area .comments-title-wrap .comments-title { + flex: 1 0 calc(3 * (100vw / 12)); + } +} + +@media only screen and (min-width: 768px) { + .comments-area .comments-title-wrap .discussion-meta { + flex: 0 0 calc(2 * (100vw / 12)); + margin-right: 1rem; + } +} + +#comment { + max-width: 100%; + box-sizing: border-box; +} + +#respond { + position: relative; +} + +#respond .comment-user-avatar { + margin: 1rem 0 -1rem; +} + +#respond .comment .comment-form { + padding-right: 0; +} + +#respond > small { + display: block; + font-size: 22px; + position: absolute; + right: calc(1rem + 100%); + top: calc(-3.5 * 1rem); + width: calc(100vw / 12); +} + +#comments > .comments-title:last-child { + display: none; +} + +.comment-form-flex { + display: flex; + flex-direction: column; +} + +.comment-form-flex .comments-title { + display: none; + margin: 0; + order: 1; +} + +.comment-form-flex #respond { + order: 2; +} + +.comment-form-flex #respond + .comments-title { + display: block; +} + +.comment-list { + list-style: none; + padding: 0; +} + +.comment-list .children { + margin: 0; + padding: 0 1rem 0 0; +} + +.comment-list > .comment:first-child { + margin-top: 0; +} + +.comment-list .pingback .comment-body, +.comment-list .trackback .comment-body { + color: #767676; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.71111em; + font-weight: 500; + margin-top: 1rem; + margin-bottom: 1rem; +} + +.comment-list .pingback .comment-body a:not(.comment-edit-link), +.comment-list .trackback .comment-body a:not(.comment-edit-link) { + font-weight: bold; + font-size: 19.55556px; + line-height: 1.5; + padding-left: 0.5rem; + display: block; +} + +.comment-list .pingback .comment-body .comment-edit-link, +.comment-list .trackback .comment-body .comment-edit-link { + color: #767676; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-weight: 500; +} + +#respond + .comment-reply { + display: none; +} + +.comment-reply .comment-reply-link { + display: inline-block; +} + +.comment { + list-style: none; + position: relative; +} + +@media only screen and (min-width: 768px) { + .comment { + padding-right: calc(.5 * (1rem + calc(100vw / 12 ))); + } + .comment.depth-1, + .comment .children { + padding-right: 0; + } + .comment.depth-1 { + margin-right: calc(3.25 * 1rem); + } +} + +.comment .comment-body { + margin: calc(2 * 1rem) 0 0; +} + +.comment .comment-meta { + position: relative; +} + +.comment .comment-author .avatar { + float: right; + margin-left: 1rem; + position: relative; +} + +@media only screen and (min-width: 768px) { + .comment .comment-author .avatar { + float: inherit; + margin-left: inherit; + position: absolute; + top: 0; + left: calc(100% + 1rem); + } +} + +.comment .comment-author .fn { + position: relative; + display: block; +} + +.comment .comment-author .fn a { + color: inherit; +} + +.comment .comment-author .fn a:hover { + color: #005177; +} + +.comment .comment-author .post-author-badge { + border-radius: 100%; + display: block; + height: 18px; + position: absolute; + background: #008fd3; + left: calc(100% - 2.5rem); + top: -3px; + width: 18px; +} + +@media only screen and (min-width: 768px) { + .comment .comment-author .post-author-badge { + left: calc(100% + 0.75rem); + } +} + +.comment .comment-author .post-author-badge svg { + width: inherit; + height: inherit; + display: block; + fill: white; + transform: scale(0.875); +} + +.comment .comment-metadata > a, +.comment .comment-metadata .comment-edit-link { + display: inline; + font-weight: 500; + color: #767676; + vertical-align: baseline; +} + +.comment .comment-metadata > a time, +.comment .comment-metadata .comment-edit-link time { + vertical-align: baseline; +} + +.comment .comment-metadata > a:hover, +.comment .comment-metadata .comment-edit-link:hover { + color: #005177; + text-decoration: none; +} + +.comment .comment-metadata > * { + display: inline-block; +} + +.comment .comment-metadata .edit-link-sep { + color: #767676; + margin: 0 0.2em; + vertical-align: baseline; +} + +.comment .comment-metadata .edit-link { + color: #767676; +} + +.comment .comment-metadata .edit-link svg { + transform: scale(0.8); + vertical-align: baseline; + margin-left: 0.1em; +} + +.comment .comment-metadata .comment-edit-link { + position: relative; + padding-right: 1rem; + margin-right: -1rem; + z-index: 1; +} + +.comment .comment-metadata .comment-edit-link:hover { + color: #0073aa; +} + +.comment .comment-content { + margin: 1rem 0; +} + +@media only screen and (min-width: 1168px) { + .comment .comment-content { + padding-left: 1rem; + } +} + +.comment .comment-content > *:first-child { + margin-top: 0; +} + +.comment .comment-content > *:last-child { + margin-bottom: 0; +} + +.comment .comment-content blockquote { + margin-right: 0; +} + +.comment .comment-content a { + text-decoration: underline; +} + +.comment .comment-content a:hover { + text-decoration: none; +} + +.comment-reply-link, +#cancel-comment-reply-link { + font-weight: 500; +} + +.comment-reply-link:hover, +#cancel-comment-reply-link:hover { + color: #005177; +} + +.discussion-avatar-list { + content: ""; + display: table; + table-layout: fixed; + margin: 0; + padding: 0; +} + +.discussion-avatar-list li { + position: relative; + list-style: none; + margin: 0 0 0 -8px; + padding: 0; + float: right; +} + +.discussion-avatar-list .comment-user-avatar img { + height: calc(1.5 * 1rem); + width: calc(1.5 * 1rem); +} + +.discussion-meta .discussion-meta-info { + margin: 0; +} + +.discussion-meta .discussion-meta-info .svg-icon { + vertical-align: middle; + fill: currentColor; + transform: scale(0.6) scaleX(-1) translateY(-0.1em); + margin-right: -0.25rem; +} + +.comment-form .comment-notes, +.comment-form label { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.71111em; + color: #767676; +} + +@media only screen and (min-width: 768px) { + .comment-form .comment-form-author, + .comment-form .comment-form-email { + width: calc(50% - 0.5rem); + float: right; + } +} + +@media only screen and (min-width: 768px) { + .comment-form .comment-form-email { + margin-right: 1rem; + } +} + +.comment-form input[name="author"], +.comment-form input[name="email"], +.comment-form input[name="url"] { + display: block; + width: 100%; +} + +/*-------------------------------------------------------------- +## Archives +--------------------------------------------------------------*/ +.archive .page-header, +.search .page-header, +.error404 .page-header { + margin: 1rem 1rem calc(3 * 1rem); +} + +@media only screen and (min-width: 768px) { + .archive .page-header, + .search .page-header, + .error404 .page-header { + margin: 0 calc(10% + 60px) calc(3 * 1rem); + } +} + +.archive .page-header .page-title, +.search .page-header .page-title, +.error404 .page-header .page-title { + color: #767676; + display: inline; + letter-spacing: normal; +} + +.archive .page-header .page-title:before, +.search .page-header .page-title:before, +.error404 .page-header .page-title:before { + display: none; +} + +.archive .page-header .search-term, +.archive .page-header .page-description, +.search .page-header .search-term, +.search .page-header .page-description, +.error404 .page-header .search-term, +.error404 .page-header .page-description { + display: inherit; + clear: both; +} + +.archive .page-header .page-description, +.search .page-header .page-description { + display: block; + color: #111; + font-size: 1em; +} + +@media only screen and (min-width: 768px) { + .hfeed .entry .entry-header { + margin: calc(3 * 1rem) calc(10% + 60px) calc(1rem / 2); + } +} + +/* 404 & Not found */ +.error-404.not-found .page-content, +.no-results.not-found .page-content { + margin: calc(3 * 1rem) 1rem; +} + +@media only screen and (min-width: 768px) { + .error-404.not-found .page-content, + .no-results.not-found .page-content { + margin: calc(3 * 1rem) calc(10% + 60px) calc(1rem / 2); + } +} + +.error-404.not-found .search-submit, +.no-results.not-found .search-submit { + vertical-align: middle; + margin: 1rem 0; +} + +.error-404.not-found .search-field, +.no-results.not-found .search-field { + width: 100%; +} + +/*-------------------------------------------------------------- +## Footer +--------------------------------------------------------------*/ +/* Site footer */ +#colophon .widget-area, +#colophon .site-info { + margin: calc(2 * 1rem) 1rem; +} + +@media only screen and (min-width: 768px) { + #colophon .widget-area, + #colophon .site-info { + margin: calc(3 * 1rem) calc(10% + 60px); + } +} + +#colophon .widget-column { + display: flex; + flex-wrap: wrap; +} + +#colophon .widget-column .widget { + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + width: 100%; + word-wrap: break-word; +} + +@media only screen and (min-width: 1168px) { + #colophon .widget-column .widget { + margin-left: calc(3 * 1rem); + width: calc(50% - (3 * 1rem)); + } +} + +#colophon .site-info { + color: #767676; + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + word-wrap: break-word; +} + +#colophon .site-info a { + color: inherit; +} + +#colophon .site-info a:hover { + text-decoration: none; + color: #0073aa; +} + +#colophon .site-info .imprint, +#colophon .site-info .privacy-policy-link { + margin-left: 1rem; +} + +/* Widgets */ +.widget { + margin: 0 0 1rem; + /* Make sure select elements fit in widgets. */ +} + +.widget select { + max-width: 100%; +} + +.widget a { + color: #0073aa; +} + +.widget a:hover { + color: #005177; +} + +.widget_archive ul, +.widget_categories ul, +.widget_meta ul, +.widget_nav_menu ul, +.widget_pages ul, +.widget_recent_comments ul, +.widget_recent_entries ul, +.widget_rss ul { + padding: 0; + list-style: none; +} + +.widget_archive ul li, +.widget_categories ul li, +.widget_meta ul li, +.widget_nav_menu ul li, +.widget_pages ul li, +.widget_recent_comments ul li, +.widget_recent_entries ul li, +.widget_rss ul li { + color: #767676; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: calc(22px * 1.125); + font-weight: 700; + line-height: 1.2; + margin-top: 0.5rem; + margin-bottom: 0.5rem; +} + +.widget_archive ul ul, +.widget_categories ul ul, +.widget_meta ul ul, +.widget_nav_menu ul ul, +.widget_pages ul ul, +.widget_recent_comments ul ul, +.widget_recent_entries ul ul, +.widget_rss ul ul { + counter-reset: submenu; +} + +.widget_archive ul ul > li > a::before, +.widget_categories ul ul > li > a::before, +.widget_meta ul ul > li > a::before, +.widget_nav_menu ul ul > li > a::before, +.widget_pages ul ul > li > a::before, +.widget_recent_comments ul ul > li > a::before, +.widget_recent_entries ul ul > li > a::before, +.widget_rss ul ul > li > a::before { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: normal; + content: "– " counters(submenu, "– ", none); + counter-increment: submenu; +} + +.widget_tag_cloud .tagcloud { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-weight: 700; +} + +.widget_search .search-field { + width: 100%; +} + +@media only screen and (min-width: 600px) { + .widget_search .search-field { + width: auto; + } +} + +.widget_search .search-submit { + display: block; + margin-top: 1rem; +} + +.widget_calendar .calendar_wrap { + text-align: center; +} + +.widget_calendar .calendar_wrap table td, +.widget_calendar .calendar_wrap table th { + border: none; +} + +.widget_calendar .calendar_wrap a { + text-decoration: underline; +} + +.widget_calendar .calendar_wrap .wp-calendar-table { + margin-bottom: 0; +} + +.widget_calendar .calendar_wrap .wp-calendar-nav { + margin: 0 0 1rem; + display: table; + width: 100%; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; +} + +.widget_calendar .calendar_wrap .wp-calendar-nav span { + display: table-cell; + padding: 0.5em; +} + +.widget_calendar .calendar_wrap .wp-calendar-nav-prev, +.widget_calendar .calendar_wrap .wp-calendar-nav-next { + width: 40%; +} + +/* Blocks */ +/* !Block styles */ +.entry .entry-content > *, +.entry .entry-summary > *, +.entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *, +.entry .entry-content > .wp-block-group > .wp-block-group__inner-container > * { + margin: 32px 0; + max-width: 100%; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *, + .entry .entry-summary > *, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > * { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content > *, + .entry .entry-summary > *, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > * { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *, + .entry .entry-summary > *, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > * { + margin: 32px 0; + } +} + +.entry .entry-content > *.alignwide, +.entry .entry-summary > *.alignwide, +.entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignwide, +.entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignwide { + margin-right: auto; + margin-left: auto; + clear: both; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *.alignwide, + .entry .entry-summary > *.alignwide, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignwide, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignwide { + width: 100%; + max-width: 100%; + } +} + +.entry .entry-content > *.alignfull, +.entry .entry-summary > *.alignfull, +.entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignfull, +.entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignfull { + position: relative; + right: -1rem; + width: calc( 100% + (2 * 1rem)); + max-width: calc( 100% + (2 * 1rem)); + clear: both; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *.alignfull, + .entry .entry-summary > *.alignfull, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignfull, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignfull { + margin-top: calc(2 * 1rem); + margin-bottom: calc(2 * 1rem); + right: calc( -12.5% - 75px); + width: calc( 125% + 150px); + max-width: calc( 125% + 150px); + } +} + +.entry .entry-content > *.alignleft, +.entry .entry-summary > *.alignleft, +.entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignleft, +.entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignleft { + float: left; + max-width: calc(5 * (100vw / 12)); + margin-top: 0; + margin-right: 0; + margin-right: 1rem; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *.alignleft, + .entry .entry-summary > *.alignleft, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignleft, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignleft { + max-width: calc(4 * (100vw / 12)); + margin-right: calc(2 * 1rem); + } +} + +.entry .entry-content > *.alignright, +.entry .entry-summary > *.alignright, +.entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignright, +.entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignright { + float: right; + max-width: calc(5 * (100vw / 12)); + margin-top: 0; + margin-left: 0; + margin-left: 1rem; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *.alignright, + .entry .entry-summary > *.alignright, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignright, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignright { + max-width: calc(4 * (100vw / 12)); + margin-left: 0; + margin-left: calc(2 * 1rem); + } +} + +.entry .entry-content > *.aligncenter, +.entry .entry-summary > *.aligncenter, +.entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.aligncenter, +.entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.aligncenter { + margin-right: auto; + margin-left: auto; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *.aligncenter, + .entry .entry-summary > *.aligncenter, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.aligncenter, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.aligncenter { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content > *.aligncenter, + .entry .entry-summary > *.aligncenter, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.aligncenter, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.aligncenter { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *.aligncenter, + .entry .entry-summary > *.aligncenter, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.aligncenter, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.aligncenter { + margin-right: 0; + margin-left: 0; + } +} + +.entry .entry-content > * > *:first-child, +.entry .entry-summary > * > *:first-child { + margin-top: 0; +} + +.entry .entry-content > * > *:last-child, +.entry .entry-summary > * > *:last-child { + margin-bottom: 0; +} + +/* + * Unset nested content selector styles + * - Prevents layout styles from cascading too deeply + * - helps with plugin compatibility + */ +.entry .entry-content .entry-content, +.entry .entry-content .entry-summary, +.entry .entry-content .entry, +.entry .entry-summary .entry-content, +.entry .entry-summary .entry-summary, +.entry .entry-summary .entry { + margin: inherit; + max-width: inherit; + padding: inherit; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .entry-content, + .entry .entry-content .entry-summary, + .entry .entry-content .entry, + .entry .entry-summary .entry-content, + .entry .entry-summary .entry-summary, + .entry .entry-summary .entry { + margin: inherit; + max-width: inherit; + padding: inherit; + } +} + +.entry .entry-content p.has-background { + padding: 20px 30px; +} + +.entry .entry-content .wp-block-audio { + width: 100%; +} + +.entry .entry-content .wp-block-audio audio { + width: 100%; +} + +.entry .entry-content .wp-block-audio.alignleft audio, +.entry .entry-content .wp-block-audio.alignright audio { + max-width: 198px; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-audio.alignleft audio, + .entry .entry-content .wp-block-audio.alignright audio { + max-width: 384px; + } +} + +@media only screen and (min-width: 1379px) { + .entry .entry-content .wp-block-audio.alignleft audio, + .entry .entry-content .wp-block-audio.alignright audio { + max-width: 385.44px; + } +} + +.entry .entry-content .wp-block-video video { + width: 100%; +} + +.entry .entry-content .wp-block-button .wp-block-button__link { + transition: background 150ms ease-in-out; + border: none; + font-size: 0.88889em; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + line-height: 1.2; + box-sizing: border-box; + font-weight: bold; + text-decoration: none; + padding: 0.76rem 1rem; + outline: none; + outline: none; +} + +.entry .entry-content .wp-block-button .wp-block-button__link:not(.has-background) { + background-color: #0073aa; +} + +.entry .entry-content .wp-block-button .wp-block-button__link:not(.has-text-color) { + color: white; +} + +.entry .entry-content .wp-block-button .wp-block-button__link:hover { + color: white; + background: #111; + cursor: pointer; +} + +.entry .entry-content .wp-block-button .wp-block-button__link:focus { + color: white; + background: #111; + outline: thin dotted; + outline-offset: -4px; +} + +.entry .entry-content .wp-block-button:not(.is-style-squared) .wp-block-button__link { + border-radius: 5px; +} + +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link, +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:focus, +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:active { + transition: all 150ms ease-in-out; + border-width: 2px; + border-style: solid; +} + +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:not(.has-background), +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:focus:not(.has-background), +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:active:not(.has-background) { + background: transparent; +} + +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color), +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:focus:not(.has-text-color), +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:active:not(.has-text-color) { + color: #0073aa; + border-color: currentColor; +} + +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:hover { + color: white; + border-color: #111; +} + +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:hover:not(.has-background) { + color: #111; +} + +.entry .entry-content .wp-block-archives, +.entry .entry-content .wp-block-categories, +.entry .entry-content .wp-block-latest-posts { + padding: 0; + list-style: none; +} + +.entry .entry-content .wp-block-archives li > a, +.entry .entry-content .wp-block-categories li > a, +.entry .entry-content .wp-block-latest-posts li > a { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: calc(22px * 1.125); + font-weight: bold; + line-height: 1.2; + text-decoration: none; +} + +.entry .entry-content .wp-block-archives.aligncenter, +.entry .entry-content .wp-block-categories.aligncenter { + text-align: center; +} + +.entry .entry-content .wp-block-categories ul { + padding-top: 0.75rem; +} + +.entry .entry-content .wp-block-categories li ul { + list-style: none; + padding-right: 0; +} + +.entry .entry-content .wp-block-categories ul { + counter-reset: submenu; +} + +.entry .entry-content .wp-block-categories ul > li > a::before { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: normal; + content: "– " counters(submenu, "– ", none); + counter-increment: submenu; +} + +.entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.71111em; + color: #767676; + line-height: 1.2; +} + +.entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-full-content, +.entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-excerpt { + margin-top: 1rem; + margin-bottom: 1rem; +} + +.entry .entry-content .wp-block-latest-posts li { + padding-bottom: 0.5rem; +} + +.entry .entry-content .wp-block-latest-posts li.menu-item-has-children, .entry .entry-content .wp-block-latest-posts li:last-child { + padding-bottom: 0; +} + +.entry .entry-content .wp-block-latest-posts li :not(:last-child) .wp-block-latest-posts__post-excerpt { + padding-bottom: 0.5rem; +} + +.entry .entry-content .wp-block-latest-posts.is-grid li { + border-top: 2px solid #ccc; + padding-top: 1rem; + margin-bottom: 2rem; +} + +.entry .entry-content .wp-block-latest-posts.is-grid li a:after { + content: ''; +} + +.entry .entry-content .wp-block-latest-posts.is-grid li:last-child { + margin-bottom: auto; +} + +.entry .entry-content .wp-block-latest-posts.is-grid li:last-child a:after { + content: ''; +} + +.entry .entry-content .wp-block-preformatted { + font-size: 0.71111em; + line-height: 1.8; + padding: 1rem; +} + +.entry .entry-content .wp-block-verse { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-size: 22px; + line-height: 1.8; +} + +.entry .entry-content .has-drop-cap:not(:focus):first-letter { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 3.375em; + line-height: 1; + font-weight: bold; + margin: 0 0 0 0.25em; +} + +.entry .entry-content .wp-block-pullquote { + border-color: transparent; + border-width: 2px; + padding: 1rem; +} + +.entry .entry-content .wp-block-pullquote blockquote { + color: #111; + border: none; + margin-top: calc(4 * 1rem); + margin-bottom: calc(4.33 * 1rem); + margin-left: 0; + padding-right: 0; +} + +.entry .entry-content .wp-block-pullquote p { + font-size: 1.6875em; + font-style: italic; + line-height: 1.3; + margin-bottom: 0.5em; + margin-top: 0.5em; +} + +.entry .entry-content .wp-block-pullquote p em { + font-style: normal; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-pullquote p { + font-size: 2.25em; + } +} + +.entry .entry-content .wp-block-pullquote cite { + display: inline-block; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + line-height: 1.6; + text-transform: none; + color: #767676; + /* + * This requires a rem-based font size calculation instead of our normal em-based one, + * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. + */ + font-size: calc(1rem / (1.25 * 1.125)); +} + +.entry .entry-content .wp-block-pullquote.alignleft, .entry .entry-content .wp-block-pullquote.alignright { + width: 100%; + padding: 0; +} + +.entry .entry-content .wp-block-pullquote.alignleft blockquote, .entry .entry-content .wp-block-pullquote.alignright blockquote { + margin: 1rem 0; + padding: 0; + text-align: right; + max-width: 100%; +} + +.entry .entry-content .wp-block-pullquote.alignleft blockquote p:first-child, .entry .entry-content .wp-block-pullquote.alignright blockquote p:first-child { + margin-top: 0; +} + +.entry .entry-content .wp-block-pullquote.is-style-solid-color { + background-color: #0073aa; + padding-right: 0; + padding-left: 0; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-pullquote.is-style-solid-color { + padding-right: 10%; + padding-left: 10%; + } +} + +.entry .entry-content .wp-block-pullquote.is-style-solid-color p { + font-size: 1.6875em; + line-height: 1.3; + margin-bottom: 0.5em; + margin-top: 0.5em; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-pullquote.is-style-solid-color p { + font-size: 2.25em; + } +} + +.entry .entry-content .wp-block-pullquote.is-style-solid-color a { + color: #fff; +} + +.entry .entry-content .wp-block-pullquote.is-style-solid-color cite { + color: inherit; +} + +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote { + max-width: 100%; + color: #fff; + padding-right: 0; + margin-right: 1rem; + margin-left: 1rem; +} + +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-text-color p, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-text-color a, .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color, .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color, .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color, .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color, .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-white-color { + color: inherit; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote { + margin-right: 0; + margin-left: 0; + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-pullquote.is-style-solid-color.alignright, .entry .entry-content .wp-block-pullquote.is-style-solid-color.alignleft { + padding: 1rem calc(2 * 1rem); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-pullquote.is-style-solid-color.alignfull { + padding-right: calc(10% + 58px + (2 * 1rem)); + padding-left: calc(10% + 58px + (2 * 1rem)); + } +} + +.entry .entry-content .wp-block-quote:not(.is-large), .entry .entry-content .wp-block-quote:not(.is-style-large) { + border-width: 2px; + border-color: #0073aa; + padding-top: 0; + padding-bottom: 0; +} + +.entry .entry-content .wp-block-quote p { + font-size: 1em; + font-style: normal; + line-height: 1.8; +} + +.entry .entry-content .wp-block-quote cite { + /* + * This requires a rem-based font size calculation instead of our normal em-based one, + * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. + */ + font-size: calc(1rem / (1.25 * 1.125)); +} + +.entry .entry-content .wp-block-quote.is-large, .entry .entry-content .wp-block-quote.is-style-large { + margin: 1rem 0; + padding: 0; + border-right: none; +} + +.entry .entry-content .wp-block-quote.is-large p, .entry .entry-content .wp-block-quote.is-style-large p { + font-size: 1.6875em; + line-height: 1.4; + font-style: italic; +} + +.entry .entry-content .wp-block-quote.is-large cite, +.entry .entry-content .wp-block-quote.is-large footer, .entry .entry-content .wp-block-quote.is-style-large cite, +.entry .entry-content .wp-block-quote.is-style-large footer { + /* + * This requires a rem-based font size calculation instead of our normal em-based one, + * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. + */ + font-size: calc(1rem / (1.25 * 1.125)); +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-quote.is-large, .entry .entry-content .wp-block-quote.is-style-large { + margin: 1rem 0; + padding: 1rem 0; + } + .entry .entry-content .wp-block-quote.is-large p, .entry .entry-content .wp-block-quote.is-style-large p { + font-size: 1.6875em; + } +} + +.entry .entry-content .wp-block-image { + max-width: 100%; +} + +.entry .entry-content .wp-block-image img { + display: block; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-image:not(.alignwide):not(.alignfull) > img { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-image:not(.alignwide):not(.alignfull) > img { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-image .aligncenter { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-image .aligncenter { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-image .aligncenter { + margin: 0; + width: calc(8 * (100vw / 12) - 28px); + } + .entry .entry-content .wp-block-image .aligncenter img { + margin: 0 auto; + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-image .aligncenter { + width: calc(6 * (100vw / 12) - 28px); + } + .entry .entry-content .wp-block-image .aligncenter img { + margin: 0 auto; + } +} + +.entry .entry-content .wp-block-image.alignfull img { + width: 100vw; + max-width: calc( 100% + (2 * 1rem)); +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-image.alignfull img { + max-width: calc( 125% + 150px); + margin-right: auto; + margin-left: auto; + } +} + +.entry .entry-content .wp-block-cover-image, +.entry .entry-content .wp-block-cover { + position: relative; + min-height: 430px; + padding: 1rem; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-cover-image, + .entry .entry-content .wp-block-cover { + padding: 1rem 10%; + } +} + +.entry .entry-content .wp-block-cover-image .wp-block-cover-image-text, +.entry .entry-content .wp-block-cover-image .wp-block-cover-text, +.entry .entry-content .wp-block-cover-image h2, +.entry .entry-content .wp-block-cover .wp-block-cover-image-text, +.entry .entry-content .wp-block-cover .wp-block-cover-text, +.entry .entry-content .wp-block-cover h2 { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 1.6875em; + font-weight: bold; + line-height: 1.25; + padding: 0; + color: #fff; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover-image .wp-block-cover-text, + .entry .entry-content .wp-block-cover-image h2, + .entry .entry-content .wp-block-cover .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover .wp-block-cover-text, + .entry .entry-content .wp-block-cover h2 { + font-size: 2.25em; + max-width: 100%; + } +} + +.entry .entry-content .wp-block-cover-image.alignleft, .entry .entry-content .wp-block-cover-image.alignright, +.entry .entry-content .wp-block-cover.alignleft, +.entry .entry-content .wp-block-cover.alignright { + width: 100%; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-cover-image.alignleft, .entry .entry-content .wp-block-cover-image.alignright, + .entry .entry-content .wp-block-cover.alignleft, + .entry .entry-content .wp-block-cover.alignright { + padding: 1rem calc(2 * 1rem); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-cover-image.alignfull .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover-image.alignfull .wp-block-cover-text, + .entry .entry-content .wp-block-cover-image.alignfull h2, + .entry .entry-content .wp-block-cover.alignfull .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover.alignfull .wp-block-cover-text, + .entry .entry-content .wp-block-cover.alignfull h2 { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-cover-image.alignfull .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover-image.alignfull .wp-block-cover-text, + .entry .entry-content .wp-block-cover-image.alignfull h2, + .entry .entry-content .wp-block-cover.alignfull .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover.alignfull .wp-block-cover-text, + .entry .entry-content .wp-block-cover.alignfull h2 { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-cover-image.alignfull, + .entry .entry-content .wp-block-cover.alignfull { + padding-right: calc(10% + 58px + (2 * 1rem)); + padding-left: calc(10% + 58px + (2 * 1rem)); + } + .entry .entry-content .wp-block-cover-image.alignfull .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover-image.alignfull .wp-block-cover-text, + .entry .entry-content .wp-block-cover-image.alignfull h2, + .entry .entry-content .wp-block-cover.alignfull .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover.alignfull .wp-block-cover-text, + .entry .entry-content .wp-block-cover.alignfull h2 { + padding: 0; + } +} + +.entry .entry-content .wp-block-gallery { + list-style-type: none; + padding-right: 0; +} + +.entry .entry-content .wp-block-gallery .blocks-gallery-image:last-child, +.entry .entry-content .wp-block-gallery .blocks-gallery-item:last-child { + margin-bottom: 16px; +} + +.entry .entry-content .wp-block-gallery figcaption a { + color: #fff; +} + +.entry .entry-content .wp-block-audio figcaption, +.entry .entry-content .wp-block-video figcaption, +.entry .entry-content .wp-block-image figcaption, +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption, +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption { + font-size: 0.71111em; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + line-height: 1.6; + margin: 0; + padding: 0.5rem; + text-align: center; +} + +.entry .entry-content .wp-block-separator, +.entry .entry-content hr { + background-color: #767676; + border: 0; + height: 2px; + margin-bottom: 2rem; + margin-top: 2rem; + max-width: 2.25em; + text-align: right; + /* Remove duplicate rule-line when a separator + * is followed by an H1, or H2 */ +} + +.entry .entry-content .wp-block-separator.is-style-wide, +.entry .entry-content hr.is-style-wide { + max-width: 100%; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-separator.is-style-wide, + .entry .entry-content hr.is-style-wide { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-separator.is-style-wide, + .entry .entry-content hr.is-style-wide { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +.entry .entry-content .wp-block-separator.is-style-dots, +.entry .entry-content hr.is-style-dots { + max-width: 100%; + background-color: inherit; + border: inherit; + height: inherit; + text-align: center; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-separator.is-style-dots, + .entry .entry-content hr.is-style-dots { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-separator.is-style-dots, + .entry .entry-content hr.is-style-dots { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +.entry .entry-content .wp-block-separator.is-style-dots:not(.has-text-color):not(.has-background), +.entry .entry-content hr.is-style-dots:not(.has-text-color):not(.has-background) { + color: #767676; +} + +.entry .entry-content .wp-block-separator.is-style-dots:before, +.entry .entry-content hr.is-style-dots:before { + font-size: 1.6875em; + letter-spacing: 0.88889em; + padding-right: 0.88889em; +} + +.entry .entry-content .wp-block-separator + h1:before, +.entry .entry-content .wp-block-separator + h2:before, +.entry .entry-content hr + h1:before, +.entry .entry-content hr + h2:before { + display: none; +} + +.entry .entry-content .wp-block-embed-twitter { + word-break: break-word; +} + +.entry .entry-content .wp-block-table th, +.entry .entry-content .wp-block-table td { + border-color: #767676; +} + +.entry .entry-content .wp-block-file { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; +} + +.entry .entry-content .wp-block-file .wp-block-file__button { + display: table; + transition: background 150ms ease-in-out; + border: none; + border-radius: 5px; + background: #0073aa; + font-size: 22px; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + line-height: 1.2; + text-decoration: none; + font-weight: bold; + padding: 0.75rem 1rem; + color: #fff; + margin-right: 0; + margin-top: calc(0.75 * 1rem); +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-file .wp-block-file__button { + font-size: 22px; + padding: 0.875rem 1.5rem; + } +} + +.entry .entry-content .wp-block-file .wp-block-file__button:hover { + background: #111; + cursor: pointer; +} + +.entry .entry-content .wp-block-file .wp-block-file__button:focus { + background: #111; + outline: thin dotted; + outline-offset: -4px; +} + +.entry .entry-content .wp-block-code { + border-radius: 0; +} + +.entry .entry-content .wp-block-code code { + font-size: 1.125em; + white-space: pre-wrap; + word-break: break-word; +} + +.entry .entry-content .wp-block-columns .wp-block-column > *:first-child { + margin-top: 0; +} + +.entry .entry-content .wp-block-columns .wp-block-column > *:last-child { + margin-bottom: 0; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-columns .wp-block-image > img:not(.alignwide):not(.alignfull), + .entry .entry-content .wp-block-columns .wp-block-image > figure { + max-width: 100%; + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-columns .wp-block-image > img:not(.alignwide):not(.alignfull), + .entry .entry-content .wp-block-columns .wp-block-image > figure { + max-width: 100%; + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-columns { + flex-wrap: nowrap; + } + .entry .entry-content .wp-block-columns .wp-block-column:not(:first-child) { + margin-right: 32px; + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-group:not(.alignfull) > .wp-block-group__inner-container > .alignfull, + .entry .entry-content .wp-block-group:not(.alignfull) > .wp-block-group__inner-container > .wp-block-image > img { + right: 0; + max-width: 100%; + } +} + +.entry .entry-content .wp-block-group.alignfull > .wp-block-group__inner-container { + max-width: calc(100% - (2 * 1rem)); + margin: 0 1rem; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-group.alignfull > .wp-block-group__inner-container { + max-width: 80%; + margin: 0 10%; + padding: 0 60px; + } +} + +.entry .entry-content .wp-block-group.has-background { + padding: 1rem; + margin-top: 0; + margin-bottom: 0; +} + +.entry .entry-content .wp-block-group.has-background .wp-block-group__inner-container > *:first-child { + margin-top: 0; +} + +.entry .entry-content .wp-block-group.has-background .wp-block-group__inner-container > *:last-child { + margin-bottom: 0; +} + +.entry .entry-content .wp-block-group.has-background.alignfull { + padding-right: 0; + padding-left: 0; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-group.has-background.alignfull { + padding-top: 1rem; + padding-bottom: 1rem; + } +} + +.entry .entry-content .wp-block-group.has-background:not(.alignfull) > .wp-block-group__inner-container > .alignfull { + width: 100%; + max-width: 100%; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-group.has-background:not(.alignfull) > .wp-block-group__inner-container > .alignfull { + width: calc( 100% + 2rem); + max-width: calc( 100% + 2rem); + margin-right: -1rem; + } +} + +.entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-weight: bold; +} + +.entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta .wp-block-latest-comments__comment-date { + font-weight: normal; +} + +.entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment, +.entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-date, +.entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-excerpt p { + font-size: inherit; +} + +.entry .entry-content .wp-block-latest-comments.has-dates .wp-block-latest-comments__comment-date { + font-size: 0.71111em; +} + +.entry .entry-content .has-small-font-size { + font-size: 0.88889em; +} + +.entry .entry-content .has-normal-font-size { + font-size: 1.125em; +} + +.entry .entry-content .has-large-font-size { + font-size: 1.6875em; +} + +.entry .entry-content .has-huge-font-size { + font-size: 2.25em; +} + +.entry .entry-content .has-primary-background-color, +.entry .entry-content .has-secondary-background-color, +.entry .entry-content .has-dark-gray-background-color, +.entry .entry-content .has-light-gray-background-color { + color: #fff; +} + +.entry .entry-content .has-primary-background-color > p, +.entry .entry-content .has-primary-background-color > h1, +.entry .entry-content .has-primary-background-color > h2, +.entry .entry-content .has-primary-background-color > h3, +.entry .entry-content .has-primary-background-color > h4, +.entry .entry-content .has-primary-background-color > h5, +.entry .entry-content .has-primary-background-color > h6, +.entry .entry-content .has-primary-background-color > a, +.entry .entry-content .has-secondary-background-color > p, +.entry .entry-content .has-secondary-background-color > h1, +.entry .entry-content .has-secondary-background-color > h2, +.entry .entry-content .has-secondary-background-color > h3, +.entry .entry-content .has-secondary-background-color > h4, +.entry .entry-content .has-secondary-background-color > h5, +.entry .entry-content .has-secondary-background-color > h6, +.entry .entry-content .has-secondary-background-color > a, +.entry .entry-content .has-dark-gray-background-color > p, +.entry .entry-content .has-dark-gray-background-color > h1, +.entry .entry-content .has-dark-gray-background-color > h2, +.entry .entry-content .has-dark-gray-background-color > h3, +.entry .entry-content .has-dark-gray-background-color > h4, +.entry .entry-content .has-dark-gray-background-color > h5, +.entry .entry-content .has-dark-gray-background-color > h6, +.entry .entry-content .has-dark-gray-background-color > a, +.entry .entry-content .has-light-gray-background-color > p, +.entry .entry-content .has-light-gray-background-color > h1, +.entry .entry-content .has-light-gray-background-color > h2, +.entry .entry-content .has-light-gray-background-color > h3, +.entry .entry-content .has-light-gray-background-color > h4, +.entry .entry-content .has-light-gray-background-color > h5, +.entry .entry-content .has-light-gray-background-color > h6, +.entry .entry-content .has-light-gray-background-color > a { + color: #fff; +} + +.entry .entry-content .has-white-background-color { + color: #111; +} + +.entry .entry-content .has-white-background-color > p, +.entry .entry-content .has-white-background-color > h1, +.entry .entry-content .has-white-background-color > h2, +.entry .entry-content .has-white-background-color > h3, +.entry .entry-content .has-white-background-color > h4, +.entry .entry-content .has-white-background-color > h5, +.entry .entry-content .has-white-background-color > h6, +.entry .entry-content .has-white-background-color > a { + color: #111; +} + +.entry .entry-content .has-primary-background-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color.has-primary-background-color { + background-color: #0073aa; +} + +.entry .entry-content .has-secondary-background-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color.has-secondary-background-color { + background-color: #005177; +} + +.entry .entry-content .has-dark-gray-background-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color.has-dark-gray-background-color { + background-color: #111; +} + +.entry .entry-content .has-light-gray-background-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color.has-light-gray-background-color { + background-color: #767676; +} + +.entry .entry-content .has-white-background-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color.has-white-background-color { + background-color: #FFF; +} + +.entry .entry-content .has-primary-color, +.entry .entry-content .wp-block-pullquote blockquote.has-primary-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color > p { + color: #0073aa; +} + +.entry .entry-content .has-secondary-color, +.entry .entry-content .wp-block-pullquote blockquote.has-secondary-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color > p { + color: #005177; +} + +.entry .entry-content .has-dark-gray-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color > p { + color: #111; +} + +.entry .entry-content .has-light-gray-color, +.entry .entry-content .wp-block-pullquote blockquote.has-light-gray-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color > p { + color: #767676; +} + +.entry .entry-content .has-white-color, +.entry .entry-content .wp-block-pullquote blockquote.has-white-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-white-color { + color: #FFF; +} + +/* Media */ +.page-content .wp-smiley, +.entry-content .wp-smiley, +.comment-content .wp-smiley { + border: none; + margin-bottom: 0; + margin-top: 0; + padding: 0; +} + +embed, +iframe, +object { + max-width: 100%; +} + +.custom-logo-link { + display: inline-block; +} + +.avatar { + border-radius: 100%; + display: block; + height: calc(2.25 * 1rem); + min-height: inherit; + width: calc(2.25 * 1rem); +} + +svg { + transition: fill 120ms ease-in-out; + fill: currentColor; +} + +/*-------------------------------------------------------------- +## Captions +--------------------------------------------------------------*/ +.wp-caption { + margin-bottom: calc(1.5 * 1rem); +} + +@media only screen and (min-width: 768px) { + .wp-caption.aligncenter { + position: relative; + right: calc( calc(8 * (100vw / 12) - 28px) / 2); + transform: translateX(50%); + } +} + +@media only screen and (min-width: 1168px) { + .wp-caption.aligncenter { + right: calc( calc(6 * (100vw / 12) - 28px) / 2); + } +} + +.wp-caption img[class*="wp-image-"] { + display: block; + margin-right: auto; + margin-left: auto; +} + +.wp-caption-text { + color: #767676; + font-size: 0.71111em; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + line-height: 1.6; + margin: 0; + padding: 0.5rem; + text-align: center; +} + +/*-------------------------------------------------------------- +## Galleries +--------------------------------------------------------------*/ +.gallery { + display: flex; + flex-flow: row wrap; + justify-content: center; + margin-bottom: calc(1.5 * 1rem); +} + +.gallery-item { + display: inline-block; + margin-left: 16px; + margin-bottom: 16px; + text-align: center; + vertical-align: top; + width: 100%; +} + +.gallery-columns-2 .gallery-item { + max-width: calc((100% - 16px * 1) / 2); +} + +.gallery-columns-2 .gallery-item:nth-of-type(2n+2) { + margin-left: 0; +} + +.gallery-columns-3 .gallery-item { + max-width: calc((100% - 16px * 2) / 3); +} + +.gallery-columns-3 .gallery-item:nth-of-type(3n+3) { + margin-left: 0; +} + +.gallery-columns-4 .gallery-item { + max-width: calc((100% - 16px * 3) / 4); +} + +.gallery-columns-4 .gallery-item:nth-of-type(4n+4) { + margin-left: 0; +} + +.gallery-columns-5 .gallery-item { + max-width: calc((100% - 16px * 4) / 5); +} + +.gallery-columns-5 .gallery-item:nth-of-type(5n+5) { + margin-left: 0; +} + +.gallery-columns-6 .gallery-item { + max-width: calc((100% - 16px * 5) / 6); +} + +.gallery-columns-6 .gallery-item:nth-of-type(6n+6) { + margin-left: 0; +} + +.gallery-columns-7 .gallery-item { + max-width: calc((100% - 16px * 6) / 7); +} + +.gallery-columns-7 .gallery-item:nth-of-type(7n+7) { + margin-left: 0; +} + +.gallery-columns-8 .gallery-item { + max-width: calc((100% - 16px * 7) / 8); +} + +.gallery-columns-8 .gallery-item:nth-of-type(8n+8) { + margin-left: 0; +} + +.gallery-columns-9 .gallery-item { + max-width: calc((100% - 16px * 8) / 9); +} + +.gallery-columns-9 .gallery-item:nth-of-type(9n+9) { + margin-left: 0; +} + +.gallery-item:last-of-type { + padding-left: 0; +} + +.gallery-caption { + display: block; + font-size: 0.71111em; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + line-height: 1.6; + margin: 0; + padding: 0.5rem; +} + +.gallery-item > div > a { + display: block; + line-height: 0; + box-shadow: 0 0 0 0 transparent; +} + +.gallery-item > div > a:focus { + box-shadow: 0 0 0 2px #0073aa; +} diff --git a/wp-content/themes/twentynineteen/style.css b/wp-content/themes/twentynineteen/style.css new file mode 100644 index 0000000..6f81778 --- /dev/null +++ b/wp-content/themes/twentynineteen/style.css @@ -0,0 +1,6525 @@ +@charset "UTF-8"; +/* +Theme Name: Twenty Nineteen +Theme URI: https://wordpress.org/themes/twentynineteen/ +Author: the WordPress team +Author URI: https://wordpress.org/ +Description: Our 2019 default theme is designed to show off the power of the block editor. It features custom styles for all the default blocks, and is built so that what you see in the editor looks like what you'll see on your website. Twenty Nineteen is designed to be adaptable to a wide range of websites, whether you’re running a photo blog, launching a new business, or supporting a non-profit. Featuring ample whitespace and modern sans-serif headlines paired with classic serif body text, it's built to be beautiful on all screen sizes. +Requires at least: 4.9.6 +Requires PHP: 5.2.4 +Version: 1.5 +License: GNU General Public License v2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html +Text Domain: twentynineteen +Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, rtl-language-support, sticky-post, threaded-comments, translation-ready + +This theme, like WordPress, is licensed under the GPL. +Use it to make something cool, have fun, and share what you've learned with others. + +Twenty Nineteen is based on Underscores https://underscores.me/, (C) 2012-2019 Automattic, Inc. +Underscores is distributed under the terms of the GNU GPL v2 or later. + +Normalizing styles have been helped along thanks to the fine work of +Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/ +*/ +/*-------------------------------------------------------------- +>>> TABLE OF CONTENTS: +---------------------------------------------------------------- +# Variables +# Normalize +# Typography + ## Headings + ## Copy +# Elements + ## Lists + ## Tables +# Forms + ## Buttons + ## Fields +# Navigation + ## Links + ## Menus + ## Next & Previous +# Accessibility +# Alignments +# Clearings +# Layout +# Widgets +# Content + ## Archives + ## Posts and pages + ## Comments +# Blocks +# Media + ## Captions + ## Galleries +--------------------------------------------------------------*/ +/* + * Chrome renders extra-wide   characters for the Hoefler Text font. + * This results in a jumping cursor when typing in both the Classic and block + * editors. The following font-face override fixes the issue by manually inserting + * a custom font that includes just a Hoefler Text space replacement for that + * character instead. + */ +@font-face { + font-family: 'NonBreakingSpaceOverride'; + src: url(data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAAAMoAA0AAAAACDQAAALTAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGh4GYACCahEICjx3CywAATYCJANUBCAFhiEHgWwbXQfILgpsY+rQRRARwyAs6uL7pxzYhxEE+32b3aeHmifR6tklkS9hiZA0ewkqGRJE+H7/+6378ASViK/PGeavqJyOzsceKi1s3BCiQsiOdn1r/RBgIJYEgCUhbm/8/8/h4saPssnTNkkiWUBrTRtjmQSajw3Ui3pZ3LYDPD+XG2C3JA/yKAS8/rU5eNfuGqRf4eNNgV4YAlIIgxglEkWe6FYpq10+wi3g+/nUgvgPFczNrz/RsTgVm/zfbPuHZlsuQECxuyqBcQwKFBjFgKO8AqP4bAN9tFJtnM9xPcbNjeXS/x1wY/xU52f5W/X1+9cnH4YwKIaoRRAkUkj/YlAAeF/624foiIDBgBmgQBeGAyhBljUPZUm/l2dTvmpqcBDUOHdbPZWd8JsBAsGr4w8/EDn82/bUPx4eh0YNrQTBuHO2FjQEAGBwK0DeI37DpQVqdERS4gZBhpeUhWCfLFz7J99aEBgsJCHvUGAdAPp4IADDCAPCEFMGpMZ9AQpTfQtQGhLbGVBZFV8BaqNyP68oTZgHNj3M8kBPfXTTC9t90UuzYhy9ciH0grVlOcqyCytisvbsERsEYztiznR0WCrmTksJwbSNK6fd1Rvr25I9oLvctUoEbNOmXJbqgYgPXEHJ82IUsrCnpkxh23F1rfZ2zcRnJYoXtauB3VTFkFXQg3uoZYD5qE0kdjDtoDoF1h2bulGmev5HbYhbrjtohQSRI4aNOkffIcT+d3v6atpaYh3JvPoQsztCcqvaBkppDSPcQ3bw3KaCBo1f5CJWTZEgW3LjLofYg51MaVezrx8xZitYbQ9KYeoRaqQdVLwSEfrKXLK1otCWOKNdR/YwYAfon5Yk8O2MJfSD10dPGA5PIJJQMkah0ugMJiv6x4Dm7LEa8xnrRGGGLAg4sAlbsA07sAt76DOsXKO3hIjtIlpnnFrt1qW4kh6NhS83P/6HB/fl1SMAAA==) format("woff2"), url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUQAA0AAAAACDQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAE9AAAABwAAAAchf5yU0dERUYAAATYAAAAHAAAAB4AJwAbT1MvMgAAAaAAAABJAAAAYJAcgU5jbWFwAAACIAAAAF4AAAFqUUxBZ2dhc3AAAATQAAAACAAAAAgAAAAQZ2x5ZgAAApAAAAAyAAAAPL0n8y9oZWFkAAABMAAAADAAAAA2Fi93Z2hoZWEAAAFgAAAAHQAAACQOSgWaaG10eAAAAewAAAAzAAAAVC7TAQBsb2NhAAACgAAAABAAAAAsAOQBAm1heHAAAAGAAAAAHQAAACAAWQALbmFtZQAAAsQAAAF6AAADIYvD/Adwb3N0AAAEQAAAAI4AAADsapk2o3jaY2BkYGAA4ov5mwzj+W2+MnCzXwCKMNzgCBSB0LfbQDQ7AxuI4mBgAlEAFKQIRHjaY2BkYGD3+NvCwMDBAALsDAyMDKhAFAA3+wH3AAAAeNpjYGRgYBBl4GBgYgABEMnIABJzAPMZAAVmAGUAAAB42mNgZlJhnMDAysDCKsKygYGBYRqEZtrDYMT4D8gHSmEHjgUFOQwODAqqf9g9/rYwMLB7MNUAhRlBcsxBrMlASoGBEQAj8QtyAAAAeNrjYGBkAAGmWQwMjO8gmBnIZ2NA0ExAzNjAAFYJVn0ASBsD6VAIDZb7AtELAgANIgb9AHjaY2BgYGaAYBkGRgYQSAHyGMF8FgYPIM3HwMHAxMDGoMCwQIFLQV8hXvXP//9AcRCfAcb///h/ygPW+w/vb7olBjUHCTCyMcAFGZmABBO6AogThgZgIUsXAEDcEzcAAHjaY2BgECMCyoEgACZaAed42mNgYmRgYGBnYGNgYAZSDJqMgorCgoqCjECRXwwNrCAKSP5mAAFGBiRgyAAAi/YFBQAAeNqtkc1OwkAUhU/5M25cEhcsZick0AwlBJq6MWwgJkAgYV/KAA2lJeUn+hY+gktXvpKv4dLTMqKycGHsTZNv7px7z50ZAFd4hYHjdw1Ls4EiHjVncIFnzVnc4F1zDkWjrzmPW+NNcwGlzIRKI3fJlUyrEjZQxb3mDH2fNGfRx4vmHKqG0JzHg6E0F9DOlFBGBxUI1GEzLNT4S0aLuTtsGAEUuYcQHkyg3KmIum1bNUvKlrjbbAIleqHHnS4iSudpQcySMYtdFiXlAxzSbAwfMxK6kZoHKhbjjespMTioOPZnzI+4ucCeTVyKMVKLfeAS6vSWaTinuZwzyy/Dc7vaed+6KaV0kukdPUk6yOcctZPvvxxqksq2lEW8RvHjMEO2FCl/zy6p3NEm0R9OFSafJdldc4QVeyaaObMBO0/5cCaa6d9Ggyubxire+lEojscdjoWUR1xGOy8KD8mG2ZLO2l2paDc3A39qmU2z2W5YNv5+u79e6QfGJY/hAAB42m3NywrCMBQE0DupWp/1AYI7/6DEaLQu66Mrd35BKUWKJSlFv1+rue4cGM7shgR981qSon+ZNwUJ8iDgoYU2OvDRRQ99DDDECAHGmGCKmf80hZSx/Kik/LliFbtmN6xmt+yOjdg9GztV4tROnRwX/Bsaaw51nt4Lc7tWaZYHp/MlzKx51LZs5htNri+2AAAAAQAB//8AD3jaY2BkYGDgAWIxIGZiYARCESBmAfMYAAR6AEMAAAABAAAAANXtRbgAAAAA2AhRFAAAAADYCNuG) format("woff"); +} + +/* If we add the border using a regular CSS border, it won't look good on non-retina devices, + * since its edges can look jagged due to lack of antialiasing. In this case, we are several + * layers of box-shadow to add the border visually, which will render the border smoother. */ +/* Calculates maximum width for post content */ +/* Nested sub-menu padding: 10 levels deep */ +/* Ensure all font family declarations come with non-latin fallbacks */ +/* Build our non-latin font styles */ +body:lang(ar), button:lang(ar), +input:lang(ar), +select:lang(ar), +optgroup:lang(ar), +textarea:lang(ar), .author-description .author-link:lang(ar), +.comment-metadata:lang(ar), +.comment-reply-link:lang(ar), +.comments-title:lang(ar), +.comment-author .fn:lang(ar), +.discussion-meta-info:lang(ar), +.entry-meta:lang(ar), +.entry-footer:lang(ar), +.main-navigation:lang(ar), +.no-comments:lang(ar), +.not-found .page-title:lang(ar), +.error-404 .page-title:lang(ar), +.post-navigation .post-title:lang(ar), +.page-links:lang(ar), +.page-description:lang(ar), +.pagination .nav-links:lang(ar), +.sticky-post:lang(ar), +.site-title:lang(ar), +.site-info:lang(ar), +#cancel-comment-reply-link:lang(ar), +h1:lang(ar), +h2:lang(ar), +h3:lang(ar), +h4:lang(ar), +h5:lang(ar), +h6:lang(ar), .page-title:lang(ar), blockquote cite:lang(ar), table:lang(ar), .button:lang(ar), +input:lang(ar)[type="button"], +input:lang(ar)[type="reset"], +input:lang(ar)[type="submit"], .comment-navigation .nav-previous:lang(ar), +.comment-navigation .nav-next:lang(ar), .comment-list .pingback .comment-body:lang(ar), +.comment-list .trackback .comment-body:lang(ar), .comment-list .pingback .comment-body .comment-edit-link:lang(ar), +.comment-list .trackback .comment-body .comment-edit-link:lang(ar), .comment-form .comment-notes:lang(ar), +.comment-form label:lang(ar), .widget_archive ul li:lang(ar), +.widget_categories ul li:lang(ar), +.widget_meta ul li:lang(ar), +.widget_nav_menu ul li:lang(ar), +.widget_pages ul li:lang(ar), +.widget_recent_comments ul li:lang(ar), +.widget_recent_entries ul li:lang(ar), +.widget_rss ul li:lang(ar), .widget_tag_cloud .tagcloud:lang(ar), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ar), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ar), .entry .entry-content .wp-block-archives li > a:lang(ar), +.entry .entry-content .wp-block-categories li > a:lang(ar), +.entry .entry-content .wp-block-latest-posts li > a:lang(ar), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ar), .entry .entry-content .wp-block-verse:lang(ar), .entry .entry-content .has-drop-cap:lang(ar):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ar), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ar), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ar), +.entry .entry-content .wp-block-cover-image h2:lang(ar), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ar), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ar), +.entry .entry-content .wp-block-cover h2:lang(ar), .entry .entry-content .wp-block-audio figcaption:lang(ar), +.entry .entry-content .wp-block-video figcaption:lang(ar), +.entry .entry-content .wp-block-image figcaption:lang(ar), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ar), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ar), .entry .entry-content .wp-block-file:lang(ar), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ar), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ar), .wp-caption-text:lang(ar), .gallery-caption:lang(ar) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(ary), button:lang(ary), +input:lang(ary), +select:lang(ary), +optgroup:lang(ary), +textarea:lang(ary), .author-description .author-link:lang(ary), +.comment-metadata:lang(ary), +.comment-reply-link:lang(ary), +.comments-title:lang(ary), +.comment-author .fn:lang(ary), +.discussion-meta-info:lang(ary), +.entry-meta:lang(ary), +.entry-footer:lang(ary), +.main-navigation:lang(ary), +.no-comments:lang(ary), +.not-found .page-title:lang(ary), +.error-404 .page-title:lang(ary), +.post-navigation .post-title:lang(ary), +.page-links:lang(ary), +.page-description:lang(ary), +.pagination .nav-links:lang(ary), +.sticky-post:lang(ary), +.site-title:lang(ary), +.site-info:lang(ary), +#cancel-comment-reply-link:lang(ary), +h1:lang(ary), +h2:lang(ary), +h3:lang(ary), +h4:lang(ary), +h5:lang(ary), +h6:lang(ary), .page-title:lang(ary), blockquote cite:lang(ary), table:lang(ary), .button:lang(ary), +input:lang(ary)[type="button"], +input:lang(ary)[type="reset"], +input:lang(ary)[type="submit"], .comment-navigation .nav-previous:lang(ary), +.comment-navigation .nav-next:lang(ary), .comment-list .pingback .comment-body:lang(ary), +.comment-list .trackback .comment-body:lang(ary), .comment-list .pingback .comment-body .comment-edit-link:lang(ary), +.comment-list .trackback .comment-body .comment-edit-link:lang(ary), .comment-form .comment-notes:lang(ary), +.comment-form label:lang(ary), .widget_archive ul li:lang(ary), +.widget_categories ul li:lang(ary), +.widget_meta ul li:lang(ary), +.widget_nav_menu ul li:lang(ary), +.widget_pages ul li:lang(ary), +.widget_recent_comments ul li:lang(ary), +.widget_recent_entries ul li:lang(ary), +.widget_rss ul li:lang(ary), .widget_tag_cloud .tagcloud:lang(ary), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ary), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ary), .entry .entry-content .wp-block-archives li > a:lang(ary), +.entry .entry-content .wp-block-categories li > a:lang(ary), +.entry .entry-content .wp-block-latest-posts li > a:lang(ary), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ary), .entry .entry-content .wp-block-verse:lang(ary), .entry .entry-content .has-drop-cap:lang(ary):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ary), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ary), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ary), +.entry .entry-content .wp-block-cover-image h2:lang(ary), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ary), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ary), +.entry .entry-content .wp-block-cover h2:lang(ary), .entry .entry-content .wp-block-audio figcaption:lang(ary), +.entry .entry-content .wp-block-video figcaption:lang(ary), +.entry .entry-content .wp-block-image figcaption:lang(ary), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ary), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ary), .entry .entry-content .wp-block-file:lang(ary), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ary), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ary), .wp-caption-text:lang(ary), .gallery-caption:lang(ary) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(azb), button:lang(azb), +input:lang(azb), +select:lang(azb), +optgroup:lang(azb), +textarea:lang(azb), .author-description .author-link:lang(azb), +.comment-metadata:lang(azb), +.comment-reply-link:lang(azb), +.comments-title:lang(azb), +.comment-author .fn:lang(azb), +.discussion-meta-info:lang(azb), +.entry-meta:lang(azb), +.entry-footer:lang(azb), +.main-navigation:lang(azb), +.no-comments:lang(azb), +.not-found .page-title:lang(azb), +.error-404 .page-title:lang(azb), +.post-navigation .post-title:lang(azb), +.page-links:lang(azb), +.page-description:lang(azb), +.pagination .nav-links:lang(azb), +.sticky-post:lang(azb), +.site-title:lang(azb), +.site-info:lang(azb), +#cancel-comment-reply-link:lang(azb), +h1:lang(azb), +h2:lang(azb), +h3:lang(azb), +h4:lang(azb), +h5:lang(azb), +h6:lang(azb), .page-title:lang(azb), blockquote cite:lang(azb), table:lang(azb), .button:lang(azb), +input:lang(azb)[type="button"], +input:lang(azb)[type="reset"], +input:lang(azb)[type="submit"], .comment-navigation .nav-previous:lang(azb), +.comment-navigation .nav-next:lang(azb), .comment-list .pingback .comment-body:lang(azb), +.comment-list .trackback .comment-body:lang(azb), .comment-list .pingback .comment-body .comment-edit-link:lang(azb), +.comment-list .trackback .comment-body .comment-edit-link:lang(azb), .comment-form .comment-notes:lang(azb), +.comment-form label:lang(azb), .widget_archive ul li:lang(azb), +.widget_categories ul li:lang(azb), +.widget_meta ul li:lang(azb), +.widget_nav_menu ul li:lang(azb), +.widget_pages ul li:lang(azb), +.widget_recent_comments ul li:lang(azb), +.widget_recent_entries ul li:lang(azb), +.widget_rss ul li:lang(azb), .widget_tag_cloud .tagcloud:lang(azb), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(azb), .entry .entry-content .wp-block-button .wp-block-button__link:lang(azb), .entry .entry-content .wp-block-archives li > a:lang(azb), +.entry .entry-content .wp-block-categories li > a:lang(azb), +.entry .entry-content .wp-block-latest-posts li > a:lang(azb), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(azb), .entry .entry-content .wp-block-verse:lang(azb), .entry .entry-content .has-drop-cap:lang(azb):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(azb), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(azb), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(azb), +.entry .entry-content .wp-block-cover-image h2:lang(azb), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(azb), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(azb), +.entry .entry-content .wp-block-cover h2:lang(azb), .entry .entry-content .wp-block-audio figcaption:lang(azb), +.entry .entry-content .wp-block-video figcaption:lang(azb), +.entry .entry-content .wp-block-image figcaption:lang(azb), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(azb), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(azb), .entry .entry-content .wp-block-file:lang(azb), .entry .entry-content .wp-block-file .wp-block-file__button:lang(azb), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(azb), .wp-caption-text:lang(azb), .gallery-caption:lang(azb) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(ckb), button:lang(ckb), +input:lang(ckb), +select:lang(ckb), +optgroup:lang(ckb), +textarea:lang(ckb), .author-description .author-link:lang(ckb), +.comment-metadata:lang(ckb), +.comment-reply-link:lang(ckb), +.comments-title:lang(ckb), +.comment-author .fn:lang(ckb), +.discussion-meta-info:lang(ckb), +.entry-meta:lang(ckb), +.entry-footer:lang(ckb), +.main-navigation:lang(ckb), +.no-comments:lang(ckb), +.not-found .page-title:lang(ckb), +.error-404 .page-title:lang(ckb), +.post-navigation .post-title:lang(ckb), +.page-links:lang(ckb), +.page-description:lang(ckb), +.pagination .nav-links:lang(ckb), +.sticky-post:lang(ckb), +.site-title:lang(ckb), +.site-info:lang(ckb), +#cancel-comment-reply-link:lang(ckb), +h1:lang(ckb), +h2:lang(ckb), +h3:lang(ckb), +h4:lang(ckb), +h5:lang(ckb), +h6:lang(ckb), .page-title:lang(ckb), blockquote cite:lang(ckb), table:lang(ckb), .button:lang(ckb), +input:lang(ckb)[type="button"], +input:lang(ckb)[type="reset"], +input:lang(ckb)[type="submit"], .comment-navigation .nav-previous:lang(ckb), +.comment-navigation .nav-next:lang(ckb), .comment-list .pingback .comment-body:lang(ckb), +.comment-list .trackback .comment-body:lang(ckb), .comment-list .pingback .comment-body .comment-edit-link:lang(ckb), +.comment-list .trackback .comment-body .comment-edit-link:lang(ckb), .comment-form .comment-notes:lang(ckb), +.comment-form label:lang(ckb), .widget_archive ul li:lang(ckb), +.widget_categories ul li:lang(ckb), +.widget_meta ul li:lang(ckb), +.widget_nav_menu ul li:lang(ckb), +.widget_pages ul li:lang(ckb), +.widget_recent_comments ul li:lang(ckb), +.widget_recent_entries ul li:lang(ckb), +.widget_rss ul li:lang(ckb), .widget_tag_cloud .tagcloud:lang(ckb), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ckb), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ckb), .entry .entry-content .wp-block-archives li > a:lang(ckb), +.entry .entry-content .wp-block-categories li > a:lang(ckb), +.entry .entry-content .wp-block-latest-posts li > a:lang(ckb), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ckb), .entry .entry-content .wp-block-verse:lang(ckb), .entry .entry-content .has-drop-cap:lang(ckb):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ckb), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ckb), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ckb), +.entry .entry-content .wp-block-cover-image h2:lang(ckb), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ckb), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ckb), +.entry .entry-content .wp-block-cover h2:lang(ckb), .entry .entry-content .wp-block-audio figcaption:lang(ckb), +.entry .entry-content .wp-block-video figcaption:lang(ckb), +.entry .entry-content .wp-block-image figcaption:lang(ckb), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ckb), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ckb), .entry .entry-content .wp-block-file:lang(ckb), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ckb), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ckb), .wp-caption-text:lang(ckb), .gallery-caption:lang(ckb) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(fa-IR), button:lang(fa-IR), +input:lang(fa-IR), +select:lang(fa-IR), +optgroup:lang(fa-IR), +textarea:lang(fa-IR), .author-description .author-link:lang(fa-IR), +.comment-metadata:lang(fa-IR), +.comment-reply-link:lang(fa-IR), +.comments-title:lang(fa-IR), +.comment-author .fn:lang(fa-IR), +.discussion-meta-info:lang(fa-IR), +.entry-meta:lang(fa-IR), +.entry-footer:lang(fa-IR), +.main-navigation:lang(fa-IR), +.no-comments:lang(fa-IR), +.not-found .page-title:lang(fa-IR), +.error-404 .page-title:lang(fa-IR), +.post-navigation .post-title:lang(fa-IR), +.page-links:lang(fa-IR), +.page-description:lang(fa-IR), +.pagination .nav-links:lang(fa-IR), +.sticky-post:lang(fa-IR), +.site-title:lang(fa-IR), +.site-info:lang(fa-IR), +#cancel-comment-reply-link:lang(fa-IR), +h1:lang(fa-IR), +h2:lang(fa-IR), +h3:lang(fa-IR), +h4:lang(fa-IR), +h5:lang(fa-IR), +h6:lang(fa-IR), .page-title:lang(fa-IR), blockquote cite:lang(fa-IR), table:lang(fa-IR), .button:lang(fa-IR), +input:lang(fa-IR)[type="button"], +input:lang(fa-IR)[type="reset"], +input:lang(fa-IR)[type="submit"], .comment-navigation .nav-previous:lang(fa-IR), +.comment-navigation .nav-next:lang(fa-IR), .comment-list .pingback .comment-body:lang(fa-IR), +.comment-list .trackback .comment-body:lang(fa-IR), .comment-list .pingback .comment-body .comment-edit-link:lang(fa-IR), +.comment-list .trackback .comment-body .comment-edit-link:lang(fa-IR), .comment-form .comment-notes:lang(fa-IR), +.comment-form label:lang(fa-IR), .widget_archive ul li:lang(fa-IR), +.widget_categories ul li:lang(fa-IR), +.widget_meta ul li:lang(fa-IR), +.widget_nav_menu ul li:lang(fa-IR), +.widget_pages ul li:lang(fa-IR), +.widget_recent_comments ul li:lang(fa-IR), +.widget_recent_entries ul li:lang(fa-IR), +.widget_rss ul li:lang(fa-IR), .widget_tag_cloud .tagcloud:lang(fa-IR), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(fa-IR), .entry .entry-content .wp-block-button .wp-block-button__link:lang(fa-IR), .entry .entry-content .wp-block-archives li > a:lang(fa-IR), +.entry .entry-content .wp-block-categories li > a:lang(fa-IR), +.entry .entry-content .wp-block-latest-posts li > a:lang(fa-IR), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(fa-IR), .entry .entry-content .wp-block-verse:lang(fa-IR), .entry .entry-content .has-drop-cap:lang(fa-IR):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(fa-IR), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(fa-IR), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(fa-IR), +.entry .entry-content .wp-block-cover-image h2:lang(fa-IR), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(fa-IR), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(fa-IR), +.entry .entry-content .wp-block-cover h2:lang(fa-IR), .entry .entry-content .wp-block-audio figcaption:lang(fa-IR), +.entry .entry-content .wp-block-video figcaption:lang(fa-IR), +.entry .entry-content .wp-block-image figcaption:lang(fa-IR), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(fa-IR), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(fa-IR), .entry .entry-content .wp-block-file:lang(fa-IR), .entry .entry-content .wp-block-file .wp-block-file__button:lang(fa-IR), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(fa-IR), .wp-caption-text:lang(fa-IR), .gallery-caption:lang(fa-IR) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(haz), button:lang(haz), +input:lang(haz), +select:lang(haz), +optgroup:lang(haz), +textarea:lang(haz), .author-description .author-link:lang(haz), +.comment-metadata:lang(haz), +.comment-reply-link:lang(haz), +.comments-title:lang(haz), +.comment-author .fn:lang(haz), +.discussion-meta-info:lang(haz), +.entry-meta:lang(haz), +.entry-footer:lang(haz), +.main-navigation:lang(haz), +.no-comments:lang(haz), +.not-found .page-title:lang(haz), +.error-404 .page-title:lang(haz), +.post-navigation .post-title:lang(haz), +.page-links:lang(haz), +.page-description:lang(haz), +.pagination .nav-links:lang(haz), +.sticky-post:lang(haz), +.site-title:lang(haz), +.site-info:lang(haz), +#cancel-comment-reply-link:lang(haz), +h1:lang(haz), +h2:lang(haz), +h3:lang(haz), +h4:lang(haz), +h5:lang(haz), +h6:lang(haz), .page-title:lang(haz), blockquote cite:lang(haz), table:lang(haz), .button:lang(haz), +input:lang(haz)[type="button"], +input:lang(haz)[type="reset"], +input:lang(haz)[type="submit"], .comment-navigation .nav-previous:lang(haz), +.comment-navigation .nav-next:lang(haz), .comment-list .pingback .comment-body:lang(haz), +.comment-list .trackback .comment-body:lang(haz), .comment-list .pingback .comment-body .comment-edit-link:lang(haz), +.comment-list .trackback .comment-body .comment-edit-link:lang(haz), .comment-form .comment-notes:lang(haz), +.comment-form label:lang(haz), .widget_archive ul li:lang(haz), +.widget_categories ul li:lang(haz), +.widget_meta ul li:lang(haz), +.widget_nav_menu ul li:lang(haz), +.widget_pages ul li:lang(haz), +.widget_recent_comments ul li:lang(haz), +.widget_recent_entries ul li:lang(haz), +.widget_rss ul li:lang(haz), .widget_tag_cloud .tagcloud:lang(haz), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(haz), .entry .entry-content .wp-block-button .wp-block-button__link:lang(haz), .entry .entry-content .wp-block-archives li > a:lang(haz), +.entry .entry-content .wp-block-categories li > a:lang(haz), +.entry .entry-content .wp-block-latest-posts li > a:lang(haz), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(haz), .entry .entry-content .wp-block-verse:lang(haz), .entry .entry-content .has-drop-cap:lang(haz):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(haz), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(haz), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(haz), +.entry .entry-content .wp-block-cover-image h2:lang(haz), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(haz), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(haz), +.entry .entry-content .wp-block-cover h2:lang(haz), .entry .entry-content .wp-block-audio figcaption:lang(haz), +.entry .entry-content .wp-block-video figcaption:lang(haz), +.entry .entry-content .wp-block-image figcaption:lang(haz), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(haz), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(haz), .entry .entry-content .wp-block-file:lang(haz), .entry .entry-content .wp-block-file .wp-block-file__button:lang(haz), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(haz), .wp-caption-text:lang(haz), .gallery-caption:lang(haz) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(ps), button:lang(ps), +input:lang(ps), +select:lang(ps), +optgroup:lang(ps), +textarea:lang(ps), .author-description .author-link:lang(ps), +.comment-metadata:lang(ps), +.comment-reply-link:lang(ps), +.comments-title:lang(ps), +.comment-author .fn:lang(ps), +.discussion-meta-info:lang(ps), +.entry-meta:lang(ps), +.entry-footer:lang(ps), +.main-navigation:lang(ps), +.no-comments:lang(ps), +.not-found .page-title:lang(ps), +.error-404 .page-title:lang(ps), +.post-navigation .post-title:lang(ps), +.page-links:lang(ps), +.page-description:lang(ps), +.pagination .nav-links:lang(ps), +.sticky-post:lang(ps), +.site-title:lang(ps), +.site-info:lang(ps), +#cancel-comment-reply-link:lang(ps), +h1:lang(ps), +h2:lang(ps), +h3:lang(ps), +h4:lang(ps), +h5:lang(ps), +h6:lang(ps), .page-title:lang(ps), blockquote cite:lang(ps), table:lang(ps), .button:lang(ps), +input:lang(ps)[type="button"], +input:lang(ps)[type="reset"], +input:lang(ps)[type="submit"], .comment-navigation .nav-previous:lang(ps), +.comment-navigation .nav-next:lang(ps), .comment-list .pingback .comment-body:lang(ps), +.comment-list .trackback .comment-body:lang(ps), .comment-list .pingback .comment-body .comment-edit-link:lang(ps), +.comment-list .trackback .comment-body .comment-edit-link:lang(ps), .comment-form .comment-notes:lang(ps), +.comment-form label:lang(ps), .widget_archive ul li:lang(ps), +.widget_categories ul li:lang(ps), +.widget_meta ul li:lang(ps), +.widget_nav_menu ul li:lang(ps), +.widget_pages ul li:lang(ps), +.widget_recent_comments ul li:lang(ps), +.widget_recent_entries ul li:lang(ps), +.widget_rss ul li:lang(ps), .widget_tag_cloud .tagcloud:lang(ps), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ps), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ps), .entry .entry-content .wp-block-archives li > a:lang(ps), +.entry .entry-content .wp-block-categories li > a:lang(ps), +.entry .entry-content .wp-block-latest-posts li > a:lang(ps), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ps), .entry .entry-content .wp-block-verse:lang(ps), .entry .entry-content .has-drop-cap:lang(ps):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ps), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ps), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ps), +.entry .entry-content .wp-block-cover-image h2:lang(ps), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ps), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ps), +.entry .entry-content .wp-block-cover h2:lang(ps), .entry .entry-content .wp-block-audio figcaption:lang(ps), +.entry .entry-content .wp-block-video figcaption:lang(ps), +.entry .entry-content .wp-block-image figcaption:lang(ps), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ps), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ps), .entry .entry-content .wp-block-file:lang(ps), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ps), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ps), .wp-caption-text:lang(ps), .gallery-caption:lang(ps) { + font-family: Tahoma, Arial, sans-serif; +} + +body:lang(be), button:lang(be), +input:lang(be), +select:lang(be), +optgroup:lang(be), +textarea:lang(be), .author-description .author-link:lang(be), +.comment-metadata:lang(be), +.comment-reply-link:lang(be), +.comments-title:lang(be), +.comment-author .fn:lang(be), +.discussion-meta-info:lang(be), +.entry-meta:lang(be), +.entry-footer:lang(be), +.main-navigation:lang(be), +.no-comments:lang(be), +.not-found .page-title:lang(be), +.error-404 .page-title:lang(be), +.post-navigation .post-title:lang(be), +.page-links:lang(be), +.page-description:lang(be), +.pagination .nav-links:lang(be), +.sticky-post:lang(be), +.site-title:lang(be), +.site-info:lang(be), +#cancel-comment-reply-link:lang(be), +h1:lang(be), +h2:lang(be), +h3:lang(be), +h4:lang(be), +h5:lang(be), +h6:lang(be), .page-title:lang(be), blockquote cite:lang(be), table:lang(be), .button:lang(be), +input:lang(be)[type="button"], +input:lang(be)[type="reset"], +input:lang(be)[type="submit"], .comment-navigation .nav-previous:lang(be), +.comment-navigation .nav-next:lang(be), .comment-list .pingback .comment-body:lang(be), +.comment-list .trackback .comment-body:lang(be), .comment-list .pingback .comment-body .comment-edit-link:lang(be), +.comment-list .trackback .comment-body .comment-edit-link:lang(be), .comment-form .comment-notes:lang(be), +.comment-form label:lang(be), .widget_archive ul li:lang(be), +.widget_categories ul li:lang(be), +.widget_meta ul li:lang(be), +.widget_nav_menu ul li:lang(be), +.widget_pages ul li:lang(be), +.widget_recent_comments ul li:lang(be), +.widget_recent_entries ul li:lang(be), +.widget_rss ul li:lang(be), .widget_tag_cloud .tagcloud:lang(be), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(be), .entry .entry-content .wp-block-button .wp-block-button__link:lang(be), .entry .entry-content .wp-block-archives li > a:lang(be), +.entry .entry-content .wp-block-categories li > a:lang(be), +.entry .entry-content .wp-block-latest-posts li > a:lang(be), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(be), .entry .entry-content .wp-block-verse:lang(be), .entry .entry-content .has-drop-cap:lang(be):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(be), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(be), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(be), +.entry .entry-content .wp-block-cover-image h2:lang(be), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(be), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(be), +.entry .entry-content .wp-block-cover h2:lang(be), .entry .entry-content .wp-block-audio figcaption:lang(be), +.entry .entry-content .wp-block-video figcaption:lang(be), +.entry .entry-content .wp-block-image figcaption:lang(be), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(be), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(be), .entry .entry-content .wp-block-file:lang(be), .entry .entry-content .wp-block-file .wp-block-file__button:lang(be), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(be), .wp-caption-text:lang(be), .gallery-caption:lang(be) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(bg-BG), button:lang(bg-BG), +input:lang(bg-BG), +select:lang(bg-BG), +optgroup:lang(bg-BG), +textarea:lang(bg-BG), .author-description .author-link:lang(bg-BG), +.comment-metadata:lang(bg-BG), +.comment-reply-link:lang(bg-BG), +.comments-title:lang(bg-BG), +.comment-author .fn:lang(bg-BG), +.discussion-meta-info:lang(bg-BG), +.entry-meta:lang(bg-BG), +.entry-footer:lang(bg-BG), +.main-navigation:lang(bg-BG), +.no-comments:lang(bg-BG), +.not-found .page-title:lang(bg-BG), +.error-404 .page-title:lang(bg-BG), +.post-navigation .post-title:lang(bg-BG), +.page-links:lang(bg-BG), +.page-description:lang(bg-BG), +.pagination .nav-links:lang(bg-BG), +.sticky-post:lang(bg-BG), +.site-title:lang(bg-BG), +.site-info:lang(bg-BG), +#cancel-comment-reply-link:lang(bg-BG), +h1:lang(bg-BG), +h2:lang(bg-BG), +h3:lang(bg-BG), +h4:lang(bg-BG), +h5:lang(bg-BG), +h6:lang(bg-BG), .page-title:lang(bg-BG), blockquote cite:lang(bg-BG), table:lang(bg-BG), .button:lang(bg-BG), +input:lang(bg-BG)[type="button"], +input:lang(bg-BG)[type="reset"], +input:lang(bg-BG)[type="submit"], .comment-navigation .nav-previous:lang(bg-BG), +.comment-navigation .nav-next:lang(bg-BG), .comment-list .pingback .comment-body:lang(bg-BG), +.comment-list .trackback .comment-body:lang(bg-BG), .comment-list .pingback .comment-body .comment-edit-link:lang(bg-BG), +.comment-list .trackback .comment-body .comment-edit-link:lang(bg-BG), .comment-form .comment-notes:lang(bg-BG), +.comment-form label:lang(bg-BG), .widget_archive ul li:lang(bg-BG), +.widget_categories ul li:lang(bg-BG), +.widget_meta ul li:lang(bg-BG), +.widget_nav_menu ul li:lang(bg-BG), +.widget_pages ul li:lang(bg-BG), +.widget_recent_comments ul li:lang(bg-BG), +.widget_recent_entries ul li:lang(bg-BG), +.widget_rss ul li:lang(bg-BG), .widget_tag_cloud .tagcloud:lang(bg-BG), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(bg-BG), .entry .entry-content .wp-block-button .wp-block-button__link:lang(bg-BG), .entry .entry-content .wp-block-archives li > a:lang(bg-BG), +.entry .entry-content .wp-block-categories li > a:lang(bg-BG), +.entry .entry-content .wp-block-latest-posts li > a:lang(bg-BG), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(bg-BG), .entry .entry-content .wp-block-verse:lang(bg-BG), .entry .entry-content .has-drop-cap:lang(bg-BG):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(bg-BG), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(bg-BG), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(bg-BG), +.entry .entry-content .wp-block-cover-image h2:lang(bg-BG), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(bg-BG), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(bg-BG), +.entry .entry-content .wp-block-cover h2:lang(bg-BG), .entry .entry-content .wp-block-audio figcaption:lang(bg-BG), +.entry .entry-content .wp-block-video figcaption:lang(bg-BG), +.entry .entry-content .wp-block-image figcaption:lang(bg-BG), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(bg-BG), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(bg-BG), .entry .entry-content .wp-block-file:lang(bg-BG), .entry .entry-content .wp-block-file .wp-block-file__button:lang(bg-BG), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(bg-BG), .wp-caption-text:lang(bg-BG), .gallery-caption:lang(bg-BG) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(kk), button:lang(kk), +input:lang(kk), +select:lang(kk), +optgroup:lang(kk), +textarea:lang(kk), .author-description .author-link:lang(kk), +.comment-metadata:lang(kk), +.comment-reply-link:lang(kk), +.comments-title:lang(kk), +.comment-author .fn:lang(kk), +.discussion-meta-info:lang(kk), +.entry-meta:lang(kk), +.entry-footer:lang(kk), +.main-navigation:lang(kk), +.no-comments:lang(kk), +.not-found .page-title:lang(kk), +.error-404 .page-title:lang(kk), +.post-navigation .post-title:lang(kk), +.page-links:lang(kk), +.page-description:lang(kk), +.pagination .nav-links:lang(kk), +.sticky-post:lang(kk), +.site-title:lang(kk), +.site-info:lang(kk), +#cancel-comment-reply-link:lang(kk), +h1:lang(kk), +h2:lang(kk), +h3:lang(kk), +h4:lang(kk), +h5:lang(kk), +h6:lang(kk), .page-title:lang(kk), blockquote cite:lang(kk), table:lang(kk), .button:lang(kk), +input:lang(kk)[type="button"], +input:lang(kk)[type="reset"], +input:lang(kk)[type="submit"], .comment-navigation .nav-previous:lang(kk), +.comment-navigation .nav-next:lang(kk), .comment-list .pingback .comment-body:lang(kk), +.comment-list .trackback .comment-body:lang(kk), .comment-list .pingback .comment-body .comment-edit-link:lang(kk), +.comment-list .trackback .comment-body .comment-edit-link:lang(kk), .comment-form .comment-notes:lang(kk), +.comment-form label:lang(kk), .widget_archive ul li:lang(kk), +.widget_categories ul li:lang(kk), +.widget_meta ul li:lang(kk), +.widget_nav_menu ul li:lang(kk), +.widget_pages ul li:lang(kk), +.widget_recent_comments ul li:lang(kk), +.widget_recent_entries ul li:lang(kk), +.widget_rss ul li:lang(kk), .widget_tag_cloud .tagcloud:lang(kk), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(kk), .entry .entry-content .wp-block-button .wp-block-button__link:lang(kk), .entry .entry-content .wp-block-archives li > a:lang(kk), +.entry .entry-content .wp-block-categories li > a:lang(kk), +.entry .entry-content .wp-block-latest-posts li > a:lang(kk), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(kk), .entry .entry-content .wp-block-verse:lang(kk), .entry .entry-content .has-drop-cap:lang(kk):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(kk), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(kk), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(kk), +.entry .entry-content .wp-block-cover-image h2:lang(kk), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(kk), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(kk), +.entry .entry-content .wp-block-cover h2:lang(kk), .entry .entry-content .wp-block-audio figcaption:lang(kk), +.entry .entry-content .wp-block-video figcaption:lang(kk), +.entry .entry-content .wp-block-image figcaption:lang(kk), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(kk), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(kk), .entry .entry-content .wp-block-file:lang(kk), .entry .entry-content .wp-block-file .wp-block-file__button:lang(kk), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(kk), .wp-caption-text:lang(kk), .gallery-caption:lang(kk) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(mk-MK), button:lang(mk-MK), +input:lang(mk-MK), +select:lang(mk-MK), +optgroup:lang(mk-MK), +textarea:lang(mk-MK), .author-description .author-link:lang(mk-MK), +.comment-metadata:lang(mk-MK), +.comment-reply-link:lang(mk-MK), +.comments-title:lang(mk-MK), +.comment-author .fn:lang(mk-MK), +.discussion-meta-info:lang(mk-MK), +.entry-meta:lang(mk-MK), +.entry-footer:lang(mk-MK), +.main-navigation:lang(mk-MK), +.no-comments:lang(mk-MK), +.not-found .page-title:lang(mk-MK), +.error-404 .page-title:lang(mk-MK), +.post-navigation .post-title:lang(mk-MK), +.page-links:lang(mk-MK), +.page-description:lang(mk-MK), +.pagination .nav-links:lang(mk-MK), +.sticky-post:lang(mk-MK), +.site-title:lang(mk-MK), +.site-info:lang(mk-MK), +#cancel-comment-reply-link:lang(mk-MK), +h1:lang(mk-MK), +h2:lang(mk-MK), +h3:lang(mk-MK), +h4:lang(mk-MK), +h5:lang(mk-MK), +h6:lang(mk-MK), .page-title:lang(mk-MK), blockquote cite:lang(mk-MK), table:lang(mk-MK), .button:lang(mk-MK), +input:lang(mk-MK)[type="button"], +input:lang(mk-MK)[type="reset"], +input:lang(mk-MK)[type="submit"], .comment-navigation .nav-previous:lang(mk-MK), +.comment-navigation .nav-next:lang(mk-MK), .comment-list .pingback .comment-body:lang(mk-MK), +.comment-list .trackback .comment-body:lang(mk-MK), .comment-list .pingback .comment-body .comment-edit-link:lang(mk-MK), +.comment-list .trackback .comment-body .comment-edit-link:lang(mk-MK), .comment-form .comment-notes:lang(mk-MK), +.comment-form label:lang(mk-MK), .widget_archive ul li:lang(mk-MK), +.widget_categories ul li:lang(mk-MK), +.widget_meta ul li:lang(mk-MK), +.widget_nav_menu ul li:lang(mk-MK), +.widget_pages ul li:lang(mk-MK), +.widget_recent_comments ul li:lang(mk-MK), +.widget_recent_entries ul li:lang(mk-MK), +.widget_rss ul li:lang(mk-MK), .widget_tag_cloud .tagcloud:lang(mk-MK), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(mk-MK), .entry .entry-content .wp-block-button .wp-block-button__link:lang(mk-MK), .entry .entry-content .wp-block-archives li > a:lang(mk-MK), +.entry .entry-content .wp-block-categories li > a:lang(mk-MK), +.entry .entry-content .wp-block-latest-posts li > a:lang(mk-MK), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(mk-MK), .entry .entry-content .wp-block-verse:lang(mk-MK), .entry .entry-content .has-drop-cap:lang(mk-MK):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(mk-MK), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(mk-MK), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(mk-MK), +.entry .entry-content .wp-block-cover-image h2:lang(mk-MK), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(mk-MK), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(mk-MK), +.entry .entry-content .wp-block-cover h2:lang(mk-MK), .entry .entry-content .wp-block-audio figcaption:lang(mk-MK), +.entry .entry-content .wp-block-video figcaption:lang(mk-MK), +.entry .entry-content .wp-block-image figcaption:lang(mk-MK), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(mk-MK), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(mk-MK), .entry .entry-content .wp-block-file:lang(mk-MK), .entry .entry-content .wp-block-file .wp-block-file__button:lang(mk-MK), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(mk-MK), .wp-caption-text:lang(mk-MK), .gallery-caption:lang(mk-MK) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(mn), button:lang(mn), +input:lang(mn), +select:lang(mn), +optgroup:lang(mn), +textarea:lang(mn), .author-description .author-link:lang(mn), +.comment-metadata:lang(mn), +.comment-reply-link:lang(mn), +.comments-title:lang(mn), +.comment-author .fn:lang(mn), +.discussion-meta-info:lang(mn), +.entry-meta:lang(mn), +.entry-footer:lang(mn), +.main-navigation:lang(mn), +.no-comments:lang(mn), +.not-found .page-title:lang(mn), +.error-404 .page-title:lang(mn), +.post-navigation .post-title:lang(mn), +.page-links:lang(mn), +.page-description:lang(mn), +.pagination .nav-links:lang(mn), +.sticky-post:lang(mn), +.site-title:lang(mn), +.site-info:lang(mn), +#cancel-comment-reply-link:lang(mn), +h1:lang(mn), +h2:lang(mn), +h3:lang(mn), +h4:lang(mn), +h5:lang(mn), +h6:lang(mn), .page-title:lang(mn), blockquote cite:lang(mn), table:lang(mn), .button:lang(mn), +input:lang(mn)[type="button"], +input:lang(mn)[type="reset"], +input:lang(mn)[type="submit"], .comment-navigation .nav-previous:lang(mn), +.comment-navigation .nav-next:lang(mn), .comment-list .pingback .comment-body:lang(mn), +.comment-list .trackback .comment-body:lang(mn), .comment-list .pingback .comment-body .comment-edit-link:lang(mn), +.comment-list .trackback .comment-body .comment-edit-link:lang(mn), .comment-form .comment-notes:lang(mn), +.comment-form label:lang(mn), .widget_archive ul li:lang(mn), +.widget_categories ul li:lang(mn), +.widget_meta ul li:lang(mn), +.widget_nav_menu ul li:lang(mn), +.widget_pages ul li:lang(mn), +.widget_recent_comments ul li:lang(mn), +.widget_recent_entries ul li:lang(mn), +.widget_rss ul li:lang(mn), .widget_tag_cloud .tagcloud:lang(mn), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(mn), .entry .entry-content .wp-block-button .wp-block-button__link:lang(mn), .entry .entry-content .wp-block-archives li > a:lang(mn), +.entry .entry-content .wp-block-categories li > a:lang(mn), +.entry .entry-content .wp-block-latest-posts li > a:lang(mn), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(mn), .entry .entry-content .wp-block-verse:lang(mn), .entry .entry-content .has-drop-cap:lang(mn):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(mn), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(mn), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(mn), +.entry .entry-content .wp-block-cover-image h2:lang(mn), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(mn), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(mn), +.entry .entry-content .wp-block-cover h2:lang(mn), .entry .entry-content .wp-block-audio figcaption:lang(mn), +.entry .entry-content .wp-block-video figcaption:lang(mn), +.entry .entry-content .wp-block-image figcaption:lang(mn), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(mn), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(mn), .entry .entry-content .wp-block-file:lang(mn), .entry .entry-content .wp-block-file .wp-block-file__button:lang(mn), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(mn), .wp-caption-text:lang(mn), .gallery-caption:lang(mn) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(ru-RU), button:lang(ru-RU), +input:lang(ru-RU), +select:lang(ru-RU), +optgroup:lang(ru-RU), +textarea:lang(ru-RU), .author-description .author-link:lang(ru-RU), +.comment-metadata:lang(ru-RU), +.comment-reply-link:lang(ru-RU), +.comments-title:lang(ru-RU), +.comment-author .fn:lang(ru-RU), +.discussion-meta-info:lang(ru-RU), +.entry-meta:lang(ru-RU), +.entry-footer:lang(ru-RU), +.main-navigation:lang(ru-RU), +.no-comments:lang(ru-RU), +.not-found .page-title:lang(ru-RU), +.error-404 .page-title:lang(ru-RU), +.post-navigation .post-title:lang(ru-RU), +.page-links:lang(ru-RU), +.page-description:lang(ru-RU), +.pagination .nav-links:lang(ru-RU), +.sticky-post:lang(ru-RU), +.site-title:lang(ru-RU), +.site-info:lang(ru-RU), +#cancel-comment-reply-link:lang(ru-RU), +h1:lang(ru-RU), +h2:lang(ru-RU), +h3:lang(ru-RU), +h4:lang(ru-RU), +h5:lang(ru-RU), +h6:lang(ru-RU), .page-title:lang(ru-RU), blockquote cite:lang(ru-RU), table:lang(ru-RU), .button:lang(ru-RU), +input:lang(ru-RU)[type="button"], +input:lang(ru-RU)[type="reset"], +input:lang(ru-RU)[type="submit"], .comment-navigation .nav-previous:lang(ru-RU), +.comment-navigation .nav-next:lang(ru-RU), .comment-list .pingback .comment-body:lang(ru-RU), +.comment-list .trackback .comment-body:lang(ru-RU), .comment-list .pingback .comment-body .comment-edit-link:lang(ru-RU), +.comment-list .trackback .comment-body .comment-edit-link:lang(ru-RU), .comment-form .comment-notes:lang(ru-RU), +.comment-form label:lang(ru-RU), .widget_archive ul li:lang(ru-RU), +.widget_categories ul li:lang(ru-RU), +.widget_meta ul li:lang(ru-RU), +.widget_nav_menu ul li:lang(ru-RU), +.widget_pages ul li:lang(ru-RU), +.widget_recent_comments ul li:lang(ru-RU), +.widget_recent_entries ul li:lang(ru-RU), +.widget_rss ul li:lang(ru-RU), .widget_tag_cloud .tagcloud:lang(ru-RU), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ru-RU), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ru-RU), .entry .entry-content .wp-block-archives li > a:lang(ru-RU), +.entry .entry-content .wp-block-categories li > a:lang(ru-RU), +.entry .entry-content .wp-block-latest-posts li > a:lang(ru-RU), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ru-RU), .entry .entry-content .wp-block-verse:lang(ru-RU), .entry .entry-content .has-drop-cap:lang(ru-RU):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ru-RU), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ru-RU), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ru-RU), +.entry .entry-content .wp-block-cover-image h2:lang(ru-RU), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ru-RU), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ru-RU), +.entry .entry-content .wp-block-cover h2:lang(ru-RU), .entry .entry-content .wp-block-audio figcaption:lang(ru-RU), +.entry .entry-content .wp-block-video figcaption:lang(ru-RU), +.entry .entry-content .wp-block-image figcaption:lang(ru-RU), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ru-RU), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ru-RU), .entry .entry-content .wp-block-file:lang(ru-RU), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ru-RU), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ru-RU), .wp-caption-text:lang(ru-RU), .gallery-caption:lang(ru-RU) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(sah), button:lang(sah), +input:lang(sah), +select:lang(sah), +optgroup:lang(sah), +textarea:lang(sah), .author-description .author-link:lang(sah), +.comment-metadata:lang(sah), +.comment-reply-link:lang(sah), +.comments-title:lang(sah), +.comment-author .fn:lang(sah), +.discussion-meta-info:lang(sah), +.entry-meta:lang(sah), +.entry-footer:lang(sah), +.main-navigation:lang(sah), +.no-comments:lang(sah), +.not-found .page-title:lang(sah), +.error-404 .page-title:lang(sah), +.post-navigation .post-title:lang(sah), +.page-links:lang(sah), +.page-description:lang(sah), +.pagination .nav-links:lang(sah), +.sticky-post:lang(sah), +.site-title:lang(sah), +.site-info:lang(sah), +#cancel-comment-reply-link:lang(sah), +h1:lang(sah), +h2:lang(sah), +h3:lang(sah), +h4:lang(sah), +h5:lang(sah), +h6:lang(sah), .page-title:lang(sah), blockquote cite:lang(sah), table:lang(sah), .button:lang(sah), +input:lang(sah)[type="button"], +input:lang(sah)[type="reset"], +input:lang(sah)[type="submit"], .comment-navigation .nav-previous:lang(sah), +.comment-navigation .nav-next:lang(sah), .comment-list .pingback .comment-body:lang(sah), +.comment-list .trackback .comment-body:lang(sah), .comment-list .pingback .comment-body .comment-edit-link:lang(sah), +.comment-list .trackback .comment-body .comment-edit-link:lang(sah), .comment-form .comment-notes:lang(sah), +.comment-form label:lang(sah), .widget_archive ul li:lang(sah), +.widget_categories ul li:lang(sah), +.widget_meta ul li:lang(sah), +.widget_nav_menu ul li:lang(sah), +.widget_pages ul li:lang(sah), +.widget_recent_comments ul li:lang(sah), +.widget_recent_entries ul li:lang(sah), +.widget_rss ul li:lang(sah), .widget_tag_cloud .tagcloud:lang(sah), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(sah), .entry .entry-content .wp-block-button .wp-block-button__link:lang(sah), .entry .entry-content .wp-block-archives li > a:lang(sah), +.entry .entry-content .wp-block-categories li > a:lang(sah), +.entry .entry-content .wp-block-latest-posts li > a:lang(sah), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(sah), .entry .entry-content .wp-block-verse:lang(sah), .entry .entry-content .has-drop-cap:lang(sah):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(sah), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(sah), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(sah), +.entry .entry-content .wp-block-cover-image h2:lang(sah), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(sah), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(sah), +.entry .entry-content .wp-block-cover h2:lang(sah), .entry .entry-content .wp-block-audio figcaption:lang(sah), +.entry .entry-content .wp-block-video figcaption:lang(sah), +.entry .entry-content .wp-block-image figcaption:lang(sah), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(sah), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(sah), .entry .entry-content .wp-block-file:lang(sah), .entry .entry-content .wp-block-file .wp-block-file__button:lang(sah), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(sah), .wp-caption-text:lang(sah), .gallery-caption:lang(sah) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(sr-RS), button:lang(sr-RS), +input:lang(sr-RS), +select:lang(sr-RS), +optgroup:lang(sr-RS), +textarea:lang(sr-RS), .author-description .author-link:lang(sr-RS), +.comment-metadata:lang(sr-RS), +.comment-reply-link:lang(sr-RS), +.comments-title:lang(sr-RS), +.comment-author .fn:lang(sr-RS), +.discussion-meta-info:lang(sr-RS), +.entry-meta:lang(sr-RS), +.entry-footer:lang(sr-RS), +.main-navigation:lang(sr-RS), +.no-comments:lang(sr-RS), +.not-found .page-title:lang(sr-RS), +.error-404 .page-title:lang(sr-RS), +.post-navigation .post-title:lang(sr-RS), +.page-links:lang(sr-RS), +.page-description:lang(sr-RS), +.pagination .nav-links:lang(sr-RS), +.sticky-post:lang(sr-RS), +.site-title:lang(sr-RS), +.site-info:lang(sr-RS), +#cancel-comment-reply-link:lang(sr-RS), +h1:lang(sr-RS), +h2:lang(sr-RS), +h3:lang(sr-RS), +h4:lang(sr-RS), +h5:lang(sr-RS), +h6:lang(sr-RS), .page-title:lang(sr-RS), blockquote cite:lang(sr-RS), table:lang(sr-RS), .button:lang(sr-RS), +input:lang(sr-RS)[type="button"], +input:lang(sr-RS)[type="reset"], +input:lang(sr-RS)[type="submit"], .comment-navigation .nav-previous:lang(sr-RS), +.comment-navigation .nav-next:lang(sr-RS), .comment-list .pingback .comment-body:lang(sr-RS), +.comment-list .trackback .comment-body:lang(sr-RS), .comment-list .pingback .comment-body .comment-edit-link:lang(sr-RS), +.comment-list .trackback .comment-body .comment-edit-link:lang(sr-RS), .comment-form .comment-notes:lang(sr-RS), +.comment-form label:lang(sr-RS), .widget_archive ul li:lang(sr-RS), +.widget_categories ul li:lang(sr-RS), +.widget_meta ul li:lang(sr-RS), +.widget_nav_menu ul li:lang(sr-RS), +.widget_pages ul li:lang(sr-RS), +.widget_recent_comments ul li:lang(sr-RS), +.widget_recent_entries ul li:lang(sr-RS), +.widget_rss ul li:lang(sr-RS), .widget_tag_cloud .tagcloud:lang(sr-RS), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(sr-RS), .entry .entry-content .wp-block-button .wp-block-button__link:lang(sr-RS), .entry .entry-content .wp-block-archives li > a:lang(sr-RS), +.entry .entry-content .wp-block-categories li > a:lang(sr-RS), +.entry .entry-content .wp-block-latest-posts li > a:lang(sr-RS), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(sr-RS), .entry .entry-content .wp-block-verse:lang(sr-RS), .entry .entry-content .has-drop-cap:lang(sr-RS):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(sr-RS), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(sr-RS), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(sr-RS), +.entry .entry-content .wp-block-cover-image h2:lang(sr-RS), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(sr-RS), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(sr-RS), +.entry .entry-content .wp-block-cover h2:lang(sr-RS), .entry .entry-content .wp-block-audio figcaption:lang(sr-RS), +.entry .entry-content .wp-block-video figcaption:lang(sr-RS), +.entry .entry-content .wp-block-image figcaption:lang(sr-RS), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(sr-RS), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(sr-RS), .entry .entry-content .wp-block-file:lang(sr-RS), .entry .entry-content .wp-block-file .wp-block-file__button:lang(sr-RS), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(sr-RS), .wp-caption-text:lang(sr-RS), .gallery-caption:lang(sr-RS) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(tt-RU), button:lang(tt-RU), +input:lang(tt-RU), +select:lang(tt-RU), +optgroup:lang(tt-RU), +textarea:lang(tt-RU), .author-description .author-link:lang(tt-RU), +.comment-metadata:lang(tt-RU), +.comment-reply-link:lang(tt-RU), +.comments-title:lang(tt-RU), +.comment-author .fn:lang(tt-RU), +.discussion-meta-info:lang(tt-RU), +.entry-meta:lang(tt-RU), +.entry-footer:lang(tt-RU), +.main-navigation:lang(tt-RU), +.no-comments:lang(tt-RU), +.not-found .page-title:lang(tt-RU), +.error-404 .page-title:lang(tt-RU), +.post-navigation .post-title:lang(tt-RU), +.page-links:lang(tt-RU), +.page-description:lang(tt-RU), +.pagination .nav-links:lang(tt-RU), +.sticky-post:lang(tt-RU), +.site-title:lang(tt-RU), +.site-info:lang(tt-RU), +#cancel-comment-reply-link:lang(tt-RU), +h1:lang(tt-RU), +h2:lang(tt-RU), +h3:lang(tt-RU), +h4:lang(tt-RU), +h5:lang(tt-RU), +h6:lang(tt-RU), .page-title:lang(tt-RU), blockquote cite:lang(tt-RU), table:lang(tt-RU), .button:lang(tt-RU), +input:lang(tt-RU)[type="button"], +input:lang(tt-RU)[type="reset"], +input:lang(tt-RU)[type="submit"], .comment-navigation .nav-previous:lang(tt-RU), +.comment-navigation .nav-next:lang(tt-RU), .comment-list .pingback .comment-body:lang(tt-RU), +.comment-list .trackback .comment-body:lang(tt-RU), .comment-list .pingback .comment-body .comment-edit-link:lang(tt-RU), +.comment-list .trackback .comment-body .comment-edit-link:lang(tt-RU), .comment-form .comment-notes:lang(tt-RU), +.comment-form label:lang(tt-RU), .widget_archive ul li:lang(tt-RU), +.widget_categories ul li:lang(tt-RU), +.widget_meta ul li:lang(tt-RU), +.widget_nav_menu ul li:lang(tt-RU), +.widget_pages ul li:lang(tt-RU), +.widget_recent_comments ul li:lang(tt-RU), +.widget_recent_entries ul li:lang(tt-RU), +.widget_rss ul li:lang(tt-RU), .widget_tag_cloud .tagcloud:lang(tt-RU), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(tt-RU), .entry .entry-content .wp-block-button .wp-block-button__link:lang(tt-RU), .entry .entry-content .wp-block-archives li > a:lang(tt-RU), +.entry .entry-content .wp-block-categories li > a:lang(tt-RU), +.entry .entry-content .wp-block-latest-posts li > a:lang(tt-RU), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(tt-RU), .entry .entry-content .wp-block-verse:lang(tt-RU), .entry .entry-content .has-drop-cap:lang(tt-RU):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(tt-RU), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(tt-RU), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(tt-RU), +.entry .entry-content .wp-block-cover-image h2:lang(tt-RU), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(tt-RU), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(tt-RU), +.entry .entry-content .wp-block-cover h2:lang(tt-RU), .entry .entry-content .wp-block-audio figcaption:lang(tt-RU), +.entry .entry-content .wp-block-video figcaption:lang(tt-RU), +.entry .entry-content .wp-block-image figcaption:lang(tt-RU), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(tt-RU), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(tt-RU), .entry .entry-content .wp-block-file:lang(tt-RU), .entry .entry-content .wp-block-file .wp-block-file__button:lang(tt-RU), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(tt-RU), .wp-caption-text:lang(tt-RU), .gallery-caption:lang(tt-RU) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(uk), button:lang(uk), +input:lang(uk), +select:lang(uk), +optgroup:lang(uk), +textarea:lang(uk), .author-description .author-link:lang(uk), +.comment-metadata:lang(uk), +.comment-reply-link:lang(uk), +.comments-title:lang(uk), +.comment-author .fn:lang(uk), +.discussion-meta-info:lang(uk), +.entry-meta:lang(uk), +.entry-footer:lang(uk), +.main-navigation:lang(uk), +.no-comments:lang(uk), +.not-found .page-title:lang(uk), +.error-404 .page-title:lang(uk), +.post-navigation .post-title:lang(uk), +.page-links:lang(uk), +.page-description:lang(uk), +.pagination .nav-links:lang(uk), +.sticky-post:lang(uk), +.site-title:lang(uk), +.site-info:lang(uk), +#cancel-comment-reply-link:lang(uk), +h1:lang(uk), +h2:lang(uk), +h3:lang(uk), +h4:lang(uk), +h5:lang(uk), +h6:lang(uk), .page-title:lang(uk), blockquote cite:lang(uk), table:lang(uk), .button:lang(uk), +input:lang(uk)[type="button"], +input:lang(uk)[type="reset"], +input:lang(uk)[type="submit"], .comment-navigation .nav-previous:lang(uk), +.comment-navigation .nav-next:lang(uk), .comment-list .pingback .comment-body:lang(uk), +.comment-list .trackback .comment-body:lang(uk), .comment-list .pingback .comment-body .comment-edit-link:lang(uk), +.comment-list .trackback .comment-body .comment-edit-link:lang(uk), .comment-form .comment-notes:lang(uk), +.comment-form label:lang(uk), .widget_archive ul li:lang(uk), +.widget_categories ul li:lang(uk), +.widget_meta ul li:lang(uk), +.widget_nav_menu ul li:lang(uk), +.widget_pages ul li:lang(uk), +.widget_recent_comments ul li:lang(uk), +.widget_recent_entries ul li:lang(uk), +.widget_rss ul li:lang(uk), .widget_tag_cloud .tagcloud:lang(uk), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(uk), .entry .entry-content .wp-block-button .wp-block-button__link:lang(uk), .entry .entry-content .wp-block-archives li > a:lang(uk), +.entry .entry-content .wp-block-categories li > a:lang(uk), +.entry .entry-content .wp-block-latest-posts li > a:lang(uk), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(uk), .entry .entry-content .wp-block-verse:lang(uk), .entry .entry-content .has-drop-cap:lang(uk):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(uk), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(uk), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(uk), +.entry .entry-content .wp-block-cover-image h2:lang(uk), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(uk), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(uk), +.entry .entry-content .wp-block-cover h2:lang(uk), .entry .entry-content .wp-block-audio figcaption:lang(uk), +.entry .entry-content .wp-block-video figcaption:lang(uk), +.entry .entry-content .wp-block-image figcaption:lang(uk), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(uk), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(uk), .entry .entry-content .wp-block-file:lang(uk), .entry .entry-content .wp-block-file .wp-block-file__button:lang(uk), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(uk), .wp-caption-text:lang(uk), .gallery-caption:lang(uk) { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +body:lang(zh-HK), button:lang(zh-HK), +input:lang(zh-HK), +select:lang(zh-HK), +optgroup:lang(zh-HK), +textarea:lang(zh-HK), .author-description .author-link:lang(zh-HK), +.comment-metadata:lang(zh-HK), +.comment-reply-link:lang(zh-HK), +.comments-title:lang(zh-HK), +.comment-author .fn:lang(zh-HK), +.discussion-meta-info:lang(zh-HK), +.entry-meta:lang(zh-HK), +.entry-footer:lang(zh-HK), +.main-navigation:lang(zh-HK), +.no-comments:lang(zh-HK), +.not-found .page-title:lang(zh-HK), +.error-404 .page-title:lang(zh-HK), +.post-navigation .post-title:lang(zh-HK), +.page-links:lang(zh-HK), +.page-description:lang(zh-HK), +.pagination .nav-links:lang(zh-HK), +.sticky-post:lang(zh-HK), +.site-title:lang(zh-HK), +.site-info:lang(zh-HK), +#cancel-comment-reply-link:lang(zh-HK), +h1:lang(zh-HK), +h2:lang(zh-HK), +h3:lang(zh-HK), +h4:lang(zh-HK), +h5:lang(zh-HK), +h6:lang(zh-HK), .page-title:lang(zh-HK), blockquote cite:lang(zh-HK), table:lang(zh-HK), .button:lang(zh-HK), +input:lang(zh-HK)[type="button"], +input:lang(zh-HK)[type="reset"], +input:lang(zh-HK)[type="submit"], .comment-navigation .nav-previous:lang(zh-HK), +.comment-navigation .nav-next:lang(zh-HK), .comment-list .pingback .comment-body:lang(zh-HK), +.comment-list .trackback .comment-body:lang(zh-HK), .comment-list .pingback .comment-body .comment-edit-link:lang(zh-HK), +.comment-list .trackback .comment-body .comment-edit-link:lang(zh-HK), .comment-form .comment-notes:lang(zh-HK), +.comment-form label:lang(zh-HK), .widget_archive ul li:lang(zh-HK), +.widget_categories ul li:lang(zh-HK), +.widget_meta ul li:lang(zh-HK), +.widget_nav_menu ul li:lang(zh-HK), +.widget_pages ul li:lang(zh-HK), +.widget_recent_comments ul li:lang(zh-HK), +.widget_recent_entries ul li:lang(zh-HK), +.widget_rss ul li:lang(zh-HK), .widget_tag_cloud .tagcloud:lang(zh-HK), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(zh-HK), .entry .entry-content .wp-block-button .wp-block-button__link:lang(zh-HK), .entry .entry-content .wp-block-archives li > a:lang(zh-HK), +.entry .entry-content .wp-block-categories li > a:lang(zh-HK), +.entry .entry-content .wp-block-latest-posts li > a:lang(zh-HK), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(zh-HK), .entry .entry-content .wp-block-verse:lang(zh-HK), .entry .entry-content .has-drop-cap:lang(zh-HK):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(zh-HK), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(zh-HK), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(zh-HK), +.entry .entry-content .wp-block-cover-image h2:lang(zh-HK), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(zh-HK), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(zh-HK), +.entry .entry-content .wp-block-cover h2:lang(zh-HK), .entry .entry-content .wp-block-audio figcaption:lang(zh-HK), +.entry .entry-content .wp-block-video figcaption:lang(zh-HK), +.entry .entry-content .wp-block-image figcaption:lang(zh-HK), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(zh-HK), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(zh-HK), .entry .entry-content .wp-block-file:lang(zh-HK), .entry .entry-content .wp-block-file .wp-block-file__button:lang(zh-HK), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(zh-HK), .wp-caption-text:lang(zh-HK), .gallery-caption:lang(zh-HK) { + font-family: -apple-system, BlinkMacSystemFont, "PingFang HK", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif; +} + +body:lang(zh-TW), button:lang(zh-TW), +input:lang(zh-TW), +select:lang(zh-TW), +optgroup:lang(zh-TW), +textarea:lang(zh-TW), .author-description .author-link:lang(zh-TW), +.comment-metadata:lang(zh-TW), +.comment-reply-link:lang(zh-TW), +.comments-title:lang(zh-TW), +.comment-author .fn:lang(zh-TW), +.discussion-meta-info:lang(zh-TW), +.entry-meta:lang(zh-TW), +.entry-footer:lang(zh-TW), +.main-navigation:lang(zh-TW), +.no-comments:lang(zh-TW), +.not-found .page-title:lang(zh-TW), +.error-404 .page-title:lang(zh-TW), +.post-navigation .post-title:lang(zh-TW), +.page-links:lang(zh-TW), +.page-description:lang(zh-TW), +.pagination .nav-links:lang(zh-TW), +.sticky-post:lang(zh-TW), +.site-title:lang(zh-TW), +.site-info:lang(zh-TW), +#cancel-comment-reply-link:lang(zh-TW), +h1:lang(zh-TW), +h2:lang(zh-TW), +h3:lang(zh-TW), +h4:lang(zh-TW), +h5:lang(zh-TW), +h6:lang(zh-TW), .page-title:lang(zh-TW), blockquote cite:lang(zh-TW), table:lang(zh-TW), .button:lang(zh-TW), +input:lang(zh-TW)[type="button"], +input:lang(zh-TW)[type="reset"], +input:lang(zh-TW)[type="submit"], .comment-navigation .nav-previous:lang(zh-TW), +.comment-navigation .nav-next:lang(zh-TW), .comment-list .pingback .comment-body:lang(zh-TW), +.comment-list .trackback .comment-body:lang(zh-TW), .comment-list .pingback .comment-body .comment-edit-link:lang(zh-TW), +.comment-list .trackback .comment-body .comment-edit-link:lang(zh-TW), .comment-form .comment-notes:lang(zh-TW), +.comment-form label:lang(zh-TW), .widget_archive ul li:lang(zh-TW), +.widget_categories ul li:lang(zh-TW), +.widget_meta ul li:lang(zh-TW), +.widget_nav_menu ul li:lang(zh-TW), +.widget_pages ul li:lang(zh-TW), +.widget_recent_comments ul li:lang(zh-TW), +.widget_recent_entries ul li:lang(zh-TW), +.widget_rss ul li:lang(zh-TW), .widget_tag_cloud .tagcloud:lang(zh-TW), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(zh-TW), .entry .entry-content .wp-block-button .wp-block-button__link:lang(zh-TW), .entry .entry-content .wp-block-archives li > a:lang(zh-TW), +.entry .entry-content .wp-block-categories li > a:lang(zh-TW), +.entry .entry-content .wp-block-latest-posts li > a:lang(zh-TW), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(zh-TW), .entry .entry-content .wp-block-verse:lang(zh-TW), .entry .entry-content .has-drop-cap:lang(zh-TW):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(zh-TW), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(zh-TW), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(zh-TW), +.entry .entry-content .wp-block-cover-image h2:lang(zh-TW), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(zh-TW), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(zh-TW), +.entry .entry-content .wp-block-cover h2:lang(zh-TW), .entry .entry-content .wp-block-audio figcaption:lang(zh-TW), +.entry .entry-content .wp-block-video figcaption:lang(zh-TW), +.entry .entry-content .wp-block-image figcaption:lang(zh-TW), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(zh-TW), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(zh-TW), .entry .entry-content .wp-block-file:lang(zh-TW), .entry .entry-content .wp-block-file .wp-block-file__button:lang(zh-TW), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(zh-TW), .wp-caption-text:lang(zh-TW), .gallery-caption:lang(zh-TW) { + font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif; +} + +body:lang(zh-CN), button:lang(zh-CN), +input:lang(zh-CN), +select:lang(zh-CN), +optgroup:lang(zh-CN), +textarea:lang(zh-CN), .author-description .author-link:lang(zh-CN), +.comment-metadata:lang(zh-CN), +.comment-reply-link:lang(zh-CN), +.comments-title:lang(zh-CN), +.comment-author .fn:lang(zh-CN), +.discussion-meta-info:lang(zh-CN), +.entry-meta:lang(zh-CN), +.entry-footer:lang(zh-CN), +.main-navigation:lang(zh-CN), +.no-comments:lang(zh-CN), +.not-found .page-title:lang(zh-CN), +.error-404 .page-title:lang(zh-CN), +.post-navigation .post-title:lang(zh-CN), +.page-links:lang(zh-CN), +.page-description:lang(zh-CN), +.pagination .nav-links:lang(zh-CN), +.sticky-post:lang(zh-CN), +.site-title:lang(zh-CN), +.site-info:lang(zh-CN), +#cancel-comment-reply-link:lang(zh-CN), +h1:lang(zh-CN), +h2:lang(zh-CN), +h3:lang(zh-CN), +h4:lang(zh-CN), +h5:lang(zh-CN), +h6:lang(zh-CN), .page-title:lang(zh-CN), blockquote cite:lang(zh-CN), table:lang(zh-CN), .button:lang(zh-CN), +input:lang(zh-CN)[type="button"], +input:lang(zh-CN)[type="reset"], +input:lang(zh-CN)[type="submit"], .comment-navigation .nav-previous:lang(zh-CN), +.comment-navigation .nav-next:lang(zh-CN), .comment-list .pingback .comment-body:lang(zh-CN), +.comment-list .trackback .comment-body:lang(zh-CN), .comment-list .pingback .comment-body .comment-edit-link:lang(zh-CN), +.comment-list .trackback .comment-body .comment-edit-link:lang(zh-CN), .comment-form .comment-notes:lang(zh-CN), +.comment-form label:lang(zh-CN), .widget_archive ul li:lang(zh-CN), +.widget_categories ul li:lang(zh-CN), +.widget_meta ul li:lang(zh-CN), +.widget_nav_menu ul li:lang(zh-CN), +.widget_pages ul li:lang(zh-CN), +.widget_recent_comments ul li:lang(zh-CN), +.widget_recent_entries ul li:lang(zh-CN), +.widget_rss ul li:lang(zh-CN), .widget_tag_cloud .tagcloud:lang(zh-CN), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(zh-CN), .entry .entry-content .wp-block-button .wp-block-button__link:lang(zh-CN), .entry .entry-content .wp-block-archives li > a:lang(zh-CN), +.entry .entry-content .wp-block-categories li > a:lang(zh-CN), +.entry .entry-content .wp-block-latest-posts li > a:lang(zh-CN), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(zh-CN), .entry .entry-content .wp-block-verse:lang(zh-CN), .entry .entry-content .has-drop-cap:lang(zh-CN):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(zh-CN), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(zh-CN), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(zh-CN), +.entry .entry-content .wp-block-cover-image h2:lang(zh-CN), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(zh-CN), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(zh-CN), +.entry .entry-content .wp-block-cover h2:lang(zh-CN), .entry .entry-content .wp-block-audio figcaption:lang(zh-CN), +.entry .entry-content .wp-block-video figcaption:lang(zh-CN), +.entry .entry-content .wp-block-image figcaption:lang(zh-CN), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(zh-CN), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(zh-CN), .entry .entry-content .wp-block-file:lang(zh-CN), .entry .entry-content .wp-block-file .wp-block-file__button:lang(zh-CN), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(zh-CN), .wp-caption-text:lang(zh-CN), .gallery-caption:lang(zh-CN) { + font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif; +} + +body:lang(bn-BD), button:lang(bn-BD), +input:lang(bn-BD), +select:lang(bn-BD), +optgroup:lang(bn-BD), +textarea:lang(bn-BD), .author-description .author-link:lang(bn-BD), +.comment-metadata:lang(bn-BD), +.comment-reply-link:lang(bn-BD), +.comments-title:lang(bn-BD), +.comment-author .fn:lang(bn-BD), +.discussion-meta-info:lang(bn-BD), +.entry-meta:lang(bn-BD), +.entry-footer:lang(bn-BD), +.main-navigation:lang(bn-BD), +.no-comments:lang(bn-BD), +.not-found .page-title:lang(bn-BD), +.error-404 .page-title:lang(bn-BD), +.post-navigation .post-title:lang(bn-BD), +.page-links:lang(bn-BD), +.page-description:lang(bn-BD), +.pagination .nav-links:lang(bn-BD), +.sticky-post:lang(bn-BD), +.site-title:lang(bn-BD), +.site-info:lang(bn-BD), +#cancel-comment-reply-link:lang(bn-BD), +h1:lang(bn-BD), +h2:lang(bn-BD), +h3:lang(bn-BD), +h4:lang(bn-BD), +h5:lang(bn-BD), +h6:lang(bn-BD), .page-title:lang(bn-BD), blockquote cite:lang(bn-BD), table:lang(bn-BD), .button:lang(bn-BD), +input:lang(bn-BD)[type="button"], +input:lang(bn-BD)[type="reset"], +input:lang(bn-BD)[type="submit"], .comment-navigation .nav-previous:lang(bn-BD), +.comment-navigation .nav-next:lang(bn-BD), .comment-list .pingback .comment-body:lang(bn-BD), +.comment-list .trackback .comment-body:lang(bn-BD), .comment-list .pingback .comment-body .comment-edit-link:lang(bn-BD), +.comment-list .trackback .comment-body .comment-edit-link:lang(bn-BD), .comment-form .comment-notes:lang(bn-BD), +.comment-form label:lang(bn-BD), .widget_archive ul li:lang(bn-BD), +.widget_categories ul li:lang(bn-BD), +.widget_meta ul li:lang(bn-BD), +.widget_nav_menu ul li:lang(bn-BD), +.widget_pages ul li:lang(bn-BD), +.widget_recent_comments ul li:lang(bn-BD), +.widget_recent_entries ul li:lang(bn-BD), +.widget_rss ul li:lang(bn-BD), .widget_tag_cloud .tagcloud:lang(bn-BD), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(bn-BD), .entry .entry-content .wp-block-button .wp-block-button__link:lang(bn-BD), .entry .entry-content .wp-block-archives li > a:lang(bn-BD), +.entry .entry-content .wp-block-categories li > a:lang(bn-BD), +.entry .entry-content .wp-block-latest-posts li > a:lang(bn-BD), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(bn-BD), .entry .entry-content .wp-block-verse:lang(bn-BD), .entry .entry-content .has-drop-cap:lang(bn-BD):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(bn-BD), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(bn-BD), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(bn-BD), +.entry .entry-content .wp-block-cover-image h2:lang(bn-BD), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(bn-BD), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(bn-BD), +.entry .entry-content .wp-block-cover h2:lang(bn-BD), .entry .entry-content .wp-block-audio figcaption:lang(bn-BD), +.entry .entry-content .wp-block-video figcaption:lang(bn-BD), +.entry .entry-content .wp-block-image figcaption:lang(bn-BD), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(bn-BD), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(bn-BD), .entry .entry-content .wp-block-file:lang(bn-BD), .entry .entry-content .wp-block-file .wp-block-file__button:lang(bn-BD), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(bn-BD), .wp-caption-text:lang(bn-BD), .gallery-caption:lang(bn-BD) { + font-family: Arial, sans-serif; +} + +body:lang(hi-IN), button:lang(hi-IN), +input:lang(hi-IN), +select:lang(hi-IN), +optgroup:lang(hi-IN), +textarea:lang(hi-IN), .author-description .author-link:lang(hi-IN), +.comment-metadata:lang(hi-IN), +.comment-reply-link:lang(hi-IN), +.comments-title:lang(hi-IN), +.comment-author .fn:lang(hi-IN), +.discussion-meta-info:lang(hi-IN), +.entry-meta:lang(hi-IN), +.entry-footer:lang(hi-IN), +.main-navigation:lang(hi-IN), +.no-comments:lang(hi-IN), +.not-found .page-title:lang(hi-IN), +.error-404 .page-title:lang(hi-IN), +.post-navigation .post-title:lang(hi-IN), +.page-links:lang(hi-IN), +.page-description:lang(hi-IN), +.pagination .nav-links:lang(hi-IN), +.sticky-post:lang(hi-IN), +.site-title:lang(hi-IN), +.site-info:lang(hi-IN), +#cancel-comment-reply-link:lang(hi-IN), +h1:lang(hi-IN), +h2:lang(hi-IN), +h3:lang(hi-IN), +h4:lang(hi-IN), +h5:lang(hi-IN), +h6:lang(hi-IN), .page-title:lang(hi-IN), blockquote cite:lang(hi-IN), table:lang(hi-IN), .button:lang(hi-IN), +input:lang(hi-IN)[type="button"], +input:lang(hi-IN)[type="reset"], +input:lang(hi-IN)[type="submit"], .comment-navigation .nav-previous:lang(hi-IN), +.comment-navigation .nav-next:lang(hi-IN), .comment-list .pingback .comment-body:lang(hi-IN), +.comment-list .trackback .comment-body:lang(hi-IN), .comment-list .pingback .comment-body .comment-edit-link:lang(hi-IN), +.comment-list .trackback .comment-body .comment-edit-link:lang(hi-IN), .comment-form .comment-notes:lang(hi-IN), +.comment-form label:lang(hi-IN), .widget_archive ul li:lang(hi-IN), +.widget_categories ul li:lang(hi-IN), +.widget_meta ul li:lang(hi-IN), +.widget_nav_menu ul li:lang(hi-IN), +.widget_pages ul li:lang(hi-IN), +.widget_recent_comments ul li:lang(hi-IN), +.widget_recent_entries ul li:lang(hi-IN), +.widget_rss ul li:lang(hi-IN), .widget_tag_cloud .tagcloud:lang(hi-IN), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(hi-IN), .entry .entry-content .wp-block-button .wp-block-button__link:lang(hi-IN), .entry .entry-content .wp-block-archives li > a:lang(hi-IN), +.entry .entry-content .wp-block-categories li > a:lang(hi-IN), +.entry .entry-content .wp-block-latest-posts li > a:lang(hi-IN), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(hi-IN), .entry .entry-content .wp-block-verse:lang(hi-IN), .entry .entry-content .has-drop-cap:lang(hi-IN):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(hi-IN), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(hi-IN), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(hi-IN), +.entry .entry-content .wp-block-cover-image h2:lang(hi-IN), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(hi-IN), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(hi-IN), +.entry .entry-content .wp-block-cover h2:lang(hi-IN), .entry .entry-content .wp-block-audio figcaption:lang(hi-IN), +.entry .entry-content .wp-block-video figcaption:lang(hi-IN), +.entry .entry-content .wp-block-image figcaption:lang(hi-IN), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(hi-IN), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(hi-IN), .entry .entry-content .wp-block-file:lang(hi-IN), .entry .entry-content .wp-block-file .wp-block-file__button:lang(hi-IN), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(hi-IN), .wp-caption-text:lang(hi-IN), .gallery-caption:lang(hi-IN) { + font-family: Arial, sans-serif; +} + +body:lang(mr), button:lang(mr), +input:lang(mr), +select:lang(mr), +optgroup:lang(mr), +textarea:lang(mr), .author-description .author-link:lang(mr), +.comment-metadata:lang(mr), +.comment-reply-link:lang(mr), +.comments-title:lang(mr), +.comment-author .fn:lang(mr), +.discussion-meta-info:lang(mr), +.entry-meta:lang(mr), +.entry-footer:lang(mr), +.main-navigation:lang(mr), +.no-comments:lang(mr), +.not-found .page-title:lang(mr), +.error-404 .page-title:lang(mr), +.post-navigation .post-title:lang(mr), +.page-links:lang(mr), +.page-description:lang(mr), +.pagination .nav-links:lang(mr), +.sticky-post:lang(mr), +.site-title:lang(mr), +.site-info:lang(mr), +#cancel-comment-reply-link:lang(mr), +h1:lang(mr), +h2:lang(mr), +h3:lang(mr), +h4:lang(mr), +h5:lang(mr), +h6:lang(mr), .page-title:lang(mr), blockquote cite:lang(mr), table:lang(mr), .button:lang(mr), +input:lang(mr)[type="button"], +input:lang(mr)[type="reset"], +input:lang(mr)[type="submit"], .comment-navigation .nav-previous:lang(mr), +.comment-navigation .nav-next:lang(mr), .comment-list .pingback .comment-body:lang(mr), +.comment-list .trackback .comment-body:lang(mr), .comment-list .pingback .comment-body .comment-edit-link:lang(mr), +.comment-list .trackback .comment-body .comment-edit-link:lang(mr), .comment-form .comment-notes:lang(mr), +.comment-form label:lang(mr), .widget_archive ul li:lang(mr), +.widget_categories ul li:lang(mr), +.widget_meta ul li:lang(mr), +.widget_nav_menu ul li:lang(mr), +.widget_pages ul li:lang(mr), +.widget_recent_comments ul li:lang(mr), +.widget_recent_entries ul li:lang(mr), +.widget_rss ul li:lang(mr), .widget_tag_cloud .tagcloud:lang(mr), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(mr), .entry .entry-content .wp-block-button .wp-block-button__link:lang(mr), .entry .entry-content .wp-block-archives li > a:lang(mr), +.entry .entry-content .wp-block-categories li > a:lang(mr), +.entry .entry-content .wp-block-latest-posts li > a:lang(mr), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(mr), .entry .entry-content .wp-block-verse:lang(mr), .entry .entry-content .has-drop-cap:lang(mr):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(mr), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(mr), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(mr), +.entry .entry-content .wp-block-cover-image h2:lang(mr), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(mr), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(mr), +.entry .entry-content .wp-block-cover h2:lang(mr), .entry .entry-content .wp-block-audio figcaption:lang(mr), +.entry .entry-content .wp-block-video figcaption:lang(mr), +.entry .entry-content .wp-block-image figcaption:lang(mr), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(mr), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(mr), .entry .entry-content .wp-block-file:lang(mr), .entry .entry-content .wp-block-file .wp-block-file__button:lang(mr), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(mr), .wp-caption-text:lang(mr), .gallery-caption:lang(mr) { + font-family: Arial, sans-serif; +} + +body:lang(ne-NP), button:lang(ne-NP), +input:lang(ne-NP), +select:lang(ne-NP), +optgroup:lang(ne-NP), +textarea:lang(ne-NP), .author-description .author-link:lang(ne-NP), +.comment-metadata:lang(ne-NP), +.comment-reply-link:lang(ne-NP), +.comments-title:lang(ne-NP), +.comment-author .fn:lang(ne-NP), +.discussion-meta-info:lang(ne-NP), +.entry-meta:lang(ne-NP), +.entry-footer:lang(ne-NP), +.main-navigation:lang(ne-NP), +.no-comments:lang(ne-NP), +.not-found .page-title:lang(ne-NP), +.error-404 .page-title:lang(ne-NP), +.post-navigation .post-title:lang(ne-NP), +.page-links:lang(ne-NP), +.page-description:lang(ne-NP), +.pagination .nav-links:lang(ne-NP), +.sticky-post:lang(ne-NP), +.site-title:lang(ne-NP), +.site-info:lang(ne-NP), +#cancel-comment-reply-link:lang(ne-NP), +h1:lang(ne-NP), +h2:lang(ne-NP), +h3:lang(ne-NP), +h4:lang(ne-NP), +h5:lang(ne-NP), +h6:lang(ne-NP), .page-title:lang(ne-NP), blockquote cite:lang(ne-NP), table:lang(ne-NP), .button:lang(ne-NP), +input:lang(ne-NP)[type="button"], +input:lang(ne-NP)[type="reset"], +input:lang(ne-NP)[type="submit"], .comment-navigation .nav-previous:lang(ne-NP), +.comment-navigation .nav-next:lang(ne-NP), .comment-list .pingback .comment-body:lang(ne-NP), +.comment-list .trackback .comment-body:lang(ne-NP), .comment-list .pingback .comment-body .comment-edit-link:lang(ne-NP), +.comment-list .trackback .comment-body .comment-edit-link:lang(ne-NP), .comment-form .comment-notes:lang(ne-NP), +.comment-form label:lang(ne-NP), .widget_archive ul li:lang(ne-NP), +.widget_categories ul li:lang(ne-NP), +.widget_meta ul li:lang(ne-NP), +.widget_nav_menu ul li:lang(ne-NP), +.widget_pages ul li:lang(ne-NP), +.widget_recent_comments ul li:lang(ne-NP), +.widget_recent_entries ul li:lang(ne-NP), +.widget_rss ul li:lang(ne-NP), .widget_tag_cloud .tagcloud:lang(ne-NP), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ne-NP), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ne-NP), .entry .entry-content .wp-block-archives li > a:lang(ne-NP), +.entry .entry-content .wp-block-categories li > a:lang(ne-NP), +.entry .entry-content .wp-block-latest-posts li > a:lang(ne-NP), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ne-NP), .entry .entry-content .wp-block-verse:lang(ne-NP), .entry .entry-content .has-drop-cap:lang(ne-NP):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ne-NP), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ne-NP), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ne-NP), +.entry .entry-content .wp-block-cover-image h2:lang(ne-NP), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ne-NP), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ne-NP), +.entry .entry-content .wp-block-cover h2:lang(ne-NP), .entry .entry-content .wp-block-audio figcaption:lang(ne-NP), +.entry .entry-content .wp-block-video figcaption:lang(ne-NP), +.entry .entry-content .wp-block-image figcaption:lang(ne-NP), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ne-NP), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ne-NP), .entry .entry-content .wp-block-file:lang(ne-NP), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ne-NP), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ne-NP), .wp-caption-text:lang(ne-NP), .gallery-caption:lang(ne-NP) { + font-family: Arial, sans-serif; +} + +body:lang(el), button:lang(el), +input:lang(el), +select:lang(el), +optgroup:lang(el), +textarea:lang(el), .author-description .author-link:lang(el), +.comment-metadata:lang(el), +.comment-reply-link:lang(el), +.comments-title:lang(el), +.comment-author .fn:lang(el), +.discussion-meta-info:lang(el), +.entry-meta:lang(el), +.entry-footer:lang(el), +.main-navigation:lang(el), +.no-comments:lang(el), +.not-found .page-title:lang(el), +.error-404 .page-title:lang(el), +.post-navigation .post-title:lang(el), +.page-links:lang(el), +.page-description:lang(el), +.pagination .nav-links:lang(el), +.sticky-post:lang(el), +.site-title:lang(el), +.site-info:lang(el), +#cancel-comment-reply-link:lang(el), +h1:lang(el), +h2:lang(el), +h3:lang(el), +h4:lang(el), +h5:lang(el), +h6:lang(el), .page-title:lang(el), blockquote cite:lang(el), table:lang(el), .button:lang(el), +input:lang(el)[type="button"], +input:lang(el)[type="reset"], +input:lang(el)[type="submit"], .comment-navigation .nav-previous:lang(el), +.comment-navigation .nav-next:lang(el), .comment-list .pingback .comment-body:lang(el), +.comment-list .trackback .comment-body:lang(el), .comment-list .pingback .comment-body .comment-edit-link:lang(el), +.comment-list .trackback .comment-body .comment-edit-link:lang(el), .comment-form .comment-notes:lang(el), +.comment-form label:lang(el), .widget_archive ul li:lang(el), +.widget_categories ul li:lang(el), +.widget_meta ul li:lang(el), +.widget_nav_menu ul li:lang(el), +.widget_pages ul li:lang(el), +.widget_recent_comments ul li:lang(el), +.widget_recent_entries ul li:lang(el), +.widget_rss ul li:lang(el), .widget_tag_cloud .tagcloud:lang(el), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(el), .entry .entry-content .wp-block-button .wp-block-button__link:lang(el), .entry .entry-content .wp-block-archives li > a:lang(el), +.entry .entry-content .wp-block-categories li > a:lang(el), +.entry .entry-content .wp-block-latest-posts li > a:lang(el), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(el), .entry .entry-content .wp-block-verse:lang(el), .entry .entry-content .has-drop-cap:lang(el):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(el), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(el), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(el), +.entry .entry-content .wp-block-cover-image h2:lang(el), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(el), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(el), +.entry .entry-content .wp-block-cover h2:lang(el), .entry .entry-content .wp-block-audio figcaption:lang(el), +.entry .entry-content .wp-block-video figcaption:lang(el), +.entry .entry-content .wp-block-image figcaption:lang(el), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(el), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(el), .entry .entry-content .wp-block-file:lang(el), .entry .entry-content .wp-block-file .wp-block-file__button:lang(el), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(el), .wp-caption-text:lang(el), .gallery-caption:lang(el) { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +body:lang(gu), button:lang(gu), +input:lang(gu), +select:lang(gu), +optgroup:lang(gu), +textarea:lang(gu), .author-description .author-link:lang(gu), +.comment-metadata:lang(gu), +.comment-reply-link:lang(gu), +.comments-title:lang(gu), +.comment-author .fn:lang(gu), +.discussion-meta-info:lang(gu), +.entry-meta:lang(gu), +.entry-footer:lang(gu), +.main-navigation:lang(gu), +.no-comments:lang(gu), +.not-found .page-title:lang(gu), +.error-404 .page-title:lang(gu), +.post-navigation .post-title:lang(gu), +.page-links:lang(gu), +.page-description:lang(gu), +.pagination .nav-links:lang(gu), +.sticky-post:lang(gu), +.site-title:lang(gu), +.site-info:lang(gu), +#cancel-comment-reply-link:lang(gu), +h1:lang(gu), +h2:lang(gu), +h3:lang(gu), +h4:lang(gu), +h5:lang(gu), +h6:lang(gu), .page-title:lang(gu), blockquote cite:lang(gu), table:lang(gu), .button:lang(gu), +input:lang(gu)[type="button"], +input:lang(gu)[type="reset"], +input:lang(gu)[type="submit"], .comment-navigation .nav-previous:lang(gu), +.comment-navigation .nav-next:lang(gu), .comment-list .pingback .comment-body:lang(gu), +.comment-list .trackback .comment-body:lang(gu), .comment-list .pingback .comment-body .comment-edit-link:lang(gu), +.comment-list .trackback .comment-body .comment-edit-link:lang(gu), .comment-form .comment-notes:lang(gu), +.comment-form label:lang(gu), .widget_archive ul li:lang(gu), +.widget_categories ul li:lang(gu), +.widget_meta ul li:lang(gu), +.widget_nav_menu ul li:lang(gu), +.widget_pages ul li:lang(gu), +.widget_recent_comments ul li:lang(gu), +.widget_recent_entries ul li:lang(gu), +.widget_rss ul li:lang(gu), .widget_tag_cloud .tagcloud:lang(gu), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(gu), .entry .entry-content .wp-block-button .wp-block-button__link:lang(gu), .entry .entry-content .wp-block-archives li > a:lang(gu), +.entry .entry-content .wp-block-categories li > a:lang(gu), +.entry .entry-content .wp-block-latest-posts li > a:lang(gu), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(gu), .entry .entry-content .wp-block-verse:lang(gu), .entry .entry-content .has-drop-cap:lang(gu):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(gu), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(gu), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(gu), +.entry .entry-content .wp-block-cover-image h2:lang(gu), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(gu), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(gu), +.entry .entry-content .wp-block-cover h2:lang(gu), .entry .entry-content .wp-block-audio figcaption:lang(gu), +.entry .entry-content .wp-block-video figcaption:lang(gu), +.entry .entry-content .wp-block-image figcaption:lang(gu), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(gu), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(gu), .entry .entry-content .wp-block-file:lang(gu), .entry .entry-content .wp-block-file .wp-block-file__button:lang(gu), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(gu), .wp-caption-text:lang(gu), .gallery-caption:lang(gu) { + font-family: Arial, sans-serif; +} + +body:lang(he-IL), button:lang(he-IL), +input:lang(he-IL), +select:lang(he-IL), +optgroup:lang(he-IL), +textarea:lang(he-IL), .author-description .author-link:lang(he-IL), +.comment-metadata:lang(he-IL), +.comment-reply-link:lang(he-IL), +.comments-title:lang(he-IL), +.comment-author .fn:lang(he-IL), +.discussion-meta-info:lang(he-IL), +.entry-meta:lang(he-IL), +.entry-footer:lang(he-IL), +.main-navigation:lang(he-IL), +.no-comments:lang(he-IL), +.not-found .page-title:lang(he-IL), +.error-404 .page-title:lang(he-IL), +.post-navigation .post-title:lang(he-IL), +.page-links:lang(he-IL), +.page-description:lang(he-IL), +.pagination .nav-links:lang(he-IL), +.sticky-post:lang(he-IL), +.site-title:lang(he-IL), +.site-info:lang(he-IL), +#cancel-comment-reply-link:lang(he-IL), +h1:lang(he-IL), +h2:lang(he-IL), +h3:lang(he-IL), +h4:lang(he-IL), +h5:lang(he-IL), +h6:lang(he-IL), .page-title:lang(he-IL), blockquote cite:lang(he-IL), table:lang(he-IL), .button:lang(he-IL), +input:lang(he-IL)[type="button"], +input:lang(he-IL)[type="reset"], +input:lang(he-IL)[type="submit"], .comment-navigation .nav-previous:lang(he-IL), +.comment-navigation .nav-next:lang(he-IL), .comment-list .pingback .comment-body:lang(he-IL), +.comment-list .trackback .comment-body:lang(he-IL), .comment-list .pingback .comment-body .comment-edit-link:lang(he-IL), +.comment-list .trackback .comment-body .comment-edit-link:lang(he-IL), .comment-form .comment-notes:lang(he-IL), +.comment-form label:lang(he-IL), .widget_archive ul li:lang(he-IL), +.widget_categories ul li:lang(he-IL), +.widget_meta ul li:lang(he-IL), +.widget_nav_menu ul li:lang(he-IL), +.widget_pages ul li:lang(he-IL), +.widget_recent_comments ul li:lang(he-IL), +.widget_recent_entries ul li:lang(he-IL), +.widget_rss ul li:lang(he-IL), .widget_tag_cloud .tagcloud:lang(he-IL), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(he-IL), .entry .entry-content .wp-block-button .wp-block-button__link:lang(he-IL), .entry .entry-content .wp-block-archives li > a:lang(he-IL), +.entry .entry-content .wp-block-categories li > a:lang(he-IL), +.entry .entry-content .wp-block-latest-posts li > a:lang(he-IL), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(he-IL), .entry .entry-content .wp-block-verse:lang(he-IL), .entry .entry-content .has-drop-cap:lang(he-IL):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(he-IL), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(he-IL), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(he-IL), +.entry .entry-content .wp-block-cover-image h2:lang(he-IL), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(he-IL), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(he-IL), +.entry .entry-content .wp-block-cover h2:lang(he-IL), .entry .entry-content .wp-block-audio figcaption:lang(he-IL), +.entry .entry-content .wp-block-video figcaption:lang(he-IL), +.entry .entry-content .wp-block-image figcaption:lang(he-IL), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(he-IL), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(he-IL), .entry .entry-content .wp-block-file:lang(he-IL), .entry .entry-content .wp-block-file .wp-block-file__button:lang(he-IL), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(he-IL), .wp-caption-text:lang(he-IL), .gallery-caption:lang(he-IL) { + font-family: "Arial Hebrew", Arial, sans-serif; +} + +body:lang(ja), button:lang(ja), +input:lang(ja), +select:lang(ja), +optgroup:lang(ja), +textarea:lang(ja), .author-description .author-link:lang(ja), +.comment-metadata:lang(ja), +.comment-reply-link:lang(ja), +.comments-title:lang(ja), +.comment-author .fn:lang(ja), +.discussion-meta-info:lang(ja), +.entry-meta:lang(ja), +.entry-footer:lang(ja), +.main-navigation:lang(ja), +.no-comments:lang(ja), +.not-found .page-title:lang(ja), +.error-404 .page-title:lang(ja), +.post-navigation .post-title:lang(ja), +.page-links:lang(ja), +.page-description:lang(ja), +.pagination .nav-links:lang(ja), +.sticky-post:lang(ja), +.site-title:lang(ja), +.site-info:lang(ja), +#cancel-comment-reply-link:lang(ja), +h1:lang(ja), +h2:lang(ja), +h3:lang(ja), +h4:lang(ja), +h5:lang(ja), +h6:lang(ja), .page-title:lang(ja), blockquote cite:lang(ja), table:lang(ja), .button:lang(ja), +input:lang(ja)[type="button"], +input:lang(ja)[type="reset"], +input:lang(ja)[type="submit"], .comment-navigation .nav-previous:lang(ja), +.comment-navigation .nav-next:lang(ja), .comment-list .pingback .comment-body:lang(ja), +.comment-list .trackback .comment-body:lang(ja), .comment-list .pingback .comment-body .comment-edit-link:lang(ja), +.comment-list .trackback .comment-body .comment-edit-link:lang(ja), .comment-form .comment-notes:lang(ja), +.comment-form label:lang(ja), .widget_archive ul li:lang(ja), +.widget_categories ul li:lang(ja), +.widget_meta ul li:lang(ja), +.widget_nav_menu ul li:lang(ja), +.widget_pages ul li:lang(ja), +.widget_recent_comments ul li:lang(ja), +.widget_recent_entries ul li:lang(ja), +.widget_rss ul li:lang(ja), .widget_tag_cloud .tagcloud:lang(ja), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ja), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ja), .entry .entry-content .wp-block-archives li > a:lang(ja), +.entry .entry-content .wp-block-categories li > a:lang(ja), +.entry .entry-content .wp-block-latest-posts li > a:lang(ja), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ja), .entry .entry-content .wp-block-verse:lang(ja), .entry .entry-content .has-drop-cap:lang(ja):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ja), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ja), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ja), +.entry .entry-content .wp-block-cover-image h2:lang(ja), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ja), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ja), +.entry .entry-content .wp-block-cover h2:lang(ja), .entry .entry-content .wp-block-audio figcaption:lang(ja), +.entry .entry-content .wp-block-video figcaption:lang(ja), +.entry .entry-content .wp-block-image figcaption:lang(ja), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ja), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ja), .entry .entry-content .wp-block-file:lang(ja), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ja), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ja), .wp-caption-text:lang(ja), .gallery-caption:lang(ja) { + font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", Meiryo, "Helvetica Neue", sans-serif; +} + +body:lang(ko-KR), button:lang(ko-KR), +input:lang(ko-KR), +select:lang(ko-KR), +optgroup:lang(ko-KR), +textarea:lang(ko-KR), .author-description .author-link:lang(ko-KR), +.comment-metadata:lang(ko-KR), +.comment-reply-link:lang(ko-KR), +.comments-title:lang(ko-KR), +.comment-author .fn:lang(ko-KR), +.discussion-meta-info:lang(ko-KR), +.entry-meta:lang(ko-KR), +.entry-footer:lang(ko-KR), +.main-navigation:lang(ko-KR), +.no-comments:lang(ko-KR), +.not-found .page-title:lang(ko-KR), +.error-404 .page-title:lang(ko-KR), +.post-navigation .post-title:lang(ko-KR), +.page-links:lang(ko-KR), +.page-description:lang(ko-KR), +.pagination .nav-links:lang(ko-KR), +.sticky-post:lang(ko-KR), +.site-title:lang(ko-KR), +.site-info:lang(ko-KR), +#cancel-comment-reply-link:lang(ko-KR), +h1:lang(ko-KR), +h2:lang(ko-KR), +h3:lang(ko-KR), +h4:lang(ko-KR), +h5:lang(ko-KR), +h6:lang(ko-KR), .page-title:lang(ko-KR), blockquote cite:lang(ko-KR), table:lang(ko-KR), .button:lang(ko-KR), +input:lang(ko-KR)[type="button"], +input:lang(ko-KR)[type="reset"], +input:lang(ko-KR)[type="submit"], .comment-navigation .nav-previous:lang(ko-KR), +.comment-navigation .nav-next:lang(ko-KR), .comment-list .pingback .comment-body:lang(ko-KR), +.comment-list .trackback .comment-body:lang(ko-KR), .comment-list .pingback .comment-body .comment-edit-link:lang(ko-KR), +.comment-list .trackback .comment-body .comment-edit-link:lang(ko-KR), .comment-form .comment-notes:lang(ko-KR), +.comment-form label:lang(ko-KR), .widget_archive ul li:lang(ko-KR), +.widget_categories ul li:lang(ko-KR), +.widget_meta ul li:lang(ko-KR), +.widget_nav_menu ul li:lang(ko-KR), +.widget_pages ul li:lang(ko-KR), +.widget_recent_comments ul li:lang(ko-KR), +.widget_recent_entries ul li:lang(ko-KR), +.widget_rss ul li:lang(ko-KR), .widget_tag_cloud .tagcloud:lang(ko-KR), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(ko-KR), .entry .entry-content .wp-block-button .wp-block-button__link:lang(ko-KR), .entry .entry-content .wp-block-archives li > a:lang(ko-KR), +.entry .entry-content .wp-block-categories li > a:lang(ko-KR), +.entry .entry-content .wp-block-latest-posts li > a:lang(ko-KR), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(ko-KR), .entry .entry-content .wp-block-verse:lang(ko-KR), .entry .entry-content .has-drop-cap:lang(ko-KR):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(ko-KR), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(ko-KR), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(ko-KR), +.entry .entry-content .wp-block-cover-image h2:lang(ko-KR), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(ko-KR), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(ko-KR), +.entry .entry-content .wp-block-cover h2:lang(ko-KR), .entry .entry-content .wp-block-audio figcaption:lang(ko-KR), +.entry .entry-content .wp-block-video figcaption:lang(ko-KR), +.entry .entry-content .wp-block-image figcaption:lang(ko-KR), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(ko-KR), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(ko-KR), .entry .entry-content .wp-block-file:lang(ko-KR), .entry .entry-content .wp-block-file .wp-block-file__button:lang(ko-KR), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(ko-KR), .wp-caption-text:lang(ko-KR), .gallery-caption:lang(ko-KR) { + font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; +} + +body:lang(th), button:lang(th), +input:lang(th), +select:lang(th), +optgroup:lang(th), +textarea:lang(th), .author-description .author-link:lang(th), +.comment-metadata:lang(th), +.comment-reply-link:lang(th), +.comments-title:lang(th), +.comment-author .fn:lang(th), +.discussion-meta-info:lang(th), +.entry-meta:lang(th), +.entry-footer:lang(th), +.main-navigation:lang(th), +.no-comments:lang(th), +.not-found .page-title:lang(th), +.error-404 .page-title:lang(th), +.post-navigation .post-title:lang(th), +.page-links:lang(th), +.page-description:lang(th), +.pagination .nav-links:lang(th), +.sticky-post:lang(th), +.site-title:lang(th), +.site-info:lang(th), +#cancel-comment-reply-link:lang(th), +h1:lang(th), +h2:lang(th), +h3:lang(th), +h4:lang(th), +h5:lang(th), +h6:lang(th), .page-title:lang(th), blockquote cite:lang(th), table:lang(th), .button:lang(th), +input:lang(th)[type="button"], +input:lang(th)[type="reset"], +input:lang(th)[type="submit"], .comment-navigation .nav-previous:lang(th), +.comment-navigation .nav-next:lang(th), .comment-list .pingback .comment-body:lang(th), +.comment-list .trackback .comment-body:lang(th), .comment-list .pingback .comment-body .comment-edit-link:lang(th), +.comment-list .trackback .comment-body .comment-edit-link:lang(th), .comment-form .comment-notes:lang(th), +.comment-form label:lang(th), .widget_archive ul li:lang(th), +.widget_categories ul li:lang(th), +.widget_meta ul li:lang(th), +.widget_nav_menu ul li:lang(th), +.widget_pages ul li:lang(th), +.widget_recent_comments ul li:lang(th), +.widget_recent_entries ul li:lang(th), +.widget_rss ul li:lang(th), .widget_tag_cloud .tagcloud:lang(th), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(th), .entry .entry-content .wp-block-button .wp-block-button__link:lang(th), .entry .entry-content .wp-block-archives li > a:lang(th), +.entry .entry-content .wp-block-categories li > a:lang(th), +.entry .entry-content .wp-block-latest-posts li > a:lang(th), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(th), .entry .entry-content .wp-block-verse:lang(th), .entry .entry-content .has-drop-cap:lang(th):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(th), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(th), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(th), +.entry .entry-content .wp-block-cover-image h2:lang(th), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(th), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(th), +.entry .entry-content .wp-block-cover h2:lang(th), .entry .entry-content .wp-block-audio figcaption:lang(th), +.entry .entry-content .wp-block-video figcaption:lang(th), +.entry .entry-content .wp-block-image figcaption:lang(th), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(th), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(th), .entry .entry-content .wp-block-file:lang(th), .entry .entry-content .wp-block-file .wp-block-file__button:lang(th), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(th), .wp-caption-text:lang(th), .gallery-caption:lang(th) { + font-family: "Sukhumvit Set", "Helvetica Neue", helvetica, arial, sans-serif; +} + +body:lang(vi), button:lang(vi), +input:lang(vi), +select:lang(vi), +optgroup:lang(vi), +textarea:lang(vi), .author-description .author-link:lang(vi), +.comment-metadata:lang(vi), +.comment-reply-link:lang(vi), +.comments-title:lang(vi), +.comment-author .fn:lang(vi), +.discussion-meta-info:lang(vi), +.entry-meta:lang(vi), +.entry-footer:lang(vi), +.main-navigation:lang(vi), +.no-comments:lang(vi), +.not-found .page-title:lang(vi), +.error-404 .page-title:lang(vi), +.post-navigation .post-title:lang(vi), +.page-links:lang(vi), +.page-description:lang(vi), +.pagination .nav-links:lang(vi), +.sticky-post:lang(vi), +.site-title:lang(vi), +.site-info:lang(vi), +#cancel-comment-reply-link:lang(vi), +h1:lang(vi), +h2:lang(vi), +h3:lang(vi), +h4:lang(vi), +h5:lang(vi), +h6:lang(vi), .page-title:lang(vi), blockquote cite:lang(vi), table:lang(vi), .button:lang(vi), +input:lang(vi)[type="button"], +input:lang(vi)[type="reset"], +input:lang(vi)[type="submit"], .comment-navigation .nav-previous:lang(vi), +.comment-navigation .nav-next:lang(vi), .comment-list .pingback .comment-body:lang(vi), +.comment-list .trackback .comment-body:lang(vi), .comment-list .pingback .comment-body .comment-edit-link:lang(vi), +.comment-list .trackback .comment-body .comment-edit-link:lang(vi), .comment-form .comment-notes:lang(vi), +.comment-form label:lang(vi), .widget_archive ul li:lang(vi), +.widget_categories ul li:lang(vi), +.widget_meta ul li:lang(vi), +.widget_nav_menu ul li:lang(vi), +.widget_pages ul li:lang(vi), +.widget_recent_comments ul li:lang(vi), +.widget_recent_entries ul li:lang(vi), +.widget_rss ul li:lang(vi), .widget_tag_cloud .tagcloud:lang(vi), .widget_calendar .calendar_wrap .wp-calendar-nav:lang(vi), .entry .entry-content .wp-block-button .wp-block-button__link:lang(vi), .entry .entry-content .wp-block-archives li > a:lang(vi), +.entry .entry-content .wp-block-categories li > a:lang(vi), +.entry .entry-content .wp-block-latest-posts li > a:lang(vi), .entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date:lang(vi), .entry .entry-content .wp-block-verse:lang(vi), .entry .entry-content .has-drop-cap:lang(vi):not(:focus):first-letter, .entry .entry-content .wp-block-pullquote cite:lang(vi), .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text:lang(vi), +.entry .entry-content .wp-block-cover-image .wp-block-cover-text:lang(vi), +.entry .entry-content .wp-block-cover-image h2:lang(vi), +.entry .entry-content .wp-block-cover .wp-block-cover-image-text:lang(vi), +.entry .entry-content .wp-block-cover .wp-block-cover-text:lang(vi), +.entry .entry-content .wp-block-cover h2:lang(vi), .entry .entry-content .wp-block-audio figcaption:lang(vi), +.entry .entry-content .wp-block-video figcaption:lang(vi), +.entry .entry-content .wp-block-image figcaption:lang(vi), +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption:lang(vi), +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption:lang(vi), .entry .entry-content .wp-block-file:lang(vi), .entry .entry-content .wp-block-file .wp-block-file__button:lang(vi), .entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta:lang(vi), .wp-caption-text:lang(vi), .gallery-caption:lang(vi) { + font-family: "Libre Franklin", sans-serif; +} + +/* Normalize */ +/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ +/* Document + ========================================================================== */ +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ +html { + line-height: 1.15; + /* 1 */ + -webkit-text-size-adjust: 100%; + /* 2 */ +} + +/* Sections + ========================================================================== */ +/** + * Remove the margin in all browsers. + */ +body { + margin: 0; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/* Grouping content + ========================================================================== */ +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ +hr { + box-sizing: content-box; + /* 1 */ + height: 0; + /* 1 */ + overflow: visible; + /* 2 */ +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ +pre { + font-family: monospace, monospace; + /* 1 */ + font-size: 1em; + /* 2 */ +} + +/* Text-level semantics + ========================================================================== */ +/** + * Remove the gray background on active links in IE 10. + */ +a { + background-color: transparent; +} + +/** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ +abbr[title] { + border-bottom: none; + /* 1 */ + text-decoration: underline; + /* 2 */ + text-decoration: underline dotted; + /* 2 */ +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ +b, +strong { + font-weight: bolder; +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ +code, +kbd, +samp { + font-family: monospace, monospace; + /* 1 */ + font-size: 1em; + /* 2 */ +} + +/** + * Add the correct font size in all browsers. + */ +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ +/** + * Remove the border on images inside links in IE 10. + */ +img { + border-style: none; +} + +/* Forms + ========================================================================== */ +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ +button, +input, +optgroup, +select, +textarea { + font-family: inherit; + /* 1 */ + font-size: 100%; + /* 1 */ + line-height: 1.15; + /* 1 */ + margin: 0; + /* 2 */ +} + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ +button, +input { + /* 1 */ + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ +button, +select { + /* 1 */ + text-transform: none; +} + +/** + * Correct the inability to style clickable types in iOS and Safari. + */ +button, +[type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +/** + * Remove the inner border and padding in Firefox. + */ +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Correct the padding in Firefox. + */ +fieldset { + padding: 0.35em 0.75em 0.625em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ +legend { + box-sizing: border-box; + /* 1 */ + color: inherit; + /* 2 */ + display: table; + /* 1 */ + max-width: 100%; + /* 1 */ + padding: 0; + /* 3 */ + white-space: normal; + /* 1 */ +} + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ +progress { + vertical-align: baseline; +} + +/** + * Remove the default vertical scrollbar in IE 10+. + */ +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ +} + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ +[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + outline-offset: -2px; + /* 2 */ +} + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ +::-webkit-file-upload-button { + -webkit-appearance: button; + /* 1 */ + font: inherit; + /* 2 */ +} + +/* Interactive + ========================================================================== */ +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ +details { + display: block; +} + +/* + * Add the correct display in all browsers. + */ +summary { + display: list-item; +} + +/* Misc + ========================================================================== */ +/** + * Add the correct display in IE 10+. + */ +template { + display: none; +} + +/** + * Add the correct display in IE 10. + */ +[hidden] { + display: none; +} + +/* Typography */ +html { + font-size: 22px; +} + +body { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + color: #111; + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: 400; + font-size: 1em; + line-height: 1.8; + margin: 0; + text-rendering: optimizeLegibility; +} + +button, +input, +select, +optgroup, +textarea { + color: #111; + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: 400; + line-height: 1.8; + text-rendering: optimizeLegibility; +} + +.author-description .author-link, +.comment-metadata, +.comment-reply-link, +.comments-title, +.comment-author .fn, +.discussion-meta-info, +.entry-meta, +.entry-footer, +.main-navigation, +.no-comments, +.not-found .page-title, +.error-404 .page-title, +.post-navigation .post-title, +.page-links, +.page-description, +.pagination .nav-links, +.sticky-post, +.site-title, +.site-info, +#cancel-comment-reply-link, +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; +} + +.main-navigation, +.page-description, +.author-description .author-link, +.not-found .page-title, +.error-404 .page-title, +.post-navigation .post-title, +.pagination .nav-links, +.comments-title, +.comment-author .fn, +.no-comments, +.site-title, +h1, +h2, +h3, +h4, +h5, +h6 { + font-weight: 700; + letter-spacing: -0.02em; + line-height: 1.2; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.page-title { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; +} + +.site-branding, +.main-navigation ul.main-menu > li, +.social-navigation, +.author-description .author-bio, +.nav-links { + line-height: 1.25; +} + +h1 { + font-size: 2.25em; +} + +@media only screen and (min-width: 768px) { + h1 { + font-size: 2.8125em; + } +} + +.entry-title, +.not-found .page-title, +.error-404 .page-title, +.has-larger-font-size, +h2 { + font-size: 1.6875em; +} + +@media only screen and (min-width: 768px) { + .entry-title, + .not-found .page-title, + .error-404 .page-title, + .has-larger-font-size, + h2 { + font-size: 2.25em; + } +} + +.has-regular-font-size, +.has-large-font-size, +.comments-title, +h3 { + font-size: 1.6875em; +} + +.site-title, +.site-description, +.main-navigation, +.nav-links, +.page-title, +.page-description, +.comment-author .fn, +.no-comments, +h2.author-title, +p.author-bio, +h4 { + font-size: 1.125em; +} + +.pagination .nav-links, +.comment-content, +h5 { + font-size: 0.88889em; +} + +.entry-meta, +.entry-footer, +.discussion-meta-info, +.site-info, +.has-small-font-size, +.comment-reply-link, +.comment-metadata, +.comment-notes, +.sticky-post, +#cancel-comment-reply-link, +img:after, +h6 { + font-size: 0.71111em; +} + +.site-title, +.page-title { + font-weight: normal; +} + +.page-description, +.page-links a { + font-weight: bold; +} + +.site-description { + letter-spacing: -0.01em; +} + +.post-navigation .post-title, +.entry-title, +.not-found .page-title, +.error-404 .page-title, +.comments-title, +blockquote { + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + word-break: break-word; + word-wrap: break-word; +} + +/* Do not hyphenate entry title on tablet view and bigger. */ +@media only screen and (min-width: 768px) { + .entry-title { + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; + } +} + +p { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +dfn, +cite, +em, +i { + font-style: italic; +} + +blockquote cite { + font-size: 0.71111em; + font-style: normal; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; +} + +pre { + font-size: 0.88889em; + font-family: "Courier 10 Pitch", Courier, monospace; + line-height: 1.8; + overflow: auto; +} + +code, +kbd, +tt, +var { + font-size: 0.88889em; + font-family: Menlo, monaco, Consolas, Lucida Console, monospace; +} + +abbr, acronym { + border-bottom: 1px dotted #666; + cursor: help; +} + +mark, +ins { + background: #fff9c0; + text-decoration: none; +} + +big { + font-size: 125%; +} + +a { + text-decoration: none; +} + +a:hover { + text-decoration: none; +} + +a:focus { + text-decoration: underline; +} + +/* Elements */ +html { + box-sizing: border-box; +} + +::-moz-selection { + background-color: #bfdcea; +} + +::selection { + background-color: #bfdcea; +} + +*, +*:before, +*:after { + box-sizing: inherit; +} + +body { + background-color: #fff; +} + +a { + transition: color 110ms ease-in-out; + color: #0073aa; +} + +a:hover, +a:active { + color: #005177; + outline: 0; + text-decoration: none; +} + +a:focus { + outline: thin; + outline-style: dotted; + text-decoration: underline; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + clear: both; + margin: 1rem 0; +} + +h1:not(.site-title):before, +h2:before { + background: #767676; + content: "\020"; + display: block; + height: 2px; + margin: 1rem 0; + width: 1em; +} + +hr { + background-color: #767676; + border: 0; + height: 2px; +} + +ul, +ol { + padding-left: 1rem; +} + +ul { + list-style: disc; +} + +ul ul { + list-style-type: circle; +} + +ol { + list-style: decimal; +} + +li { + line-height: 1.8; +} + +li > ul, +li > ol { + padding-left: 2rem; +} + +dt { + font-weight: bold; +} + +dd { + margin: 0 1rem 1rem; +} + +img { + height: auto; + max-width: 100%; + position: relative; +} + +figure { + margin: 0; +} + +blockquote { + border-left: 2px solid #0073aa; + margin-left: 0; + padding: 0 0 0 1rem; +} + +blockquote > p { + margin: 0 0 1rem; +} + +blockquote cite { + color: #767676; +} + +table { + margin: 0 0 1rem; + border-collapse: collapse; + width: 100%; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; +} + +table td, +table th { + padding: 0.5em; + border: 1px solid #767676; + word-break: break-all; +} + +/* Forms */ +.button, +button, +input[type="button"], +input[type="reset"], +input[type="submit"] { + transition: background 150ms ease-in-out; + background: #0073aa; + border: none; + border-radius: 5px; + box-sizing: border-box; + color: #fff; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.88889em; + font-weight: 700; + line-height: 1.2; + outline: none; + padding: 0.76rem 1rem; + text-decoration: none; + vertical-align: bottom; +} + +.button:hover, +button:hover, +input[type="button"]:hover, +input[type="reset"]:hover, +input[type="submit"]:hover { + background: #111; + cursor: pointer; +} + +.button:visited, +button:visited, +input[type="button"]:visited, +input[type="reset"]:visited, +input[type="submit"]:visited { + color: #fff; + text-decoration: none; +} + +.button:focus, +button:focus, +input[type="button"]:focus, +input[type="reset"]:focus, +input[type="submit"]:focus { + background: #111; + outline: thin dotted; + outline-offset: -4px; +} + +input[type="text"], +input[type="email"], +input[type="url"], +input[type="password"], +input[type="search"], +input[type="number"], +input[type="tel"], +input[type="range"], +input[type="date"], +input[type="month"], +input[type="week"], +input[type="time"], +input[type="datetime"], +input[type="datetime-local"], +input[type="color"], +textarea { + -webkit-backface-visibility: hidden; + background: #fff; + border: solid 1px #ccc; + box-sizing: border-box; + outline: none; + padding: 0.36rem 0.66rem; + -webkit-appearance: none; + outline-offset: 0; + border-radius: 0; +} + +input[type="text"]:focus, +input[type="email"]:focus, +input[type="url"]:focus, +input[type="password"]:focus, +input[type="search"]:focus, +input[type="number"]:focus, +input[type="tel"]:focus, +input[type="range"]:focus, +input[type="date"]:focus, +input[type="month"]:focus, +input[type="week"]:focus, +input[type="time"]:focus, +input[type="datetime"]:focus, +input[type="datetime-local"]:focus, +input[type="color"]:focus, +textarea:focus { + border-color: #0073aa; + outline: thin solid rgba(0, 115, 170, 0.15); + outline-offset: -4px; +} + +input[type="search"]::-webkit-search-decoration { + display: none; +} + +textarea { + box-sizing: border-box; + display: block; + width: 100%; + max-width: 100%; + resize: vertical; +} + +form p { + margin: 1rem 0; +} + +/* Navigation */ +/*-------------------------------------------------------------- +## Links +--------------------------------------------------------------*/ +a { + transition: color 110ms ease-in-out; + color: #0073aa; +} + +a:visited { + color: #0073aa; +} + +a:hover, +a:active { + color: #005177; + outline: 0; + text-decoration: none; +} + +a:focus { + outline: thin dotted; + text-decoration: underline; +} + +/*-------------------------------------------------------------- +## Menus +--------------------------------------------------------------*/ +/** === Main menu === */ +.main-navigation { + display: block; + margin-top: 0.25rem; + /* Un-style buttons */ + /* + * Sub-menu styles + * + * :focus-within needs its own selector so other similar + * selectors don’t get ignored if a browser doesn’t recognize it + */ + /** + * Fade-in animation for top-level submenus + */ + /** + * Off-canvas touch device styles + */ +} + +body.page .main-navigation { + display: block; +} + +.main-navigation > div { + display: inline; +} + +.main-navigation button { + display: inline-block; + border: none; + padding: 0; + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-weight: 700; + line-height: 1.2; + text-decoration: none; + background: transparent; + color: inherit; + cursor: pointer; + transition: background 250ms ease-in-out, + transform 150ms ease; + -webkit-appearance: none; + -moz-appearance: none; +} + +.main-navigation button:hover, .main-navigation button:focus { + background: transparent; +} + +.main-navigation button:focus { + outline: 1px solid transparent; + outline-offset: -4px; +} + +.main-navigation button:active { + transform: scale(0.99); +} + +.main-navigation .main-menu { + display: inline-block; + margin: 0; + padding: 0; +} + +.main-navigation .main-menu > li { + color: #0073aa; + display: inline; + position: relative; +} + +.main-navigation .main-menu > li > a { + font-weight: 700; + color: #0073aa; + margin-right: 0.5rem; +} + +.main-navigation .main-menu > li > a + svg { + margin-right: 0.5rem; +} + +.main-navigation .main-menu > li > a:hover, +.main-navigation .main-menu > li > a:hover + svg { + color: #005177; +} + +.main-navigation .main-menu > li.menu-item-has-children { + display: inline-block; + position: inherit; +} + +@media only screen and (min-width: 768px) { + .main-navigation .main-menu > li.menu-item-has-children { + position: relative; + } +} + +.main-navigation .main-menu > li.menu-item-has-children > a { + margin-right: 0.125rem; +} + +.main-navigation .main-menu > li.menu-item-has-children > a:after, +.main-navigation .main-menu > li.menu-item-has-children .menu-item-has-children > a:after { + content: ""; + display: none; +} + +.main-navigation .main-menu > li.menu-item-has-children .submenu-expand { + display: inline-block; + margin-right: 0.25rem; + /* Priority+ Menu */ +} + +.main-navigation .main-menu > li.menu-item-has-children .submenu-expand.main-menu-more-toggle { + position: relative; + height: 24px; + line-height: 1.2; + width: 24px; + padding: 0; + margin-left: 0.5rem; +} + +.main-navigation .main-menu > li.menu-item-has-children .submenu-expand.main-menu-more-toggle svg { + height: 24px; + width: 24px; + top: -0.125rem; + vertical-align: text-bottom; +} + +.wp-customizer-unloading .main-navigation .main-menu > li.menu-item-has-children .submenu-expand, .main-navigation .main-menu > li.menu-item-has-children .submenu-expand.is-empty { + display: none; +} + +.main-navigation .main-menu > li.menu-item-has-children .submenu-expand svg { + position: relative; + top: 0.2rem; +} + +.main-navigation .main-menu > li:last-child > a, +.main-navigation .main-menu > li:last-child.menu-item-has-children .submenu-expand { + margin-right: 0; +} + +.main-navigation .sub-menu { + background-color: #0073aa; + color: #fff; + list-style: none; + padding-left: 0; + position: absolute; + opacity: 0; + left: -9999px; + z-index: 99999; +} + +@media only screen and (min-width: 768px) { + .main-navigation .sub-menu { + width: auto; + min-width: -moz-max-content; + min-width: -webkit-max-content; + min-width: max-content; + } +} + +.main-navigation .sub-menu > li { + display: block; + float: none; + position: relative; +} + +.main-navigation .sub-menu > li.menu-item-has-children .submenu-expand { + display: inline-block; + position: absolute; + width: calc( 24px + 1rem); + right: 0; + top: calc( .125 * 1rem); + bottom: 0; + color: white; + line-height: 1; + padding: calc( .5 * 1rem); +} + +.main-navigation .sub-menu > li.menu-item-has-children .submenu-expand svg { + top: 0; +} + +.main-navigation .sub-menu > li.menu-item-has-children .submenu-expand { + margin-right: 0; +} + +@media only screen and (min-width: 768px) { + .main-navigation .sub-menu > li.menu-item-has-children .menu-item-has-children > a:after { + content: "\203a"; + } +} + +.main-navigation .sub-menu > li > a, +.main-navigation .sub-menu > li > .menu-item-link-return { + color: #fff; + display: block; + line-height: 1.2; + text-shadow: none; + padding: calc( .5 * 1rem) calc( 24px + 1rem) calc( .5 * 1rem) 1rem; + white-space: nowrap; +} + +.main-navigation .sub-menu > li > a:hover, .main-navigation .sub-menu > li > a:focus, +.main-navigation .sub-menu > li > .menu-item-link-return:hover, +.main-navigation .sub-menu > li > .menu-item-link-return:focus { + background: #005177; +} + +.main-navigation .sub-menu > li > a:hover:after, .main-navigation .sub-menu > li > a:focus:after, +.main-navigation .sub-menu > li > .menu-item-link-return:hover:after, +.main-navigation .sub-menu > li > .menu-item-link-return:focus:after { + background: #005177; +} + +.main-navigation .sub-menu > li > .menu-item-link-return { + width: 100%; + font-size: 22px; + font-weight: normal; + text-align: left; +} + +.main-navigation .sub-menu > li > a:empty { + display: none; +} + +.main-navigation .sub-menu > li.mobile-parent-nav-menu-item { + display: none; + font-size: 0.88889em; + font-weight: normal; +} + +.main-navigation .sub-menu > li.mobile-parent-nav-menu-item svg { + position: relative; + top: 0.2rem; + margin-right: calc( .25 * 1rem); +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu { + display: block; + left: 0; + margin-top: 0; + opacity: 1; + width: auto; + min-width: 100%; + /* Non-mobile position */ + /* Nested sub-menu dashes */ +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu { + display: block; + left: 0; + margin-top: 0; + opacity: 1; + width: auto; + min-width: 100%; + /* Non-mobile position */ + /* Nested sub-menu dashes */ +} + +@media only screen and (min-width: 768px) { + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu { + display: block; + margin-top: 0; + opacity: 1; + position: absolute; + left: 0; + right: auto; + top: auto; + bottom: auto; + height: auto; + min-width: -moz-max-content; + min-width: -webkit-max-content; + min-width: max-content; + transform: none; + } + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu { + display: block; + margin-top: 0; + opacity: 1; + position: absolute; + left: 0; + right: auto; + top: auto; + bottom: auto; + height: auto; + min-width: -moz-max-content; + min-width: -webkit-max-content; + min-width: max-content; + transform: none; + } +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu.hidden-links { + left: 0; + width: 100%; + display: table; + position: absolute; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu.hidden-links { + left: 0; + width: 100%; + display: table; + position: absolute; +} + +@media only screen and (min-width: 768px) { + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu.hidden-links { + right: 0; + left: auto; + display: block; + width: max-content; + } + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu.hidden-links { + right: 0; + left: auto; + display: block; + width: max-content; + } +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu .submenu-expand { + display: none; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu .submenu-expand { + display: none; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu .sub-menu { + display: block; + margin-top: inherit; + position: relative; + width: 100%; + left: 0; + opacity: 1; + /* Non-mobile position */ +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu .sub-menu { + display: block; + margin-top: inherit; + position: relative; + width: 100%; + left: 0; + opacity: 1; + /* Non-mobile position */ +} + +@media only screen and (min-width: 768px) { + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu .sub-menu { + float: none; + max-width: 100%; + } + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu .sub-menu { + float: none; + max-width: 100%; + } +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu .sub-menu { + counter-reset: submenu; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu .sub-menu { + counter-reset: submenu; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas)[focus-within] > .sub-menu .sub-menu > li > a::before { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: normal; + content: "– " counters(submenu, "– ", none); + counter-increment: submenu; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus-within > .sub-menu .sub-menu > li > a::before { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: normal; + content: "– " counters(submenu, "– ", none); + counter-increment: submenu; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu, +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu, +.main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu { + display: block; + left: 0; + margin-top: 0; + opacity: 1; + width: auto; + min-width: 100%; + /* Non-mobile position */ + /* Nested sub-menu dashes */ +} + +@media only screen and (min-width: 768px) { + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu, + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu, + .main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu { + display: block; + float: none; + margin-top: 0; + opacity: 1; + position: absolute; + left: 0; + right: auto; + top: auto; + bottom: auto; + height: auto; + min-width: -moz-max-content; + min-width: -webkit-max-content; + min-width: max-content; + transform: none; + } +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu.hidden-links, +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu.hidden-links, +.main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu.hidden-links { + left: 0; + width: 100%; + display: table; + position: absolute; +} + +@media only screen and (min-width: 768px) { + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu.hidden-links, + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu.hidden-links, + .main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu.hidden-links { + right: 0; + left: auto; + display: table; + width: max-content; + } +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu .submenu-expand, +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu .submenu-expand, +.main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu .submenu-expand { + display: none; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu .sub-menu, +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu .sub-menu, +.main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu .sub-menu { + display: block; + margin-top: inherit; + position: relative; + width: 100%; + left: 0; + opacity: 1; + /* Non-mobile position */ +} + +@media only screen and (min-width: 768px) { + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu .sub-menu, + .main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu .sub-menu, + .main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu .sub-menu { + float: none; + max-width: 100%; + } +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu .sub-menu, +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu .sub-menu, +.main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu .sub-menu { + counter-reset: submenu; +} + +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):hover > .sub-menu .sub-menu > li > a::before, +.main-navigation .main-menu .menu-item-has-children:not(.off-canvas):focus > .sub-menu .sub-menu > li > a::before, +.main-navigation .main-menu .menu-item-has-children.is-focused:not(.off-canvas) > .sub-menu .sub-menu > li > a::before { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: normal; + content: "– " counters(submenu, "– ", none); + counter-increment: submenu; +} + +.main-navigation .main-menu > .menu-item-has-children:not(.off-canvas):hover > .sub-menu { + animation: fade_in 0.1s forwards; +} + +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu .submenu-expand .svg-icon { + transform: rotate(270deg); +} + +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu .sub-menu { + opacity: 0; + position: absolute; + z-index: 0; + transform: translateX(-100%); +} + +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu li:hover, +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu li:focus, +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu li > a:hover, +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu li > a:focus { + background-color: transparent; +} + +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu > li > a, +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu > li > .menu-item-link-return { + white-space: inherit; +} + +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu.expanded-true { + display: table; + margin-top: 0; + opacity: 1; + padding-left: 0; + /* Mobile position */ + left: 0; + top: 0; + right: 0; + bottom: 0; + position: fixed; + z-index: 100000; + /* Make sure appears above mobile admin bar */ + width: 100vw; + height: 100vh; + max-width: 100vw; + transform: translateX(100%); + animation: slide_in_right 0.3s forwards; + /* Prevent menu from being blocked by admin bar */ +} + +.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu.expanded-true > .mobile-parent-nav-menu-item { + display: block; +} + +.admin-bar .main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu.expanded-true { + top: 46px; + height: calc( 100vh - 46px); + /* WP core breakpoint */ +} + +.admin-bar .main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu.expanded-true .sub-menu.expanded-true { + top: 0; +} + +@media only screen and (min-width: 782px) { + .admin-bar .main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu.expanded-true { + top: 32px; + height: calc( 100vh - 32px); + } + .admin-bar .main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu.expanded-true .sub-menu.expanded-true { + top: 0; + } +} + +.main-navigation .main-menu-more:nth-child(n+3) { + display: none; +} + +/* Menu animation */ +@keyframes slide_in_right { + 100% { + transform: translateX(0%); + } +} + +@keyframes fade_in { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +/* Social menu */ +.social-navigation { + margin-top: calc(1rem / 2); + text-align: left; +} + +.social-navigation ul.social-links-menu { + content: ""; + display: table; + table-layout: fixed; + display: inline-block; + margin: 0; + padding: 0; +} + +.social-navigation ul.social-links-menu li { + display: inline-block; + vertical-align: bottom; + vertical-align: -webkit-baseline-middle; + list-style: none; +} + +.social-navigation ul.social-links-menu li:nth-child(n+2) { + margin-left: 0.1em; +} + +.social-navigation ul.social-links-menu li a { + border-bottom: 1px solid transparent; + display: block; + color: #111; + margin-bottom: -1px; + transition: opacity 110ms ease-in-out; +} + +.social-navigation ul.social-links-menu li a:hover, .social-navigation ul.social-links-menu li a:active { + color: #111; + opacity: 0.6; +} + +.social-navigation ul.social-links-menu li a:focus { + color: #111; + opacity: 1; + border-bottom: 1px solid #111; +} + +.social-navigation ul.social-links-menu li a svg { + display: block; + width: 32px; + height: 32px; + transform: translateZ(0); +} + +.social-navigation ul.social-links-menu li a svg#ui-icon-link { + transform: rotate(-45deg); +} + +@media only screen and (min-width: 768px) { + .site-title + .social-navigation, + .site-description + .social-navigation { + margin-top: calc(1rem / 5); + } +} + +/** === Footer menu === */ +.footer-navigation { + display: inline; +} + +.footer-navigation > div { + display: inline; +} + +.footer-navigation .footer-menu { + display: inline; + padding-left: 0; +} + +.footer-navigation .footer-menu li { + display: inline; + margin-right: 1rem; +} + +/*-------------------------------------------------------------- +## Next / Previous +--------------------------------------------------------------*/ +/* Next/Previous navigation */ +.post-navigation { + margin: calc(3 * 1rem) 0; +} + +@media only screen and (min-width: 768px) { + .post-navigation { + margin: calc(3 * 1rem) calc(10% + 60px); + max-width: calc(6 * (100vw / 12)); + } +} + +@media only screen and (min-width: 1168px) { + .post-navigation { + margin: calc(3 * 1rem) 0; + max-width: 100%; + } +} + +.post-navigation .nav-links { + margin: 0 1rem; + max-width: 100%; + display: flex; + flex-direction: column; +} + +@media only screen and (min-width: 768px) { + .post-navigation .nav-links { + margin: 0; + } +} + +@media only screen and (min-width: 1168px) { + .post-navigation .nav-links { + flex-direction: row; + margin: 0 calc(10% + 60px); + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +.post-navigation .nav-links a .meta-nav { + color: #767676; + user-select: none; +} + +.post-navigation .nav-links a .meta-nav:before, .post-navigation .nav-links a .meta-nav:after { + display: none; + content: "—"; + width: 2em; + color: #767676; + height: 1em; +} + +.post-navigation .nav-links a .post-title { + hyphens: auto; +} + +.post-navigation .nav-links a:hover { + color: #005177; +} + +@media only screen and (min-width: 1168px) { + .post-navigation .nav-links .nav-previous, + .post-navigation .nav-links .nav-next { + min-width: calc(50% - 2 * 1rem); + } +} + +.post-navigation .nav-links .nav-previous { + order: 2; +} + +@media only screen and (min-width: 1168px) { + .post-navigation .nav-links .nav-previous { + order: 1; + } +} + +.post-navigation .nav-links .nav-previous + .nav-next { + margin-bottom: 1rem; +} + +.post-navigation .nav-links .nav-previous .meta-nav:before { + display: inline; +} + +.post-navigation .nav-links .nav-next { + order: 1; +} + +@media only screen and (min-width: 1168px) { + .post-navigation .nav-links .nav-next { + order: 2; + padding-left: 1rem; + } +} + +.post-navigation .nav-links .nav-next .meta-nav:after { + display: inline; +} + +.pagination .nav-links { + display: flex; + flex-wrap: wrap; + padding: 0 calc(.5 * 1rem); +} + +.pagination .nav-links > * { + padding: calc(.5 * 1rem); +} + +.pagination .nav-links > *.dots, .pagination .nav-links > *.prev { + padding-left: 0; +} + +.pagination .nav-links > *.dots, .pagination .nav-links > *.next { + padding-right: 0; +} + +.pagination .nav-links a:focus { + text-decoration: underline; + outline-offset: -1px; +} + +.pagination .nav-links a:focus.prev, .pagination .nav-links a:focus.next { + text-decoration: none; +} + +.pagination .nav-links a:focus.prev .nav-prev-text, +.pagination .nav-links a:focus.prev .nav-next-text, .pagination .nav-links a:focus.next .nav-prev-text, +.pagination .nav-links a:focus.next .nav-next-text { + text-decoration: underline; +} + +.pagination .nav-links .nav-next-text, +.pagination .nav-links .nav-prev-text { + display: none; +} + +@media only screen and (min-width: 768px) { + .pagination .nav-links { + margin-left: calc(10% + 60px); + padding: 0; + } + .pagination .nav-links .prev > *, + .pagination .nav-links .next > * { + display: inline-block; + vertical-align: text-bottom; + } + .pagination .nav-links > * { + padding: 1rem; + } +} + +.comment-navigation .nav-links { + display: flex; + flex-direction: row; +} + +.comment-navigation .nav-previous, +.comment-navigation .nav-next { + min-width: 50%; + width: 100%; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-weight: bold; +} + +.comment-navigation .nav-previous .secondary-text, +.comment-navigation .nav-next .secondary-text { + display: none; +} + +@media only screen and (min-width: 768px) { + .comment-navigation .nav-previous .secondary-text, + .comment-navigation .nav-next .secondary-text { + display: inline; + } +} + +.comment-navigation .nav-previous svg, +.comment-navigation .nav-next svg { + vertical-align: middle; + position: relative; + margin: 0 -0.35em; + top: -1px; +} + +.comment-navigation .nav-next { + text-align: right; +} + +/* Accessibility */ +/* Text meant only for screen readers. */ +.screen-reader-text { + border: 0; + clip: rect(1px, 1px, 1px, 1px); + clip-path: inset(50%); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute !important; + width: 1px; + word-wrap: normal !important; + /* Many screen reader and browser combinations announce broken words as they would appear visually. */ +} + +.screen-reader-text:focus { + background-color: #f1f1f1; + border-radius: 3px; + box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); + clip: auto !important; + clip-path: none; + color: #21759b; + display: block; + font-size: 0.875rem; + font-weight: bold; + height: auto; + left: 5px; + line-height: normal; + padding: 15px 23px 14px; + text-decoration: none; + top: 5px; + width: auto; + z-index: 100000; + /* Above WP toolbar. */ +} + +/* Do not show the outline on the skip link target. */ +#content[tabindex="-1"]:focus { + outline: 0; +} + +/* Alignments */ +.alignleft { + /*rtl:ignore*/ + float: left; + /*rtl:ignore*/ + margin-right: 1rem; +} + +@media only screen and (min-width: 768px) { + .alignleft { + /*rtl:ignore*/ + margin-right: calc(2 * 1rem); + } +} + +.alignright { + /*rtl:ignore*/ + float: right; + /*rtl:ignore*/ + margin-left: 1rem; +} + +@media only screen and (min-width: 768px) { + .alignright { + /*rtl:ignore*/ + margin-left: calc(2 * 1rem); + } +} + +.aligncenter { + clear: both; + display: block; + margin-left: auto; + margin-right: auto; +} + +/* Clearings */ +.clear:before, +.clear:after, +.entry-content:before, +.entry-content:after, +.comment-content:before, +.comment-content:after, +.site-header:before, +.site-header:after, +.site-content:before, +.site-content:after, +.site-footer:before, +.site-footer:after { + content: ""; + display: table; + table-layout: fixed; +} + +.clear:after, +.entry-content:after, +.comment-content:after, +.site-header:after, +.site-content:after, +.site-footer:after { + clear: both; +} + +/* Layout */ +/** === Layout === */ +#page { + width: 100%; +} + +.site-content { + overflow: hidden; +} + +/* Content */ +/*-------------------------------------------------------------- +## Header +--------------------------------------------------------------*/ +.site-header { + padding: 1em; +} + +.site-header.featured-image { + display: flex; + flex-direction: column; + justify-content: space-between; + min-height: 90vh; +} + +.site-header.featured-image .site-branding-container { + margin-bottom: auto; +} + +@media only screen and (min-width: 768px) { + .site-header { + margin: 0; + padding: 3rem 0; + } + .site-header.featured-image { + min-height: 100vh; + margin-bottom: 3rem; + } +} + +.site-branding { + color: #767676; + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + position: relative; + word-wrap: break-word; +} + +@media only screen and (min-width: 768px) { + .site-branding { + margin: 0 calc(10% + 60px); + } +} + +.site-logo { + position: relative; + z-index: 999; + margin-bottom: calc(.66 * 1rem); +} + +@media only screen and (min-width: 768px) { + .site-logo { + margin-bottom: 0; + position: absolute; + right: calc(100% + (1.25 * 1rem)); + top: 4px; + z-index: 999; + } +} + +.site-logo .custom-logo-link { + border-radius: 100%; + box-sizing: content-box; + box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); + display: block; + width: 50px; + height: 50px; + overflow: hidden; + transition: box-shadow 200ms ease-in-out; +} + +.site-logo .custom-logo-link .custom-logo { + min-height: inherit; +} + +.site-logo .custom-logo-link:hover, .site-logo .custom-logo-link:active, .site-logo .custom-logo-link:focus { + box-shadow: 0 0 0 2px black; +} + +@media only screen and (min-width: 768px) { + .site-logo .custom-logo-link { + width: 64px; + height: 64px; + } +} + +.site-title { + margin: auto; + display: inline; + color: #111; + /* When there is no description set, make sure navigation appears below title. */ +} + +.site-title a { + color: #111; +} + +.site-title a:link, .site-title a:visited { + color: #111; +} + +.site-title a:hover { + color: #4a4a4a; +} + +.featured-image .site-title { + margin: 0; +} + +@media only screen and (min-width: 768px) { + .featured-image .site-title { + display: inline-block; + } +} + +.site-title + .main-navigation { + display: block; +} + +@media only screen and (min-width: 768px) { + .site-title { + display: inline; + } +} + +.site-title:not(:empty) + .site-description:not(:empty):before { + content: "\2014"; + margin: 0 .2em; +} + +.site-description { + display: inline; + color: #767676; + font-weight: normal; + margin: 0; +} + +.site-header.featured-image { + /* Hide overflow for overflowing featured image */ + overflow: hidden; + /* Need relative positioning to properly align layers. */ + position: relative; + /* Add text shadow to text, to increase readability. */ + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); + /* Set white text color when featured image is set. */ + /* add focus state to social media icons */ + /* Entry header */ + /* Custom Logo Link */ + /* Make sure important elements are above pseudo elements used for effects. */ + /* Set up image filter layer positioning */ + /* Background & Effects */ + /* Shared background settings between pseudo elements. */ + background-position: center; + background-repeat: no-repeat; + background-size: cover; + /* The intensity of each blend mode is controlled via layer opacity. */ + /* Second layer: screen. */ + /* Third layer: multiply. */ + /* When image filters are inactive, a black overlay is added. */ + /* Fourth layer: overlay. */ + /* Fifth layer: readability overlay */ +} + +.site-header.featured-image .site-branding .site-title, +.site-header.featured-image .site-branding .site-description, +.site-header.featured-image .main-navigation a:after, +.site-header.featured-image .main-navigation .main-menu > li.menu-item-has-children:after, +.site-header.featured-image .main-navigation li, +.site-header.featured-image .social-navigation li, +.site-header.featured-image .entry-meta, +.site-header.featured-image .entry-title { + color: #fff; +} + +.site-header.featured-image .main-navigation a, +.site-header.featured-image .main-navigation a + svg, +.site-header.featured-image .social-navigation a, +.site-header.featured-image .site-title a, +.site-header.featured-image .site-featured-image a { + color: #fff; + transition: opacity 110ms ease-in-out; +} + +.site-header.featured-image .main-navigation a:hover, .site-header.featured-image .main-navigation a:active, +.site-header.featured-image .main-navigation a:hover + svg, +.site-header.featured-image .main-navigation a:active + svg, +.site-header.featured-image .main-navigation a + svg:hover, +.site-header.featured-image .main-navigation a + svg:active, +.site-header.featured-image .main-navigation a + svg:hover + svg, +.site-header.featured-image .main-navigation a + svg:active + svg, +.site-header.featured-image .social-navigation a:hover, +.site-header.featured-image .social-navigation a:active, +.site-header.featured-image .social-navigation a:hover + svg, +.site-header.featured-image .social-navigation a:active + svg, +.site-header.featured-image .site-title a:hover, +.site-header.featured-image .site-title a:active, +.site-header.featured-image .site-title a:hover + svg, +.site-header.featured-image .site-title a:active + svg, +.site-header.featured-image .site-featured-image a:hover, +.site-header.featured-image .site-featured-image a:active, +.site-header.featured-image .site-featured-image a:hover + svg, +.site-header.featured-image .site-featured-image a:active + svg { + color: #fff; + opacity: 0.6; +} + +.site-header.featured-image .main-navigation a:focus, +.site-header.featured-image .main-navigation a:focus + svg, +.site-header.featured-image .main-navigation a + svg:focus, +.site-header.featured-image .main-navigation a + svg:focus + svg, +.site-header.featured-image .social-navigation a:focus, +.site-header.featured-image .social-navigation a:focus + svg, +.site-header.featured-image .site-title a:focus, +.site-header.featured-image .site-title a:focus + svg, +.site-header.featured-image .site-featured-image a:focus, +.site-header.featured-image .site-featured-image a:focus + svg { + color: #fff; +} + +.site-header.featured-image .main-navigation .sub-menu a { + opacity: inherit; +} + +.site-header.featured-image .social-navigation a:focus { + color: #fff; + opacity: 1; + border-bottom: 1px solid #fff; +} + +.site-header.featured-image .social-navigation svg, +.site-header.featured-image .site-featured-image svg { + /* Use -webkit- only if supporting: Chrome < 54, iOS < 9.3, Android < 4.4.4 */ + -webkit-filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); + filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); +} + +.site-header.featured-image .site-featured-image { + /* First layer: grayscale. */ +} + +.site-header.featured-image .site-featured-image .post-thumbnail img { + height: auto; + left: 50%; + max-width: 1000%; + min-height: 100%; + min-width: 100vw; + position: absolute; + top: 50%; + transform: translateX(-50%) translateY(-50%); + width: auto; + z-index: 1; + /* When image filters are active, make it grayscale to colorize it blue. */ +} + +@supports (object-fit: cover) { + .site-header.featured-image .site-featured-image .post-thumbnail img { + height: 100%; + left: 0; + object-fit: cover; + top: 0; + transform: none; + width: 100%; + } +} + +.image-filters-enabled .site-header.featured-image .site-featured-image .post-thumbnail img { + filter: grayscale(100%); +} + +.site-header.featured-image .site-featured-image .entry-header { + margin-top: calc( 4 * 1rem); + margin-bottom: 0; + margin-left: 0; + margin-right: 0; + /* Entry meta */ +} + +@media only screen and (min-width: 768px) { + .site-header.featured-image .site-featured-image .entry-header { + margin-left: calc(10% + 60px); + margin-right: calc(10% + 60px); + } +} + +.site-header.featured-image .site-featured-image .entry-header .entry-title:before { + background: #fff; +} + +.site-header.featured-image .site-featured-image .entry-header .entry-meta { + font-weight: 500; +} + +.site-header.featured-image .site-featured-image .entry-header .entry-meta > span { + margin-right: 1rem; + display: inline-block; +} + +.site-header.featured-image .site-featured-image .entry-header .entry-meta > span:last-child { + margin-right: 0; +} + +.site-header.featured-image .site-featured-image .entry-header .entry-meta a { + transition: color 110ms ease-in-out; + color: currentColor; +} + +.site-header.featured-image .site-featured-image .entry-header .entry-meta a:hover { + text-decoration: none; +} + +.site-header.featured-image .site-featured-image .entry-header .entry-meta .svg-icon { + position: relative; + display: inline-block; + vertical-align: middle; + margin-right: 0.5em; +} + +.site-header.featured-image .site-featured-image .entry-header .entry-meta .discussion-avatar-list { + display: none; +} + +@media only screen and (min-width: 768px) { + .site-header.featured-image .site-featured-image .entry-header.has-discussion .entry-meta { + display: flex; + position: relative; + } + .site-header.featured-image .site-featured-image .entry-header.has-discussion .entry-title { + padding-right: calc(1 * (100vw / 12) + 1rem); + } + .site-header.featured-image .site-featured-image .entry-header.has-discussion .entry-meta .comment-count { + position: absolute; + right: 0; + } + .site-header.featured-image .site-featured-image .entry-header.has-discussion .entry-meta .discussion-avatar-list { + display: block; + position: absolute; + bottom: 100%; + } +} + +.site-header.featured-image .custom-logo-link { + background: #fff; + box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); +} + +.site-header.featured-image .custom-logo-link:hover, .site-header.featured-image .custom-logo-link:active, .site-header.featured-image .custom-logo-link:focus { + box-shadow: 0 0 0 2px white; +} + +.site-header.featured-image .site-branding { + position: relative; + z-index: 10; +} + +.site-header.featured-image .site-featured-image .entry-header { + position: relative; + z-index: 9; +} + +.site-header.featured-image .site-branding-container:after, +.site-header.featured-image .site-featured-image:before, +.site-header.featured-image .site-featured-image:after, .site-header.featured-image:after { + display: block; + position: absolute; + top: 0; + left: 0; + content: "\020"; + width: 100%; + height: 100%; +} + +.image-filters-enabled .site-header.featured-image .site-featured-image:before { + background: #0073aa; + mix-blend-mode: screen; + opacity: 0.1; +} + +.site-header.featured-image .site-featured-image:after { + background: #000; + mix-blend-mode: multiply; + opacity: .7; + /* When image filters are active, a blue overlay is added. */ +} + +.image-filters-enabled .site-header.featured-image .site-featured-image:after { + background: #0073aa; + opacity: .8; + z-index: 3; + /* Browsers supporting mix-blend-mode don't need opacity < 1 */ +} + +@supports (mix-blend-mode: multiply) { + .image-filters-enabled .site-header.featured-image .site-featured-image:after { + opacity: 1; + } +} + +.image-filters-enabled .site-header.featured-image .site-branding-container:after { + background: rgba(0, 0, 0, 0.35); + mix-blend-mode: overlay; + opacity: 0.5; + z-index: 4; + /* Browsers supporting mix-blend-mode can have a light overlay */ +} + +@supports (mix-blend-mode: overlay) { + .image-filters-enabled .site-header.featured-image .site-branding-container:after { + background: rgba(255, 255, 255, 0.35); + } +} + +.site-header.featured-image:after { + background: #000; + /** + * Add a transition to the readability overlay, to add a subtle + * but smooth effect when resizing the screen. + */ + transition: opacity 1200ms ease-in-out; + opacity: 0.7; + z-index: 5; + /* When image filters are active, a blue overlay is added. */ +} + +.image-filters-enabled .site-header.featured-image:after { + background: #000e14; + opacity: 0.38; +} + +@media only screen and (min-width: 768px) { + .image-filters-enabled .site-header.featured-image:after { + opacity: 0.18; + } +} + +.site-header.featured-image ::-moz-selection { + background: rgba(255, 255, 255, 0.17); +} + +.site-header.featured-image ::selection { + background: rgba(255, 255, 255, 0.17); +} + +/*-------------------------------------------------------------- +## Posts and pages +--------------------------------------------------------------*/ +.sticky { + display: block; +} + +.sticky-post { + background: #0073aa; + color: #fff; + display: inline-block; + font-weight: bold; + line-height: 1; + padding: .25rem; + position: absolute; + text-transform: uppercase; + top: -1rem; + z-index: 1; +} + +.updated:not(.published) { + display: none; +} + +.page-links { + clear: both; + margin: 0 0 calc(1.5 * 1rem); +} + +.entry { + margin-top: calc(6 * 1rem); +} + +.entry:first-of-type { + margin-top: 0; +} + +.entry .entry-header { + margin: calc(3 * 1rem) 1rem 1rem; + position: relative; +} + +@media only screen and (min-width: 768px) { + .entry .entry-header { + margin: calc(3 * 1rem) calc(10% + 60px) 1rem; + } +} + +.entry .entry-title { + margin: 0; +} + +.entry .entry-title:before { + background: #767676; + content: "\020"; + display: block; + height: 2px; + margin: 1rem 0; + width: 1em; +} + +.entry .entry-title a { + color: inherit; +} + +.entry .entry-title a:hover { + color: #4a4a4a; +} + +.entry .entry-meta, +.entry .entry-footer { + color: #767676; + font-weight: 500; +} + +.entry .entry-meta > span, +.entry .entry-footer > span { + margin-right: 1rem; + display: inline-block; +} + +.entry .entry-meta > span:last-child, +.entry .entry-footer > span:last-child { + margin-right: 0; +} + +.entry .entry-meta a, +.entry .entry-footer a { + transition: color 110ms ease-in-out; + color: currentColor; +} + +.entry .entry-meta a:hover, +.entry .entry-footer a:hover { + text-decoration: none; + color: #0073aa; +} + +.entry .entry-meta .svg-icon, +.entry .entry-footer .svg-icon { + position: relative; + display: inline-block; + vertical-align: middle; + margin-right: 0.5em; +} + +.entry .entry-meta { + margin: 1rem 0; +} + +.entry .entry-footer { + margin: calc(2 * 1rem) 1rem 1rem; +} + +@media only screen and (min-width: 768px) { + .entry .entry-footer { + margin: 1rem calc(10% + 60px) calc(3 * 1rem); + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-footer { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +.entry .post-thumbnail { + margin: 1rem; +} + +@media only screen and (min-width: 768px) { + .entry .post-thumbnail { + margin: 1rem calc(10% + 60px); + } +} + +.entry .post-thumbnail:focus { + outline: none; +} + +.entry .post-thumbnail .post-thumbnail-inner { + display: block; +} + +.entry .post-thumbnail .post-thumbnail-inner img { + position: relative; + display: block; + width: 100%; +} + +.image-filters-enabled .entry .post-thumbnail { + position: relative; + display: block; +} + +.image-filters-enabled .entry .post-thumbnail .post-thumbnail-inner { + filter: grayscale(100%); +} + +.image-filters-enabled .entry .post-thumbnail .post-thumbnail-inner:after { + background: rgba(0, 0, 0, 0.35); + content: ""; + display: block; + height: 100%; + opacity: .5; + pointer-events: none; + position: absolute; + top: 0; + width: 100%; + z-index: 4; +} + +@supports (mix-blend-mode: multiply) { + .image-filters-enabled .entry .post-thumbnail .post-thumbnail-inner:after { + display: none; + } +} + +.image-filters-enabled .entry .post-thumbnail:before, .image-filters-enabled .entry .post-thumbnail:after { + position: absolute; + display: block; + width: 100%; + height: 100%; + top: 0; + left: 0; + content: "\020"; + pointer-events: none; +} + +.image-filters-enabled .entry .post-thumbnail:before { + background: #0073aa; + mix-blend-mode: screen; + opacity: 0.1; + z-index: 2; +} + +.image-filters-enabled .entry .post-thumbnail:after { + background: #0073aa; + mix-blend-mode: multiply; + opacity: .8; + z-index: 3; + /* Browsers supporting mix-blend-mode don't need opacity < 1 */ +} + +@supports (mix-blend-mode: multiply) { + .image-filters-enabled .entry .post-thumbnail:after { + opacity: 1; + } +} + +.entry .entry-content, +.entry .entry-summary { + max-width: calc(100% - (2 * 1rem)); + margin: 0 1rem; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content, + .entry .entry-summary { + max-width: 80%; + margin: 0 10%; + padding: 0 60px; + } +} + +.entry .entry-content p { + word-wrap: break-word; +} + +.entry .entry-content .more-link { + transition: color 110ms ease-in-out; + display: inline; + color: inherit; +} + +.entry .entry-content .more-link:after { + content: "\02192"; + display: inline-block; + margin-left: 0.5em; +} + +.entry .entry-content .more-link:hover { + color: #0073aa; + text-decoration: none; +} + +.entry .entry-content a { + text-decoration: underline; +} + +.entry .entry-content a.button, .entry .entry-content a:hover { + text-decoration: none; +} + +.entry .entry-content a.button { + display: inline-block; +} + +.entry .entry-content a.button:hover { + background: #111; + color: #fff; + cursor: pointer; +} + +.entry .entry-content > iframe[style] { + margin: 32px 0 !important; + max-width: 100% !important; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > iframe[style] { + max-width: calc(8 * (100vw / 12) - 28px) !important; + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content > iframe[style] { + max-width: calc(6 * (100vw / 12) - 28px) !important; + } +} + +.entry .entry-content .page-links a { + margin: calc(0.5 * 1rem); + text-decoration: none; +} + +.entry .entry-content .wp-audio-shortcode { + max-width: calc(100vw - (2 * 1rem)); +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-audio-shortcode { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-audio-shortcode { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +/* Author description */ +.author-bio { + margin: calc(2 * 1rem) 1rem 1rem; +} + +@media only screen and (min-width: 768px) { + .author-bio { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .author-bio { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .author-bio { + margin: calc(3 * 1rem) calc(10% + 60px); + } +} + +@media only screen and (min-width: 1168px) { + .author-bio { + margin: calc(3 * 1rem) calc(10% + 60px); + } +} + +.author-bio .author-title { + display: inline; +} + +.author-bio .author-title:before { + background: #767676; + content: "\020"; + display: block; + height: 2px; + margin: 1rem 0; + width: 1em; +} + +.author-bio .author-description { + display: inline; + color: #767676; + font-size: 1.125em; + line-height: 1.2; +} + +.author-bio .author-description .author-link { + display: inline-block; +} + +.author-bio .author-description .author-link:hover { + color: #005177; + text-decoration: none; +} + +/*-------------------------------------------------------------- +## Comments +--------------------------------------------------------------*/ +.comment-content a { + word-wrap: break-word; +} + +.bypostauthor { + display: block; +} + +.comments-area { + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + margin: calc(2 * 1rem) 1rem; + word-wrap: break-word; + /* Add extra margin when the comments section is located immediately after the + * post itself (this happens on pages). + */ +} + +@media only screen and (min-width: 768px) { + .comments-area { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .comments-area { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .comments-area { + margin: calc(3 * 1rem) calc(10% + 60px); + } +} + +.comments-area > * { + margin-top: calc(2 * 1rem); + margin-bottom: calc(2 * 1rem); +} + +@media only screen and (min-width: 768px) { + .comments-area > * { + margin-top: calc(3 * 1rem); + margin-bottom: calc(3 * 1rem); + } +} + +.entry + .comments-area { + margin-top: calc(3 * 1rem); +} + +@media only screen and (min-width: 768px) { + .comments-area .comments-title-wrap { + align-items: baseline; + display: flex; + justify-content: space-between; + } +} + +.comments-area .comments-title-wrap .comments-title { + margin: 0; +} + +.comments-area .comments-title-wrap .comments-title:before { + background: #767676; + content: "\020"; + display: block; + height: 2px; + margin: 1rem 0; + width: 1em; +} + +@media only screen and (min-width: 768px) { + .comments-area .comments-title-wrap .comments-title { + flex: 1 0 calc(3 * (100vw / 12)); + } +} + +@media only screen and (min-width: 768px) { + .comments-area .comments-title-wrap .discussion-meta { + flex: 0 0 calc(2 * (100vw / 12)); + margin-left: 1rem; + } +} + +#comment { + max-width: 100%; + box-sizing: border-box; +} + +#respond { + position: relative; +} + +#respond .comment-user-avatar { + margin: 1rem 0 -1rem; +} + +#respond .comment .comment-form { + padding-left: 0; +} + +#respond > small { + display: block; + font-size: 22px; + position: absolute; + left: calc(1rem + 100%); + top: calc(-3.5 * 1rem); + width: calc(100vw / 12); +} + +#comments > .comments-title:last-child { + display: none; +} + +.comment-form-flex { + display: flex; + flex-direction: column; +} + +.comment-form-flex .comments-title { + display: none; + margin: 0; + order: 1; +} + +.comment-form-flex #respond { + order: 2; +} + +.comment-form-flex #respond + .comments-title { + display: block; +} + +.comment-list { + list-style: none; + padding: 0; +} + +.comment-list .children { + margin: 0; + padding: 0 0 0 1rem; +} + +.comment-list > .comment:first-child { + margin-top: 0; +} + +.comment-list .pingback .comment-body, +.comment-list .trackback .comment-body { + color: #767676; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.71111em; + font-weight: 500; + margin-top: 1rem; + margin-bottom: 1rem; +} + +.comment-list .pingback .comment-body a:not(.comment-edit-link), +.comment-list .trackback .comment-body a:not(.comment-edit-link) { + font-weight: bold; + font-size: 19.55556px; + line-height: 1.5; + padding-right: 0.5rem; + display: block; +} + +.comment-list .pingback .comment-body .comment-edit-link, +.comment-list .trackback .comment-body .comment-edit-link { + color: #767676; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-weight: 500; +} + +#respond + .comment-reply { + display: none; +} + +.comment-reply .comment-reply-link { + display: inline-block; +} + +.comment { + list-style: none; + position: relative; +} + +@media only screen and (min-width: 768px) { + .comment { + padding-left: calc(.5 * (1rem + calc(100vw / 12 ))); + } + .comment.depth-1, + .comment .children { + padding-left: 0; + } + .comment.depth-1 { + margin-left: calc(3.25 * 1rem); + } +} + +.comment .comment-body { + margin: calc(2 * 1rem) 0 0; +} + +.comment .comment-meta { + position: relative; +} + +.comment .comment-author .avatar { + float: left; + margin-right: 1rem; + position: relative; +} + +@media only screen and (min-width: 768px) { + .comment .comment-author .avatar { + float: inherit; + margin-right: inherit; + position: absolute; + top: 0; + right: calc(100% + 1rem); + } +} + +.comment .comment-author .fn { + position: relative; + display: block; +} + +.comment .comment-author .fn a { + color: inherit; +} + +.comment .comment-author .fn a:hover { + color: #005177; +} + +.comment .comment-author .post-author-badge { + border-radius: 100%; + display: block; + height: 18px; + position: absolute; + background: #008fd3; + right: calc(100% - 2.5rem); + top: -3px; + width: 18px; +} + +@media only screen and (min-width: 768px) { + .comment .comment-author .post-author-badge { + right: calc(100% + 0.75rem); + } +} + +.comment .comment-author .post-author-badge svg { + width: inherit; + height: inherit; + display: block; + fill: white; + transform: scale(0.875); +} + +.comment .comment-metadata > a, +.comment .comment-metadata .comment-edit-link { + display: inline; + font-weight: 500; + color: #767676; + vertical-align: baseline; +} + +.comment .comment-metadata > a time, +.comment .comment-metadata .comment-edit-link time { + vertical-align: baseline; +} + +.comment .comment-metadata > a:hover, +.comment .comment-metadata .comment-edit-link:hover { + color: #005177; + text-decoration: none; +} + +.comment .comment-metadata > * { + display: inline-block; +} + +.comment .comment-metadata .edit-link-sep { + color: #767676; + margin: 0 0.2em; + vertical-align: baseline; +} + +.comment .comment-metadata .edit-link { + color: #767676; +} + +.comment .comment-metadata .edit-link svg { + transform: scale(0.8); + vertical-align: baseline; + margin-right: 0.1em; +} + +.comment .comment-metadata .comment-edit-link { + position: relative; + padding-left: 1rem; + margin-left: -1rem; + z-index: 1; +} + +.comment .comment-metadata .comment-edit-link:hover { + color: #0073aa; +} + +.comment .comment-content { + margin: 1rem 0; +} + +@media only screen and (min-width: 1168px) { + .comment .comment-content { + padding-right: 1rem; + } +} + +.comment .comment-content > *:first-child { + margin-top: 0; +} + +.comment .comment-content > *:last-child { + margin-bottom: 0; +} + +.comment .comment-content blockquote { + margin-left: 0; +} + +.comment .comment-content a { + text-decoration: underline; +} + +.comment .comment-content a:hover { + text-decoration: none; +} + +.comment-reply-link, +#cancel-comment-reply-link { + font-weight: 500; +} + +.comment-reply-link:hover, +#cancel-comment-reply-link:hover { + color: #005177; +} + +.discussion-avatar-list { + content: ""; + display: table; + table-layout: fixed; + margin: 0; + padding: 0; +} + +.discussion-avatar-list li { + position: relative; + list-style: none; + margin: 0 -8px 0 0; + padding: 0; + float: left; +} + +.discussion-avatar-list .comment-user-avatar img { + height: calc(1.5 * 1rem); + width: calc(1.5 * 1rem); +} + +.discussion-meta .discussion-meta-info { + margin: 0; +} + +.discussion-meta .discussion-meta-info .svg-icon { + vertical-align: middle; + fill: currentColor; + transform: scale(0.6) scaleX(-1) translateY(-0.1em); + margin-left: -0.25rem; +} + +.comment-form .comment-notes, +.comment-form label { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.71111em; + color: #767676; +} + +@media only screen and (min-width: 768px) { + .comment-form .comment-form-author, + .comment-form .comment-form-email { + width: calc(50% - 0.5rem); + float: left; + } +} + +@media only screen and (min-width: 768px) { + .comment-form .comment-form-email { + margin-left: 1rem; + } +} + +.comment-form input[name="author"], +.comment-form input[name="email"], +.comment-form input[name="url"] { + display: block; + width: 100%; +} + +/*-------------------------------------------------------------- +## Archives +--------------------------------------------------------------*/ +.archive .page-header, +.search .page-header, +.error404 .page-header { + margin: 1rem 1rem calc(3 * 1rem); +} + +@media only screen and (min-width: 768px) { + .archive .page-header, + .search .page-header, + .error404 .page-header { + margin: 0 calc(10% + 60px) calc(3 * 1rem); + } +} + +.archive .page-header .page-title, +.search .page-header .page-title, +.error404 .page-header .page-title { + color: #767676; + display: inline; + letter-spacing: normal; +} + +.archive .page-header .page-title:before, +.search .page-header .page-title:before, +.error404 .page-header .page-title:before { + display: none; +} + +.archive .page-header .search-term, +.archive .page-header .page-description, +.search .page-header .search-term, +.search .page-header .page-description, +.error404 .page-header .search-term, +.error404 .page-header .page-description { + display: inherit; + clear: both; +} + +.archive .page-header .page-description, +.search .page-header .page-description { + display: block; + color: #111; + font-size: 1em; +} + +@media only screen and (min-width: 768px) { + .hfeed .entry .entry-header { + margin: calc(3 * 1rem) calc(10% + 60px) calc(1rem / 2); + } +} + +/* 404 & Not found */ +.error-404.not-found .page-content, +.no-results.not-found .page-content { + margin: calc(3 * 1rem) 1rem; +} + +@media only screen and (min-width: 768px) { + .error-404.not-found .page-content, + .no-results.not-found .page-content { + margin: calc(3 * 1rem) calc(10% + 60px) calc(1rem / 2); + } +} + +.error-404.not-found .search-submit, +.no-results.not-found .search-submit { + vertical-align: middle; + margin: 1rem 0; +} + +.error-404.not-found .search-field, +.no-results.not-found .search-field { + width: 100%; +} + +/*-------------------------------------------------------------- +## Footer +--------------------------------------------------------------*/ +/* Site footer */ +#colophon .widget-area, +#colophon .site-info { + margin: calc(2 * 1rem) 1rem; +} + +@media only screen and (min-width: 768px) { + #colophon .widget-area, + #colophon .site-info { + margin: calc(3 * 1rem) calc(10% + 60px); + } +} + +#colophon .widget-column { + display: flex; + flex-wrap: wrap; +} + +#colophon .widget-column .widget { + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + width: 100%; + word-wrap: break-word; +} + +@media only screen and (min-width: 1168px) { + #colophon .widget-column .widget { + margin-right: calc(3 * 1rem); + width: calc(50% - (3 * 1rem)); + } +} + +#colophon .site-info { + color: #767676; + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; + word-wrap: break-word; +} + +#colophon .site-info a { + color: inherit; +} + +#colophon .site-info a:hover { + text-decoration: none; + color: #0073aa; +} + +#colophon .site-info .imprint, +#colophon .site-info .privacy-policy-link { + margin-right: 1rem; +} + +/* Widgets */ +.widget { + margin: 0 0 1rem; + /* Make sure select elements fit in widgets. */ +} + +.widget select { + max-width: 100%; +} + +.widget a { + color: #0073aa; +} + +.widget a:hover { + color: #005177; +} + +.widget_archive ul, +.widget_categories ul, +.widget_meta ul, +.widget_nav_menu ul, +.widget_pages ul, +.widget_recent_comments ul, +.widget_recent_entries ul, +.widget_rss ul { + padding: 0; + list-style: none; +} + +.widget_archive ul li, +.widget_categories ul li, +.widget_meta ul li, +.widget_nav_menu ul li, +.widget_pages ul li, +.widget_recent_comments ul li, +.widget_recent_entries ul li, +.widget_rss ul li { + color: #767676; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: calc(22px * 1.125); + font-weight: 700; + line-height: 1.2; + margin-top: 0.5rem; + margin-bottom: 0.5rem; +} + +.widget_archive ul ul, +.widget_categories ul ul, +.widget_meta ul ul, +.widget_nav_menu ul ul, +.widget_pages ul ul, +.widget_recent_comments ul ul, +.widget_recent_entries ul ul, +.widget_rss ul ul { + counter-reset: submenu; +} + +.widget_archive ul ul > li > a::before, +.widget_categories ul ul > li > a::before, +.widget_meta ul ul > li > a::before, +.widget_nav_menu ul ul > li > a::before, +.widget_pages ul ul > li > a::before, +.widget_recent_comments ul ul > li > a::before, +.widget_recent_entries ul ul > li > a::before, +.widget_rss ul ul > li > a::before { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: normal; + content: "– " counters(submenu, "– ", none); + counter-increment: submenu; +} + +.widget_tag_cloud .tagcloud { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-weight: 700; +} + +.widget_search .search-field { + width: 100%; +} + +@media only screen and (min-width: 600px) { + .widget_search .search-field { + width: auto; + } +} + +.widget_search .search-submit { + display: block; + margin-top: 1rem; +} + +.widget_calendar .calendar_wrap { + text-align: center; +} + +.widget_calendar .calendar_wrap table td, +.widget_calendar .calendar_wrap table th { + border: none; +} + +.widget_calendar .calendar_wrap a { + text-decoration: underline; +} + +.widget_calendar .calendar_wrap .wp-calendar-table { + margin-bottom: 0; +} + +.widget_calendar .calendar_wrap .wp-calendar-nav { + margin: 0 0 1rem; + display: table; + width: 100%; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; +} + +.widget_calendar .calendar_wrap .wp-calendar-nav span { + display: table-cell; + padding: 0.5em; +} + +.widget_calendar .calendar_wrap .wp-calendar-nav-prev, +.widget_calendar .calendar_wrap .wp-calendar-nav-next { + width: 40%; +} + +/* Blocks */ +/* !Block styles */ +.entry .entry-content > *, +.entry .entry-summary > *, +.entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *, +.entry .entry-content > .wp-block-group > .wp-block-group__inner-container > * { + margin: 32px 0; + max-width: 100%; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *, + .entry .entry-summary > *, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > * { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content > *, + .entry .entry-summary > *, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > * { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *, + .entry .entry-summary > *, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > * { + margin: 32px 0; + } +} + +.entry .entry-content > *.alignwide, +.entry .entry-summary > *.alignwide, +.entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignwide, +.entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignwide { + margin-left: auto; + margin-right: auto; + clear: both; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *.alignwide, + .entry .entry-summary > *.alignwide, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignwide, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignwide { + width: 100%; + max-width: 100%; + } +} + +.entry .entry-content > *.alignfull, +.entry .entry-summary > *.alignfull, +.entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignfull, +.entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignfull { + position: relative; + left: -1rem; + width: calc( 100% + (2 * 1rem)); + max-width: calc( 100% + (2 * 1rem)); + clear: both; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *.alignfull, + .entry .entry-summary > *.alignfull, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignfull, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignfull { + margin-top: calc(2 * 1rem); + margin-bottom: calc(2 * 1rem); + left: calc( -12.5% - 75px); + width: calc( 125% + 150px); + max-width: calc( 125% + 150px); + } +} + +.entry .entry-content > *.alignleft, +.entry .entry-summary > *.alignleft, +.entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignleft, +.entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignleft { + /*rtl:ignore*/ + float: left; + max-width: calc(5 * (100vw / 12)); + margin-top: 0; + margin-left: 0; + /*rtl:ignore*/ + margin-right: 1rem; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *.alignleft, + .entry .entry-summary > *.alignleft, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignleft, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignleft { + max-width: calc(4 * (100vw / 12)); + /*rtl:ignore*/ + margin-right: calc(2 * 1rem); + } +} + +.entry .entry-content > *.alignright, +.entry .entry-summary > *.alignright, +.entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignright, +.entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignright { + /*rtl:ignore*/ + float: right; + max-width: calc(5 * (100vw / 12)); + margin-top: 0; + margin-right: 0; + /*rtl:ignore*/ + margin-left: 1rem; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *.alignright, + .entry .entry-summary > *.alignright, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.alignright, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.alignright { + max-width: calc(4 * (100vw / 12)); + margin-right: 0; + /*rtl:ignore*/ + margin-left: calc(2 * 1rem); + } +} + +.entry .entry-content > *.aligncenter, +.entry .entry-summary > *.aligncenter, +.entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.aligncenter, +.entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.aligncenter { + margin-left: auto; + margin-right: auto; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *.aligncenter, + .entry .entry-summary > *.aligncenter, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.aligncenter, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.aligncenter { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content > *.aligncenter, + .entry .entry-summary > *.aligncenter, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.aligncenter, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.aligncenter { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content > *.aligncenter, + .entry .entry-summary > *.aligncenter, + .entry .entry-summary > .wp-block-group > .wp-block-group__inner-container > *.aligncenter, + .entry .entry-content > .wp-block-group > .wp-block-group__inner-container > *.aligncenter { + margin-left: 0; + margin-right: 0; + } +} + +.entry .entry-content > * > *:first-child, +.entry .entry-summary > * > *:first-child { + margin-top: 0; +} + +.entry .entry-content > * > *:last-child, +.entry .entry-summary > * > *:last-child { + margin-bottom: 0; +} + +/* + * Unset nested content selector styles + * - Prevents layout styles from cascading too deeply + * - helps with plugin compatibility + */ +.entry .entry-content .entry-content, +.entry .entry-content .entry-summary, +.entry .entry-content .entry, +.entry .entry-summary .entry-content, +.entry .entry-summary .entry-summary, +.entry .entry-summary .entry { + margin: inherit; + max-width: inherit; + padding: inherit; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .entry-content, + .entry .entry-content .entry-summary, + .entry .entry-content .entry, + .entry .entry-summary .entry-content, + .entry .entry-summary .entry-summary, + .entry .entry-summary .entry { + margin: inherit; + max-width: inherit; + padding: inherit; + } +} + +.entry .entry-content p.has-background { + padding: 20px 30px; +} + +.entry .entry-content .wp-block-audio { + width: 100%; +} + +.entry .entry-content .wp-block-audio audio { + width: 100%; +} + +.entry .entry-content .wp-block-audio.alignleft audio, +.entry .entry-content .wp-block-audio.alignright audio { + max-width: 198px; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-audio.alignleft audio, + .entry .entry-content .wp-block-audio.alignright audio { + max-width: 384px; + } +} + +@media only screen and (min-width: 1379px) { + .entry .entry-content .wp-block-audio.alignleft audio, + .entry .entry-content .wp-block-audio.alignright audio { + max-width: 385.44px; + } +} + +.entry .entry-content .wp-block-video video { + width: 100%; +} + +.entry .entry-content .wp-block-button .wp-block-button__link { + transition: background 150ms ease-in-out; + border: none; + font-size: 0.88889em; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + line-height: 1.2; + box-sizing: border-box; + font-weight: bold; + text-decoration: none; + padding: 0.76rem 1rem; + outline: none; + outline: none; +} + +.entry .entry-content .wp-block-button .wp-block-button__link:not(.has-background) { + background-color: #0073aa; +} + +.entry .entry-content .wp-block-button .wp-block-button__link:not(.has-text-color) { + color: white; +} + +.entry .entry-content .wp-block-button .wp-block-button__link:hover { + color: white; + background: #111; + cursor: pointer; +} + +.entry .entry-content .wp-block-button .wp-block-button__link:focus { + color: white; + background: #111; + outline: thin dotted; + outline-offset: -4px; +} + +.entry .entry-content .wp-block-button:not(.is-style-squared) .wp-block-button__link { + border-radius: 5px; +} + +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link, +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:focus, +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:active { + transition: all 150ms ease-in-out; + border-width: 2px; + border-style: solid; +} + +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:not(.has-background), +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:focus:not(.has-background), +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:active:not(.has-background) { + background: transparent; +} + +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color), +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:focus:not(.has-text-color), +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:active:not(.has-text-color) { + color: #0073aa; + border-color: currentColor; +} + +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:hover { + color: white; + border-color: #111; +} + +.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:hover:not(.has-background) { + color: #111; +} + +.entry .entry-content .wp-block-archives, +.entry .entry-content .wp-block-categories, +.entry .entry-content .wp-block-latest-posts { + padding: 0; + list-style: none; +} + +.entry .entry-content .wp-block-archives li > a, +.entry .entry-content .wp-block-categories li > a, +.entry .entry-content .wp-block-latest-posts li > a { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: calc(22px * 1.125); + font-weight: bold; + line-height: 1.2; + text-decoration: none; +} + +.entry .entry-content .wp-block-archives.aligncenter, +.entry .entry-content .wp-block-categories.aligncenter { + text-align: center; +} + +.entry .entry-content .wp-block-categories ul { + padding-top: 0.75rem; +} + +.entry .entry-content .wp-block-categories li ul { + list-style: none; + padding-left: 0; +} + +.entry .entry-content .wp-block-categories ul { + counter-reset: submenu; +} + +.entry .entry-content .wp-block-categories ul > li > a::before { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-weight: normal; + content: "– " counters(submenu, "– ", none); + counter-increment: submenu; +} + +.entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-date { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.71111em; + color: #767676; + line-height: 1.2; +} + +.entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-full-content, +.entry .entry-content .wp-block-latest-posts .wp-block-latest-posts__post-excerpt { + margin-top: 1rem; + margin-bottom: 1rem; +} + +.entry .entry-content .wp-block-latest-posts li { + padding-bottom: 0.5rem; +} + +.entry .entry-content .wp-block-latest-posts li.menu-item-has-children, .entry .entry-content .wp-block-latest-posts li:last-child { + padding-bottom: 0; +} + +.entry .entry-content .wp-block-latest-posts li :not(:last-child) .wp-block-latest-posts__post-excerpt { + padding-bottom: 0.5rem; +} + +.entry .entry-content .wp-block-latest-posts.is-grid li { + border-top: 2px solid #ccc; + padding-top: 1rem; + margin-bottom: 2rem; +} + +.entry .entry-content .wp-block-latest-posts.is-grid li a:after { + content: ''; +} + +.entry .entry-content .wp-block-latest-posts.is-grid li:last-child { + margin-bottom: auto; +} + +.entry .entry-content .wp-block-latest-posts.is-grid li:last-child a:after { + content: ''; +} + +.entry .entry-content .wp-block-preformatted { + font-size: 0.71111em; + line-height: 1.8; + padding: 1rem; +} + +.entry .entry-content .wp-block-verse { + font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif; + font-size: 22px; + line-height: 1.8; +} + +.entry .entry-content .has-drop-cap:not(:focus):first-letter { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 3.375em; + line-height: 1; + font-weight: bold; + margin: 0 0.25em 0 0; +} + +.entry .entry-content .wp-block-pullquote { + border-color: transparent; + border-width: 2px; + padding: 1rem; +} + +.entry .entry-content .wp-block-pullquote blockquote { + color: #111; + border: none; + margin-top: calc(4 * 1rem); + margin-bottom: calc(4.33 * 1rem); + margin-right: 0; + padding-left: 0; +} + +.entry .entry-content .wp-block-pullquote p { + font-size: 1.6875em; + font-style: italic; + line-height: 1.3; + margin-bottom: 0.5em; + margin-top: 0.5em; +} + +.entry .entry-content .wp-block-pullquote p em { + font-style: normal; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-pullquote p { + font-size: 2.25em; + } +} + +.entry .entry-content .wp-block-pullquote cite { + display: inline-block; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + line-height: 1.6; + text-transform: none; + color: #767676; + /* + * This requires a rem-based font size calculation instead of our normal em-based one, + * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. + */ + font-size: calc(1rem / (1.25 * 1.125)); +} + +.entry .entry-content .wp-block-pullquote.alignleft, .entry .entry-content .wp-block-pullquote.alignright { + width: 100%; + padding: 0; +} + +.entry .entry-content .wp-block-pullquote.alignleft blockquote, .entry .entry-content .wp-block-pullquote.alignright blockquote { + margin: 1rem 0; + padding: 0; + text-align: left; + max-width: 100%; +} + +.entry .entry-content .wp-block-pullquote.alignleft blockquote p:first-child, .entry .entry-content .wp-block-pullquote.alignright blockquote p:first-child { + margin-top: 0; +} + +.entry .entry-content .wp-block-pullquote.is-style-solid-color { + background-color: #0073aa; + padding-left: 0; + padding-right: 0; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-pullquote.is-style-solid-color { + padding-left: 10%; + padding-right: 10%; + } +} + +.entry .entry-content .wp-block-pullquote.is-style-solid-color p { + font-size: 1.6875em; + line-height: 1.3; + margin-bottom: 0.5em; + margin-top: 0.5em; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-pullquote.is-style-solid-color p { + font-size: 2.25em; + } +} + +.entry .entry-content .wp-block-pullquote.is-style-solid-color a { + color: #fff; +} + +.entry .entry-content .wp-block-pullquote.is-style-solid-color cite { + color: inherit; +} + +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote { + max-width: 100%; + color: #fff; + padding-left: 0; + margin-left: 1rem; + margin-right: 1rem; +} + +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-text-color p, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-text-color a, .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color, .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color, .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color, .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color, .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-white-color { + color: inherit; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote { + margin-left: 0; + margin-right: 0; + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-pullquote.is-style-solid-color.alignright, .entry .entry-content .wp-block-pullquote.is-style-solid-color.alignleft { + padding: 1rem calc(2 * 1rem); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-pullquote.is-style-solid-color.alignfull { + padding-left: calc(10% + 58px + (2 * 1rem)); + padding-right: calc(10% + 58px + (2 * 1rem)); + } +} + +.entry .entry-content .wp-block-quote:not(.is-large), .entry .entry-content .wp-block-quote:not(.is-style-large) { + border-width: 2px; + border-color: #0073aa; + padding-top: 0; + padding-bottom: 0; +} + +.entry .entry-content .wp-block-quote p { + font-size: 1em; + font-style: normal; + line-height: 1.8; +} + +.entry .entry-content .wp-block-quote cite { + /* + * This requires a rem-based font size calculation instead of our normal em-based one, + * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. + */ + font-size: calc(1rem / (1.25 * 1.125)); +} + +.entry .entry-content .wp-block-quote.is-large, .entry .entry-content .wp-block-quote.is-style-large { + margin: 1rem 0; + padding: 0; + border-left: none; +} + +.entry .entry-content .wp-block-quote.is-large p, .entry .entry-content .wp-block-quote.is-style-large p { + font-size: 1.6875em; + line-height: 1.4; + font-style: italic; +} + +.entry .entry-content .wp-block-quote.is-large cite, +.entry .entry-content .wp-block-quote.is-large footer, .entry .entry-content .wp-block-quote.is-style-large cite, +.entry .entry-content .wp-block-quote.is-style-large footer { + /* + * This requires a rem-based font size calculation instead of our normal em-based one, + * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs. + */ + font-size: calc(1rem / (1.25 * 1.125)); +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-quote.is-large, .entry .entry-content .wp-block-quote.is-style-large { + margin: 1rem 0; + padding: 1rem 0; + } + .entry .entry-content .wp-block-quote.is-large p, .entry .entry-content .wp-block-quote.is-style-large p { + font-size: 1.6875em; + } +} + +.entry .entry-content .wp-block-image { + max-width: 100%; +} + +.entry .entry-content .wp-block-image img { + display: block; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-image:not(.alignwide):not(.alignfull) > img { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-image:not(.alignwide):not(.alignfull) > img { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-image .aligncenter { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-image .aligncenter { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-image .aligncenter { + margin: 0; + width: calc(8 * (100vw / 12) - 28px); + } + .entry .entry-content .wp-block-image .aligncenter img { + margin: 0 auto; + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-image .aligncenter { + width: calc(6 * (100vw / 12) - 28px); + } + .entry .entry-content .wp-block-image .aligncenter img { + margin: 0 auto; + } +} + +.entry .entry-content .wp-block-image.alignfull img { + width: 100vw; + max-width: calc( 100% + (2 * 1rem)); +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-image.alignfull img { + max-width: calc( 125% + 150px); + margin-left: auto; + margin-right: auto; + } +} + +.entry .entry-content .wp-block-cover-image, +.entry .entry-content .wp-block-cover { + position: relative; + min-height: 430px; + padding: 1rem; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-cover-image, + .entry .entry-content .wp-block-cover { + padding: 1rem 10%; + } +} + +.entry .entry-content .wp-block-cover-image .wp-block-cover-image-text, +.entry .entry-content .wp-block-cover-image .wp-block-cover-text, +.entry .entry-content .wp-block-cover-image h2, +.entry .entry-content .wp-block-cover .wp-block-cover-image-text, +.entry .entry-content .wp-block-cover .wp-block-cover-text, +.entry .entry-content .wp-block-cover h2 { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 1.6875em; + font-weight: bold; + line-height: 1.25; + padding: 0; + color: #fff; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-cover-image .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover-image .wp-block-cover-text, + .entry .entry-content .wp-block-cover-image h2, + .entry .entry-content .wp-block-cover .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover .wp-block-cover-text, + .entry .entry-content .wp-block-cover h2 { + font-size: 2.25em; + max-width: 100%; + } +} + +.entry .entry-content .wp-block-cover-image.alignleft, .entry .entry-content .wp-block-cover-image.alignright, +.entry .entry-content .wp-block-cover.alignleft, +.entry .entry-content .wp-block-cover.alignright { + width: 100%; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-cover-image.alignleft, .entry .entry-content .wp-block-cover-image.alignright, + .entry .entry-content .wp-block-cover.alignleft, + .entry .entry-content .wp-block-cover.alignright { + padding: 1rem calc(2 * 1rem); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-cover-image.alignfull .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover-image.alignfull .wp-block-cover-text, + .entry .entry-content .wp-block-cover-image.alignfull h2, + .entry .entry-content .wp-block-cover.alignfull .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover.alignfull .wp-block-cover-text, + .entry .entry-content .wp-block-cover.alignfull h2 { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-cover-image.alignfull .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover-image.alignfull .wp-block-cover-text, + .entry .entry-content .wp-block-cover-image.alignfull h2, + .entry .entry-content .wp-block-cover.alignfull .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover.alignfull .wp-block-cover-text, + .entry .entry-content .wp-block-cover.alignfull h2 { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-cover-image.alignfull, + .entry .entry-content .wp-block-cover.alignfull { + padding-left: calc(10% + 58px + (2 * 1rem)); + padding-right: calc(10% + 58px + (2 * 1rem)); + } + .entry .entry-content .wp-block-cover-image.alignfull .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover-image.alignfull .wp-block-cover-text, + .entry .entry-content .wp-block-cover-image.alignfull h2, + .entry .entry-content .wp-block-cover.alignfull .wp-block-cover-image-text, + .entry .entry-content .wp-block-cover.alignfull .wp-block-cover-text, + .entry .entry-content .wp-block-cover.alignfull h2 { + padding: 0; + } +} + +.entry .entry-content .wp-block-gallery { + list-style-type: none; + padding-left: 0; +} + +.entry .entry-content .wp-block-gallery .blocks-gallery-image:last-child, +.entry .entry-content .wp-block-gallery .blocks-gallery-item:last-child { + margin-bottom: 16px; +} + +.entry .entry-content .wp-block-gallery figcaption a { + color: #fff; +} + +.entry .entry-content .wp-block-audio figcaption, +.entry .entry-content .wp-block-video figcaption, +.entry .entry-content .wp-block-image figcaption, +.entry .entry-content .wp-block-gallery .blocks-gallery-image figcaption, +.entry .entry-content .wp-block-gallery .blocks-gallery-item figcaption { + font-size: 0.71111em; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + line-height: 1.6; + margin: 0; + padding: 0.5rem; + text-align: center; +} + +.entry .entry-content .wp-block-separator, +.entry .entry-content hr { + background-color: #767676; + border: 0; + height: 2px; + margin-bottom: 2rem; + margin-top: 2rem; + max-width: 2.25em; + text-align: left; + /* Remove duplicate rule-line when a separator + * is followed by an H1, or H2 */ +} + +.entry .entry-content .wp-block-separator.is-style-wide, +.entry .entry-content hr.is-style-wide { + max-width: 100%; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-separator.is-style-wide, + .entry .entry-content hr.is-style-wide { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-separator.is-style-wide, + .entry .entry-content hr.is-style-wide { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +.entry .entry-content .wp-block-separator.is-style-dots, +.entry .entry-content hr.is-style-dots { + max-width: 100%; + background-color: inherit; + border: inherit; + height: inherit; + text-align: center; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-separator.is-style-dots, + .entry .entry-content hr.is-style-dots { + max-width: calc(8 * (100vw / 12) - 28px); + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-separator.is-style-dots, + .entry .entry-content hr.is-style-dots { + max-width: calc(6 * (100vw / 12) - 28px); + } +} + +.entry .entry-content .wp-block-separator.is-style-dots:not(.has-text-color):not(.has-background), +.entry .entry-content hr.is-style-dots:not(.has-text-color):not(.has-background) { + color: #767676; +} + +.entry .entry-content .wp-block-separator.is-style-dots:before, +.entry .entry-content hr.is-style-dots:before { + font-size: 1.6875em; + letter-spacing: 0.88889em; + padding-left: 0.88889em; +} + +.entry .entry-content .wp-block-separator + h1:before, +.entry .entry-content .wp-block-separator + h2:before, +.entry .entry-content hr + h1:before, +.entry .entry-content hr + h2:before { + display: none; +} + +.entry .entry-content .wp-block-embed-twitter { + word-break: break-word; +} + +.entry .entry-content .wp-block-table th, +.entry .entry-content .wp-block-table td { + border-color: #767676; +} + +.entry .entry-content .wp-block-file { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; +} + +.entry .entry-content .wp-block-file .wp-block-file__button { + display: table; + transition: background 150ms ease-in-out; + border: none; + border-radius: 5px; + background: #0073aa; + font-size: 22px; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + line-height: 1.2; + text-decoration: none; + font-weight: bold; + padding: 0.75rem 1rem; + color: #fff; + margin-left: 0; + margin-top: calc(0.75 * 1rem); +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-file .wp-block-file__button { + font-size: 22px; + padding: 0.875rem 1.5rem; + } +} + +.entry .entry-content .wp-block-file .wp-block-file__button:hover { + background: #111; + cursor: pointer; +} + +.entry .entry-content .wp-block-file .wp-block-file__button:focus { + background: #111; + outline: thin dotted; + outline-offset: -4px; +} + +.entry .entry-content .wp-block-code { + border-radius: 0; +} + +.entry .entry-content .wp-block-code code { + font-size: 1.125em; + white-space: pre-wrap; + word-break: break-word; +} + +.entry .entry-content .wp-block-columns .wp-block-column > *:first-child { + margin-top: 0; +} + +.entry .entry-content .wp-block-columns .wp-block-column > *:last-child { + margin-bottom: 0; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-columns .wp-block-image > img:not(.alignwide):not(.alignfull), + .entry .entry-content .wp-block-columns .wp-block-image > figure { + max-width: 100%; + } +} + +@media only screen and (min-width: 1168px) { + .entry .entry-content .wp-block-columns .wp-block-image > img:not(.alignwide):not(.alignfull), + .entry .entry-content .wp-block-columns .wp-block-image > figure { + max-width: 100%; + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-columns { + flex-wrap: nowrap; + } + .entry .entry-content .wp-block-columns .wp-block-column:not(:first-child) { + margin-left: 32px; + } +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-group:not(.alignfull) > .wp-block-group__inner-container > .alignfull, + .entry .entry-content .wp-block-group:not(.alignfull) > .wp-block-group__inner-container > .wp-block-image > img { + left: 0; + max-width: 100%; + } +} + +.entry .entry-content .wp-block-group.alignfull > .wp-block-group__inner-container { + max-width: calc(100% - (2 * 1rem)); + margin: 0 1rem; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-group.alignfull > .wp-block-group__inner-container { + max-width: 80%; + margin: 0 10%; + padding: 0 60px; + } +} + +.entry .entry-content .wp-block-group.has-background { + padding: 1rem; + margin-top: 0; + margin-bottom: 0; +} + +.entry .entry-content .wp-block-group.has-background .wp-block-group__inner-container > *:first-child { + margin-top: 0; +} + +.entry .entry-content .wp-block-group.has-background .wp-block-group__inner-container > *:last-child { + margin-bottom: 0; +} + +.entry .entry-content .wp-block-group.has-background.alignfull { + padding-left: 0; + padding-right: 0; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-group.has-background.alignfull { + padding-top: 1rem; + padding-bottom: 1rem; + } +} + +.entry .entry-content .wp-block-group.has-background:not(.alignfull) > .wp-block-group__inner-container > .alignfull { + width: 100%; + max-width: 100%; +} + +@media only screen and (min-width: 768px) { + .entry .entry-content .wp-block-group.has-background:not(.alignfull) > .wp-block-group__inner-container > .alignfull { + width: calc( 100% + 2rem); + max-width: calc( 100% + 2rem); + margin-left: -1rem; + } +} + +.entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-weight: bold; +} + +.entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-meta .wp-block-latest-comments__comment-date { + font-weight: normal; +} + +.entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment, +.entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-date, +.entry .entry-content .wp-block-latest-comments .wp-block-latest-comments__comment-excerpt p { + font-size: inherit; +} + +.entry .entry-content .wp-block-latest-comments.has-dates .wp-block-latest-comments__comment-date { + font-size: 0.71111em; +} + +.entry .entry-content .has-small-font-size { + font-size: 0.88889em; +} + +.entry .entry-content .has-normal-font-size { + font-size: 1.125em; +} + +.entry .entry-content .has-large-font-size { + font-size: 1.6875em; +} + +.entry .entry-content .has-huge-font-size { + font-size: 2.25em; +} + +.entry .entry-content .has-primary-background-color, +.entry .entry-content .has-secondary-background-color, +.entry .entry-content .has-dark-gray-background-color, +.entry .entry-content .has-light-gray-background-color { + color: #fff; +} + +.entry .entry-content .has-primary-background-color > p, +.entry .entry-content .has-primary-background-color > h1, +.entry .entry-content .has-primary-background-color > h2, +.entry .entry-content .has-primary-background-color > h3, +.entry .entry-content .has-primary-background-color > h4, +.entry .entry-content .has-primary-background-color > h5, +.entry .entry-content .has-primary-background-color > h6, +.entry .entry-content .has-primary-background-color > a, +.entry .entry-content .has-secondary-background-color > p, +.entry .entry-content .has-secondary-background-color > h1, +.entry .entry-content .has-secondary-background-color > h2, +.entry .entry-content .has-secondary-background-color > h3, +.entry .entry-content .has-secondary-background-color > h4, +.entry .entry-content .has-secondary-background-color > h5, +.entry .entry-content .has-secondary-background-color > h6, +.entry .entry-content .has-secondary-background-color > a, +.entry .entry-content .has-dark-gray-background-color > p, +.entry .entry-content .has-dark-gray-background-color > h1, +.entry .entry-content .has-dark-gray-background-color > h2, +.entry .entry-content .has-dark-gray-background-color > h3, +.entry .entry-content .has-dark-gray-background-color > h4, +.entry .entry-content .has-dark-gray-background-color > h5, +.entry .entry-content .has-dark-gray-background-color > h6, +.entry .entry-content .has-dark-gray-background-color > a, +.entry .entry-content .has-light-gray-background-color > p, +.entry .entry-content .has-light-gray-background-color > h1, +.entry .entry-content .has-light-gray-background-color > h2, +.entry .entry-content .has-light-gray-background-color > h3, +.entry .entry-content .has-light-gray-background-color > h4, +.entry .entry-content .has-light-gray-background-color > h5, +.entry .entry-content .has-light-gray-background-color > h6, +.entry .entry-content .has-light-gray-background-color > a { + color: #fff; +} + +.entry .entry-content .has-white-background-color { + color: #111; +} + +.entry .entry-content .has-white-background-color > p, +.entry .entry-content .has-white-background-color > h1, +.entry .entry-content .has-white-background-color > h2, +.entry .entry-content .has-white-background-color > h3, +.entry .entry-content .has-white-background-color > h4, +.entry .entry-content .has-white-background-color > h5, +.entry .entry-content .has-white-background-color > h6, +.entry .entry-content .has-white-background-color > a { + color: #111; +} + +.entry .entry-content .has-primary-background-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color.has-primary-background-color { + background-color: #0073aa; +} + +.entry .entry-content .has-secondary-background-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color.has-secondary-background-color { + background-color: #005177; +} + +.entry .entry-content .has-dark-gray-background-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color.has-dark-gray-background-color { + background-color: #111; +} + +.entry .entry-content .has-light-gray-background-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color.has-light-gray-background-color { + background-color: #767676; +} + +.entry .entry-content .has-white-background-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color.has-white-background-color { + background-color: #FFF; +} + +.entry .entry-content .has-primary-color, +.entry .entry-content .wp-block-pullquote blockquote.has-primary-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color > p { + color: #0073aa; +} + +.entry .entry-content .has-secondary-color, +.entry .entry-content .wp-block-pullquote blockquote.has-secondary-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color > p { + color: #005177; +} + +.entry .entry-content .has-dark-gray-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color > p { + color: #111; +} + +.entry .entry-content .has-light-gray-color, +.entry .entry-content .wp-block-pullquote blockquote.has-light-gray-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color > p { + color: #767676; +} + +.entry .entry-content .has-white-color, +.entry .entry-content .wp-block-pullquote blockquote.has-white-color, +.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-white-color { + color: #FFF; +} + +/* Media */ +.page-content .wp-smiley, +.entry-content .wp-smiley, +.comment-content .wp-smiley { + border: none; + margin-bottom: 0; + margin-top: 0; + padding: 0; +} + +embed, +iframe, +object { + max-width: 100%; +} + +.custom-logo-link { + display: inline-block; +} + +.avatar { + border-radius: 100%; + display: block; + height: calc(2.25 * 1rem); + min-height: inherit; + width: calc(2.25 * 1rem); +} + +svg { + transition: fill 120ms ease-in-out; + fill: currentColor; +} + +/*-------------------------------------------------------------- +## Captions +--------------------------------------------------------------*/ +.wp-caption { + margin-bottom: calc(1.5 * 1rem); +} + +@media only screen and (min-width: 768px) { + .wp-caption.aligncenter { + position: relative; + left: calc( calc(8 * (100vw / 12) - 28px) / 2); + transform: translateX(-50%); + } +} + +@media only screen and (min-width: 1168px) { + .wp-caption.aligncenter { + left: calc( calc(6 * (100vw / 12) - 28px) / 2); + } +} + +.wp-caption img[class*="wp-image-"] { + display: block; + margin-left: auto; + margin-right: auto; +} + +.wp-caption-text { + color: #767676; + font-size: 0.71111em; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + line-height: 1.6; + margin: 0; + padding: 0.5rem; + text-align: center; +} + +/*-------------------------------------------------------------- +## Galleries +--------------------------------------------------------------*/ +.gallery { + display: flex; + flex-flow: row wrap; + justify-content: center; + margin-bottom: calc(1.5 * 1rem); +} + +.gallery-item { + display: inline-block; + margin-right: 16px; + margin-bottom: 16px; + text-align: center; + vertical-align: top; + width: 100%; +} + +.gallery-columns-2 .gallery-item { + max-width: calc((100% - 16px * 1) / 2); +} + +.gallery-columns-2 .gallery-item:nth-of-type(2n+2) { + margin-right: 0; +} + +.gallery-columns-3 .gallery-item { + max-width: calc((100% - 16px * 2) / 3); +} + +.gallery-columns-3 .gallery-item:nth-of-type(3n+3) { + margin-right: 0; +} + +.gallery-columns-4 .gallery-item { + max-width: calc((100% - 16px * 3) / 4); +} + +.gallery-columns-4 .gallery-item:nth-of-type(4n+4) { + margin-right: 0; +} + +.gallery-columns-5 .gallery-item { + max-width: calc((100% - 16px * 4) / 5); +} + +.gallery-columns-5 .gallery-item:nth-of-type(5n+5) { + margin-right: 0; +} + +.gallery-columns-6 .gallery-item { + max-width: calc((100% - 16px * 5) / 6); +} + +.gallery-columns-6 .gallery-item:nth-of-type(6n+6) { + margin-right: 0; +} + +.gallery-columns-7 .gallery-item { + max-width: calc((100% - 16px * 6) / 7); +} + +.gallery-columns-7 .gallery-item:nth-of-type(7n+7) { + margin-right: 0; +} + +.gallery-columns-8 .gallery-item { + max-width: calc((100% - 16px * 7) / 8); +} + +.gallery-columns-8 .gallery-item:nth-of-type(8n+8) { + margin-right: 0; +} + +.gallery-columns-9 .gallery-item { + max-width: calc((100% - 16px * 8) / 9); +} + +.gallery-columns-9 .gallery-item:nth-of-type(9n+9) { + margin-right: 0; +} + +.gallery-item:last-of-type { + padding-right: 0; +} + +.gallery-caption { + display: block; + font-size: 0.71111em; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + line-height: 1.6; + margin: 0; + padding: 0.5rem; +} + +.gallery-item > div > a { + display: block; + line-height: 0; + box-shadow: 0 0 0 0 transparent; +} + +.gallery-item > div > a:focus { + box-shadow: 0 0 0 2px #0073aa; +} diff --git a/wp-content/themes/twentynineteen/style.scss b/wp-content/themes/twentynineteen/style.scss new file mode 100644 index 0000000..960469d --- /dev/null +++ b/wp-content/themes/twentynineteen/style.scss @@ -0,0 +1,110 @@ +/* +Theme Name: Twenty Nineteen +Theme URI: https://wordpress.org/themes/twentynineteen/ +Author: the WordPress team +Author URI: https://wordpress.org/ +Description: Our 2019 default theme is designed to show off the power of the block editor. It features custom styles for all the default blocks, and is built so that what you see in the editor looks like what you'll see on your website. Twenty Nineteen is designed to be adaptable to a wide range of websites, whether you’re running a photo blog, launching a new business, or supporting a non-profit. Featuring ample whitespace and modern sans-serif headlines paired with classic serif body text, it's built to be beautiful on all screen sizes. +Requires at least: 4.9.6 +Requires PHP: 5.2.4 +Version: 1.5 +License: GNU General Public License v2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html +Text Domain: twentynineteen +Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, rtl-language-support, sticky-post, threaded-comments, translation-ready + +This theme, like WordPress, is licensed under the GPL. +Use it to make something cool, have fun, and share what you've learned with others. + +Twenty Nineteen is based on Underscores https://underscores.me/, (C) 2012-2019 Automattic, Inc. +Underscores is distributed under the terms of the GNU GPL v2 or later. + +Normalizing styles have been helped along thanks to the fine work of +Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/ +*/ + +/*-------------------------------------------------------------- +>>> TABLE OF CONTENTS: +---------------------------------------------------------------- +# Variables +# Normalize +# Typography + ## Headings + ## Copy +# Elements + ## Lists + ## Tables +# Forms + ## Buttons + ## Fields +# Navigation + ## Links + ## Menus + ## Next & Previous +# Accessibility +# Alignments +# Clearings +# Layout +# Widgets +# Content + ## Archives + ## Posts and pages + ## Comments +# Blocks +# Media + ## Captions + ## Galleries +--------------------------------------------------------------*/ +@import "sass/variables-site/variables-site"; +@import "sass/mixins/mixins-master"; + +/* Normalize */ + +@import "sass/normalize"; + +/* Typography */ + +@import "sass/typography/typography"; + +/* Elements */ + +@import "sass/elements/elements"; + +/* Forms */ + +@import "sass/forms/forms"; + +/* Navigation */ + +@import "sass/navigation/navigation"; + +/* Accessibility */ + +@import "sass/modules/accessibility"; + +/* Alignments */ + +@import "sass/modules/alignments"; + +/* Clearings */ + +@import "sass/modules/clearings"; + +/* Layout */ + +@import "sass/layout/layout"; + +/* Content */ + +@import "sass/site/site"; + +/* Widgets */ + +@import "sass/site/secondary/widgets"; + +/* Blocks */ + +@import "sass/blocks/blocks"; + +/* Media */ + +@import "sass/media/media"; diff --git a/wp-content/themes/twentynineteen/template-parts/content/content-excerpt.php b/wp-content/themes/twentynineteen/template-parts/content/content-excerpt.php new file mode 100644 index 0000000..f3d12c9 --- /dev/null +++ b/wp-content/themes/twentynineteen/template-parts/content/content-excerpt.php @@ -0,0 +1,33 @@ + + + diff --git a/wp-content/themes/twentynineteen/template-parts/content/content-none.php b/wp-content/themes/twentynineteen/template-parts/content/content-none.php new file mode 100644 index 0000000..9a30c00 --- /dev/null +++ b/wp-content/themes/twentynineteen/template-parts/content/content-none.php @@ -0,0 +1,53 @@ + + +
            + + +
            + ' . wp_kses( + /* translators: 1: Link to WP admin new post page. */ + __( 'Ready to publish your first post? Get started here.', 'twentynineteen' ), + array( + 'a' => array( + 'href' => array(), + ), + ) + ) . '

            ', + esc_url( admin_url( 'post-new.php' ) ) + ); + + elseif ( is_search() ) : + ?> + +

            + + +

            + +
            +
            diff --git a/wp-content/themes/twentynineteen/template-parts/content/content-page.php b/wp-content/themes/twentynineteen/template-parts/content/content-page.php new file mode 100644 index 0000000..de59cc4 --- /dev/null +++ b/wp-content/themes/twentynineteen/template-parts/content/content-page.php @@ -0,0 +1,56 @@ + + +
            > + +
            + +
            + + +
            + '', + ) + ); + ?> +
            + + +
            + %s', 'twentynineteen' ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ), + get_the_title() + ), + '' . twentynineteen_get_icon_svg( 'edit', 16 ), + '' + ); + ?> +
            + +
            diff --git a/wp-content/themes/twentynineteen/template-parts/content/content-single.php b/wp-content/themes/twentynineteen/template-parts/content/content-single.php new file mode 100644 index 0000000..c4a8d1e --- /dev/null +++ b/wp-content/themes/twentynineteen/template-parts/content/content-single.php @@ -0,0 +1,55 @@ + + +
            > + +
            + +
            + + +
            + "%s"', 'twentynineteen' ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ), + get_the_title() + ) + ); + + wp_link_pages( + array( + 'before' => '', + ) + ); + ?> +
            + +
            + +
            + + + + + +
            diff --git a/wp-content/themes/twentynineteen/template-parts/content/content.php b/wp-content/themes/twentynineteen/template-parts/content/content.php new file mode 100644 index 0000000..6657815 --- /dev/null +++ b/wp-content/themes/twentynineteen/template-parts/content/content.php @@ -0,0 +1,59 @@ + + +
            > +
            + %s', _x( 'Featured', 'post', 'twentynineteen' ) ); + } + if ( is_singular() ) : + the_title( '

            ', '

            ' ); + else : + the_title( sprintf( '

            ', esc_url( get_permalink() ) ), '

            ' ); + endif; + ?> +
            + + + +
            + "%s"', 'twentynineteen' ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ), + get_the_title() + ) + ); + + wp_link_pages( + array( + 'before' => '', + ) + ); + ?> +
            + +
            + +
            +
            diff --git a/wp-content/themes/twentynineteen/template-parts/footer/footer-widgets.php b/wp-content/themes/twentynineteen/template-parts/footer/footer-widgets.php new file mode 100644 index 0000000..da7baa3 --- /dev/null +++ b/wp-content/themes/twentynineteen/template-parts/footer/footer-widgets.php @@ -0,0 +1,24 @@ + + + + + diff --git a/wp-content/themes/twentynineteen/template-parts/header/entry-header.php b/wp-content/themes/twentynineteen/template-parts/header/entry-header.php new file mode 100644 index 0000000..774f0b3 --- /dev/null +++ b/wp-content/themes/twentynineteen/template-parts/header/entry-header.php @@ -0,0 +1,46 @@ + + +', '' ); ?> + + + + diff --git a/wp-content/themes/twentynineteen/template-parts/header/site-branding.php b/wp-content/themes/twentynineteen/template-parts/header/site-branding.php new file mode 100644 index 0000000..e4519ba --- /dev/null +++ b/wp-content/themes/twentynineteen/template-parts/header/site-branding.php @@ -0,0 +1,60 @@ + +
            + + + + + + + +

            + +

            + + + + +

            + +

            + + + + + + + +
            diff --git a/wp-content/themes/twentynineteen/template-parts/post/author-bio.php b/wp-content/themes/twentynineteen/template-parts/post/author-bio.php new file mode 100644 index 0000000..b7792ef --- /dev/null +++ b/wp-content/themes/twentynineteen/template-parts/post/author-bio.php @@ -0,0 +1,30 @@ + +
            +

            + + + +

            +

            + + +

            +
            + diff --git a/wp-content/themes/twentynineteen/template-parts/post/discussion-meta.php b/wp-content/themes/twentynineteen/template-parts/post/discussion-meta.php new file mode 100644 index 0000000..e5b70d4 --- /dev/null +++ b/wp-content/themes/twentynineteen/template-parts/post/discussion-meta.php @@ -0,0 +1,32 @@ +responses > 0; + +if ( $has_responses ) { + /* translators: %d: Number of comments. */ + $meta_label = sprintf( _n( '%d Comment', '%d Comments', $discussion->responses, 'twentynineteen' ), $discussion->responses ); +} else { + $meta_label = __( 'No comments', 'twentynineteen' ); +} +?> + +
            + authors ); + } + ?> +

            + + +

            +
            diff --git a/wp-content/themes/twentyseventeen/404.php b/wp-content/themes/twentyseventeen/404.php new file mode 100644 index 0000000..883f918 --- /dev/null +++ b/wp-content/themes/twentyseventeen/404.php @@ -0,0 +1,35 @@ + + +
            +
            +
            + +
            + +
            +

            + + + +
            +
            +
            +
            +
            + + + +
            + + + + + +
            +
            + + + twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '' . __( 'Previous page', 'twentyseventeen' ) . '', + 'next_text' => '' . __( 'Next page', 'twentyseventeen' ) . '' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ), + 'before_page_number' => '' . __( 'Page', 'twentyseventeen' ) . ' ', + ) + ); + + else : + + get_template_part( 'template-parts/post/content', 'none' ); + + endif; + ?> + +
            +
            + +
            + +>> TABLE OF CONTENTS: +---------------------------------------------------------------- +1.0 General Block Styles +2.0 Blocks - Common Blocks +3.0 Blocks - Formatting +4.0 Blocks - Layout Elements +5.0 Blocks - Widgets +6.0 Blocks - Colors +--------------------------------------------------------------*/ + +/*-------------------------------------------------------------- +1.0 General Block Styles +--------------------------------------------------------------*/ + +/* Captions */ + +[class^="wp-block-"]:not(.wp-block-gallery) figcaption { + font-style: italic; + margin-bottom: 1.5em; + text-align: left; +} + +.rtl [class^="wp-block-"]:not(.wp-block-gallery) figcaption { + text-align: right; +} + +/*-------------------------------------------------------------- +2.0 Blocks - Common Blocks +--------------------------------------------------------------*/ + +/* Paragraph */ + +p.has-drop-cap:not(:focus)::first-letter { + font-size: 5em; + margin-top: 0.075em; +} + +/* Image */ + +.wp-block-image { + margin-bottom: 1.5em; +} + +.wp-block-image figure { + margin-bottom: 0; + margin-top: 0; +} + +.wp-block-image figure.alignleft { + margin-right: 1.5em; +} + +.wp-block-image figure.alignright { + margin-left: 1.5em; +} + +/* Gallery */ + +.wp-block-gallery { + margin-bottom: 1.5em; +} + +.wp-block-gallery figcaption { + font-style: italic; +} + +.wp-block-gallery.aligncenter { + display: flex; + margin: 0 -8px; +} + +/* Quote */ + +.wp-block-quote:not(.is-large):not(.is-style-large) { + border: 0; + padding: 0; +} + +.wp-block-quote.alignleft p:last-of-type, +.wp-block-quote.alignright p:last-of-type { + margin-bottom: 0; +} + +.wp-block-quote cite { + color: inherit; + font-size: inherit; +} + +/* Audio */ + +.wp-block-audio audio { + display: block; + width: 100%; +} + +/* Cover */ + +.wp-block-cover-image.alignright, +.wp-block-cover.alignright, +.wp-block-cover-image.alignleft, +.wp-block-cover.alignleft, +.wp-block-cover-image.aligncenter, +.wp-block-cover.aligncenter { + display: flex; +} + +/* File */ + +.wp-block-file .wp-block-file__button { + background-color: #222; + -webkit-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: none; + box-shadow: none; + color: #fff; + display: inline-block; + font-size: 14px; + font-size: 0.875rem; + font-weight: 800; + margin-top: 2em; + padding: 0.7em 2em; + -webkit-transition: background-color 0.2s ease-in-out; + transition: background-color 0.2s ease-in-out; + white-space: nowrap; +} + +.wp-block-file .wp-block-file__button:hover, +.wp-block-file .wp-block-file__button:focus { + background-color: #767676; + -webkit-box-shadow: none; + box-shadow: none; +} + +/*-------------------------------------------------------------- +3.0 Blocks - Formatting +--------------------------------------------------------------*/ + +/* Code */ + +.wp-block-code { + background: transparent; + border: 0; + padding: 0; +} + +/* Pullquote */ + +.wp-block-pullquote { + border: 0; +} + +.wp-block-pullquote__citation, +.wp-block-pullquote cite { + font-size: inherit; + text-transform: none; +} + +/* Table */ + +.wp-block-table thead th { + border-bottom: 2px solid #bbb; + padding-bottom: 0.5em; +} + +.wp-block-table tr { + border-bottom: 1px solid #eee; +} + +.wp-block-table th, +.wp-block-table td { + border: 0; +} + +.rtl .wp-block-table th, +.rtl .wp-block-table td { + text-align: right; +} + +/*-------------------------------------------------------------- +4.0 Blocks - Layout Elements +--------------------------------------------------------------*/ + +/* Buttons */ + +.wp-block-button .wp-block-button__link { + -webkit-box-shadow: none; + box-shadow: none; + display: inline-block; + font-size: 14px; + font-size: 0.875rem; + font-weight: 800; + line-height: 1.66; + margin-top: 2em; + padding: 0.7em 2em; + -webkit-transition: background-color 0.2s ease-in-out; + transition: background-color 0.2s ease-in-out; + white-space: nowrap; +} + +.entry-content .wp-block-button__link { + background-color: #222; + color: #fff; +} + +.entry-content .is-style-outline .wp-block-button__link:not(.has-background) { + background-color: transparent; +} + +.entry-content .is-style-outline .wp-block-button__link:not(.has-text-color) { + color: #222; +} + +.colors-dark .wp-block-button__link { + background-color: #fff; + color: #000; +} + +.entry-content .wp-block-button__link:hover, +.entry-content .wp-block-button__link:focus, +.entry-content .is-style-outline .wp-block-button__link:not(.has-background):hover, +.entry-content .is-style-outline .wp-block-button__link:not(.has-background):focus { + background-color: #767676; + -webkit-box-shadow: none; + box-shadow: none; + color: #fff; +} + +.colors-dark .entry-content .wp-block-button__link:hover, +.colors-dark .entry-content .wp-block-button__link:focus, +.colors-dark .entry-content .is-style-outline .wp-block-button__link:not(.has-background):hover, +.colors-dark .entry-content .is-style-outline .wp-block-button__link:not(.has-background):focus { + background-color: #bbb; + color: #000; +} + +.colors-dark .entry-content .is-style-outline .wp-block-button__link:not(.has-text-color) { + color: #fff; +} + +.colors-dark .entry-content .is-style-outline .wp-block-button__link:not(.has-text-color):hover, +.colors-dark .entry-content .is-style-outline .wp-block-button__link:not(.has-text-color):focus { + color: #222; +} + +.colors-custom .entry-content .wp-block-button__link, +.colors-custom .entry-content .wp-block-button__link:hover, +.colors-custom .entry-content .wp-block-button__link:focus, +.colors-dark .entry-content .wp-block-button__link, +.colors-dark .entry-content .wp-block-button__link:hover, +.colors-dark .entry-content .wp-block-button__link:focus { + -webkit-box-shadow: none; + box-shadow: none; +} + +.colors-custom .entry-content .wp-block-button__link:hover, +.colors-custom .entry-content .wp-block-button__link:focus { + color: #fff; +} + +/* Separator */ + +.wp-block-separator { + border: 0; +} + +.wp-block-separator:not(.is-style-wide):not(.is-style-dots) { + max-width: 100px; +} + +/* Media & Text */ + +.wp-block-media-text { + margin-bottom: 1.5em; +} + +.wp-block-media-text *:last-child { + margin-bottom: 0; +} + +/*-------------------------------------------------------------- +5.0 Blocks - Widgets +--------------------------------------------------------------*/ + +/* Archives, Categories & Latest Posts */ + +.wp-block-archives.aligncenter, +.wp-block-categories.aligncenter, +.wp-block-latest-posts.aligncenter { + list-style-position: inside; + text-align: center; +} + +/* Comments */ + +.wp-block-latest-comments article { + margin-bottom: 4em; +} + +.blog:not(.has-sidebar) #primary .wp-block-latest-comments article, +.archive:not(.page-one-column):not(.has-sidebar) #primary .wp-block-latest-comments article, +.search:not(.has-sidebar) #primary .wp-block-latest-comments article { + float: none; + width: 100%; +} + +.wp-block-latest-comments .avatar, +.wp-block-latest-comments__comment-avatar { + border-radius: 0; +} + +.wp-block-latest-comments a { + -webkit-box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 1); + box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 1); + +} + +.wp-block-latest-comments__comment-meta { + font-size: 16px; + font-size: 1rem; + margin-bottom: 0.4em; +} + +.wp-block-latest-comments__comment-author, +.wp-block-latest-comments__comment-link { + font-weight: 700; + text-decoration: none; +} + +.wp-block-latest-comments__comment-date { + color: #767676; + font-size: 10px; + font-size: 0.625rem; + font-weight: 800; + letter-spacing: 0.1818em; + margin-top: 0.4em; + text-transform: uppercase; +} + +.editor-block-list__block .wp-block-latest-comments__comment-excerpt p { + font-size: 14px; + font-size: 0.875rem; +} + +/*-------------------------------------------------------------- +6.0 Blocks - Colors +--------------------------------------------------------------*/ + +.entry-content .has-pale-pink-color { + color: #f78da7; +} + +.entry-content .has-pale-pink-background-color, +.wp-block-button.is-style-outline .has-pale-pink-background-color:link { + background-color: #f78da7; +} + +.entry-content .has-vivid-red-color { + color: #cf2e2e; +} + +.entry-content .has-vivid-red-background-color, +.wp-block-button.is-style-outline .has-vivid-red-background-color:link { + background-color: #cf2e2e; +} + +.entry-content .has-luminous-vivid-orange-color { + color: #ff6900; +} + +.entry-content .has-luminous-vivid-orange-background-color, +.wp-block-button.is-style-outline .has-luminous-vivid-orange-background-color:link { + background-color: #ff6900; +} + +.entry-content .has-luminous-vivid-amber-color { + color: #fcb900; +} + +.entry-content .has-luminous-vivid-amber-background-color, +.wp-block-button.is-style-outline .has-luminous-vivid-amber-background-color:link { + background-color: #fcb900; +} + +.entry-content .has-light-green-cyan-color { + color: #7bdcb5; +} + +.entry-content .has-light-green-cyan-background-color, +.wp-block-button.is-style-outline .has-light-green-cyan-background-color:link { + background-color: #7bdcb5; +} + +.entry-content .has-vivid-green-cyan-color { + color: #00d084; +} + +.entry-content .has-vivid-green-cyan-background-color, +.wp-block-button.is-style-outline .has-vivid-green-cyan-background-color:link { + background-color: #00d084; +} + +.entry-content .has-pale-cyan-blue-color { + color: #8ed1fc; +} + +.entry-content .has-pale-cyan-blue-background-color, +.wp-block-button.is-style-outline .has-pale-cyan-blue-background-color:link { + background-color: #8ed1fc; +} + +.entry-content .has-vivid-cyan-blue-color { + color: #0693e3; +} + +.entry-content .has-vivid-cyan-blue-background-color, +.wp-block-button.is-style-outline .has-vivid-cyan-blue-background-color:link { + background-color: #0693e3; +} + +.entry-content .has-very-light-gray-color { + color: #eee; +} + +.entry-content .has-very-light-gray-background-color, +.wp-block-button.is-style-outline .has-very-light-gray-background-color:link { + background-color: #eee; +} + +.entry-content .has-cyan-bluish-gray-color { + color: #abb8c3; +} + +.entry-content .has-cyan-bluish-gray-background-color, +.wp-block-button.is-style-outline .has-cyan-bluish-gray-background-color:link { + background-color: #abb8c3; +} + +.entry-content .has-very-dark-gray-color { + color: #313131; +} + +.entry-content .has-very-dark-gray-background-color, +.wp-block-button.is-style-outline .has-very-dark-gray-background-color:link { + background-color: #313131; +} diff --git a/wp-content/themes/twentyseventeen/assets/css/colors-dark.css b/wp-content/themes/twentyseventeen/assets/css/colors-dark.css new file mode 100644 index 0000000..b1ed95a --- /dev/null +++ b/wp-content/themes/twentyseventeen/assets/css/colors-dark.css @@ -0,0 +1,566 @@ +/** + * Twenty Seventeen: Dark Color Scheme + * + * See inc/color-patterns.php for dynamic color overrides for the theme. + * + * Colors are ordered from light to dark. + */ + +.colors-dark button, +.colors-dark input[type="button"], +.colors-dark input[type="submit"], +.colors-dark .entry-footer .edit-link a.post-edit-link { + background-color: #fff; +} + +.colors-dark a:hover, +.colors-dark a:active, +.colors-dark .entry-content a:focus, +.colors-dark .entry-content a:hover, +.colors-dark .entry-summary a:focus, +.colors-dark .entry-summary a:hover, +.colors-dark .comment-content a:focus, +.colors-dark .comment-content a:hover, +.colors-dark .widget a:focus, +.colors-dark .widget a:hover, +.colors-dark .site-footer .widget-area a:focus, +.colors-dark .site-footer .widget-area a:hover, +.colors-dark .posts-navigation a:focus, +.colors-dark .posts-navigation a:hover, +.colors-dark .comment-metadata a:focus, +.colors-dark .comment-metadata a:hover, +.colors-dark .comment-metadata a.comment-edit-link:focus, +.colors-dark .comment-metadata a.comment-edit-link:hover, +.colors-dark .comment-reply-link:focus, +.colors-dark .comment-reply-link:hover, +.colors-dark .widget_authors a:focus strong, +.colors-dark .widget_authors a:hover strong, +.colors-dark .entry-title a:focus, +.colors-dark .entry-title a:hover, +.colors-dark .entry-meta a:focus, +.colors-dark .entry-meta a:hover, +.colors-dark.blog .entry-meta a.post-edit-link:focus, +.colors-dark.blog .entry-meta a.post-edit-link:hover, +.colors-dark.archive .entry-meta a.post-edit-link:focus, +.colors-dark.archive .entry-meta a.post-edit-link:hover, +.colors-dark.search .entry-meta a.post-edit-link:focus, +.colors-dark.search .entry-meta a.post-edit-link:hover, +.colors-dark .page-links a:focus .page-number, +.colors-dark .page-links a:hover .page-number, +.colors-dark .entry-footer .cat-links a:focus, +.colors-dark .entry-footer .cat-links a:hover, +.colors-dark .entry-footer .tags-links a:focus, +.colors-dark .entry-footer .tags-links a:hover, +.colors-dark .post-navigation a:focus, +.colors-dark .post-navigation a:hover, +.colors-dark .pagination a:not(.prev):not(.next):focus, +.colors-dark .pagination a:not(.prev):not(.next):hover, +.colors-dark .comments-pagination a:not(.prev):not(.next):focus, +.colors-dark .comments-pagination a:not(.prev):not(.next):hover, +.colors-dark .logged-in-as a:focus, +.colors-dark .logged-in-as a:hover, +.colors-dark a:focus .nav-title, +.colors-dark a:hover .nav-title, +.colors-dark .edit-link a:focus, +.colors-dark .edit-link a:hover, +.colors-dark .site-info a:focus, +.colors-dark .site-info a:hover, +.colors-dark .widget .widget-title a:focus, +.colors-dark .widget .widget-title a:hover, +.colors-dark .widget ul li a:focus, +.colors-dark .widget ul li a:hover { + color: #fff; +} + +.colors-dark .entry-content a:focus, +.colors-dark .entry-content a:hover, +.colors-dark .entry-summary a:focus, +.colors-dark .entry-summary a:hover, +.colors-dark .comment-content a:focus, +.colors-dark .comment-content a:hover, +.colors-dark .widget a:focus, +.colors-dark .widget a:hover, +.colors-dark .site-footer .widget-area a:focus, +.colors-dark .site-footer .widget-area a:hover, +.colors-dark .posts-navigation a:focus, +.colors-dark .posts-navigation a:hover, +.colors-dark .comment-metadata a:focus, +.colors-dark .comment-metadata a:hover, +.colors-dark .comment-metadata a.comment-edit-link:focus, +.colors-dark .comment-metadata a.comment-edit-link:hover, +.colors-dark .comment-reply-link:focus, +.colors-dark .comment-reply-link:hover, +.colors-dark .widget_authors a:focus strong, +.colors-dark .widget_authors a:hover strong, +.colors-dark .entry-title a:focus, +.colors-dark .entry-title a:hover, +.colors-dark .entry-meta a:focus, +.colors-dark .entry-meta a:hover, +.colors-dark.blog .entry-meta a.post-edit-link:focus, +.colors-dark.blog .entry-meta a.post-edit-link:hover, +.colors-dark.archive .entry-meta a.post-edit-link:focus, +.colors-dark.archive .entry-meta a.post-edit-link:hover, +.colors-dark.search .entry-meta a.post-edit-link:focus, +.colors-dark.search .entry-meta a.post-edit-link:hover, +.colors-dark .page-links a:focus .page-number, +.colors-dark .page-links a:hover .page-number, +.colors-dark .entry-footer .cat-links a:focus, +.colors-dark .entry-footer .cat-links a:hover, +.colors-dark .entry-footer .tags-links a:focus, +.colors-dark .entry-footer .tags-links a:hover, +.colors-dark .post-navigation a:focus, +.colors-dark .post-navigation a:hover, +.colors-dark .pagination a:not(.prev):not(.next):focus, +.colors-dark .pagination a:not(.prev):not(.next):hover, +.colors-dark .comments-pagination a:not(.prev):not(.next):focus, +.colors-dark .comments-pagination a:not(.prev):not(.next):hover, +.colors-dark .logged-in-as a:focus, +.colors-dark .logged-in-as a:hover, +.colors-dark a:focus .nav-title, +.colors-dark a:hover .nav-title, +.colors-dark .edit-link a:focus, +.colors-dark .edit-link a:hover, +.colors-dark .site-info a:focus, +.colors-dark .site-info a:hover, +.colors-dark .widget .widget-title a:focus, +.colors-dark .widget .widget-title a:hover, +.colors-dark .widget ul li a:focus, +.colors-dark .widget ul li a:hover { + -webkit-box-shadow: inset 0 0 0 rgba(255, 255, 255, 0), 0 3px 0 rgba(255, 255, 255, 1); /* Equivalant to #fff */ + box-shadow: inset 0 0 0 rgba(255, 255, 255, 0), 0 3px 0 rgba(255, 255, 255, 1); /* Equivalant to #fff */ +} + +.colors-dark .entry-content a, +.colors-dark .entry-summary a, +.colors-dark .comment-content a, +.colors-dark .widget a, +.colors-dark .site-footer .widget-area a, +.colors-dark .posts-navigation a, +.colors-dark .widget_authors a strong { + -webkit-box-shadow: inset 0 -1px 0 rgba(240, 240, 240, 1); /* Equivalant to #f0f0f0 */ + box-shadow: inset 0 -1px 0 rgba(240, 240, 240, 1); /* Equivalant to #f0f0f0 */ +} + +body.colors-dark, +.colors-dark button, +.colors-dark input, +.colors-dark select, +.colors-dark textarea, +.colors-dark h3, +.colors-dark h4, +.colors-dark h6, +.colors-dark label, +.colors-dark .entry-title a, +.colors-dark.twentyseventeen-front-page .panel-content .recent-posts article, +.colors-dark .entry-footer .cat-links a, +.colors-dark .entry-footer .tags-links a, +.colors-dark .format-quote blockquote, +.colors-dark .nav-title, +.colors-dark .comment-body { + color: #eee; +} + +/* Placeholder text color -- selectors need to be separate to work. */ +.colors-dark ::-webkit-input-placeholder { + color: #ddd; +} + +.colors-dark :-moz-placeholder { + color: #ddd; +} + +.colors-dark ::-moz-placeholder { + color: #ddd; +} + +.colors-dark :-ms-input-placeholder { + color: #ddd; +} + +.colors-dark input[type="text"]:focus, +.colors-dark input[type="email"]:focus, +.colors-dark input[type="url"]:focus, +.colors-dark input[type="password"]:focus, +.colors-dark input[type="search"]:focus, +.colors-dark input[type="number"]:focus, +.colors-dark input[type="tel"]:focus, +.colors-dark input[type="range"]:focus, +.colors-dark input[type="date"]:focus, +.colors-dark input[type="month"]:focus, +.colors-dark input[type="week"]:focus, +.colors-dark input[type="time"]:focus, +.colors-dark input[type="datetime"]:focus, +.colors-dark input[type="datetime-local"]:focus, +.colors-dark input[type="color"]:focus, +.colors-dark textarea:focus, +.bypostauthor > .comment-body > .comment-meta > .comment-author .avatar { + border-color: #eee; +} + +.colors-dark input[type="text"]:focus, +.colors-dark input[type="email"]:focus, +.colors-dark input[type="url"]:focus, +.colors-dark input[type="password"]:focus, +.colors-dark input[type="search"]:focus, +.colors-dark input[type="number"]:focus, +.colors-dark input[type="tel"]:focus, +.colors-dark input[type="range"]:focus, +.colors-dark input[type="date"]:focus, +.colors-dark input[type="month"]:focus, +.colors-dark input[type="week"]:focus, +.colors-dark input[type="time"]:focus, +.colors-dark input[type="datetime"]:focus, +.colors-dark input[type="datetime-local"]:focus, +.colors-dark input[type="color"]:focus, +.colors-dark textarea:focus, +.colors-dark button.secondary, +.colors-dark input[type="reset"], +.colors-dark input[type="button"].secondary, +.colors-dark input[type="reset"].secondary, +.colors-dark input[type="submit"].secondary, +.colors-dark a, +.colors-dark .site-title, +.colors-dark .site-title a, +.colors-dark .navigation-top a, +.colors-dark .dropdown-toggle, +.colors-dark .menu-toggle, +.colors-dark .page .panel-content .entry-title, +.colors-dark .page-title, +.colors-dark.page:not(.twentyseventeen-front-page) .entry-title, +.colors-dark .page-links a .page-number, +.colors-dark .comment-metadata a.comment-edit-link, +.colors-dark .comment-reply-link .icon, +.colors-dark h2.widget-title, +.colors-dark mark, +.colors-dark .post-navigation a:focus .icon, +.colors-dark .post-navigation a:hover .icon, +.colors-dark.blog .entry-meta a.post-edit-link, +.colors-dark.archive .entry-meta a.post-edit-link, +.colors-dark.search .entry-meta a.post-edit-link, +.colors-custom .twentyseventeen-panel .recent-posts .entry-header .edit-link { + color: #ddd; +} + +.colors-dark h2, +.colors-dark blockquote, +.colors-dark input[type="text"], +.colors-dark input[type="email"], +.colors-dark input[type="url"], +.colors-dark input[type="password"], +.colors-dark input[type="search"], +.colors-dark input[type="number"], +.colors-dark input[type="tel"], +.colors-dark input[type="range"], +.colors-dark input[type="date"], +.colors-dark input[type="month"], +.colors-dark input[type="week"], +.colors-dark input[type="time"], +.colors-dark input[type="datetime"], +.colors-dark input[type="datetime-local"], +.colors-dark input[type="color"], +.colors-dark textarea, +.colors-dark .navigation-top .current-menu-item > a, +.colors-dark .navigation-top .current_page_item > a, +.colors-dark .entry-content blockquote.alignleft, +.colors-dark .entry-content blockquote.alignright, +.colors-dark .taxonomy-description, +.colors-dark .site-info a, +.colors-dark .wp-caption { + color: #ccc; +} + +.colors-dark abbr, +.colors-dark acronym { + border-bottom-color: #ccc; +} + +.colors-dark h5, +.main-navigation a:hover, +.colors-dark .entry-meta, +.colors-dark .entry-meta a, +.colors-dark .nav-subtitle, +.colors-dark .comment-metadata, +.colors-dark .comment-metadata a, +.colors-dark .no-comments, +.colors-dark .comment-awaiting-moderation, +.colors-dark .page-numbers.current, +.colors-dark .page-links .page-number, +.colors-dark .site-description { + color: #bbb; +} + +.colors-dark :not( .mejs-button ) > button:hover, +.colors-dark :not( .mejs-button ) > button:focus, +.colors-dark input[type="button"]:hover, +.colors-dark input[type="button"]:focus, +.colors-dark input[type="submit"]:hover, +.colors-dark input[type="submit"]:focus, +.colors-dark .prev.page-numbers:focus, +.colors-dark .prev.page-numbers:hover, +.colors-dark .next.page-numbers:focus, +.colors-dark .next.page-numbers:hover, +.colors-dark .entry-footer .edit-link a.post-edit-link:focus, +.colors-dark .entry-footer .edit-link a.post-edit-link:hover { + background: #bbb; +} + +.colors-dark .social-navigation a:hover, +.colors-dark .social-navigation a:focus { + background: #999; + color: #222; +} + +.colors-dark .entry-footer .cat-links .icon, +.colors-dark .entry-footer .tags-links .icon { + color: #666; +} + +.colors-dark button.secondary:hover, +.colors-dark button.secondary:focus, +.colors-dark input[type="reset"]:hover, +.colors-dark input[type="reset"]:focus, +.colors-dark input[type="button"].secondary:hover, +.colors-dark input[type="button"].secondary:focus, +.colors-dark input[type="reset"].secondary:hover, +.colors-dark input[type="reset"].secondary:focus, +.colors-dark input[type="submit"].secondary:hover, +.colors-dark input[type="submit"].secondary:focus, +.colors-dark .social-navigation a, +.colors-dark hr { + background: #555; +} + +.colors-dark input[type="text"], +.colors-dark input[type="email"], +.colors-dark input[type="url"], +.colors-dark input[type="password"], +.colors-dark input[type="search"], +.colors-dark input[type="number"], +.colors-dark input[type="tel"], +.colors-dark input[type="range"], +.colors-dark input[type="date"], +.colors-dark input[type="month"], +.colors-dark input[type="week"], +.colors-dark input[type="time"], +.colors-dark input[type="datetime"], +.colors-dark input[type="datetime-local"], +.colors-dark input[type="color"], +.colors-dark textarea, +.colors-dark select, +.colors-dark fieldset, +.colors-dark .widget .tagcloud a:hover, +.colors-dark .widget .tagcloud a:focus, +.colors-dark .widget.widget_tag_cloud a:hover, +.colors-dark .widget.widget_tag_cloud a:focus, +.colors-dark .wp_widget_tag_cloud a:hover, +.colors-dark .wp_widget_tag_cloud a:focus { + border-color: #555; +} + +.colors-dark button.secondary, +.colors-dark input[type="reset"], +.colors-dark input[type="button"].secondary, +.colors-dark input[type="reset"].secondary, +.colors-dark input[type="submit"].secondary, +.colors-dark .prev.page-numbers, +.colors-dark .next.page-numbers { + background-color: #444; +} + +.colors-dark .widget .tagcloud a, +.colors-dark .widget.widget_tag_cloud a, +.colors-dark .wp_widget_tag_cloud a { + border-color: #444; +} + +.colors-dark.twentyseventeen-front-page article:not(.has-post-thumbnail):not(:first-child), +.colors-dark .widget ul li { + border-top-color: #444; +} + +.colors-dark .widget ul li { + border-bottom-color: #444; +} + +.colors-dark pre, +.colors-dark mark, +.colors-dark ins, +.colors-dark input[type="text"], +.colors-dark input[type="email"], +.colors-dark input[type="url"], +.colors-dark input[type="password"], +.colors-dark input[type="search"], +.colors-dark input[type="number"], +.colors-dark input[type="tel"], +.colors-dark input[type="range"], +.colors-dark input[type="date"], +.colors-dark input[type="month"], +.colors-dark input[type="week"], +.colors-dark input[type="time"], +.colors-dark input[type="datetime"], +.colors-dark input[type="datetime-local"], +.colors-dark input[type="color"], +.colors-dark textarea, +.colors-dark select, +.colors-dark fieldset { + background: #333; +} + +.colors-dark tr, +.colors-dark thead th { + border-color: #333; +} + +.colors-dark .navigation-top, +.colors-dark .main-navigation > div > ul, +.colors-dark .pagination, +.colors-dark .comment-navigation, +.colors-dark .entry-footer, +.colors-dark .site-footer { + border-top-color: #333; +} + +.colors-dark .single-featured-image-header, +.colors-dark .navigation-top, +.colors-dark .main-navigation li, +.colors-dark .entry-footer, +.colors-dark #comments { + border-bottom-color: #333; +} + +.colors-dark .site-header, +.colors-dark .single-featured-image-header { + background-color: #262626; +} + +.colors-dark button, +.colors-dark input[type="button"], +.colors-dark input[type="submit"], +.colors-dark .prev.page-numbers:focus, +.colors-dark .prev.page-numbers:hover, +.colors-dark .next.page-numbers:focus, +.colors-dark .next.page-numbers:hover { + color: #222; +} + +body.colors-dark, +.colors-dark .site-content-contain, +.colors-dark .navigation-top, +.colors-dark .main-navigation ul { + background: #222; +} + +.colors-dark .entry-title a, +.colors-dark .entry-meta a, +.colors-dark.blog .entry-meta a.post-edit-link, +.colors-dark.archive .entry-meta a.post-edit-link, +.colors-dark.search .entry-meta a.post-edit-link, +.colors-dark .page-links a, +.colors-dark .page-links a .page-number, +.colors-dark .entry-footer a, +.colors-dark .entry-footer .cat-links a, +.colors-dark .entry-footer .tags-links a, +.colors-dark .edit-link a, +.colors-dark .post-navigation a, +.colors-dark .logged-in-as a, +.colors-dark .comment-navigation a, +.colors-dark .comment-metadata a, +.colors-dark .comment-metadata a.comment-edit-link, +.colors-dark .comment-reply-link, +.colors-dark a .nav-title, +.colors-dark .pagination a, +.colors-dark .comments-pagination a, +.colors-dark .widget .widget-title a, +.colors-dark .widget ul li a, +.colors-dark .site-footer .widget-area ul li a, +.colors-dark .site-info a { + -webkit-box-shadow: inset 0 -1px 0 rgba(34, 34, 34, 1); /* Equivalant to #222 */ + box-shadow: inset 0 -1px 0 rgba(34, 34, 34, 1); /* Equivalant to #222 */ +} + +/* Fixes linked images */ +.colors-dark .entry-content a img, +.colors-dark .comment-content a img, +.colors-dark .widget a img { + -webkit-box-shadow: 0 0 0 8px #222; + box-shadow: 0 0 0 8px #222; +} + +.colors-dark .entry-footer .edit-link a.post-edit-link { + color: #000; +} + +.colors-dark .menu-toggle, +.colors-dark .menu-toggle:hover, +.colors-dark .menu-toggle:focus, +.colors-dark .dropdown-toggle, +.colors-dark .dropdown-toggle:hover, +.colors-dark .dropdown-toggle:focus, +.colors-dark .menu-scroll-down, +.colors-dark .menu-scroll-down:hover, +.colors-dark .menu-scroll-down:focus { + background-color: transparent; +} + +.colors-dark .gallery-item a, +.colors-dark .gallery-item a:hover, +.colors-dark .gallery-item a:focus, +.colors-dark .widget .tagcloud a, +.colors-dark .widget .tagcloud a:focus, +.colors-dark .widget .tagcloud a:hover, +.colors-dark .widget.widget_tag_cloud a, +.colors-dark .widget.widget_tag_cloud a:focus, +.colors-dark .widget.widget_tag_cloud a:hover, +.colors-dark .wp_widget_tag_cloud a, +.colors-dark .wp_widget_tag_cloud a:focus, +.colors-dark .wp_widget_tag_cloud a:hover, +.colors-dark .entry-footer .edit-link a.post-edit-link:focus, +.colors-dark .entry-footer .edit-link a.post-edit-link:hover { + -webkit-box-shadow: none; + box-shadow: none; +} + +@media screen and (min-width: 48em) { + + .colors-dark .nav-links .nav-previous .nav-title .icon, + .colors-dark .nav-links .nav-next .nav-title .icon { + color: #eee; + } + + .colors-dark .main-navigation li li:hover, + .colors-dark .main-navigation li li.focus { + background: #999; + } + + .colors-dark .menu-scroll-down { + color: #999; + } + + .colors-dark .main-navigation ul ul { + border-color: #333; + background: #222; + } + + .colors-dark .main-navigation ul li.menu-item-has-children:before, + .colors-dark .main-navigation ul li.page_item_has_children:before { + border-bottom-color: #333; + } + + .main-navigation ul li.menu-item-has-children:after, + .main-navigation ul li.page_item_has_children:after { + border-bottom-color: #222; + } + + .colors-dark .main-navigation li li.focus > a, + .colors-dark .main-navigation li li:focus > a, + .colors-dark .main-navigation li li:hover > a, + .colors-dark .main-navigation li li a:hover, + .colors-dark .main-navigation li li a:focus, + .colors-dark .main-navigation li li.current_page_item a:hover, + .colors-dark .main-navigation li li.current-menu-item a:hover, + .colors-dark .main-navigation li li.current_page_item a:focus, + .colors-dark .main-navigation li li.current-menu-item a:focus { + color: #222; + } + +} diff --git a/wp-content/themes/twentyseventeen/assets/css/editor-blocks.css b/wp-content/themes/twentyseventeen/assets/css/editor-blocks.css new file mode 100644 index 0000000..35c34bc --- /dev/null +++ b/wp-content/themes/twentyseventeen/assets/css/editor-blocks.css @@ -0,0 +1,808 @@ +/* +Theme Name: Twenty Seventeen +Description: Used to style blocks in the editor. +*/ + +/*-------------------------------------------------------------- +>>> TABLE OF CONTENTS: +---------------------------------------------------------------- +1.0 General Typography +2.0 General Block Settings +3.0 Blocks - Common Blocks +4.0 Blocks - Formatting +5.0 Blocks - Layout Elements +6.0 Blocks - Widgets + +--------------------------------------------------------------*/ + +/*-------------------------------------------------------------- +1.0 General Typography +--------------------------------------------------------------*/ + +.edit-post-visual-editor .editor-block-list__block, +.editor-default-block-appender textarea.editor-default-block-appender__content { + font-size: 15px; + font-size: 0.9375rem; +} + +.editor-default-block-appender textarea.editor-default-block-appender__content { + font-family: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif; +} + +.edit-post-visual-editor .editor-block-list__block { + color: #333; +} + +.editor-post-title__block .editor-post-title__input { + color: #333; + font-family: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif; + font-size: 20px; + font-size: 1.25rem; + font-weight: 300; +} + +@media screen and (min-width: 30em) { + + .edit-post-visual-editor .editor-block-list__block { + font-size: 18px; + font-size: 1.125rem; + } + + .editor-post-title__block .editor-post-title__input { + font-size: 26px; + font-size: 1.625rem; + } + + .edit-post-visual-editor .editor-block-list__block h1 { + font-size: 30px; + font-size: 1.875rem; + } + + .edit-post-visual-editor .editor-block-list__block h2 { + font-size: 26px; + font-size: 1.625rem; + } + + .edit-post-visual-editor .editor-block-list__block h3 { + font-size: 22px; + font-size: 1.375rem; + } + + .edit-post-visual-editor .editor-block-list__block h4 { + font-size: 18px; + font-size: 1.125rem; + } + + .edit-post-visual-editor .editor-block-list__block h5 { + font-size: 13px; + font-size: 0.8125rem; + } + + .edit-post-visual-editor .editor-block-list__block h6 { + font-size: 16px; + font-size: 1rem; + } +} + +@media screen and (min-width: 48em) { + + .edit-post-visual-editor .editor-block-list__block { + font-size: 16px; + font-size: 1rem; + } + + .editor-rich-text__tinymce.mce-content-body { + line-height: 1.5; + } +} + +/* Typography for Arabic Font */ + +html[lang="ar"] .edit-post-visual-editor .editor-block-list__block, +html[lang="ary"] .edit-post-visual-editor .editor-block-list__block, +html[lang="azb"] .edit-post-visual-editor .editor-block-list__block, +html[lang="fa-IR"] .edit-post-visual-editor .editor-block-list__block, +html[lang="haz"] .edit-post-visual-editor .editor-block-list__block, +html[lang="ps"] .edit-post-visual-editor .editor-block-list__block, +html[lang="ur"] .edit-post-visual-editor .editor-block-list__block { + font-family: Tahoma, Arial, sans-serif; +} + +html[lang="ar"] .edit-post-visual-editor h1, +html[lang="ar"] .edit-post-visual-editor h2, +html[lang="ar"] .edit-post-visual-editor h3, +html[lang="ar"] .edit-post-visual-editor h4, +html[lang="ar"] .edit-post-visual-editor h5, +html[lang="ar"] .edit-post-visual-editor h6, +html[lang="ary"] .edit-post-visual-editor h1, +html[lang="ary"] .edit-post-visual-editor h2, +html[lang="ary"] .edit-post-visual-editor h3, +html[lang="ary"] .edit-post-visual-editor h4, +html[lang="ary"] .edit-post-visual-editor h5, +html[lang="ary"] .edit-post-visual-editor h6, +html[lang="azb"] .edit-post-visual-editor h1, +html[lang="azb"] .edit-post-visual-editor h2, +html[lang="azb"] .edit-post-visual-editor h3, +html[lang="azb"] .edit-post-visual-editor h4, +html[lang="azb"] .edit-post-visual-editor h5, +html[lang="azb"] .edit-post-visual-editor h6, +html[lang="fa-IR"] .edit-post-visual-editor h1, +html[lang="fa-IR"] .edit-post-visual-editor h2, +html[lang="fa-IR"] .edit-post-visual-editor h3, +html[lang="fa-IR"] .edit-post-visual-editor h4, +html[lang="fa-IR"] .edit-post-visual-editor h5, +html[lang="fa-IR"] .edit-post-visual-editor h6, +html[lang="haz"] .edit-post-visual-editor h1, +html[lang="haz"] .edit-post-visual-editor h2, +html[lang="haz"] .edit-post-visual-editor h3, +html[lang="haz"] .edit-post-visual-editor h4, +html[lang="haz"] .edit-post-visual-editor h5, +html[lang="haz"] .edit-post-visual-editor h6, +html[lang="ps"] .edit-post-visual-editor h1, +html[lang="ps"] .edit-post-visual-editor h2, +html[lang="ps"] .edit-post-visual-editor h3, +html[lang="ps"] .edit-post-visual-editor h4, +html[lang="ps"] .edit-post-visual-editor h5, +html[lang="ps"] .edit-post-visual-editor h6, +html[lang="ur"] .edit-post-visual-editor h1, +html[lang="ur"] .edit-post-visual-editor h2, +html[lang="ur"] .edit-post-visual-editor h3, +html[lang="ur"] .edit-post-visual-editor h4, +html[lang="ur"] .edit-post-visual-editor h5, +html[lang="ur"] .edit-post-visual-editor h6 { + font-weight: 700; +} + +/* Typography for Chinese Font */ + +html[lang^="zh-"] .edit-post-visual-editor .editor-block-list__block { + font-family: "PingFang TC", "Helvetica Neue", Helvetica, STHeitiTC-Light, Arial, sans-serif; +} + +html[lang="zh-CN"] .edit-post-visual-editor .editor-block-list__block { + font-family: "PingFang SC", "Helvetica Neue", Helvetica, STHeitiSC-Light, Arial, sans-serif; +} + +html[lang^="zh-"] .edit-post-visual-editor h1, +html[lang^="zh-"] .edit-post-visual-editor h2, +html[lang^="zh-"] .edit-post-visual-editor h3, +html[lang^="zh-"] .edit-post-visual-editor h4, +html[lang^="zh-"] .edit-post-visual-editor h5, +html[lang^="zh-"] .edit-post-visual-editor h6 { + font-weight: 700; +} + +/* Typography for Cyrillic Font */ + +html[lang="bg-BG"] .edit-post-visual-editor .editor-block-list__block, +html[lang="ru-RU"] .edit-post-visual-editor .editor-block-list__block, +html[lang="uk"] .edit-post-visual-editor .editor-block-list__block { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +html[lang="bg-BG"] .edit-post-visual-editor h1, +html[lang="bg-BG"] .edit-post-visual-editor h2, +html[lang="bg-BG"] .edit-post-visual-editor h3, +html[lang="bg-BG"] .edit-post-visual-editor h4, +html[lang="bg-BG"] .edit-post-visual-editor h5, +html[lang="bg-BG"] .edit-post-visual-editor h6, +html[lang="ru-RU"] .edit-post-visual-editor h1, +html[lang="ru-RU"] .edit-post-visual-editor h2, +html[lang="ru-RU"] .edit-post-visual-editor h3, +html[lang="ru-RU"] .edit-post-visual-editor h4, +html[lang="ru-RU"] .edit-post-visual-editor h5, +html[lang="ru-RU"] .edit-post-visual-editor h6, +html[lang="uk"] .edit-post-visual-editor h1, +html[lang="uk"] .edit-post-visual-editor h2, +html[lang="uk"] .edit-post-visual-editor h3, +html[lang="uk"] .edit-post-visual-editor h4, +html[lang="uk"] .edit-post-visual-editor h5, +html[lang="uk"] .edit-post-visual-editor h6 { + font-weight: 700; + line-height: 1.2; +} + +/* Typography for Devanagari Font */ + +html[lang="bn-BD"] .edit-post-visual-editor .editor-block-list__block, +html[lang="hi-IN"] .edit-post-visual-editor .editor-block-list__block, +html[lang="mr-IN"] .edit-post-visual-editor .editor-block-list__block { + font-family: Arial, sans-serif; +} + +html[lang="bn-BD"] .edit-post-visual-editor h1, +html[lang="bn-BD"] .edit-post-visual-editor h2, +html[lang="bn-BD"] .edit-post-visual-editor h3, +html[lang="bn-BD"] .edit-post-visual-editor h4, +html[lang="bn-BD"] .edit-post-visual-editor h5, +html[lang="bn-BD"] .edit-post-visual-editor h6, +html[lang="hi-IN"] .edit-post-visual-editor h1, +html[lang="hi-IN"] .edit-post-visual-editor h2, +html[lang="hi-IN"] .edit-post-visual-editor h3, +html[lang="hi-IN"] .edit-post-visual-editor h4, +html[lang="hi-IN"] .edit-post-visual-editor h5, +html[lang="hi-IN"] .edit-post-visual-editor h6, +html[lang="mr-IN"] .edit-post-visual-editor h1, +html[lang="mr-IN"] .edit-post-visual-editor h2, +html[lang="mr-IN"] .edit-post-visual-editor h3, +html[lang="mr-IN"] .edit-post-visual-editor h4, +html[lang="mr-IN"] .edit-post-visual-editor h5, +html[lang="mr-IN"] .edit-post-visual-editor h6 { + font-weight: 700; +} + +/* Typography for Greek Font */ + +html[lang="el"] .edit-post-visual-editor .editor-block-list__block { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +html[lang="el"] .edit-post-visual-editor h1, +html[lang="el"] .edit-post-visual-editor h2, +html[lang="el"] .edit-post-visual-editor h3, +html[lang="el"] .edit-post-visual-editor h4, +html[lang="el"] .edit-post-visual-editor h5, +html[lang="el"] .edit-post-visual-editor h6 { + font-weight: 700; + line-height: 1.3; +} + +/* Typography for Gujarati Font */ + +html[lang="gu-IN"] .edit-post-visual-editor .editor-block-list__block { + font-family: Arial, sans-serif; +} + +html[lang="gu-IN"] .edit-post-visual-editor h1, +html[lang="gu-IN"] .edit-post-visual-editor h2, +html[lang="gu-IN"] .edit-post-visual-editor h3, +html[lang="gu-IN"] .edit-post-visual-editor h4, +html[lang="gu-IN"] .edit-post-visual-editor h5, +html[lang="gu-IN"] .edit-post-visual-editor h6 { + font-weight: 700; +} + +/* Typography for Hebrew Font */ + +html[lang="he-IL"] .edit-post-visual-editor .editor-block-list__block { + font-family: "Arial Hebrew", Arial, sans-serif; +} + +html[lang="he-IL"] .edit-post-visual-editor h1, +html[lang="he-IL"] .edit-post-visual-editor h2, +html[lang="he-IL"] .edit-post-visual-editor h3, +html[lang="he-IL"] .edit-post-visual-editor h4, +html[lang="he-IL"] .edit-post-visual-editor h5, +html[lang="he-IL"] .edit-post-visual-editor h6 { + font-weight: 700; +} + +/* Typography for Japanese Font */ + +html[lang="ja"] .edit-post-visual-editor .editor-block-list__block { + font-family: "Hiragino Kaku Gothic Pro", Meiryo, sans-serif; +} + +html[lang="ja"] .edit-post-visual-editor h1, +html[lang="ja"] .edit-post-visual-editor h2, +html[lang="ja"] .edit-post-visual-editor h3, +html[lang="ja"] .edit-post-visual-editor h4, +html[lang="ja"] .edit-post-visual-editor h5, +html[lang="ja"] .edit-post-visual-editor h6 { + font-weight: 700; +} + +/* Typography for Korean font */ + +html[lang="ko-KR"] .edit-post-visual-editor .editor-block-list__block { + font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; +} + +html[lang="ko-KR"] .edit-post-visual-editor h1, +html[lang="ko-KR"] .edit-post-visual-editor h2, +html[lang="ko-KR"] .edit-post-visual-editor h3, +html[lang="ko-KR"] .edit-post-visual-editor h4, +html[lang="ko-KR"] .edit-post-visual-editor h5, +html[lang="ko-KR"] .edit-post-visual-editor h6 { + font-weight: 600; +} + +/* Typography for Thai Font */ + +html[lang="th"] .edit-post-visual-editor .editor-block-list__block { + line-height: 1.8; + font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +html[lang="th"] .edit-post-visual-editor h1, +html[lang="th"] .edit-post-visual-editor h2, +html[lang="th"] .edit-post-visual-editor h3, +html[lang="th"] .edit-post-visual-editor h4, +html[lang="th"] .edit-post-visual-editor h5, +html[lang="th"] .edit-post-visual-editor h6 { + line-height: 1.65; + font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +/* Remove letter-spacing for all non-latin alphabets */ + +html[lang="ar"] .edit-post-visual-editor *, +html[lang="ary"] .edit-post-visual-editor *, +html[lang="azb"] .edit-post-visual-editor *, +html[lang="haz"] .edit-post-visual-editor *, +html[lang="ps"] .edit-post-visual-editor *, +html[lang^="zh-"] .edit-post-visual-editor *, +html[lang="bg-BG"] .edit-post-visual-editor *, +html[lang="ru-RU"] .edit-post-visual-editor *, +html[lang="uk"] .edit-post-visual-editor *, +html[lang="bn-BD"] .edit-post-visual-editor *, +html[lang="hi-IN"] .edit-post-visual-editor *, +html[lang="mr-IN"] .edit-post-visual-editor *, +html[lang="el"] .edit-post-visual-editor *, +html[lang="gu-IN"] .edit-post-visual-editor *, +html[lang="he-IL"] .edit-post-visual-editor *, +html[lang="ja"] .edit-post-visual-editor *, +html[lang="ko-KR"] .edit-post-visual-editor *, +html[lang="th"] .edit-post-visual-editor * { + letter-spacing: 0 !important; +} + +/*-------------------------------------------------------------- +2.0 General Block Settings +--------------------------------------------------------------*/ + +/* Main column width */ + +.editor-styles-wrapper { + max-width: 100% !important; /* Override where editor-style.css is affecting this. */ +} + +.wp-block { + max-width: 674px; /* Based on one-column post width; 644px + 30px to account for padding. */ +} + +/* Alignments */ + +.edit-post-visual-editor .alignleft { + margin-right: 1.5em; +} + +.edit-post-visual-editor .alignright { + margin-left: 1.5em; +} + +/* Link styles */ + +.edit-post-visual-editor a, +.editor-block-list__block a, +.wp-block-freeform.block-library-rich-text__tinymce a { + color: #222; +} + +/* List styles */ + +.edit-post-visual-editor ul:not(.wp-block-gallery), +.editor-block-list__block ul:not(.wp-block-gallery), +.block-library-list ul, +.edit-post-visual-editor ol, +.editor-block-list__block ol, +.block-library-list ol, +.block-library-list .editor-rich-text__tinymce { + margin: 0 0 1.5em 1.5em; + padding: 0; +} + +.edit-post-visual-editor ul:not(.wp-block-gallery), +.editor-block-list__block ul:not(.wp-block-gallery), +.block-library-list ul { + list-style: disc; +} + +.edit-post-visual-editor ol, +.editor-block-list__block ol, +.block-library-list ol { + list-style: decimal; +} + +.edit-post-visual-editor li > ul:not(.wp-block-gallery), +.editor-block-list__block li > ul:not(.wp-block-gallery), +.block-library-list li > ul:not(.wp-block-gallery), +.edit-post-visual-editor li > ol, +.editor-block-list__block li > ol, +.block-library-list li > ol { + margin-bottom: 0; + margin-left: 1.5em; +} + +.edit-post-visual-editor li, +.editor-block-list__block li, +.block-library-list li { + margin: 0; +} + +.rtl .edit-post-visual-editor ul:not(.wp-block-gallery), +.rtl .editor-block-list__block ul:not(.wp-block-gallery), +.rtl .block-library-list ul, +.rtl .edit-post-visual-editor ol, +.rtl .editor-block-list__block ol, +.rtl .block-library-list ol, +.rtl .block-library-list .editor-rich-text__tinymce, +.rtl .edit-post-visual-editor li > ul:not(.wp-block-gallery), +.rtl .editor-block-list__block li > ul:not(.wp-block-gallery), +.rtl .block-library-list li > ul:not(.wp-block-gallery), +.rtl .edit-post-visual-editor li > ol, +.rtl .editor-block-list__block li > ol, +.rtl .block-library-list li > ol { + margin-left: 1.5em; + margin-right: 1.5em; +} + +/* Quote styles */ + +.editor-block-list__block blockquote p { + font-size: 18px; + font-size: 1.125rem; +} + +.editor-block-list__block blockquote.alignright p, +.editor-block-list__block blockquote.alignleft p { + font-size: 13px; + font-size: 0.8125rem; +} + +.editor-block-list__block blockquote cite { + display: block; + font-style: normal; + font-weight: 600; + margin-top: 0.5em; +} + +/* Caption styles*/ + +[class^="wp-block-"]:not(.wp-block-gallery) figcaption { + font-style: italic; + margin-bottom: 1.5em; + text-align: left; +} + +.rtl [class^="wp-block-"]:not(.wp-block-gallery) figcaption { + text-align: right; +} + +/* Code styles */ + +.wp-block-freeform.block-library-rich-text__tinymce code { + background: transparent; +} + +/* Table styles */ + +.rtl .editor-block-list__block th { + text-align: right; +} + +/*-------------------------------------------------------------- +3.0 Blocks - Common Blocks +--------------------------------------------------------------*/ + +/* Paragraph */ + +.wp-block-paragraph.has-drop-cap:not(:focus)::first-letter { + font-size: 5em; + margin-top: 0.075em; +} + +.wp-block-paragraph.has-background { + padding: 20px 30px; +} + +/* Gallery */ + +.wp-block-gallery figcaption { + font-style: italic; +} + +/* Quote */ + +.wp-block-quote { + color: #666; + font-size: 18px; + font-size: 1.125rem; + font-style: italic; + line-height: 1.7; +} + +.wp-block-quote:not(.is-large):not(.is-style-large) { + border: 0; + padding: 0; +} + +.editor-block-list__block .wp-block-quote .wp-block-quote__citation { + color: inherit; + display: block; + font-size: inherit; + font-style: normal; + font-weight: 600; + margin-top: 0.5em; +} + +.wp-block-quote.alignleft, +.wp-block-quote.alignright { + color: #666; + width: 48%; +} + +.editor-block-list__block .wp-block-quote.alignleft p, +.editor-block-list__block .wp-block-quote.alignright p, +.editor-block-list__block .wp-block-quote.alignleft .wp-block-quote__citation, +.editor-block-list__block .wp-block-quote.alignright .wp-block-quote__citation { + font-size: 13px; + font-size: 0.8125rem; +} + +.editor-block-list__block .wp-block-quote.alignleft p:last-of-type, +.editor-block-list__block .wp-block-quote.alignright p:last-of-type { + margin-bottom: 0; +} + +.wp-block-quote.is-large .wp-block-quote__citation, +.wp-block-quote.is-style-large .wp-block-quote__citation { + text-align: right; +} + +.rtl .wp-block-quote.is-large .wp-block-quote__citation, +.rtl .wp-block-quote.is-style-large .wp-block-quote__citation { + text-align: left; +} + +@media screen and (min-width: 30em) { + .editor-block-list__block .wp-block-quote.alignleft p, + .editor-block-list__block .wp-block-quote.alignright p, + .editor-block-list__block .wp-block-quote.alignleft .wp-block-quote__citation, + .editor-block-list__block .wp-block-quote.alignright .wp-block-quote__citation, + .editor-block-list__block .wp-block-quote footer { + font-size: 14px; + font-size: 0.875rem; + } +} + +@media screen and (min-width: 48em) { + .editor-block-list__block .wp-block-quote.alignleft p, + .editor-block-list__block .wp-block-quote.alignright p, + .editor-block-list__block .wp-block-quote.alignleft .wp-block-quote__citation, + .editor-block-list__block .wp-block-quote.alignright .wp-block-quote__citation { + font-size: 13px; + font-size: 0.8125rem; + } + + .editor-block-list__block .wp-block-quote.alignleft { + margin-left: -17.5%; + width: 48%; + } + + .editor-block-list__block .wp-block-quote.alignright { + margin-right: -17.5%; + width: 48%; + } +} + +/* File */ + +.wp-block-file .wp-block-file__textlink { + -webkit-box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 1px 0 rgba(0, 0, 0, 1); + box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 1px 0 rgba(0, 0, 0, 1); +} + +.wp-block-file .wp-block-file__button { + background-color: #222; + -webkit-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: none; + box-shadow: none; + color: #fff; + display: inline-block; + font-size: 14px; + font-size: 0.875rem; + font-weight: 800; + padding: 0.7em 2em; + -webkit-transition: background-color 0.2s ease-in-out; + transition: background-color 0.2s ease-in-out; + white-space: nowrap; +} + +/*-------------------------------------------------------------- +4.0 Blocks - Formatting +--------------------------------------------------------------*/ + +/* Code */ + +.wp-block-code { + border: 0; + padding: 0; +} + +/* Classic */ + +.wp-block-freeform.block-library-rich-text__tinymce li, +.wp-block-freeform.block-library-rich-text__tinymce p { + line-height: 1.5; +} + +.wp-block-freeform.block-library-rich-text__tinymce blockquote { + border: 0; + padding: 0; +} + +/* Pullquote */ + +.wp-block-pullquote { + border: 0; +} + +.wp-block-pullquote.alignleft blockquote > .editor-rich-text p, +.wp-block-pullquote.alignright blockquote > .editor-rich-text p { + font-size: 20px; +} + + +.wp-block-pullquote .wp-block-pullquote__citation { + font-size: inherit; + font-weight: 600; + text-transform: none; +} + +/* Table */ + +table.wp-block-table { + border-collapse: collapse; + margin: 0 0 1.5em; + width: 100%; +} + +table.wp-block-table thead th { + border: 0; + border-bottom: 2px solid #bbb; + padding-bottom: 0.5em; +} + +table.wp-block-table th { + padding: 0.4em; + text-align: left; +} + +table.wp-block-table tr { + border-bottom: 1px solid #eee; +} + +table.wp-block-table th, +table.wp-block-table td { + border: 0; + padding: 0.4em; +} + +table.wp-block-table th:first-child, +table.wp-block-table td:first-child { + padding-left: 0; +} + +table.wp-block-table th:last-child, +table.wp-block-table td:last-child { + padding-right: 0; +} + +.wp-block-table__cell-content { + padding: 0; +} + +.rtl table.wp-block-table th, +.rtl table.wp-block-table td { + text-align: right; +} + +/*-------------------------------------------------------------- +5.0 Blocks - Layout Elements +--------------------------------------------------------------*/ + +/* Separator */ + +.edit-post-visual-editor .wp-block-separator { + border: 0; +} + +/* Buttons */ + +.wp-block-button .wp-block-button__link { + -webkit-box-shadow: none; + box-shadow: none; + display: inline-block; + font-size: 14px; + font-size: 0.875rem; + font-weight: 800; + line-height: 1.66; + margin-top: 2em; + padding: 0.7em 2em; + -webkit-transition: background-color 0.2s ease-in-out; + transition: background-color 0.2s ease-in-out; + white-space: nowrap; +} + +.wp-block-button .wp-block-button__link[data-is-placeholder-visible="true"] { + height: auto; +} + +.wp-block-button__link { + background-color: #222; + color: #fff; +} + +.is-style-outline .wp-block-button__link { + color: #222; +} + +/* Media & Text */ + +.wp-block-media-text *:last-child { + margin-bottom: 0; +} + +/*-------------------------------------------------------------- +6.0 Blocks - Widgets +--------------------------------------------------------------*/ + +/* Archives, Categories & Latest Posts */ + +[data-align="center"] .wp-block-archives ul, +[data-align="center"] .wp-block-categories ul, +[data-align="center"] .wp-block-latest-posts ul { + list-style-position: inside; +} + +/* Latest Comments */ + +.editor-block-list__block ol.wp-block-latest-comments > li:before { + content: ''; +} + +.wp-block-latest-comments article { + margin-bottom: 4em; +} + +.wp-block-latest-comments .avatar, +.wp-block-latest-comments__comment-avatar { + border-radius: 0; +} + +.wp-block-latest-comments__comment-meta { + font-size: 16px; + font-size: 1rem; + margin-bottom: 0.4em; +} + +.editor-block-list__block .wp-block-latest-comments__comment-meta a { + -webkit-box-shadow: none; + box-shadow: none; + font-weight: 700; +} + +.wp-block-latest-comments__comment-date { + color: #767676; + font-size: 10px; + font-size: 0.625rem; + font-weight: 800; + letter-spacing: 0.1818em; + margin-top: 0.4em; + text-transform: uppercase; +} + +.editor-block-list__block .wp-block-latest-comments__comment-excerpt p { + font-size: 14px; + font-size: 0.875rem; +} + +/* Latest Posts */ + +.edit-post-visual-editor .wp-block-latest-posts.is-grid { + list-style: none; + margin-left: 0; + margin-right: 0; +} diff --git a/wp-content/themes/twentyseventeen/assets/css/editor-style.css b/wp-content/themes/twentyseventeen/assets/css/editor-style.css new file mode 100644 index 0000000..52e08f8 --- /dev/null +++ b/wp-content/themes/twentyseventeen/assets/css/editor-style.css @@ -0,0 +1,582 @@ +/* +Theme Name: Twenty Seventeen +Description: Used to style the TinyMCE editor. +*/ + + +/** + * Table of Contents: + * + * 1.0 - Body + * 2.0 - Typography + * 3.0 - Elements + * 4.0 - Alignment + * 5.0 - Caption + * 6.0 - Galleries + * 7.0 - Media Elements + * 8.0 - RTL + */ + +/** + * 1.0 - Body + */ + +body { + background-color: #fff; + color: #333; + margin: 20px 40px; + max-width: 580px; +} + +/** + * 2.0 - Typography + */ + +body, +button, +input, +select, +textarea { + font-family: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif; + font-size: 16px; + font-size: 1rem; + font-weight: 400; + line-height: 1.66; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + clear: both; + line-height: 1.4; + margin: 0 0 0.75em; + padding: 1.5em 0 0; +} + +h1:first-child, +h2:first-child, +h3:first-child, +h4:first-child, +h5:first-child, +h6:first-child { + padding-top: 0; +} + +h1 { + font-size: 24px; + font-size: 1.5rem; + font-weight: 300; +} + +h2 { + color: #666; + font-size: 20px; + font-size: 1.25rem; + font-weight: 300; +} + +h3 { + color: #333; + font-size: 18px; + font-size: 1.125rem; + font-weight: 300; +} + +h4 { + color: #333; + font-size: 16px; + font-size: 1rem; + font-weight: 800; +} + +h5 { + color: #767676; + font-size: 13px; + font-size: 0.8125rem; + font-weight: 800; + letter-spacing: 0.15em; + text-transform: uppercase; +} + +h6 { + color: #333; + font-size: 15px; + font-size: 0.9375rem; + font-weight: 800; +} + +p { + margin: 0 0 1.5em; + padding: 0; +} + +dfn, +cite, +em, +i { + font-style: italic; +} + +blockquote { + color: #666; + font-size: 18px; + font-size: 1.125rem; + font-style: italic; + line-height: 1.7; + margin: 0; + overflow: hidden; + padding: 0; +} + +blockquote.alignleft, +blockquote.alignright { + font-size: 14px; + font-size: 0.875rem; + width: 34%; +} + +address { + margin: 0 0 1.5em; +} + +pre { + background: #eee; + font-family: "Courier 10 Pitch", Courier, monospace; + font-size: 15px; + font-size: 0.9375rem; + line-height: 1.6; + margin-bottom: 1.6em; + max-width: 100%; + overflow: auto; + padding: 1.6em; +} + +code, +kbd, +tt, +var { + font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; + font-size: 15px; + font-size: 0.9375rem; +} + +abbr, +acronym { + border-bottom: 1px dotted #666; + cursor: help; +} + +mark, +ins { + background: #eee; + text-decoration: none; +} + +big { + font-size: 125%; +} + +blockquote, +q { + quotes: "" ""; +} + +blockquote:before, +blockquote:after, +q:before, +q:after { + content: ""; +} + +/* Typography for Thai Font */ + +html[lang="th"] h1, +html[lang="th"] h2, +html[lang="th"] h3, +html[lang="th"] h4, +html[lang="th"] h5, +html[lang="th"] h6 { + letter-spacing: 0; + line-height: 1.65; +} + +html[lang="th"] body, +html[lang="th"] button, +html[lang="th"] input, +html[lang="th"] select, +html[lang="th"] textarea { + line-height: 1.8; +} + +/** + * 3.0 - Elements + */ + +hr { + background-color: #bbb; + border: 0; + height: 1px; + margin-bottom: 1.5em; +} + +ul, +ol { + margin: 0 0 1.5em; + padding: 0; +} + +ul { + list-style: disc; +} + +ol > li { + position: relative; +} + +li > ul, +li > ol { + margin-bottom: 0; + margin-left: 1.5em; +} + +dt { + font-weight: 700; +} + +dd { + margin: 0 1.5em 1.5em; +} + +table { + border-collapse: collapse; + margin: 0 0 1.5em; + width: 100%; +} + +thead th { + border-bottom: 2px solid #bbb; + padding-bottom: 0.5em; +} + +th { + padding: 0.4em; + text-align: left; +} + +tr { + border-bottom: 1px solid #eee; +} + +td { + padding: 0.4em; +} + +th:first-child, +td:first-child { + padding-left: 0; +} + +th:last-child, +td:last-child { + padding-right: 0; +} + +a { + -webkit-box-shadow: inset 0 -1px 0 rgba(15, 15, 15, 1); + box-shadow: inset 0 -1px 0 rgba(15, 15, 15, 1); + color: #222; + text-decoration: none; + -webkit-transition: color 80ms ease-in, -webkit-box-shadow 130ms ease-in-out; + transition: color 80ms ease-in, -webkit-box-shadow 130ms ease-in-out; + transition: color 80ms ease-in, box-shadow 130ms ease-in-out; + transition: color 80ms ease-in, box-shadow 130ms ease-in-out, -webkit-box-shadow 130ms ease-in-out; +} + +a:focus { + outline: thin dotted; +} + +a:hover, +a:focus { + color: #000; + -webkit-box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 3px 0 rgba(0, 0, 0, 1); + box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 3px 0 rgba(0, 0, 0, 1); +} + +/* Fixes linked images */ + +a img { + background: #fff; + -webkit-box-shadow: 0 0 0 6px #fff; + box-shadow: 0 0 0 6px #fff; +} + +/** + * 4.0 - Alignment + */ + +img { + height: auto; /* Make sure images are scaled correctly. */ + max-width: 100%; /* Adhere to container width. */ +} + +embed, +iframe, +object { + margin-bottom: 1.5em; + max-width: 100%; +} + +/** + * 5.0 - Caption + */ + +.wp-caption { + color: #666; + font-size: 13px; + font-size: 0.8125rem; + font-style: italic; + margin-bottom: 1.5em; + max-width: 100%; +} + +.wp-caption img[class*="wp-image-"] { + display: block; + margin-left: auto; + margin-right: auto; +} + +.wp-caption .wp-caption-text { + margin: 0.8075em 0; +} + +/** + * 6.0 - Galleries + */ + +.gallery { + margin-bottom: 1.5em; +} + +.gallery-item { + display: inline-block; + text-align: center; + vertical-align: top; + width: 100%; +} + +.gallery-item a, +.gallery-item a:hover, +.gallery-item a:focus { + -webkit-box-shadow: none; + box-shadow: none; + background: none; + display: inline-block; +} + +.gallery-columns-2 .gallery-item { + max-width: 50%; +} + +.gallery-columns-3 .gallery-item { + max-width: 33.33%; +} + +.gallery-columns-4 .gallery-item { + max-width: 25%; +} + +.gallery-columns-5 .gallery-item { + max-width: 20%; +} + +.gallery-columns-6 .gallery-item { + max-width: 16.66%; +} + +.gallery-columns-7 .gallery-item { + max-width: 14.28%; +} + +.gallery-columns-8 .gallery-item { + max-width: 12.5%; +} + +.gallery-columns-9 .gallery-item { + max-width: 11.11%; +} + +.gallery-caption { + display: block; +} + +/** + * 7.0 - Media Elements + */ + +.mejs-container { + margin-bottom: 1.5em; +} + +/* Audio Player */ + +.mejs-controls a.mejs-horizontal-volume-slider, +.mejs-controls a.mejs-horizontal-volume-slider:focus, +.mejs-controls a.mejs-horizontal-volume-slider:hover { + background: transparent; + border: 0; +} + +/* Playlist Color Overrides: Light */ + +.wp-playlist-light { + border-color: #eee; + color: #222; +} + +.wp-playlist-light .wp-playlist-current-item .wp-playlist-item-album { + color: #333; +} + +.wp-playlist-light .wp-playlist-current-item .wp-playlist-item-artist { + color: #767676; +} + +.wp-playlist-light .wp-playlist-item { + border-bottom: 1px dotted #eee; + -webkit-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out; + transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out; +} + +.wp-playlist-light .wp-playlist-item:hover, +.wp-playlist-light .wp-playlist-item:focus { + border-bottom-color: rgba(0, 0, 0, 0); + background-color: #767676; + color: #fff; +} + +.wp-playlist-light a.wp-playlist-caption:hover, +.wp-playlist-light .wp-playlist-item:hover a, +.wp-playlist-light .wp-playlist-item:focus a { + color: #fff; +} + +/* Playlist Color Overrides: Dark */ + +.wp-playlist-dark { + background: #222; + border-color: #333; +} + +.wp-playlist-dark .mejs-container .mejs-controls { + background-color: #333; +} + +.wp-playlist-dark .wp-playlist-caption { + color: #fff; +} + +.wp-playlist-dark .wp-playlist-current-item .wp-playlist-item-album { + color: #eee; +} + +.wp-playlist-dark .wp-playlist-current-item .wp-playlist-item-artist { + color: #aaa; +} + +.wp-playlist-dark .wp-playlist-playing { + background-color: #333; +} + +.wp-playlist-dark .wp-playlist-item { + border-bottom: 1px dotted #555; + -webkit-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out; + transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out; +} + +.wp-playlist-dark .wp-playlist-item:hover, +.wp-playlist-dark .wp-playlist-item:focus { + border-bottom-color: rgba(0, 0, 0, 0); + background-color: #aaa; + color: #222; +} + +.wp-playlist-dark a.wp-playlist-caption:hover, +.wp-playlist-dark .wp-playlist-item:hover a, +.wp-playlist-dark .wp-playlist-item:focus a { + color: #222; +} + +/* Playlist Style Overrides */ + +.wp-playlist { + padding: 0.625em 0.625em 0.3125em; +} + +.wp-playlist-current-item .wp-playlist-item-title { + font-weight: 700; +} + +.wp-playlist-current-item .wp-playlist-item-album { + font-style: normal; +} + +.wp-playlist-current-item .wp-playlist-item-artist { + font-size: 10px; + font-size: 0.625rem; + font-weight: 800; + letter-spacing: 0.1818em; + text-transform: uppercase; +} + +.wp-playlist-item { + padding: 0 0.3125em; + cursor: pointer; +} + +.wp-playlist-item:last-of-type { + border-bottom: none; +} + +.wp-playlist-item a { + padding: 0.3125em 0; + border-bottom: none; +} + +.wp-playlist-item a, +.wp-playlist-item a:focus, +.wp-playlist-item a:hover { + -webkit-box-shadow: none; + box-shadow: none; + background: transparent; +} + +.wp-playlist-item-length { + top: 5px; +} + +/** + * 8.0 - RTL + */ + +.rtl th { + text-align: right; +} + +.rtl ol > li:before { + left: auto; + right: -1.5em; +} + +.rtl li > ul, +.rtl li > ol { + margin-left: 0; + margin-right: 1.5em; +} + +.rtl .mejs-offscreen { + right: -10000px; +} diff --git a/wp-content/themes/twentyseventeen/assets/css/ie8.css b/wp-content/themes/twentyseventeen/assets/css/ie8.css new file mode 100644 index 0000000..18a8643 --- /dev/null +++ b/wp-content/themes/twentyseventeen/assets/css/ie8.css @@ -0,0 +1,225 @@ +/* +Theme Name: Twenty Seventeen +Description: IE8 specific style. +*/ + +body { + font-size: 16px; +} + +h1 { + font-size: 30px; + font-size: 1.875rem; +} + +h2, +.page .panel-content .recent-posts .entry-title { + font-size: 26px; + font-size: 1.625rem; +} + +h3 { + font-size: 22px; + font-size: 1.375rem; +} + +h4 { + font-size: 18px; + font-size: 1.125rem; +} + +h5 { + font-size: 13px; + font-size: 0.8125rem; +} + +h6 { + font-size: 16px; + font-size: 1rem; +} + +img { + width: inherit; /* Make images fill their parent's space. */ +} + +/* Fixes linked images */ +.entry-content a img, +.widget a img { + filter: progid:DXImageTransform.Microsoft.DropShadow(OffX=0, OffY=5, Color=#ffffff); +} + +/* Layout */ + +.site-content { + padding: 6.5em 0 0; +} + +/* Site Branding */ + +.custom-header { + overflow: hidden; +} + +.has-header-image.twentyseventeen-front-page .custom-header, +.has-header-image.home.blog .custom-header { + display: block; +} + +.custom-header-media { + background-position: bottom center; +} + +.site-branding { + padding: 45px 0; +} + +.has-header-image.twentyseventeen-front-page .site-branding, +.has-header-image.home.blog .site-branding { + bottom: 0; + display: block; + left: 0; + height: auto; + padding-top: 0; + position: absolute; + width: 100%; +} + +.has-header-image .custom-header-media img { + left: 0; + top: 0; +} + +.site-title { + font-size: 36px; + font-weight: 700; +} + +.site-description { + font-size: 16px; +} + +/* Main Navigation */ + +.navigation-top { + background: #fff; + position: relative; + z-index: 10; +} + +.menu-toggle { + width: 150px; +} + +.main-navigation ul#top-menu { + margin-bottom: -1px; + padding: 0; +} + +.no-svg .dropdown-toggle { + padding: 0.25em 0 0; +} + +.no-svg .dropdown-toggle.toggled-on { + padding: 0.75em 0 0; +} + +.dropdown-toggle .svg-fallback.icon-angle-down { + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=-1, M12=1.2246467991473532e-16, M21=-1.2246467991473532e-16, M22=-1, SizingMethod='auto expand')"; +} + +.dropdown-toggle.toggled-on .svg-fallback.icon-angle-down { + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0, M22=1, SizingMethod='auto expand')"; +} + +/* Front Page */ + +.twentyseventeen-front-page.has-header-image .custom-header, +.blog.home.has-header-image .custom-header, +.panel-image { + height: 800px; + max-height: 800px; + padding-top: 0; +} + +.twentyseventeen-front-page .custom-header-media, +.blog.home .custom-header-media { + background-position: center center; +} + +.twentyseventeen-front-page.has-header-image .site-branding, +.home.blog.has-header-image .site-branding { + bottom: 20px; + position: absolute; + width: 100%; +} + +.page .panel-content .entry-title, +.page-title, +.page .entry-title { + font-size: 14px; + font-size: 0.875rem; + font-weight: 700; + letter-spacing: 0.14em; + text-transform: uppercase; +} + +/* Posts */ + +.blog .site-main > article, +.archive .site-main > article, +.search .site-main > article { + padding-bottom: 4em; +} + +time.updated { + display: none; +} + +time.published { + display: inline-block; +} + +.blog .entry-title { + padding-top: 0; +} + +.single-post .entry-title, +.page .entry-title, +.entry-meta + .entry-title { + font-size: 26px; + font-weight: 400; + letter-spacing: normal; + padding-top: 0; + text-transform: none; +} + +.entry-footer .cat-links, +.entry-footer .tags-links { + padding-left: 0; +} + +.comment-author .avatar { + z-index: -1; +} + +ol.children .children { + padding-left: 2em; +} + +/* RTL Styles */ + +.rtl .has-header-image.twentyseventeen-front-page .site-branding, +.rtl .has-header-image.home.blog .site-branding { + left: auto; + right: 0; +} + +.rtl .entry-footer .cat-links, +.rtl .entry-footer .tags-links { + padding-right: 0; +} + +.rtl ol.children .children { + padding-left: 0; + padding-right: 2em; +} diff --git a/wp-content/themes/twentyseventeen/assets/css/ie9.css b/wp-content/themes/twentyseventeen/assets/css/ie9.css new file mode 100644 index 0000000..af9574e --- /dev/null +++ b/wp-content/themes/twentyseventeen/assets/css/ie9.css @@ -0,0 +1,43 @@ +/* +Theme Name: Twenty Seventeen +Description: IE9 specific styles. +*/ + +.has-header-image.twentyseventeen-front-page .custom-header, +.has-header-video.twentyseventeen-front-page .custom-header, +.has-header-image.home.blog .custom-header, +.has-header-video.home.blog .custom-header { + height: 300px; +} + +.has-header-image .custom-header-media img, +.has-header-video .custom-header-media video, +.has-header-video .custom-header-media iframe { + min-width: 100%; +} + +@media screen and (min-width: 30em) { + + .has-header-image.twentyseventeen-front-page .custom-header, + .has-header-video.twentyseventeen-front-page .custom-header, + .has-header-image.home.blog .custom-header, + .has-header-video.home.blog .custom-header, + .twentyseventeen-front-page.has-header-image .custom-header-media, + .home.blog.has-header-image .custom-header-media, + .panel-image { + height: 700px; + } +} + +@media screen and (min-width: 48em) { + + .has-header-image.twentyseventeen-front-page .custom-header, + .has-header-video.twentyseventeen-front-page .custom-header, + .has-header-image.home.blog .custom-header, + .has-header-video.home.blog .custom-header, + .twentyseventeen-front-page.has-header-image .custom-header-media, + .home.blog.has-header-image .custom-header-media, + .panel-image { + height: 1000px; + } +} diff --git a/wp-content/themes/twentyseventeen/assets/images/coffee.jpg b/wp-content/themes/twentyseventeen/assets/images/coffee.jpg new file mode 100644 index 0000000..13847cd Binary files /dev/null and b/wp-content/themes/twentyseventeen/assets/images/coffee.jpg differ diff --git a/wp-content/themes/twentyseventeen/assets/images/espresso.jpg b/wp-content/themes/twentyseventeen/assets/images/espresso.jpg new file mode 100644 index 0000000..7514c96 Binary files /dev/null and b/wp-content/themes/twentyseventeen/assets/images/espresso.jpg differ diff --git a/wp-content/themes/twentyseventeen/assets/images/header.jpg b/wp-content/themes/twentyseventeen/assets/images/header.jpg new file mode 100644 index 0000000..a3fd3e7 Binary files /dev/null and b/wp-content/themes/twentyseventeen/assets/images/header.jpg differ diff --git a/wp-content/themes/twentyseventeen/assets/images/sandwich.jpg b/wp-content/themes/twentyseventeen/assets/images/sandwich.jpg new file mode 100644 index 0000000..6baddbf Binary files /dev/null and b/wp-content/themes/twentyseventeen/assets/images/sandwich.jpg differ diff --git a/wp-content/themes/twentyseventeen/assets/images/svg-icons.svg b/wp-content/themes/twentyseventeen/assets/images/svg-icons.svg new file mode 100644 index 0000000..d5f9ade --- /dev/null +++ b/wp-content/themes/twentyseventeen/assets/images/svg-icons.svg @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wp-content/themes/twentyseventeen/assets/js/customize-controls.js b/wp-content/themes/twentyseventeen/assets/js/customize-controls.js new file mode 100644 index 0000000..8477975 --- /dev/null +++ b/wp-content/themes/twentyseventeen/assets/js/customize-controls.js @@ -0,0 +1,36 @@ +/** + * Scripts within the customizer controls window. + * + * Contextually shows the color hue control and informs the preview + * when users open or close the front page sections section. + */ + +(function() { + wp.customize.bind( 'ready', function() { + + // Only show the color hue control when there's a custom color scheme. + wp.customize( 'colorscheme', function( setting ) { + wp.customize.control( 'colorscheme_hue', function( control ) { + var visibility = function() { + if ( 'custom' === setting.get() ) { + control.container.slideDown( 180 ); + } else { + control.container.slideUp( 180 ); + } + }; + + visibility(); + setting.bind( visibility ); + }); + }); + + // Detect when the front page sections section is expanded (or closed) so we can adjust the preview accordingly. + wp.customize.section( 'theme_options', function( section ) { + section.expanded.bind( function( isExpanding ) { + + // Value of isExpanding will = true if you're entering the section, false if you're leaving it. + wp.customize.previewer.send( 'section-highlight', { expanded: isExpanding }); + } ); + } ); + }); +})(); diff --git a/wp-content/themes/twentyseventeen/assets/js/customize-preview.js b/wp-content/themes/twentyseventeen/assets/js/customize-preview.js new file mode 100644 index 0000000..e97dd83 --- /dev/null +++ b/wp-content/themes/twentyseventeen/assets/js/customize-preview.js @@ -0,0 +1,150 @@ +/** + * File customize-preview.js. + * + * Instantly live-update customizer settings in the preview for improved user experience. + */ + +(function( $ ) { + + // Collect information from customize-controls.js about which panels are opening. + wp.customize.bind( 'preview-ready', function() { + + // Initially hide the theme option placeholders on load. + $( '.panel-placeholder' ).hide(); + + wp.customize.preview.bind( 'section-highlight', function( data ) { + + // Only on the front page. + if ( ! $( 'body' ).hasClass( 'twentyseventeen-front-page' ) ) { + return; + } + + // When the section is expanded, show and scroll to the content placeholders, exposing the edit links. + if ( true === data.expanded ) { + $( 'body' ).addClass( 'highlight-front-sections' ); + $( '.panel-placeholder' ).slideDown( 200, function() { + $.scrollTo( $( '#panel1' ), { + duration: 600, + offset: { 'top': -70 } // Account for sticky menu. + }); + }); + + // If we've left the panel, hide the placeholders and scroll back to the top. + } else { + $( 'body' ).removeClass( 'highlight-front-sections' ); + // Don't change scroll when leaving - it's likely to have unintended consequences. + $( '.panel-placeholder' ).slideUp( 200 ); + } + }); + }); + + // Site title and description. + wp.customize( 'blogname', function( value ) { + value.bind( function( to ) { + $( '.site-title a' ).text( to ); + }); + }); + wp.customize( 'blogdescription', function( value ) { + value.bind( function( to ) { + $( '.site-description' ).text( to ); + }); + }); + + // Header text color. + wp.customize( 'header_textcolor', function( value ) { + value.bind( function( to ) { + if ( 'blank' === to ) { + $( '.site-title, .site-description' ).css({ + clip: 'rect(1px, 1px, 1px, 1px)', + position: 'absolute' + }); + // Add class for different logo styles if title and description are hidden. + $( 'body' ).addClass( 'title-tagline-hidden' ); + } else { + + // Check if the text color has been removed and use default colors in theme stylesheet. + if ( ! to.length ) { + $( '#twentyseventeen-custom-header-styles' ).remove(); + } + $( '.site-title, .site-description' ).css({ + clip: 'auto', + position: 'relative' + }); + $( '.site-branding, .site-branding a, .site-description, .site-description a' ).css({ + color: to + }); + // Add class for different logo styles if title and description are visible. + $( 'body' ).removeClass( 'title-tagline-hidden' ); + } + }); + }); + + // Color scheme. + wp.customize( 'colorscheme', function( value ) { + value.bind( function( to ) { + + // Update color body class. + $( 'body' ) + .removeClass( 'colors-light colors-dark colors-custom' ) + .addClass( 'colors-' + to ); + }); + }); + + // Custom color hue. + wp.customize( 'colorscheme_hue', function( value ) { + value.bind( function( to ) { + + // Update custom color CSS. + var style = $( '#custom-theme-colors' ), + hue = style.data( 'hue' ), + css = style.html(); + + // Equivalent to css.replaceAll, with hue followed by comma to prevent values with units from being changed. + css = css.split( hue + ',' ).join( to + ',' ); + style.html( css ).data( 'hue', to ); + }); + }); + + // Page layouts. + wp.customize( 'page_layout', function( value ) { + value.bind( function( to ) { + if ( 'one-column' === to ) { + $( 'body' ).addClass( 'page-one-column' ).removeClass( 'page-two-column' ); + } else { + $( 'body' ).removeClass( 'page-one-column' ).addClass( 'page-two-column' ); + } + } ); + } ); + + // Whether a header image is available. + function hasHeaderImage() { + var image = wp.customize( 'header_image' )(); + return '' !== image && 'remove-header' !== image; + } + + // Whether a header video is available. + function hasHeaderVideo() { + var externalVideo = wp.customize( 'external_header_video' )(), + video = wp.customize( 'header_video' )(); + + return '' !== externalVideo || ( 0 !== video && '' !== video ); + } + + // Toggle a body class if a custom header exists. + $.each( [ 'external_header_video', 'header_image', 'header_video' ], function( index, settingId ) { + wp.customize( settingId, function( setting ) { + setting.bind(function() { + if ( hasHeaderImage() ) { + $( document.body ).addClass( 'has-header-image' ); + } else { + $( document.body ).removeClass( 'has-header-image' ); + } + + if ( ! hasHeaderVideo() ) { + $( document.body ).removeClass( 'has-header-video' ); + } + } ); + } ); + } ); + +} )( jQuery ); diff --git a/wp-content/themes/twentyseventeen/assets/js/global.js b/wp-content/themes/twentyseventeen/assets/js/global.js new file mode 100644 index 0000000..b6322de --- /dev/null +++ b/wp-content/themes/twentyseventeen/assets/js/global.js @@ -0,0 +1,250 @@ +/* global twentyseventeenScreenReaderText */ +(function( $ ) { + + // Variables and DOM Caching. + var $body = $( 'body' ), + $customHeader = $body.find( '.custom-header' ), + $branding = $customHeader.find( '.site-branding' ), + $navigation = $body.find( '.navigation-top' ), + $navWrap = $navigation.find( '.wrap' ), + $navMenuItem = $navigation.find( '.menu-item' ), + $menuToggle = $navigation.find( '.menu-toggle' ), + $menuScrollDown = $body.find( '.menu-scroll-down' ), + $sidebar = $body.find( '#secondary' ), + $entryContent = $body.find( '.entry-content' ), + $formatQuote = $body.find( '.format-quote blockquote' ), + isFrontPage = $body.hasClass( 'twentyseventeen-front-page' ) || $body.hasClass( 'home blog' ), + navigationFixedClass = 'site-navigation-fixed', + navigationHeight, + navigationOuterHeight, + navPadding, + navMenuItemHeight, + idealNavHeight, + navIsNotTooTall, + headerOffset, + menuTop = 0, + resizeTimer; + + // Ensure the sticky navigation doesn't cover current focused links. + $( 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]', '.site-content-contain' ).filter( ':visible' ).focus( function() { + if ( $navigation.hasClass( 'site-navigation-fixed' ) ) { + var windowScrollTop = $( window ).scrollTop(), + fixedNavHeight = $navigation.height(), + itemScrollTop = $( this ).offset().top, + offsetDiff = itemScrollTop - windowScrollTop; + + // Account for Admin bar. + if ( $( '#wpadminbar' ).length ) { + offsetDiff -= $( '#wpadminbar' ).height(); + } + + if ( offsetDiff < fixedNavHeight ) { + $( window ).scrollTo( itemScrollTop - ( fixedNavHeight + 50 ), 0 ); + } + } + }); + + // Set properties of navigation. + function setNavProps() { + navigationHeight = $navigation.height(); + navigationOuterHeight = $navigation.outerHeight(); + navPadding = parseFloat( $navWrap.css( 'padding-top' ) ) * 2; + navMenuItemHeight = $navMenuItem.outerHeight() * 2; + idealNavHeight = navPadding + navMenuItemHeight; + navIsNotTooTall = navigationHeight <= idealNavHeight; + } + + // Make navigation 'stick'. + function adjustScrollClass() { + + // Make sure we're not on a mobile screen. + if ( 'none' === $menuToggle.css( 'display' ) ) { + + // Make sure the nav isn't taller than two rows. + if ( navIsNotTooTall ) { + + // When there's a custom header image or video, the header offset includes the height of the navigation. + if ( isFrontPage && ( $body.hasClass( 'has-header-image' ) || $body.hasClass( 'has-header-video' ) ) ) { + headerOffset = $customHeader.innerHeight() - navigationOuterHeight; + } else { + headerOffset = $customHeader.innerHeight(); + } + + // If the scroll is more than the custom header, set the fixed class. + if ( $( window ).scrollTop() >= headerOffset ) { + $navigation.addClass( navigationFixedClass ); + } else { + $navigation.removeClass( navigationFixedClass ); + } + + } else { + + // Remove 'fixed' class if nav is taller than two rows. + $navigation.removeClass( navigationFixedClass ); + } + } + } + + // Set margins of branding in header. + function adjustHeaderHeight() { + if ( 'none' === $menuToggle.css( 'display' ) ) { + + // The margin should be applied to different elements on front-page or home vs interior pages. + if ( isFrontPage ) { + $branding.css( 'margin-bottom', navigationOuterHeight ); + } else { + $customHeader.css( 'margin-bottom', navigationOuterHeight ); + } + + } else { + $customHeader.css( 'margin-bottom', '0' ); + $branding.css( 'margin-bottom', '0' ); + } + } + + // Set icon for quotes. + function setQuotesIcon() { + $( twentyseventeenScreenReaderText.quote ).prependTo( $formatQuote ); + } + + // Add 'below-entry-meta' class to elements. + function belowEntryMetaClass( param ) { + var sidebarPos, sidebarPosBottom; + + if ( ! $body.hasClass( 'has-sidebar' ) || ( + $body.hasClass( 'search' ) || + $body.hasClass( 'single-attachment' ) || + $body.hasClass( 'error404' ) || + $body.hasClass( 'twentyseventeen-front-page' ) + ) ) { + return; + } + + sidebarPos = $sidebar.offset(); + sidebarPosBottom = sidebarPos.top + ( $sidebar.height() + 28 ); + + $entryContent.find( param ).each( function() { + var $element = $( this ), + elementPos = $element.offset(), + elementPosTop = elementPos.top; + + // Add 'below-entry-meta' to elements below the entry meta. + if ( elementPosTop > sidebarPosBottom ) { + $element.addClass( 'below-entry-meta' ); + } else { + $element.removeClass( 'below-entry-meta' ); + } + }); + } + + /* + * Test if inline SVGs are supported. + * @link https://github.com/Modernizr/Modernizr/ + */ + function supportsInlineSVG() { + var div = document.createElement( 'div' ); + div.innerHTML = ''; + return 'http://www.w3.org/2000/svg' === ( 'undefined' !== typeof SVGRect && div.firstChild && div.firstChild.namespaceURI ); + } + + /** + * Test if an iOS device. + */ + function checkiOS() { + return /iPad|iPhone|iPod/.test(navigator.userAgent) && ! window.MSStream; + } + + /* + * Test if background-attachment: fixed is supported. + * @link http://stackoverflow.com/questions/14115080/detect-support-for-background-attachment-fixed + */ + function supportsFixedBackground() { + var el = document.createElement('div'), + isSupported; + + try { + if ( ! ( 'backgroundAttachment' in el.style ) || checkiOS() ) { + return false; + } + el.style.backgroundAttachment = 'fixed'; + isSupported = ( 'fixed' === el.style.backgroundAttachment ); + return isSupported; + } + catch (e) { + return false; + } + } + + // Fire on document ready. + $( document ).ready( function() { + + // If navigation menu is present on page, setNavProps and adjustScrollClass. + if ( $navigation.length ) { + setNavProps(); + adjustScrollClass(); + } + + // If 'Scroll Down' arrow in present on page, calculate scroll offset and bind an event handler to the click event. + if ( $menuScrollDown.length ) { + + if ( $( 'body' ).hasClass( 'admin-bar' ) ) { + menuTop -= 32; + } + if ( $( 'body' ).hasClass( 'blog' ) ) { + menuTop -= 30; // The div for latest posts has no space above content, add some to account for this. + } + if ( ! $navigation.length ) { + navigationOuterHeight = 0; + } + + $menuScrollDown.click( function( e ) { + e.preventDefault(); + $( window ).scrollTo( '#primary', { + duration: 600, + offset: { top: menuTop - navigationOuterHeight } + }); + }); + } + + adjustHeaderHeight(); + setQuotesIcon(); + belowEntryMetaClass( 'blockquote.alignleft, blockquote.alignright' ); + if ( true === supportsInlineSVG() ) { + document.documentElement.className = document.documentElement.className.replace( /(\s*)no-svg(\s*)/, '$1svg$2' ); + } + + if ( true === supportsFixedBackground() ) { + document.documentElement.className += ' background-fixed'; + } + }); + + // If navigation menu is present on page, adjust it on scroll and screen resize. + if ( $navigation.length ) { + + // On scroll, we want to stick/unstick the navigation. + $( window ).on( 'scroll', function() { + adjustScrollClass(); + adjustHeaderHeight(); + }); + + // Also want to make sure the navigation is where it should be on resize. + $( window ).resize( function() { + setNavProps(); + setTimeout( adjustScrollClass, 500 ); + }); + } + + $( window ).resize( function() { + clearTimeout( resizeTimer ); + resizeTimer = setTimeout( function() { + belowEntryMetaClass( 'blockquote.alignleft, blockquote.alignright' ); + }, 300 ); + setTimeout( adjustHeaderHeight, 1000 ); + }); + + // Add header video class after the video is loaded. + $( document ).on( 'wp-custom-header-video-loaded', function() { + $body.addClass( 'has-header-video' ); + }); + +})( jQuery ); diff --git a/wp-content/themes/twentyseventeen/assets/js/html5.js b/wp-content/themes/twentyseventeen/assets/js/html5.js new file mode 100644 index 0000000..9c1f049 --- /dev/null +++ b/wp-content/themes/twentyseventeen/assets/js/html5.js @@ -0,0 +1,326 @@ +/** +* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +;(function(window, document) { +/*jshint evil:true */ + /** version */ + var version = '3.7.3'; + + /** Preset options */ + var options = window.html5 || {}; + + /** Used to skip problem elements */ + var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; + + /** Not all elements can be cloned in IE **/ + var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; + + /** Detect whether the browser supports default html5 styles */ + var supportsHtml5Styles; + + /** Name of the expando, to work with multiple documents or to re-shiv one document */ + var expando = '_html5shiv'; + + /** The id for the the documents expando */ + var expanID = 0; + + /** Cached data for each document */ + var expandoData = {}; + + /** Detect whether the browser supports unknown elements */ + var supportsUnknownElements; + + (function() { + try { + var a = document.createElement('a'); + a.innerHTML = ''; + //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles + supportsHtml5Styles = ('hidden' in a); + + supportsUnknownElements = a.childNodes.length == 1 || (function() { + // assign a false positive if unable to shiv + (document.createElement)('a'); + var frag = document.createDocumentFragment(); + return ( + typeof frag.cloneNode == 'undefined' || + typeof frag.createDocumentFragment == 'undefined' || + typeof frag.createElement == 'undefined' + ); + }()); + } catch(e) { + // assign a false positive if detection fails => unable to shiv + supportsHtml5Styles = true; + supportsUnknownElements = true; + } + + }()); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a style sheet with the given CSS text and adds it to the document. + * @private + * @param {Document} ownerDocument The document. + * @param {String} cssText The CSS text. + * @returns {StyleSheet} The style element. + */ + function addStyleSheet(ownerDocument, cssText) { + var p = ownerDocument.createElement('p'), + parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; + + p.innerHTML = 'x'; + return parent.insertBefore(p.lastChild, parent.firstChild); + } + + /** + * Returns the value of `html5.elements` as an array. + * @private + * @returns {Array} An array of shived element node names. + */ + function getElements() { + var elements = html5.elements; + return typeof elements == 'string' ? elements.split(' ') : elements; + } + + /** + * Extends the built-in list of html5 elements + * @memberOf html5 + * @param {String|Array} newElements whitespace separated list or array of new element names to shiv + * @param {Document} ownerDocument The context document. + */ + function addElements(newElements, ownerDocument) { + var elements = html5.elements; + if(typeof elements != 'string'){ + elements = elements.join(' '); + } + if(typeof newElements != 'string'){ + newElements = newElements.join(' '); + } + html5.elements = elements +' '+ newElements; + shivDocument(ownerDocument); + } + + /** + * Returns the data associated to the given document + * @private + * @param {Document} ownerDocument The document. + * @returns {Object} An object of data. + */ + function getExpandoData(ownerDocument) { + var data = expandoData[ownerDocument[expando]]; + if (!data) { + data = {}; + expanID++; + ownerDocument[expando] = expanID; + expandoData[expanID] = data; + } + return data; + } + + /** + * returns a shived element for the given nodeName and document + * @memberOf html5 + * @param {String} nodeName name of the element + * @param {Document|DocumentFragment} ownerDocument The context document. + * @returns {Object} The shived element. + */ + function createElement(nodeName, ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createElement(nodeName); + } + if (!data) { + data = getExpandoData(ownerDocument); + } + var node; + + if (data.cache[nodeName]) { + node = data.cache[nodeName].cloneNode(); + } else if (saveClones.test(nodeName)) { + node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); + } else { + node = data.createElem(nodeName); + } + + // Avoid adding some elements to fragments in IE < 9 because + // * Attributes like `name` or `type` cannot be set/changed once an element + // is inserted into a document/fragment + // * Link elements with `src` attributes that are inaccessible, as with + // a 403 response, will cause the tab/window to crash + // * Script elements appended to fragments will execute when their `src` + // or `text` property is set + return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; + } + + /** + * returns a shived DocumentFragment for the given document + * @memberOf html5 + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived DocumentFragment. + */ + function createDocumentFragment(ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createDocumentFragment(); + } + data = data || getExpandoData(ownerDocument); + var clone = data.frag.cloneNode(), + i = 0, + elems = getElements(), + l = elems.length; + for(;igmailcom | http://flesler.blogspot.com + * Licensed under MIT + * http://flesler.blogspot.com/2007/10/jqueryscrollto.html + * @projectDescription Lightweight, cross-browser and highly customizable animated scrolling with jQuery + * @author Ariel Flesler + * @version 2.1.2 + */ +;(function(factory) { + 'use strict'; + if (typeof define === 'function' && define.amd) { + // AMD + define( ['jquery'], factory ); + } else if (typeof module !== 'undefined' && module.exports) { + // CommonJS + module.exports = factory( require( 'jquery' ) ); + } else { + // Global + factory( jQuery ); + } +})(function($) { + 'use strict'; + + var $scrollTo = $.scrollTo = function(target, duration, settings) { + return $( window ).scrollTo( target, duration, settings ); + }; + + $scrollTo.defaults = { + axis:'xy', + duration: 0, + limit:true + }; + + function isWin(elem) { + return ! elem.nodeName || + $.inArray( elem.nodeName.toLowerCase(), ['iframe','#document','html','body'] ) !== -1; + } + + $.fn.scrollTo = function(target, duration, settings) { + if (typeof duration === 'object') { + settings = duration; + duration = 0; + } + if (typeof settings === 'function') { + settings = { onAfter:settings }; + } + if (target === 'max') { + target = 9e9; + } + + settings = $.extend( {}, $scrollTo.defaults, settings ); + // Speed is still recognized for backwards compatibility + duration = duration || settings.duration; + // Make sure the settings are given right + var queue = settings.queue && settings.axis.length > 1; + if (queue) { + // Let's keep the overall duration + duration /= 2; + } + settings.offset = both( settings.offset ); + settings.over = both( settings.over ); + + return this.each(function() { + // Null target yields nothing, just like jQuery does + if (target === null) { return; } + + var win = isWin( this ), + elem = win ? this.contentWindow || window : this, + $elem = $( elem ), + targ = target, + attr = {}, + toff; + + switch (typeof targ) { + // A number will pass the regex + case 'number': + case 'string': + if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test( targ )) { + targ = both( targ ); + // We are done + break; + } + // Relative/Absolute selector + targ = win ? $( targ ) : $( targ, elem ); + /* falls through */ + case 'object': + if (targ.length === 0) { return; } + // DOMElement / jQuery + if (targ.is || targ.style) { + // Get the real position of the target + toff = (targ = $( targ )).offset(); + } + } + + var offset = $.isFunction( settings.offset ) && settings.offset( elem, targ ) || settings.offset; + + $.each(settings.axis.split( '' ), function(i, axis) { + var Pos = axis === 'x' ? 'Left' : 'Top', + pos = Pos.toLowerCase(), + key = 'scroll' + Pos, + prev = $elem[key](), + max = $scrollTo.max( elem, axis ); + + if (toff) {// jQuery / DOMElement + attr[key] = toff[pos] + (win ? 0 : prev - $elem.offset()[pos]); + + // If it's a dom element, reduce the margin + if (settings.margin) { + attr[key] -= parseInt( targ.css( 'margin' + Pos ), 10 ) || 0; + attr[key] -= parseInt( targ.css( 'border' + Pos + 'Width' ), 10 ) || 0; + } + + attr[key] += offset[pos] || 0; + + if (settings.over[pos]) { + // Scroll to a fraction of its width/height + attr[key] += targ[axis === 'x'?'width':'height']() * settings.over[pos]; + } + } else { + var val = targ[pos]; + // Handle percentage values + attr[key] = val.slice && val.slice( -1 ) === '%' ? + parseFloat( val ) / 100 * max + : val; + } + + // Number or 'number' + if (settings.limit && /^\d+$/.test( attr[key] )) { + // Check the limits + attr[key] = attr[key] <= 0 ? 0 : Math.min( attr[key], max ); + } + + // Don't waste time animating, if there's no need. + if ( ! i && settings.axis.length > 1) { + if (prev === attr[key]) { + // No animation needed + attr = {}; + } else if (queue) { + // Intermediate animation + animate( settings.onAfterFirst ); + // Don't animate this axis again in the next iteration. + attr = {}; + } + } + }); + + animate( settings.onAfter ); + + function animate(callback) { + var opts = $.extend({}, settings, { + // The queue setting conflicts with animate() + // Force it to always be true + queue: true, + duration: duration, + complete: callback && function() { + callback.call( elem, targ, settings ); + } + }); + $elem.animate( attr, opts ); + } + }); + }; + + // Max scrolling position, works on quirks mode + // It only fails (not too badly) on IE, quirks mode. + $scrollTo.max = function(elem, axis) { + var Dim = axis === 'x' ? 'Width' : 'Height', + scroll = 'scroll' + Dim; + + if ( ! isWin( elem )) { + return elem[scroll] - $( elem )[Dim.toLowerCase()](); } + + var size = 'client' + Dim, + doc = elem.ownerDocument || elem.document, + html = doc.documentElement, + body = doc.body; + + return Math.max( html[scroll], body[scroll] ) - Math.min( html[size], body[size] ); + }; + + function both(val) { + return $.isFunction( val ) || $.isPlainObject( val ) ? val : { top:val, left:val }; + } + + // Add special hooks so that window scroll properties can be animated + $.Tween.propHooks.scrollLeft = $.Tween.propHooks.scrollTop = { + get: function(t) { + return $( t.elem )[t.prop](); + }, + set: function(t) { + var curr = this.get( t ); + // If interrupt is true and user scrolled, stop animating + if (t.options.interrupt && t._last && t._last !== curr) { + return $( t.elem ).stop(); + } + var next = Math.round( t.now ); + // Don't waste CPU + // Browsers don't render floating point scroll + if (curr !== next) { + $( t.elem )[t.prop](next); + t._last = this.get( t ); + } + } + }; + + // AMD requirement + return $scrollTo; +}); diff --git a/wp-content/themes/twentyseventeen/assets/js/navigation.js b/wp-content/themes/twentyseventeen/assets/js/navigation.js new file mode 100644 index 0000000..f0fd652 --- /dev/null +++ b/wp-content/themes/twentyseventeen/assets/js/navigation.js @@ -0,0 +1,109 @@ +/* global twentyseventeenScreenReaderText */ +/** + * Theme functions file. + * + * Contains handlers for navigation and widget area. + */ + +(function( $ ) { + var masthead, menuToggle, siteNavContain, siteNavigation; + + function initMainNavigation( container ) { + + // Add dropdown toggle that displays child menu items. + var dropdownToggle = $( '
            + +
            +
            + + + +
            +
            + + + + + + diff --git a/wp-content/themes/twentyseventeen/front-page.php b/wp-content/themes/twentyseventeen/front-page.php new file mode 100644 index 0000000..a28074e --- /dev/null +++ b/wp-content/themes/twentyseventeen/front-page.php @@ -0,0 +1,59 @@ + + +
            +
            + + + + + +
            +
            + + tag in the document head, and expect WordPress to + * provide it for us. + */ + add_theme_support( 'title-tag' ); + + /* + * Enable support for Post Thumbnails on posts and pages. + * + * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ + */ + add_theme_support( 'post-thumbnails' ); + + add_image_size( 'twentyseventeen-featured-image', 2000, 1200, true ); + + add_image_size( 'twentyseventeen-thumbnail-avatar', 100, 100, true ); + + // Set the default content width. + $GLOBALS['content_width'] = 525; + + // This theme uses wp_nav_menu() in two locations. + register_nav_menus( + array( + 'top' => __( 'Top Menu', 'twentyseventeen' ), + 'social' => __( 'Social Links Menu', 'twentyseventeen' ), + ) + ); + + /* + * Switch default core markup for search form, comment form, and comments + * to output valid HTML5. + */ + add_theme_support( + 'html5', + array( + 'comment-form', + 'comment-list', + 'gallery', + 'caption', + 'script', + 'style', + ) + ); + + /* + * Enable support for Post Formats. + * + * See: https://wordpress.org/support/article/post-formats/ + */ + add_theme_support( + 'post-formats', + array( + 'aside', + 'image', + 'video', + 'quote', + 'link', + 'gallery', + 'audio', + ) + ); + + // Add theme support for Custom Logo. + add_theme_support( + 'custom-logo', + array( + 'width' => 250, + 'height' => 250, + 'flex-width' => true, + ) + ); + + // Add theme support for selective refresh for widgets. + add_theme_support( 'customize-selective-refresh-widgets' ); + + /* + * This theme styles the visual editor to resemble the theme style, + * specifically font, colors, and column width. + */ + add_editor_style( array( 'assets/css/editor-style.css', twentyseventeen_fonts_url() ) ); + + // Load regular editor styles into the new block-based editor. + add_theme_support( 'editor-styles' ); + + // Load default block styles. + add_theme_support( 'wp-block-styles' ); + + // Add support for responsive embeds. + add_theme_support( 'responsive-embeds' ); + + // Define and register starter content to showcase the theme on new sites. + $starter_content = array( + 'widgets' => array( + // Place three core-defined widgets in the sidebar area. + 'sidebar-1' => array( + 'text_business_info', + 'search', + 'text_about', + ), + + // Add the core-defined business info widget to the footer 1 area. + 'sidebar-2' => array( + 'text_business_info', + ), + + // Put two core-defined widgets in the footer 2 area. + 'sidebar-3' => array( + 'text_about', + 'search', + ), + ), + + // Specify the core-defined pages to create and add custom thumbnails to some of them. + 'posts' => array( + 'home', + 'about' => array( + 'thumbnail' => '{{image-sandwich}}', + ), + 'contact' => array( + 'thumbnail' => '{{image-espresso}}', + ), + 'blog' => array( + 'thumbnail' => '{{image-coffee}}', + ), + 'homepage-section' => array( + 'thumbnail' => '{{image-espresso}}', + ), + ), + + // Create the custom image attachments used as post thumbnails for pages. + 'attachments' => array( + 'image-espresso' => array( + 'post_title' => _x( 'Espresso', 'Theme starter content', 'twentyseventeen' ), + 'file' => 'assets/images/espresso.jpg', // URL relative to the template directory. + ), + 'image-sandwich' => array( + 'post_title' => _x( 'Sandwich', 'Theme starter content', 'twentyseventeen' ), + 'file' => 'assets/images/sandwich.jpg', + ), + 'image-coffee' => array( + 'post_title' => _x( 'Coffee', 'Theme starter content', 'twentyseventeen' ), + 'file' => 'assets/images/coffee.jpg', + ), + ), + + // Default to a static front page and assign the front and posts pages. + 'options' => array( + 'show_on_front' => 'page', + 'page_on_front' => '{{home}}', + 'page_for_posts' => '{{blog}}', + ), + + // Set the front page section theme mods to the IDs of the core-registered pages. + 'theme_mods' => array( + 'panel_1' => '{{homepage-section}}', + 'panel_2' => '{{about}}', + 'panel_3' => '{{blog}}', + 'panel_4' => '{{contact}}', + ), + + // Set up nav menus for each of the two areas registered in the theme. + 'nav_menus' => array( + // Assign a menu to the "top" location. + 'top' => array( + 'name' => __( 'Top Menu', 'twentyseventeen' ), + 'items' => array( + 'link_home', // Note that the core "home" page is actually a link in case a static front page is not used. + 'page_about', + 'page_blog', + 'page_contact', + ), + ), + + // Assign a menu to the "social" location. + 'social' => array( + 'name' => __( 'Social Links Menu', 'twentyseventeen' ), + 'items' => array( + 'link_yelp', + 'link_facebook', + 'link_twitter', + 'link_instagram', + 'link_email', + ), + ), + ), + ); + + /** + * Filters Twenty Seventeen array of starter content. + * + * @since Twenty Seventeen 1.1 + * + * @param array $starter_content Array of starter content. + */ + $starter_content = apply_filters( 'twentyseventeen_starter_content', $starter_content ); + + add_theme_support( 'starter-content', $starter_content ); +} +add_action( 'after_setup_theme', 'twentyseventeen_setup' ); + +/** + * Set the content width in pixels, based on the theme's design and stylesheet. + * + * Priority 0 to make it available to lower priority callbacks. + * + * @global int $content_width + */ +function twentyseventeen_content_width() { + + $content_width = $GLOBALS['content_width']; + + // Get layout. + $page_layout = get_theme_mod( 'page_layout' ); + + // Check if layout is one column. + if ( 'one-column' === $page_layout ) { + if ( twentyseventeen_is_frontpage() ) { + $content_width = 644; + } elseif ( is_page() ) { + $content_width = 740; + } + } + + // Check if is single post and there is no sidebar. + if ( is_single() && ! is_active_sidebar( 'sidebar-1' ) ) { + $content_width = 740; + } + + /** + * Filter Twenty Seventeen content width of the theme. + * + * @since Twenty Seventeen 1.0 + * + * @param int $content_width Content width in pixels. + */ + $GLOBALS['content_width'] = apply_filters( 'twentyseventeen_content_width', $content_width ); +} +add_action( 'template_redirect', 'twentyseventeen_content_width', 0 ); + +/** + * Register custom fonts. + */ +function twentyseventeen_fonts_url() { + $fonts_url = ''; + + /* + * translators: If there are characters in your language that are not supported + * by Libre Franklin, translate this to 'off'. Do not translate into your own language. + */ + $libre_franklin = _x( 'on', 'Libre Franklin font: on or off', 'twentyseventeen' ); + + if ( 'off' !== $libre_franklin ) { + $font_families = array(); + + $font_families[] = 'Libre Franklin:300,300i,400,400i,600,600i,800,800i'; + + $query_args = array( + 'family' => urlencode( implode( '|', $font_families ) ), + 'subset' => urlencode( 'latin,latin-ext' ), + 'display' => urlencode( 'fallback' ), + ); + + $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); + } + + return esc_url_raw( $fonts_url ); +} + +/** + * Add preconnect for Google Fonts. + * + * @since Twenty Seventeen 1.0 + * + * @param array $urls URLs to print for resource hints. + * @param string $relation_type The relation type the URLs are printed. + * @return array $urls URLs to print for resource hints. + */ +function twentyseventeen_resource_hints( $urls, $relation_type ) { + if ( wp_style_is( 'twentyseventeen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { + $urls[] = array( + 'href' => 'https://fonts.gstatic.com', + 'crossorigin', + ); + } + + return $urls; +} +add_filter( 'wp_resource_hints', 'twentyseventeen_resource_hints', 10, 2 ); + +/** + * Register widget area. + * + * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar + */ +function twentyseventeen_widgets_init() { + register_sidebar( + array( + 'name' => __( 'Blog Sidebar', 'twentyseventeen' ), + 'id' => 'sidebar-1', + 'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'twentyseventeen' ), + 'before_widget' => '
            ', + 'after_widget' => '
            ', + 'before_title' => '

            ', + 'after_title' => '

            ', + ) + ); + + register_sidebar( + array( + 'name' => __( 'Footer 1', 'twentyseventeen' ), + 'id' => 'sidebar-2', + 'description' => __( 'Add widgets here to appear in your footer.', 'twentyseventeen' ), + 'before_widget' => '
            ', + 'after_widget' => '
            ', + 'before_title' => '

            ', + 'after_title' => '

            ', + ) + ); + + register_sidebar( + array( + 'name' => __( 'Footer 2', 'twentyseventeen' ), + 'id' => 'sidebar-3', + 'description' => __( 'Add widgets here to appear in your footer.', 'twentyseventeen' ), + 'before_widget' => '
            ', + 'after_widget' => '
            ', + 'before_title' => '

            ', + 'after_title' => '

            ', + ) + ); +} +add_action( 'widgets_init', 'twentyseventeen_widgets_init' ); + +/** + * Replaces "[...]" (appended to automatically generated excerpts) with ... and + * a 'Continue reading' link. + * + * @since Twenty Seventeen 1.0 + * + * @param string $link Link to single post/page. + * @return string 'Continue reading' link prepended with an ellipsis. + */ +function twentyseventeen_excerpt_more( $link ) { + if ( is_admin() ) { + return $link; + } + + $link = sprintf( + '', + esc_url( get_permalink( get_the_ID() ) ), + /* translators: %s: Post title. */ + sprintf( __( 'Continue reading "%s"', 'twentyseventeen' ), get_the_title( get_the_ID() ) ) + ); + return ' … ' . $link; +} +add_filter( 'excerpt_more', 'twentyseventeen_excerpt_more' ); + +/** + * Handles JavaScript detection. + * + * Adds a `js` class to the root `` element when JavaScript is detected. + * + * @since Twenty Seventeen 1.0 + */ +function twentyseventeen_javascript_detection() { + echo "\n"; +} +add_action( 'wp_head', 'twentyseventeen_javascript_detection', 0 ); + +/** + * Add a pingback url auto-discovery header for singularly identifiable articles. + */ +function twentyseventeen_pingback_header() { + if ( is_singular() && pings_open() ) { + printf( '' . "\n", esc_url( get_bloginfo( 'pingback_url' ) ) ); + } +} +add_action( 'wp_head', 'twentyseventeen_pingback_header' ); + +/** + * Display custom color CSS. + */ +function twentyseventeen_colors_css_wrap() { + if ( 'custom' !== get_theme_mod( 'colorscheme' ) && ! is_customize_preview() ) { + return; + } + + require_once get_parent_theme_file_path( '/inc/color-patterns.php' ); + $hue = absint( get_theme_mod( 'colorscheme_hue', 250 ) ); + + $customize_preview_data_hue = ''; + if ( is_customize_preview() ) { + $customize_preview_data_hue = 'data-hue="' . $hue . '"'; + } + ?> + + twentyseventeen_get_svg( array( 'icon' => 'quote-right' ) ), + ); + + if ( has_nav_menu( 'top' ) ) { + wp_enqueue_script( 'twentyseventeen-navigation', get_theme_file_uri( '/assets/js/navigation.js' ), array( 'jquery' ), '20161203', true ); + $twentyseventeen_l10n['expand'] = __( 'Expand child menu', 'twentyseventeen' ); + $twentyseventeen_l10n['collapse'] = __( 'Collapse child menu', 'twentyseventeen' ); + $twentyseventeen_l10n['icon'] = twentyseventeen_get_svg( + array( + 'icon' => 'angle-down', + 'fallback' => true, + ) + ); + } + + wp_enqueue_script( 'twentyseventeen-global', get_theme_file_uri( '/assets/js/global.js' ), array( 'jquery' ), '20190121', true ); + + wp_enqueue_script( 'jquery-scrollto', get_theme_file_uri( '/assets/js/jquery.scrollTo.js' ), array( 'jquery' ), '2.1.2', true ); + + wp_localize_script( 'twentyseventeen-skip-link-focus-fix', 'twentyseventeenScreenReaderText', $twentyseventeen_l10n ); + + if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { + wp_enqueue_script( 'comment-reply' ); + } +} +add_action( 'wp_enqueue_scripts', 'twentyseventeen_scripts' ); + +/** + * Enqueues styles for the block-based editor. + * + * @since Twenty Seventeen 1.8 + */ +function twentyseventeen_block_editor_styles() { + // Block styles. + wp_enqueue_style( 'twentyseventeen-block-editor-style', get_theme_file_uri( '/assets/css/editor-blocks.css' ), array(), '20190328' ); + // Add custom fonts. + wp_enqueue_style( 'twentyseventeen-fonts', twentyseventeen_fonts_url(), array(), null ); +} +add_action( 'enqueue_block_editor_assets', 'twentyseventeen_block_editor_styles' ); + +/** + * Add custom image sizes attribute to enhance responsive image functionality + * for content images. + * + * @since Twenty Seventeen 1.0 + * + * @param string $sizes A source size value for use in a 'sizes' attribute. + * @param array $size Image size. Accepts an array of width and height + * values in pixels (in that order). + * @return string A source size value for use in a content image 'sizes' attribute. + */ +function twentyseventeen_content_image_sizes_attr( $sizes, $size ) { + $width = $size[0]; + + if ( 740 <= $width ) { + $sizes = '(max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px'; + } + + if ( is_active_sidebar( 'sidebar-1' ) || is_archive() || is_search() || is_home() || is_page() ) { + if ( ! ( is_page() && 'one-column' === get_theme_mod( 'page_options' ) ) && 767 <= $width ) { + $sizes = '(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px'; + } + } + + return $sizes; +} +add_filter( 'wp_calculate_image_sizes', 'twentyseventeen_content_image_sizes_attr', 10, 2 ); + +/** + * Filter the `sizes` value in the header image markup. + * + * @since Twenty Seventeen 1.0 + * + * @param string $html The HTML image tag markup being filtered. + * @param object $header The custom header object returned by 'get_custom_header()'. + * @param array $attr Array of the attributes for the image tag. + * @return string The filtered header image HTML. + */ +function twentyseventeen_header_image_tag( $html, $header, $attr ) { + if ( isset( $attr['sizes'] ) ) { + $html = str_replace( $attr['sizes'], '100vw', $html ); + } + return $html; +} +add_filter( 'get_header_image_tag', 'twentyseventeen_header_image_tag', 10, 3 ); + +/** + * Add custom image sizes attribute to enhance responsive image functionality + * for post thumbnails. + * + * @since Twenty Seventeen 1.0 + * + * @param array $attr Attributes for the image markup. + * @param int $attachment Image attachment ID. + * @param array $size Registered image size or flat array of height and width dimensions. + * @return array The filtered attributes for the image markup. + */ +function twentyseventeen_post_thumbnail_sizes_attr( $attr, $attachment, $size ) { + if ( is_archive() || is_search() || is_home() ) { + $attr['sizes'] = '(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px'; + } else { + $attr['sizes'] = '100vw'; + } + + return $attr; +} +add_filter( 'wp_get_attachment_image_attributes', 'twentyseventeen_post_thumbnail_sizes_attr', 10, 3 ); + +/** + * Use front-page.php when Front page displays is set to a static page. + * + * @since Twenty Seventeen 1.0 + * + * @param string $template front-page.php. + * + * @return string The template to be used: blank if is_home() is true (defaults to index.php), else $template. + */ +function twentyseventeen_front_page_template( $template ) { + return is_home() ? '' : $template; +} +add_filter( 'frontpage_template', 'twentyseventeen_front_page_template' ); + +/** + * Modifies tag cloud widget arguments to display all tags in the same font size + * and use list format for better accessibility. + * + * @since Twenty Seventeen 1.4 + * + * @param array $args Arguments for tag cloud widget. + * @return array The filtered arguments for tag cloud widget. + */ +function twentyseventeen_widget_tag_cloud_args( $args ) { + $args['largest'] = 1; + $args['smallest'] = 1; + $args['unit'] = 'em'; + $args['format'] = 'list'; + + return $args; +} +add_filter( 'widget_tag_cloud_args', 'twentyseventeen_widget_tag_cloud_args' ); + +/** + * Get unique ID. + * + * This is a PHP implementation of Underscore's uniqueId method. A static variable + * contains an integer that is incremented with each call. This number is returned + * with the optional prefix. As such the returned value is not universally unique, + * but it is unique across the life of the PHP process. + * + * @since Twenty Seventeen 2.0 + * @see wp_unique_id() Themes requiring WordPress 5.0.3 and greater should use this instead. + * + * @staticvar int $id_counter + * + * @param string $prefix Prefix for the returned ID. + * @return string Unique ID. + */ +function twentyseventeen_unique_id( $prefix = '' ) { + static $id_counter = 0; + if ( function_exists( 'wp_unique_id' ) ) { + return wp_unique_id( $prefix ); + } + return $prefix . (string) ++$id_counter; +} + +/** + * Implement the Custom Header feature. + */ +require get_parent_theme_file_path( '/inc/custom-header.php' ); + +/** + * Custom template tags for this theme. + */ +require get_parent_theme_file_path( '/inc/template-tags.php' ); + +/** + * Additional features to allow styling of the templates. + */ +require get_parent_theme_file_path( '/inc/template-functions.php' ); + +/** + * Customizer additions. + */ +require get_parent_theme_file_path( '/inc/customizer.php' ); + +/** + * SVG icons functions and filters. + */ +require get_parent_theme_file_path( '/inc/icon-functions.php' ); diff --git a/wp-content/themes/twentyseventeen/header.php b/wp-content/themes/twentyseventeen/header.php new file mode 100644 index 0000000..3368bd3 --- /dev/null +++ b/wp-content/themes/twentyseventeen/header.php @@ -0,0 +1,58 @@ + section and everything up until
            + * + * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials + * + * @package WordPress + * @subpackage Twenty_Seventeen + * @since Twenty Seventeen 1.0 + * @version 1.0 + */ + +?> + class="no-js no-svg"> + + + + + + + + +> + +
            + + + + + '; + echo get_the_post_thumbnail( get_queried_object_id(), 'twentyseventeen-featured-image' ); + echo '
            '; + endif; + ?> + +
            +
            diff --git a/wp-content/themes/twentyseventeen/inc/back-compat.php b/wp-content/themes/twentyseventeen/inc/back-compat.php new file mode 100644 index 0000000..64f2d73 --- /dev/null +++ b/wp-content/themes/twentyseventeen/inc/back-compat.php @@ -0,0 +1,76 @@ +

            %s

            ', $message ); +} + +/** + * Prevents the Customizer from being loaded on WordPress versions prior to 4.7. + * + * @since Twenty Seventeen 1.0 + * + * @global string $wp_version WordPress version. + */ +function twentyseventeen_customize() { + wp_die( + /* translators: %s: The current WordPress version. */ + sprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] ), + '', + array( + 'back_link' => true, + ) + ); +} +add_action( 'load-customize.php', 'twentyseventeen_customize' ); + +/** + * Prevents the Theme Preview from being loaded on WordPress versions prior to 4.7. + * + * @since Twenty Seventeen 1.0 + * + * @global string $wp_version WordPress version. + */ +function twentyseventeen_preview() { + if ( isset( $_GET['preview'] ) ) { + /* translators: %s: The current WordPress version. */ + wp_die( sprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] ) ); + } +} +add_action( 'template_redirect', 'twentyseventeen_preview' ); diff --git a/wp-content/themes/twentyseventeen/inc/color-patterns.php b/wp-content/themes/twentyseventeen/inc/color-patterns.php new file mode 100644 index 0000000..225b124 --- /dev/null +++ b/wp-content/themes/twentyseventeen/inc/color-patterns.php @@ -0,0 +1,580 @@ + .comment-body > .comment-meta > .comment-author .avatar { + border-color: hsl( ' . $hue . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */ +} + +.colors-custom h2, +.colors-custom blockquote, +.colors-custom input[type="text"], +.colors-custom input[type="email"], +.colors-custom input[type="url"], +.colors-custom input[type="password"], +.colors-custom input[type="search"], +.colors-custom input[type="number"], +.colors-custom input[type="tel"], +.colors-custom input[type="range"], +.colors-custom input[type="date"], +.colors-custom input[type="month"], +.colors-custom input[type="week"], +.colors-custom input[type="time"], +.colors-custom input[type="datetime"], +.colors-custom input[type="datetime-local"], +.colors-custom input[type="color"], +.colors-custom textarea, +.colors-custom .site-description, +.colors-custom .entry-content blockquote.alignleft, +.colors-custom .entry-content blockquote.alignright, +.colors-custom .colors-custom .taxonomy-description, +.colors-custom .site-info a, +.colors-custom .wp-caption, +.colors-custom .gallery-caption { + color: hsl( ' . $hue . ', ' . $saturation . ', 40% ); /* base: #666; */ +} + +.colors-custom abbr, +.colors-custom acronym { + border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 40% ); /* base: #666; */ +} + +.colors-custom h5, +.colors-custom .entry-meta, +.colors-custom .entry-meta a, +.colors-custom.blog .entry-meta a.post-edit-link, +.colors-custom.archive .entry-meta a.post-edit-link, +.colors-custom.search .entry-meta a.post-edit-link, +.colors-custom .nav-subtitle, +.colors-custom .comment-metadata, +.colors-custom .comment-metadata a, +.colors-custom .no-comments, +.colors-custom .comment-awaiting-moderation, +.colors-custom .page-numbers.current, +.colors-custom .page-links .page-number, +.colors-custom .navigation-top .current-menu-item > a, +.colors-custom .navigation-top .current_page_item > a, +.colors-custom .main-navigation a:hover, +.colors-custom .site-content .wp-playlist-light .wp-playlist-current-item .wp-playlist-item-artist { + color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */ +} + +.colors-custom :not( .mejs-button ) > button:hover, +.colors-custom :not( .mejs-button ) > button:focus, +.colors-custom input[type="button"]:hover, +.colors-custom input[type="button"]:focus, +.colors-custom input[type="submit"]:hover, +.colors-custom input[type="submit"]:focus, +.colors-custom .entry-footer .edit-link a.post-edit-link:hover, +.colors-custom .entry-footer .edit-link a.post-edit-link:focus, +.colors-custom .social-navigation a, +.colors-custom .prev.page-numbers:focus, +.colors-custom .prev.page-numbers:hover, +.colors-custom .next.page-numbers:focus, +.colors-custom .next.page-numbers:hover, +.colors-custom .site-content .wp-playlist-light .wp-playlist-item:hover, +.colors-custom .site-content .wp-playlist-light .wp-playlist-item:focus { + background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 46% ); /* base: #767676; */ +} + +.colors-custom button.secondary:hover, +.colors-custom button.secondary:focus, +.colors-custom input[type="reset"]:hover, +.colors-custom input[type="reset"]:focus, +.colors-custom input[type="button"].secondary:hover, +.colors-custom input[type="button"].secondary:focus, +.colors-custom input[type="reset"].secondary:hover, +.colors-custom input[type="reset"].secondary:focus, +.colors-custom input[type="submit"].secondary:hover, +.colors-custom input[type="submit"].secondary:focus, +.colors-custom hr { + background: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ +} + +.colors-custom input[type="text"], +.colors-custom input[type="email"], +.colors-custom input[type="url"], +.colors-custom input[type="password"], +.colors-custom input[type="search"], +.colors-custom input[type="number"], +.colors-custom input[type="tel"], +.colors-custom input[type="range"], +.colors-custom input[type="date"], +.colors-custom input[type="month"], +.colors-custom input[type="week"], +.colors-custom input[type="time"], +.colors-custom input[type="datetime"], +.colors-custom input[type="datetime-local"], +.colors-custom input[type="color"], +.colors-custom textarea, +.colors-custom select, +.colors-custom fieldset, +.colors-custom .widget .tagcloud a:hover, +.colors-custom .widget .tagcloud a:focus, +.colors-custom .widget.widget_tag_cloud a:hover, +.colors-custom .widget.widget_tag_cloud a:focus, +.colors-custom .wp_widget_tag_cloud a:hover, +.colors-custom .wp_widget_tag_cloud a:focus { + border-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ +} + +.colors-custom thead th { + border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ +} + +.colors-custom .entry-footer .cat-links .icon, +.colors-custom .entry-footer .tags-links .icon { + color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ +} + +.colors-custom button.secondary, +.colors-custom input[type="reset"], +.colors-custom input[type="button"].secondary, +.colors-custom input[type="reset"].secondary, +.colors-custom input[type="submit"].secondary, +.colors-custom .prev.page-numbers, +.colors-custom .next.page-numbers { + background-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */ +} + +.colors-custom .widget .tagcloud a, +.colors-custom .widget.widget_tag_cloud a, +.colors-custom .wp_widget_tag_cloud a { + border-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */ +} + +.colors-custom.twentyseventeen-front-page article:not(.has-post-thumbnail):not(:first-child), +.colors-custom .widget ul li { + border-top-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */ +} + +.colors-custom .widget ul li { + border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */ +} + +.colors-custom pre, +.colors-custom mark, +.colors-custom ins { + background: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */ +} + +.colors-custom .navigation-top, +.colors-custom .main-navigation > div > ul, +.colors-custom .pagination, +.colors-custom .comments-pagination, +.colors-custom .entry-footer, +.colors-custom .site-footer { + border-top-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */ +} + +.colors-custom .navigation-top, +.colors-custom .main-navigation li, +.colors-custom .entry-footer, +.colors-custom .single-featured-image-header, +.colors-custom .site-content .wp-playlist-light .wp-playlist-item, +.colors-custom tr { + border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */ +} + +.colors-custom .site-content .wp-playlist-light { + border-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */ +} + +.colors-custom .site-header, +.colors-custom .single-featured-image-header { + background-color: hsl( ' . $hue . ', ' . $saturation . ', 98% ); /* base: #fafafa; */ +} + +.colors-custom button, +.colors-custom input[type="button"], +.colors-custom input[type="submit"], +.colors-custom .entry-footer .edit-link a.post-edit-link, +.colors-custom .social-navigation a, +.colors-custom .site-content .wp-playlist-light a.wp-playlist-caption:hover, +.colors-custom .site-content .wp-playlist-light .wp-playlist-item:hover a, +.colors-custom .site-content .wp-playlist-light .wp-playlist-item:focus a, +.colors-custom .site-content .wp-playlist-light .wp-playlist-item:hover, +.colors-custom .site-content .wp-playlist-light .wp-playlist-item:focus, +.colors-custom .prev.page-numbers:focus, +.colors-custom .prev.page-numbers:hover, +.colors-custom .next.page-numbers:focus, +.colors-custom .next.page-numbers:hover, +.colors-custom.has-header-image .site-title, +.colors-custom.has-header-video .site-title, +.colors-custom.has-header-image .site-title a, +.colors-custom.has-header-video .site-title a, +.colors-custom.has-header-image .site-description, +.colors-custom.has-header-video .site-description { + color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ +} + +body.colors-custom, +.colors-custom .navigation-top, +.colors-custom .main-navigation ul { + background: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ +} + +.colors-custom .widget ul li a, +.colors-custom .site-footer .widget-area ul li a { + -webkit-box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: rgba(255, 255, 255, 1); */ + box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: rgba(255, 255, 255, 1); */ +} + +.colors-custom .menu-toggle, +.colors-custom .menu-toggle:hover, +.colors-custom .menu-toggle:focus, +.colors-custom .menu .dropdown-toggle, +.colors-custom .menu-scroll-down, +.colors-custom .menu-scroll-down:hover, +.colors-custom .menu-scroll-down:focus { + background-color: transparent; +} + +.colors-custom .widget .tagcloud a, +.colors-custom .widget .tagcloud a:focus, +.colors-custom .widget .tagcloud a:hover, +.colors-custom .widget.widget_tag_cloud a, +.colors-custom .widget.widget_tag_cloud a:focus, +.colors-custom .widget.widget_tag_cloud a:hover, +.colors-custom .wp_widget_tag_cloud a, +.colors-custom .wp_widget_tag_cloud a:focus, +.colors-custom .wp_widget_tag_cloud a:hover, +.colors-custom .entry-footer .edit-link a.post-edit-link:focus, +.colors-custom .entry-footer .edit-link a.post-edit-link:hover { + -webkit-box-shadow: none !important; + box-shadow: none !important; +} + +/* Reset non-customizable hover styling for links */ +.colors-custom .entry-content a:hover, +.colors-custom .entry-content a:focus, +.colors-custom .entry-summary a:hover, +.colors-custom .entry-summary a:focus, +.colors-custom .comment-content a:focus, +.colors-custom .comment-content a:hover, +.colors-custom .widget a:hover, +.colors-custom .widget a:focus, +.colors-custom .site-footer .widget-area a:hover, +.colors-custom .site-footer .widget-area a:focus, +.colors-custom .posts-navigation a:hover, +.colors-custom .posts-navigation a:focus, +.colors-custom .widget_authors a:hover strong, +.colors-custom .widget_authors a:focus strong { + -webkit-box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 3px 0 rgba(0, 0, 0, 1); + box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 3px 0 rgba(0, 0, 0, 1); +} + +.colors-custom .gallery-item a, +.colors-custom .gallery-item a:hover, +.colors-custom .gallery-item a:focus { + -webkit-box-shadow: none; + box-shadow: none; +} + +@media screen and (min-width: 48em) { + + .colors-custom .nav-links .nav-previous .nav-title .icon, + .colors-custom .nav-links .nav-next .nav-title .icon { + color: hsl( ' . $hue . ', ' . $saturation . ', 20% ); /* base: #222; */ + } + + .colors-custom .main-navigation li li:hover, + .colors-custom .main-navigation li li.focus { + background: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */ + } + + .colors-custom .navigation-top .menu-scroll-down { + color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */; + } + + .colors-custom abbr[title] { + border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */; + } + + .colors-custom .main-navigation ul ul { + border-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ + background: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ + } + + .colors-custom .main-navigation ul li.menu-item-has-children:before, + .colors-custom .main-navigation ul li.page_item_has_children:before { + border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ + } + + .colors-custom .main-navigation ul li.menu-item-has-children:after, + .colors-custom .main-navigation ul li.page_item_has_children:after { + border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ + } + + .colors-custom .main-navigation li li.focus > a, + .colors-custom .main-navigation li li:focus > a, + .colors-custom .main-navigation li li:hover > a, + .colors-custom .main-navigation li li a:hover, + .colors-custom .main-navigation li li a:focus, + .colors-custom .main-navigation li li.current_page_item a:hover, + .colors-custom .main-navigation li li.current-menu-item a:hover, + .colors-custom .main-navigation li li.current_page_item a:focus, + .colors-custom .main-navigation li li.current-menu-item a:focus { + color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ + } +}'; + + /** + * Filters Twenty Seventeen custom colors CSS. + * + * @since Twenty Seventeen 1.0 + * + * @param string $css Base theme colors CSS. + * @param int $hue The user's selected color hue. + * @param string $saturation Filtered theme color saturation level. + */ + return apply_filters( 'twentyseventeen_custom_colors_css', $css, $hue, $saturation ); +} diff --git a/wp-content/themes/twentyseventeen/inc/custom-header.php b/wp-content/themes/twentyseventeen/inc/custom-header.php new file mode 100644 index 0000000..ad266a2 --- /dev/null +++ b/wp-content/themes/twentyseventeen/inc/custom-header.php @@ -0,0 +1,131 @@ + get_parent_theme_file_uri( '/assets/images/header.jpg' ), + 'width' => 2000, + 'height' => 1200, + 'flex-height' => true, + 'video' => true, + 'wp-head-callback' => 'twentyseventeen_header_style', + ) + ) + ); + + register_default_headers( + array( + 'default-image' => array( + 'url' => '%s/assets/images/header.jpg', + 'thumbnail_url' => '%s/assets/images/header.jpg', + 'description' => __( 'Default Header Image', 'twentyseventeen' ), + ), + ) + ); +} +add_action( 'after_setup_theme', 'twentyseventeen_custom_header_setup' ); + +if ( ! function_exists( 'twentyseventeen_header_style' ) ) : + /** + * Styles the header image and text displayed on the blog. + * + * @see twentyseventeen_custom_header_setup(). + */ + function twentyseventeen_header_style() { + $header_text_color = get_header_textcolor(); + + // If no custom options for text are set, let's bail. + // get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value. + if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { + return; + } + + // If we get this far, we have custom styles. Let's do this. + ?> + + ' . __( 'Play background video', 'twentyseventeen' ) . '' . twentyseventeen_get_svg( array( 'icon' => 'play' ) ); + $settings['l10n']['pause'] = '' . __( 'Pause background video', 'twentyseventeen' ) . '' . twentyseventeen_get_svg( array( 'icon' => 'pause' ) ); + return $settings; +} +add_filter( 'header_video_settings', 'twentyseventeen_video_controls' ); diff --git a/wp-content/themes/twentyseventeen/inc/customizer.php b/wp-content/themes/twentyseventeen/inc/customizer.php new file mode 100644 index 0000000..e84d4a4 --- /dev/null +++ b/wp-content/themes/twentyseventeen/inc/customizer.php @@ -0,0 +1,249 @@ +get_setting( 'blogname' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; + + $wp_customize->selective_refresh->add_partial( + 'blogname', + array( + 'selector' => '.site-title a', + 'render_callback' => 'twentyseventeen_customize_partial_blogname', + ) + ); + $wp_customize->selective_refresh->add_partial( + 'blogdescription', + array( + 'selector' => '.site-description', + 'render_callback' => 'twentyseventeen_customize_partial_blogdescription', + ) + ); + + /** + * Custom colors. + */ + $wp_customize->add_setting( + 'colorscheme', + array( + 'default' => 'light', + 'transport' => 'postMessage', + 'sanitize_callback' => 'twentyseventeen_sanitize_colorscheme', + ) + ); + + $wp_customize->add_setting( + 'colorscheme_hue', + array( + 'default' => 250, + 'transport' => 'postMessage', + 'sanitize_callback' => 'absint', // The hue is stored as a positive integer. + ) + ); + + $wp_customize->add_control( + 'colorscheme', + array( + 'type' => 'radio', + 'label' => __( 'Color Scheme', 'twentyseventeen' ), + 'choices' => array( + 'light' => __( 'Light', 'twentyseventeen' ), + 'dark' => __( 'Dark', 'twentyseventeen' ), + 'custom' => __( 'Custom', 'twentyseventeen' ), + ), + 'section' => 'colors', + 'priority' => 5, + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'colorscheme_hue', + array( + 'mode' => 'hue', + 'section' => 'colors', + 'priority' => 6, + ) + ) + ); + + /** + * Theme options. + */ + $wp_customize->add_section( + 'theme_options', + array( + 'title' => __( 'Theme Options', 'twentyseventeen' ), + 'priority' => 130, // Before Additional CSS. + ) + ); + + $wp_customize->add_setting( + 'page_layout', + array( + 'default' => 'two-column', + 'sanitize_callback' => 'twentyseventeen_sanitize_page_layout', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'page_layout', + array( + 'label' => __( 'Page Layout', 'twentyseventeen' ), + 'section' => 'theme_options', + 'type' => 'radio', + 'description' => __( 'When the two-column layout is assigned, the page title is in one column and content is in the other.', 'twentyseventeen' ), + 'choices' => array( + 'one-column' => __( 'One Column', 'twentyseventeen' ), + 'two-column' => __( 'Two Column', 'twentyseventeen' ), + ), + 'active_callback' => 'twentyseventeen_is_view_with_layout_option', + ) + ); + + /** + * Filter number of front page sections in Twenty Seventeen. + * + * @since Twenty Seventeen 1.0 + * + * @param int $num_sections Number of front page sections. + */ + $num_sections = apply_filters( 'twentyseventeen_front_page_sections', 4 ); + + // Create a setting and control for each of the sections available in the theme. + for ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) { + $wp_customize->add_setting( + 'panel_' . $i, + array( + 'default' => false, + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'panel_' . $i, + array( + /* translators: %d: The front page section number. */ + 'label' => sprintf( __( 'Front Page Section %d Content', 'twentyseventeen' ), $i ), + 'description' => ( 1 !== $i ? '' : __( 'Select pages to feature in each area from the dropdowns. Add an image to a section by setting a featured image in the page editor. Empty sections will not be displayed.', 'twentyseventeen' ) ), + 'section' => 'theme_options', + 'type' => 'dropdown-pages', + 'allow_addition' => true, + 'active_callback' => 'twentyseventeen_is_static_front_page', + ) + ); + + $wp_customize->selective_refresh->add_partial( + 'panel_' . $i, + array( + 'selector' => '#panel' . $i, + 'render_callback' => 'twentyseventeen_front_page_section', + 'container_inclusive' => true, + ) + ); + } +} +add_action( 'customize_register', 'twentyseventeen_customize_register' ); + +/** + * Sanitize the page layout options. + * + * @param string $input Page layout. + */ +function twentyseventeen_sanitize_page_layout( $input ) { + $valid = array( + 'one-column' => __( 'One Column', 'twentyseventeen' ), + 'two-column' => __( 'Two Column', 'twentyseventeen' ), + ); + + if ( array_key_exists( $input, $valid ) ) { + return $input; + } + + return ''; +} + +/** + * Sanitize the colorscheme. + * + * @param string $input Color scheme. + */ +function twentyseventeen_sanitize_colorscheme( $input ) { + $valid = array( 'light', 'dark', 'custom' ); + + if ( in_array( $input, $valid, true ) ) { + return $input; + } + + return 'light'; +} + +/** + * Render the site title for the selective refresh partial. + * + * @since Twenty Seventeen 1.0 + * @see twentyseventeen_customize_register() + * + * @return void + */ +function twentyseventeen_customize_partial_blogname() { + bloginfo( 'name' ); +} + +/** + * Render the site tagline for the selective refresh partial. + * + * @since Twenty Seventeen 1.0 + * @see twentyseventeen_customize_register() + * + * @return void + */ +function twentyseventeen_customize_partial_blogdescription() { + bloginfo( 'description' ); +} + +/** + * Return whether we're previewing the front page and it's a static page. + */ +function twentyseventeen_is_static_front_page() { + return ( is_front_page() && ! is_home() ); +} + +/** + * Return whether we're on a view that supports a one or two column layout. + */ +function twentyseventeen_is_view_with_layout_option() { + // This option is available on all pages. It's also available on archives when there isn't a sidebar. + return ( is_page() || ( is_archive() && ! is_active_sidebar( 'sidebar-1' ) ) ); +} + +/** + * Bind JS handlers to instantly live-preview changes. + */ +function twentyseventeen_customize_preview_js() { + wp_enqueue_script( 'twentyseventeen-customize-preview', get_theme_file_uri( '/assets/js/customize-preview.js' ), array( 'customize-preview' ), '20161002', true ); +} +add_action( 'customize_preview_init', 'twentyseventeen_customize_preview_js' ); + +/** + * Load dynamic logic for the customizer controls area. + */ +function twentyseventeen_panels_js() { + wp_enqueue_script( 'twentyseventeen-customize-controls', get_theme_file_uri( '/assets/js/customize-controls.js' ), array(), '20161020', true ); +} +add_action( 'customize_controls_enqueue_scripts', 'twentyseventeen_panels_js' ); diff --git a/wp-content/themes/twentyseventeen/inc/icon-functions.php b/wp-content/themes/twentyseventeen/inc/icon-functions.php new file mode 100644 index 0000000..34581f6 --- /dev/null +++ b/wp-content/themes/twentyseventeen/inc/icon-functions.php @@ -0,0 +1,220 @@ + '', + 'title' => '', + 'desc' => '', + 'fallback' => false, + ); + + // Parse args. + $args = wp_parse_args( $args, $defaults ); + + // Set aria hidden. + $aria_hidden = ' aria-hidden="true"'; + + // Set ARIA. + $aria_labelledby = ''; + + /* + * Twenty Seventeen doesn't use the SVG title or description attributes; non-decorative icons are described with .screen-reader-text. + * + * However, child themes can use the title and description to add information to non-decorative SVG icons to improve accessibility. + * + * Example 1 with title: 'arrow-right', 'title' => __( 'This is the title', 'textdomain' ) ) ); ?> + * + * Example 2 with title and description: 'arrow-right', 'title' => __( 'This is the title', 'textdomain' ), 'desc' => __( 'This is the description', 'textdomain' ) ) ); ?> + * + * See https://www.paciellogroup.com/blog/2013/12/using-aria-enhance-svg-accessibility/. + */ + if ( $args['title'] ) { + $aria_hidden = ''; + $unique_id = twentyseventeen_unique_id(); + $aria_labelledby = ' aria-labelledby="title-' . $unique_id . '"'; + + if ( $args['desc'] ) { + $aria_labelledby = ' aria-labelledby="title-' . $unique_id . ' desc-' . $unique_id . '"'; + } + } + + // Begin SVG markup. + $svg = ''; + + // Display the title. + if ( $args['title'] ) { + $svg .= '' . esc_html( $args['title'] ) . ''; + + // Display the desc only if the title is already set. + if ( $args['desc'] ) { + $svg .= '' . esc_html( $args['desc'] ) . ''; + } + } + + /* + * Display the icon. + * + * The whitespace around `` is intentional - it is a work around to a keyboard navigation bug in Safari 10. + * + * See https://core.trac.wordpress.org/ticket/38387. + */ + $svg .= ' '; + + // Add some markup to use as a fallback for browsers that do not support SVGs. + if ( $args['fallback'] ) { + $svg .= ''; + } + + $svg .= ''; + + return $svg; +} + +/** + * Display SVG icons in social links menu. + * + * @param string $item_output The menu item output. + * @param WP_Post $item Menu item object. + * @param int $depth Depth of the menu. + * @param array $args wp_nav_menu() arguments. + * @return string $item_output The menu item output with social icon. + */ +function twentyseventeen_nav_menu_social_icons( $item_output, $item, $depth, $args ) { + // Get supported social icons. + $social_icons = twentyseventeen_social_links_icons(); + + // Change SVG icon inside social links menu if there is supported URL. + if ( 'social' === $args->theme_location ) { + foreach ( $social_icons as $attr => $value ) { + if ( false !== strpos( $item_output, $attr ) ) { + $item_output = str_replace( $args->link_after, '' . twentyseventeen_get_svg( array( 'icon' => esc_attr( $value ) ) ), $item_output ); + } + } + } + + return $item_output; +} +add_filter( 'walker_nav_menu_start_el', 'twentyseventeen_nav_menu_social_icons', 10, 4 ); + +/** + * Add dropdown icon if menu item has children. + * + * @param string $title The menu item's title. + * @param WP_Post $item The current menu item. + * @param array $args An array of wp_nav_menu() arguments. + * @param int $depth Depth of menu item. Used for padding. + * @return string $title The menu item's title with dropdown icon. + */ +function twentyseventeen_dropdown_icon_to_menu_link( $title, $item, $args, $depth ) { + if ( 'top' === $args->theme_location ) { + foreach ( $item->classes as $value ) { + if ( 'menu-item-has-children' === $value || 'page_item_has_children' === $value ) { + $title = $title . twentyseventeen_get_svg( array( 'icon' => 'angle-down' ) ); + } + } + } + + return $title; +} +add_filter( 'nav_menu_item_title', 'twentyseventeen_dropdown_icon_to_menu_link', 10, 4 ); + +/** + * Returns an array of supported social links (URL and icon name). + * + * @return array $social_links_icons + */ +function twentyseventeen_social_links_icons() { + // Supported social links icons. + $social_links_icons = array( + 'behance.net' => 'behance', + 'codepen.io' => 'codepen', + 'deviantart.com' => 'deviantart', + 'digg.com' => 'digg', + 'docker.com' => 'dockerhub', + 'dribbble.com' => 'dribbble', + 'dropbox.com' => 'dropbox', + 'facebook.com' => 'facebook', + 'flickr.com' => 'flickr', + 'foursquare.com' => 'foursquare', + 'plus.google.com' => 'google-plus', + 'github.com' => 'github', + 'instagram.com' => 'instagram', + 'linkedin.com' => 'linkedin', + 'mailto:' => 'envelope-o', + 'medium.com' => 'medium', + 'pinterest.com' => 'pinterest-p', + 'pscp.tv' => 'periscope', + 'getpocket.com' => 'get-pocket', + 'reddit.com' => 'reddit-alien', + 'skype.com' => 'skype', + 'skype:' => 'skype', + 'slideshare.net' => 'slideshare', + 'snapchat.com' => 'snapchat-ghost', + 'soundcloud.com' => 'soundcloud', + 'spotify.com' => 'spotify', + 'stumbleupon.com' => 'stumbleupon', + 'tumblr.com' => 'tumblr', + 'twitch.tv' => 'twitch', + 'twitter.com' => 'twitter', + 'vimeo.com' => 'vimeo', + 'vine.co' => 'vine', + 'vk.com' => 'vk', + 'wordpress.org' => 'wordpress', + 'wordpress.com' => 'wordpress', + 'yelp.com' => 'yelp', + 'youtube.com' => 'youtube', + ); + + /** + * Filter Twenty Seventeen social links icons. + * + * @since Twenty Seventeen 1.0 + * + * @param array $social_links_icons Array of social links icons. + */ + return apply_filters( 'twentyseventeen_social_links_icons', $social_links_icons ); +} diff --git a/wp-content/themes/twentyseventeen/inc/template-functions.php b/wp-content/themes/twentyseventeen/inc/template-functions.php new file mode 100644 index 0000000..77a8801 --- /dev/null +++ b/wp-content/themes/twentyseventeen/inc/template-functions.php @@ -0,0 +1,102 @@ +' . get_the_author() . '' + ); + + // Finally, let's write all of this to the page. + echo '' . twentyseventeen_time_link() . ''; + } +endif; + + +if ( ! function_exists( 'twentyseventeen_time_link' ) ) : + /** + * Gets a nicely formatted string for the published date. + */ + function twentyseventeen_time_link() { + $time_string = ''; + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $time_string = ''; + } + + $time_string = sprintf( + $time_string, + get_the_date( DATE_W3C ), + get_the_date(), + get_the_modified_date( DATE_W3C ), + get_the_modified_date() + ); + + // Wrap the time string in a link, and preface it with 'Posted on'. + return sprintf( + /* translators: %s: Post date. */ + __( 'Posted on %s', 'twentyseventeen' ), + '' . $time_string . '' + ); + } +endif; + + +if ( ! function_exists( 'twentyseventeen_entry_footer' ) ) : + /** + * Prints HTML with meta information for the categories, tags and comments. + */ + function twentyseventeen_entry_footer() { + + /* translators: Used between list items, there is a space after the comma. */ + $separate_meta = __( ', ', 'twentyseventeen' ); + + // Get Categories for posts. + $categories_list = get_the_category_list( $separate_meta ); + + // Get Tags for posts. + $tags_list = get_the_tag_list( '', $separate_meta ); + + // We don't want to output .entry-footer if it will be empty, so make sure its not. + if ( ( ( twentyseventeen_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) { + + echo '
            '; + + if ( 'post' === get_post_type() ) { + if ( ( $categories_list && twentyseventeen_categorized_blog() ) || $tags_list ) { + echo ''; + + // Make sure there's more than one category before displaying. + if ( $categories_list && twentyseventeen_categorized_blog() ) { + echo '' . twentyseventeen_get_svg( array( 'icon' => 'folder-open' ) ) . '' . __( 'Categories', 'twentyseventeen' ) . '' . $categories_list . ''; + } + + if ( $tags_list && ! is_wp_error( $tags_list ) ) { + echo '' . twentyseventeen_get_svg( array( 'icon' => 'hashtag' ) ) . '' . __( 'Tags', 'twentyseventeen' ) . '' . $tags_list . ''; + } + + echo ''; + } + } + + twentyseventeen_edit_link(); + + echo '
            '; + } + } +endif; + + +if ( ! function_exists( 'twentyseventeen_edit_link' ) ) : + /** + * Returns an accessibility-friendly link to edit a post or page. + * + * This also gives us a little context about what exactly we're editing + * (post or page?) so that users understand a bit more where they are in terms + * of the template hierarchy and their content. Helpful when/if the single-page + * layout with multiple posts/pages shown gets confusing. + */ + function twentyseventeen_edit_link() { + edit_post_link( + sprintf( + /* translators: %s: Post title. */ + __( 'Edit "%s"', 'twentyseventeen' ), + get_the_title() + ), + '', + '' + ); + } +endif; + +/** + * Display a front page section. + * + * @param WP_Customize_Partial $partial Partial associated with a selective refresh request. + * @param integer $id Front page section to display. + */ +function twentyseventeen_front_page_section( $partial = null, $id = 0 ) { + if ( is_a( $partial, 'WP_Customize_Partial' ) ) { + // Find out the id and set it up during a selective refresh. + global $twentyseventeencounter; + + $id = str_replace( 'panel_', '', $partial->id ); + + $twentyseventeencounter = $id; + } + + global $post; // Modify the global post object before setting up post data. + if ( get_theme_mod( 'panel_' . $id ) ) { + $post = get_post( get_theme_mod( 'panel_' . $id ) ); + setup_postdata( $post ); + set_query_var( 'panel', $id ); + + get_template_part( 'template-parts/page/content', 'front-page-panels' ); + + wp_reset_postdata(); + } elseif ( is_customize_preview() ) { + // The output placeholder anchor. + printf( + '
            ' . + '%2$s
            ', + $id, + /* translators: %s: The section ID. */ + sprintf( __( 'Front Page Section %s Placeholder', 'twentyseventeen' ), $id ) + ); + } +} + +/** + * Returns true if a blog has more than 1 category. + * + * @return bool + */ +function twentyseventeen_categorized_blog() { + $category_count = get_transient( 'twentyseventeen_categories' ); + + if ( false === $category_count ) { + // Create an array of all the categories that are attached to posts. + $categories = get_categories( + array( + 'fields' => 'ids', + 'hide_empty' => 1, + // We only need to know if there is more than one category. + 'number' => 2, + ) + ); + + // Count the number of categories that are attached to the posts. + $category_count = count( $categories ); + + set_transient( 'twentyseventeen_categories', $category_count ); + } + + // Allow viewing case of 0 or 1 categories in post preview. + if ( is_preview() ) { + return true; + } + + return $category_count > 1; +} + + +/** + * Flush out the transients used in twentyseventeen_categorized_blog. + */ +function twentyseventeen_category_transient_flusher() { + if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { + return; + } + // Like, beat it. Dig? + delete_transient( 'twentyseventeen_categories' ); +} +add_action( 'edit_category', 'twentyseventeen_category_transient_flusher' ); +add_action( 'save_post', 'twentyseventeen_category_transient_flusher' ); + +if ( ! function_exists( 'wp_body_open' ) ) : + /** + * Fire the wp_body_open action. + * + * Added for backward compatibility to support pre-5.2.0 WordPress versions. + * + * @since Twenty Seventeen 2.2 + */ + function wp_body_open() { + /** + * Triggered after the opening tag. + * + * @since Twenty Seventeen 2.2 + */ + do_action( 'wp_body_open' ); + } +endif; diff --git a/wp-content/themes/twentyseventeen/index.php b/wp-content/themes/twentyseventeen/index.php new file mode 100644 index 0000000..0bf56bb --- /dev/null +++ b/wp-content/themes/twentyseventeen/index.php @@ -0,0 +1,72 @@ + + +
            + + + + + + +
            +
            + + twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '' . __( 'Previous page', 'twentyseventeen' ) . '', + 'next_text' => '' . __( 'Next page', 'twentyseventeen' ) . '' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ), + 'before_page_number' => '' . __( 'Page', 'twentyseventeen' ) . ' ', + ) + ); + + else : + + get_template_part( 'template-parts/post/content', 'none' ); + + endif; + ?> + +
            +
            + +
            + + + +
            +
            +
            + + + +
            +
            +
            + + Themes and click the 'Add New' button. +2. Type in Twenty Seventeen in the search form and press the 'Enter' key on your keyboard. +3. Click on the 'Activate' button to use your new theme right away. +4. Go to https://wordpress.org/support/article/twenty-seventeen/ for a guide on how to customize this theme. +5. Navigate to Appearance > Customize in your admin panel and customize to taste. + +== Copyright == + +Twenty Seventeen WordPress Theme, Copyright 2016-2020 WordPress.org +Twenty Seventeen is distributed under the terms of the GNU GPL + +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 2 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. + +Twenty Seventeen bundles the following third-party resources: + +HTML5 Shiv, Copyright 2014 Alexander Farkas +Licenses: MIT/GPL2 +Source: https://github.com/aFarkas/html5shiv + +jQuery scrollTo, Copyright 2007-2015 Ariel Flesler +License: MIT +Source: https://github.com/flesler/jquery.scrollTo + +normalize.css, Copyright 2012-2016 Nicolas Gallagher and Jonathan Neal +License: MIT +Source: https://necolas.github.io/normalize.css/ + +Font Awesome icons, Copyright Dave Gandy +License: SIL Open Font License, version 1.1. +Source: http://fontawesome.io/ + +Bundled header image, Copyright Alvin Engler +License: CC0 1.0 Universal (CC0 1.0) +Source: https://unsplash.com/@englr?photo=bIhpiQA009k + +== Changelog == + += 2.3 = +* Released: March 31, 2020 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_2.3 + += 2.2 = +* Released: May 7, 2019 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_2.2 + += 2.1 = +* Released: February 21, 2019 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_2.1 + += 2.0 = +* Released: January 9, 2019 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_2.0 + += 1.9 = +* Released: December 19, 2018 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_1.9 + += 1.8 = +* Released: December 6, 2018 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_1.8 + += 1.7 = +* Released: August 2, 2018 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_1.7 + += 1.6 = +* Released: May 17, 2018 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_1.6 + += 1.5 = +* Released: April 4, 2018 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_1.5 + += 1.4 = +* Released: November 14, 2017 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_1.4 + += 1.3 = +* Released: June 8, 2017 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_1.3 + += 1.2 = +* Released: April 18, 2017 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_1.2 + += 1.1 = +* Released: January 6, 2017 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_1.1 + += 1.0 = +* Released: December 6, 2016 + +Initial release diff --git a/wp-content/themes/twentyseventeen/rtl.css b/wp-content/themes/twentyseventeen/rtl.css new file mode 100644 index 0000000..2d8773d --- /dev/null +++ b/wp-content/themes/twentyseventeen/rtl.css @@ -0,0 +1,556 @@ +/* +Theme Name: Twenty Seventeen + +Adding support for languages written in a Right To Left (RTL) direction is easy, +it's just a matter of overwriting all the horizontal positioning attributes +of your CSS stylesheet in a separate stylesheet file named rtl.css. + +https://codex.wordpress.org/Right-to-Left_Language_Support + +*/ + +/* Reset */ + +body { + direction: rtl; + unicode-bidi: embed; +} + +th { + text-align: right; +} + +/* Accessibility */ + +.screen-reader-text:focus { + left: auto; + right: 5px; +} + +/* Typography */ + +textarea { + padding-right: 3px; +} + +li > ul, +li > ol { + margin-left: 0; + margin-right: 1.5em; +} + +th:first-child, +td:first-child { + padding-left: 0.4em; + padding-right: 0; +} + +th:last-child, +td:last-child { + padding-left: 0; + padding-right: 0.4em; +} + +/* Forms */ + +input[type="radio"], +input[type="checkbox"] { + margin-left: 0.5em; + margin-right: 0; +} + +/* Media */ + +.mejs-offscreen { + right: -10000px; +} + +/* Site Branding */ + +.custom-logo-link { + padding-left: 1em; + padding-right: 0; +} + +/* Main Navigation */ + +.main-navigation ul { + text-align: right; +} + +.main-navigation ul ul { + padding-left: 0; + padding-right: 1.5em; +} + +.menu-toggle .icon { + margin-left: 0.5em; + margin-right: 0; +} + +.dropdown-toggle { + left: -0.5em; + right: auto; +} + +/* Front Page */ + +.wp-custom-header-video-button { + left: 30px; + right: auto; +} + +.twentyseventeen-panel .recent-posts .entry-header .edit-link { + margin-left: 0; + margin-right: 1em; +} + +/* Blog, Archive, Search */ + +.blog .entry-meta a.post-edit-link, +.archive .entry-meta a.post-edit-link, +.search .entry-meta a.post-edit-link { + margin-left: 0; + margin-right: 1em; +} + +.search .page .entry-meta a.post-edit-link { + margin-right: 0; +} + +.sticky .icon-thumb-tack { + left: auto; + right: -1.5em; +} + +.prev.page-numbers .icon, +.next.page-numbers .icon { + display: inline-block; + -ms-transform: rotate(180deg); /* IE 9 */ + -webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */ + transform: rotate(180deg); +} + +.prev.page-numbers { + float: right; +} + +.next.page-numbers { + float: left; +} + +.nav-links .nav-previous .nav-title .nav-title-icon-wrapper { + margin-left: 0.5em; + margin-right: 0; +} + +.nav-links .nav-next .nav-title .nav-title-icon-wrapper { + margin-left: 0; + margin-right: 0.5em; +} + +/* Blog Entries */ + +.entry-footer .cat-links, +.entry-footer .tags-links { + padding-left: 0; + padding-right: 2.5em; +} + +.entry-footer .cat-links .icon, +.entry-footer .tags-links .icon { + left: auto; + margin-left: 0.5em; + margin-right: 0; + right: 0; +} + +/* Comments */ + +.comment-body { + margin-left: 0; + margin-right: 65px; +} + +.comment-reply-link .icon { + left: auto; + right: -2em; + -webkit-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + transform: scale(-1, 1); +} + +.comment-author .avatar { + left: auto; + right: -65px; +} + +.comment-reply-link:before { + left: auto; + right: -2em; +} + +.children .comment-author .avatar { + left: auto; + right: -45px; +} + +.form-submit { + text-align: left; +} + +.comment-form #wp-comment-cookies-consent { + margin: 0 0 0 10px; +} + +/* Post Formats */ + +.format-quote blockquote .icon { + left: auto; + right: -1.25em; + -webkit-transform: none; + -ms-transform: none; + transform: none; +} + +/* Post Navigation */ + +.nav-links .nav-previous .nav-title .nav-title-icon-wrapper, +.nav-links .nav-next .nav-title .nav-title-icon-wrapper { + display: inline-block; + -ms-transform: rotate(180deg); /* IE 9 */ + -webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */ + transform: rotate(180deg); +} + +/* Widgets */ + +.widget ul { + margin: 0; +} + +.search-form .search-submit { + left: 3px; + right: auto; +} + +.tagcloud ul li { + float: right; + margin: 4px 0 0 4px; +} + +.widget ul li li { + padding-left: 0; + padding-right: 1.5rem; +} + +.widget_text ul { + margin: 0 1.5em 1.5em 0; +} + +.widget_text ul li ul { + margin: 0 1.5em 0 0; +} + +/* Footer */ + +.social-navigation a { + margin-left: 1em; + margin-right: 0; +} + +/* Customizer styles */ + +.twentyseventeen-customizer.twentyseventeen-front-page .twentyseventeen-panel .twentyseventeen-panel-title { + left: 3.2em; + right: auto; +} + +/* Gallery Styles */ + +.gallery-item, +.gallery-caption { + text-align: right; +} + +/* SVG Fallback */ + +.no-svg .dropdown-toggle { + left: 0; + right: auto; +} + +/* Media queries */ + +@media screen and (min-width: 48em) { + + body.page-template-full-width-page #primary { + float: none; + } + + .has-sidebar:not(.error404) #primary { + float: right; + } + + .has-sidebar #secondary { + float: left; + } + + .error404 #primary { + float: none; + } + + /* Site Branding */ + + .custom-logo-link { + padding-left: 2em; + padding-right: 0; + } + + /* Navigation */ + + .main-navigation ul ul { + padding-right: 0; + } + + .main-navigation ul ul:before, + .main-navigation ul ul:after { + left: 0.5em; + right: auto; + } + + .main-navigation ul ul, + .main-navigation ul ul ul { + left: auto; + right: -999em; + } + + .main-navigation ul ul li:hover > ul, + .main-navigation ul ul li.focus > ul { + left: auto; + right: 100%; + } + + .main-navigation ul li:hover > ul, + .main-navigation ul li.focus > ul { + left: auto; + right: 0.5em; + } + + .main-navigation ul li.menu-item-has-children:before, + .main-navigation ul li.menu-item-has-children:after, + .main-navigation ul li.page_item_has_children:before, + .main-navigation ul li.page_item_has_children:after { + left: 1em; + right: auto; + } + + .main-navigation .menu-item-has-children > a > .icon, + .main-navigation .page_item_has_children > a > .icon { + left: auto; + right: 5px; + } + + .main-navigation ul ul .menu-item-has-children > a > .icon, + .main-navigation ul ul .page_item_has_children > a > .icon { + left: 1em; + right: auto; + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); + } + + /* Scroll down arrow */ + + .navigation-top .menu-scroll-down { + left: 0; + right: auto; + } + + .site-header .menu-scroll-down { + left: 0; + right: auto; + } + + .entry-title a { + margin-left: auto; + margin-right: -2px; + } + + /* Front Page */ + + .page-two-column .panel-content .entry-header { + float: right; + } + + .page-two-column .panel-content .entry-content { + float: left; + } + + /* Front Page - Recent Posts */ + + .page-two-column .panel-content .recent-posts { + clear: left; + float: left; + } + + /* Blog, Archive, Search */ + + .sticky .icon-thumb-tack { + left: auto; + right: -2.5em; + } + + body:not(.has-sidebar):not(.page-one-column) .page-header, + body.has-sidebar.error404 #primary .page-header, + body.page-two-column:not(.archive) #primary .entry-header, + body.page-two-column.archive:not(.has-sidebar) #primary .page-header { + float: right; + } + + .blog:not(.has-sidebar) #primary article, + .archive:not(.has-sidebar):not(.page-one-column) #primary article, + .search:not(.has-sidebar) #primary article, + .has-sidebar.error404 #primary .page-content, + .error404.has-sidebar #primary .page-content, + body.page-two-column:not(.archive) #primary .entry-content, + body.page-two-column #comments { + float: left; + } + + .entry-footer .edit-link a.post-edit-link { + margin-left: 0; + margin-right: 1em; + } + + /* Entry content */ + + /* with sidebar */ + + .has-sidebar .entry-content blockquote.alignleft { + margin-left: 0; + width: 34%; + } + + .has-sidebar #primary .entry-content blockquote.alignright, + .has-sidebar #primary .entry-content blockquote.alignright.below-entry-meta { + margin-right: 0; + width: 34%; + } + + .has-sidebar #primary .entry-content blockquote.alignleft.below-entry-meta { + margin-left: -72.5%; + width: 62%; + } + + /* blog index and archive */ + + .blog:not(.has-sidebar) .entry-content blockquote.alignleft, + .twentyseventeen-front-page.page-two-column .entry-content blockquote.alignleft, + .archive:not(.has-sidebar) .entry-content blockquote.alignleft, + .page-two-column .entry-content blockquote.alignleft { + margin-left: 0; + width: 34%; + } + + .blog:not(.has-sidebar) .entry-content blockquote.alignright, + .twentyseventeen-front-page.page-two-column #primary .entry-content blockquote.alignright, + .archive:not(.has-sidebar) .entry-content blockquote.alignright, + .page-two-column #primary .entry-content blockquote.alignright { + margin-right: -72.5%; + width: 62%; + } + + /* Post formats */ + + .format-quote blockquote .icon { + left: auto; + right: -1.5em; + } + + .navigation.pagination { + float: left; + } + + .has-sidebar .navigation.pagination, + .archive.page-one-column:not(.has-sidebar) .navigation.pagination { + float: none; + } + + .post-navigation .nav-previous { + float: right; + } + + .post-navigation .nav-next { + float: left; + text-align: left; + } + + /* Comments */ + + ol.children .children { + padding-left: 0; + padding-right: 2em; + } + + /* Post Navigation */ + + .nav-links .nav-previous .nav-title .nav-title-icon-wrapper { + left: auto; + right: -2em; + } + + .nav-links .nav-next .nav-title .nav-title-icon-wrapper { + left: -2em; + right: auto; + } + + /* Footer */ + + .site-footer .widget-column.footer-widget-1 { + float: right; + } + + .site-footer .widget-column.footer-widget-2 { + float: left; + } + + .social-navigation { + clear: right; + float: right; + } + + .site-info { + float: right; + } + + .social-navigation + .site-info { + margin-left: 0; + margin-right: 6%; + } +} + +@media screen and (min-width: 67em) { + + /* Sticky posts */ + + .sticky .icon-thumb-tack { + left: auto; + right: -1.25em; + } +} + +@media screen and (min-width: 79em) { + + .has-sidebar #primary .entry-content blockquote.alignright, + .has-sidebar #primary .entry-content blockquote.alignright.below-entry-meta { + margin-right: -20%; + } + + .blog:not(.has-sidebar) .entry-content blockquote.alignleft, + .archive:not(.has-sidebar) .entry-content blockquote.alignleft, + .page-two-column .entry-content blockquote.alignleft, + .twentyseventeen-front-page .entry-content blockquote.alignleft { + margin-left: -20%; + } +} diff --git a/wp-content/themes/twentyseventeen/screenshot.png b/wp-content/themes/twentyseventeen/screenshot.png new file mode 100644 index 0000000..088b741 Binary files /dev/null and b/wp-content/themes/twentyseventeen/screenshot.png differ diff --git a/wp-content/themes/twentyseventeen/search.php b/wp-content/themes/twentyseventeen/search.php new file mode 100644 index 0000000..2558acb --- /dev/null +++ b/wp-content/themes/twentyseventeen/search.php @@ -0,0 +1,72 @@ + + +
            + + + +
            +
            + + twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '' . __( 'Previous page', 'twentyseventeen' ) . '', + 'next_text' => '' . __( 'Next page', 'twentyseventeen' ) . '' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ), + 'before_page_number' => '' . __( 'Page', 'twentyseventeen' ) . ' ', + ) + ); + + else : + ?> + +

            + + +
            +
            + +
            + + + + + + diff --git a/wp-content/themes/twentyseventeen/sidebar.php b/wp-content/themes/twentyseventeen/sidebar.php new file mode 100644 index 0000000..ed441c1 --- /dev/null +++ b/wp-content/themes/twentyseventeen/sidebar.php @@ -0,0 +1,20 @@ + + + diff --git a/wp-content/themes/twentyseventeen/single.php b/wp-content/themes/twentyseventeen/single.php new file mode 100644 index 0000000..afe2e02 --- /dev/null +++ b/wp-content/themes/twentyseventeen/single.php @@ -0,0 +1,47 @@ + + +
            +
            +
            + + '' . __( 'Previous Post', 'twentyseventeen' ) . ' ' . twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '%title', + 'next_text' => '' . __( 'Next Post', 'twentyseventeen' ) . ' %title' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ) . '', + ) + ); + + endwhile; // End the loop. + ?> + +
            +
            + +
            + +>> TABLE OF CONTENTS: +---------------------------------------------------------------- +1.0 Normalize +2.0 Accessibility +3.0 Alignments +4.0 Clearings +5.0 Typography +6.0 Forms +7.0 Formatting +8.0 Lists +9.0 Tables +10.0 Links +11.0 Featured Image Hover +12.0 Navigation +13.0 Layout + 13.1 Header + 13.2 Front Page + 13.3 Regular Content + 13.4 Posts + 13.5 Pages + 13.6 Footer +14.0 Comments +15.0 Widgets +16.0 Media + 16.1 Galleries +17.0 Customizer +18.0 SVGs Fallbacks +19.0 Media Queries +20.0 Print +--------------------------------------------------------------*/ + +/*-------------------------------------------------------------- +1.0 Normalize +Styles based on Normalize v5.0.0 @link https://github.com/necolas/normalize.css +--------------------------------------------------------------*/ + +html { + font-family: sans-serif; + line-height: 1.15; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} + +body { + margin: 0; +} + +article, +aside, +footer, +header, +nav, +section { + display: block; +} + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +figcaption, +figure, +main { + display: block; +} + +figure { + margin: 1em 0; +} + +hr { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; + overflow: visible; +} + +pre { + font-family: monospace, monospace; + font-size: 1em; +} + +a { + background-color: transparent; + -webkit-text-decoration-skip: objects; +} + +a:active, +a:hover { + outline-width: 0; +} + +abbr[title] { + border-bottom: 1px #767676 dotted; + text-decoration: none; +} + +b, +strong { + font-weight: inherit; +} + +b, +strong { + font-weight: 700; +} + +code, +kbd, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +dfn { + font-style: italic; +} + +mark { + background-color: #eee; + color: #222; +} + +small { + font-size: 80%; +} + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +audio, +video { + display: inline-block; +} + +audio:not([controls]) { + display: none; + height: 0; +} + +img { + border-style: none; +} + +svg:not(:root) { + overflow: hidden; +} + +button, +input, +optgroup, +select, +textarea { + font-family: sans-serif; + font-size: 100%; + line-height: 1.15; + margin: 0; +} + +button, +input { + overflow: visible; +} + +button, +select { + text-transform: none; +} + +button, +html [type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +fieldset { + border: 1px solid #bbb; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +legend { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + color: inherit; + display: table; + max-width: 100%; + padding: 0; + white-space: normal; +} + +progress { + display: inline-block; + vertical-align: baseline; +} + +textarea { + overflow: auto; +} + +[type="checkbox"], +[type="radio"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +[type="search"] { + -webkit-appearance: textfield; + outline-offset: -2px; +} + +[type="search"]::-webkit-search-cancel-button, +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +::-webkit-file-upload-button { + -webkit-appearance: button; + font: inherit; +} + +details, +menu { + display: block; +} + +summary { + display: list-item; +} + +canvas { + display: inline-block; +} + +template { + display: none; +} + +[hidden] { + display: none; +} + +/*-------------------------------------------------------------- +2.0 Accessibility +--------------------------------------------------------------*/ + +/* Text meant only for screen readers. */ + +.screen-reader-text { + clip: rect(1px, 1px, 1px, 1px); + height: 1px; + overflow: hidden; + position: absolute !important; + width: 1px; + word-wrap: normal !important; /* Many screen reader and browser combinations announce broken words as they would appear visually. */ +} + +.screen-reader-text:focus { + background-color: #f1f1f1; + -webkit-border-radius: 3px; + border-radius: 3px; + -webkit-box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); + box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); + clip: auto !important; + color: #21759b; + display: block; + font-size: 14px; + font-size: 0.875rem; + font-weight: 700; + height: auto; + left: 5px; + line-height: normal; + padding: 15px 23px 14px; + text-decoration: none; + top: 5px; + width: auto; + z-index: 100000; /* Above WP toolbar. */ +} + +/*-------------------------------------------------------------- +3.0 Alignments +--------------------------------------------------------------*/ + +.alignleft { + display: inline; + float: left; + margin-right: 1.5em; +} + +.alignright { + display: inline; + float: right; + margin-left: 1.5em; +} + +.aligncenter { + clear: both; + display: block; + margin-left: auto; + margin-right: auto; +} + +/*-------------------------------------------------------------- +4.0 Clearings +--------------------------------------------------------------*/ + +.clear:before, +.clear:after, +.entry-content:before, +.entry-content:after, +.entry-footer:before, +.entry-footer:after, +.comment-content:before, +.comment-content:after, +.site-header:before, +.site-header:after, +.site-content:before, +.site-content:after, +.site-footer:before, +.site-footer:after, +.nav-links:before, +.nav-links:after, +.pagination:before, +.pagination:after, +.comment-author:before, +.comment-author:after, +.widget-area:before, +.widget-area:after, +.widget:before, +.widget:after, +.comment-meta:before, +.comment-meta:after { + content: ""; + display: table; + table-layout: fixed; +} + +.clear:after, +.entry-content:after, +.entry-footer:after, +.comment-content:after, +.site-header:after, +.site-content:after, +.site-footer:after, +.nav-links:after, +.pagination:after, +.comment-author:after, +.widget-area:after, +.widget:after, +.comment-meta:after { + clear: both; +} + +/*-------------------------------------------------------------- +5.0 Typography +--------------------------------------------------------------*/ + +body, +button, +input, +select, +textarea { + color: #333; + font-family: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif; + font-size: 15px; + font-size: 0.9375rem; + font-weight: 400; + line-height: 1.66; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + clear: both; + line-height: 1.4; + margin: 0 0 0.75em; + padding: 1.5em 0 0; +} + +h1:first-child, +h2:first-child, +h3:first-child, +h4:first-child, +h5:first-child, +h6:first-child { + padding-top: 0; +} + +h1 { + font-size: 24px; + font-size: 1.5rem; + font-weight: 300; +} + +h2, +.home.blog .entry-title { + color: #666; + font-size: 20px; + font-size: 1.25rem; + font-weight: 300; +} + +h3 { + color: #333; + font-size: 18px; + font-size: 1.125rem; + font-weight: 300; +} + +h4 { + color: #333; + font-size: 16px; + font-size: 1rem; + font-weight: 800; +} + +h5 { + color: #767676; + font-size: 13px; + font-size: 0.8125rem; + font-weight: 800; + letter-spacing: 0.15em; + text-transform: uppercase; +} + +h6 { + color: #333; + font-size: 15px; + font-size: 0.9375rem; + font-weight: 800; +} + +p { + margin: 0 0 1.5em; + padding: 0; +} + +dfn, +cite, +em, +i { + font-style: italic; +} + +blockquote { + color: #666; + font-size: 18px; + font-size: 1.125rem; + font-style: italic; + line-height: 1.7; + margin: 0; + overflow: hidden; + padding: 0; +} + +blockquote cite { + display: block; + font-style: normal; + font-weight: 600; + margin-top: 0.5em; +} + +address { + margin: 0 0 1.5em; +} + +pre { + background: #eee; + font-family: "Courier 10 Pitch", Courier, monospace; + font-size: 15px; + font-size: 0.9375rem; + line-height: 1.6; + margin-bottom: 1.6em; + max-width: 100%; + overflow: auto; + padding: 1.6em; +} + +code, +kbd, +tt, +var { + font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; + font-size: 15px; + font-size: 0.9375rem; +} + +abbr, +acronym { + border-bottom: 1px dotted #666; + cursor: help; +} + +mark, +ins { + background: #eee; + text-decoration: none; +} + +big { + font-size: 125%; +} + +blockquote { + quotes: "" ""; +} + +q { + quotes: "“" "”" "‘" "’"; +} + +blockquote:before, +blockquote:after { + content: ""; +} + +:focus { + outline: none; +} + +/* Typography for Arabic Font */ + +html[lang="ar"] body, +html[lang="ar"] button, +html[lang="ar"] input, +html[lang="ar"] select, +html[lang="ar"] textarea, +html[lang="ary"] body, +html[lang="ary"] button, +html[lang="ary"] input, +html[lang="ary"] select, +html[lang="ary"] textarea, +html[lang="azb"] body, +html[lang="azb"] button, +html[lang="azb"] input, +html[lang="azb"] select, +html[lang="azb"] textarea, +html[lang="fa-IR"] body, +html[lang="fa-IR"] button, +html[lang="fa-IR"] input, +html[lang="fa-IR"] select, +html[lang="fa-IR"] textarea, +html[lang="haz"] body, +html[lang="haz"] button, +html[lang="haz"] input, +html[lang="haz"] select, +html[lang="haz"] textarea, +html[lang="ps"] body, +html[lang="ps"] button, +html[lang="ps"] input, +html[lang="ps"] select, +html[lang="ps"] textarea, +html[lang="ur"] body, +html[lang="ur"] button, +html[lang="ur"] input, +html[lang="ur"] select, +html[lang="ur"] textarea { + font-family: Tahoma, Arial, sans-serif; +} + +html[lang="ar"] h1, +html[lang="ar"] h2, +html[lang="ar"] h3, +html[lang="ar"] h4, +html[lang="ar"] h5, +html[lang="ar"] h6, +html[lang="ary"] h1, +html[lang="ary"] h2, +html[lang="ary"] h3, +html[lang="ary"] h4, +html[lang="ary"] h5, +html[lang="ary"] h6, +html[lang="azb"] h1, +html[lang="azb"] h2, +html[lang="azb"] h3, +html[lang="azb"] h4, +html[lang="azb"] h5, +html[lang="azb"] h6, +html[lang="fa-IR"] h1, +html[lang="fa-IR"] h2, +html[lang="fa-IR"] h3, +html[lang="fa-IR"] h4, +html[lang="fa-IR"] h5, +html[lang="fa-IR"] h6, +html[lang="haz"] h1, +html[lang="haz"] h2, +html[lang="haz"] h3, +html[lang="haz"] h4, +html[lang="haz"] h5, +html[lang="haz"] h6, +html[lang="ps"] h1, +html[lang="ps"] h2, +html[lang="ps"] h3, +html[lang="ps"] h4, +html[lang="ps"] h5, +html[lang="ps"] h6, +html[lang="ur"] h1, +html[lang="ur"] h2, +html[lang="ur"] h3, +html[lang="ur"] h4, +html[lang="ur"] h5, +html[lang="ur"] h6 { + font-weight: 700; +} + +/* Typography for Chinese Font */ + +html[lang^="zh-"] body, +html[lang^="zh-"] button, +html[lang^="zh-"] input, +html[lang^="zh-"] select, +html[lang^="zh-"] textarea { + font-family: "PingFang TC", "Helvetica Neue", Helvetica, STHeitiTC-Light, Arial, sans-serif; +} + +html[lang="zh-CN"] body, +html[lang="zh-CN"] button, +html[lang="zh-CN"] input, +html[lang="zh-CN"] select, +html[lang="zh-CN"] textarea { + font-family: "PingFang SC", "Helvetica Neue", Helvetica, STHeitiSC-Light, Arial, sans-serif; +} + +html[lang^="zh-"] h1, +html[lang^="zh-"] h2, +html[lang^="zh-"] h3, +html[lang^="zh-"] h4, +html[lang^="zh-"] h5, +html[lang^="zh-"] h6 { + font-weight: 700; +} + +/* Typography for Cyrillic Font */ + +html[lang="bg-BG"] body, +html[lang="bg-BG"] button, +html[lang="bg-BG"] input, +html[lang="bg-BG"] select, +html[lang="bg-BG"] textarea, +html[lang="ru-RU"] body, +html[lang="ru-RU"] button, +html[lang="ru-RU"] input, +html[lang="ru-RU"] select, +html[lang="ru-RU"] textarea, +html[lang="uk"] body, +html[lang="uk"] button, +html[lang="uk"] input, +html[lang="uk"] select, +html[lang="uk"] textarea { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +html[lang="bg-BG"] h1, +html[lang="bg-BG"] h2, +html[lang="bg-BG"] h3, +html[lang="bg-BG"] h4, +html[lang="bg-BG"] h5, +html[lang="bg-BG"] h6, +html[lang="ru-RU"] h1, +html[lang="ru-RU"] h2, +html[lang="ru-RU"] h3, +html[lang="ru-RU"] h4, +html[lang="ru-RU"] h5, +html[lang="ru-RU"] h6, +html[lang="uk"] h1, +html[lang="uk"] h2, +html[lang="uk"] h3, +html[lang="uk"] h4, +html[lang="uk"] h5, +html[lang="uk"] h6 { + font-weight: 700; + line-height: 1.2; +} + +/* Typography for Devanagari Font */ + +html[lang="bn-BD"] body, +html[lang="bn-BD"] button, +html[lang="bn-BD"] input, +html[lang="bn-BD"] select, +html[lang="bn-BD"] textarea, +html[lang="hi-IN"] body, +html[lang="hi-IN"] button, +html[lang="hi-IN"] input, +html[lang="hi-IN"] select, +html[lang="hi-IN"] textarea, +html[lang="mr-IN"] body, +html[lang="mr-IN"] button, +html[lang="mr-IN"] input, +html[lang="mr-IN"] select, +html[lang="mr-IN"] textarea { + font-family: Arial, sans-serif; +} + +html[lang="bn-BD"] h1, +html[lang="bn-BD"] h2, +html[lang="bn-BD"] h3, +html[lang="bn-BD"] h4, +html[lang="bn-BD"] h5, +html[lang="bn-BD"] h6, +html[lang="hi-IN"] h1, +html[lang="hi-IN"] h2, +html[lang="hi-IN"] h3, +html[lang="hi-IN"] h4, +html[lang="hi-IN"] h5, +html[lang="hi-IN"] h6, +html[lang="mr-IN"] h1, +html[lang="mr-IN"] h2, +html[lang="mr-IN"] h3, +html[lang="mr-IN"] h4, +html[lang="mr-IN"] h5, +html[lang="mr-IN"] h6 { + font-weight: 700; +} + +/* Typography for Greek Font */ + +html[lang="el"] body, +html[lang="el"] button, +html[lang="el"] input, +html[lang="el"] select, +html[lang="el"] textarea { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +html[lang="el"] h1, +html[lang="el"] h2, +html[lang="el"] h3, +html[lang="el"] h4, +html[lang="el"] h5, +html[lang="el"] h6 { + font-weight: 700; + line-height: 1.3; +} + +/* Typography for Gujarati Font */ + +html[lang="gu-IN"] body, +html[lang="gu-IN"] button, +html[lang="gu-IN"] input, +html[lang="gu-IN"] select, +html[lang="gu-IN"] textarea { + font-family: Arial, sans-serif; +} + +html[lang="gu-IN"] h1, +html[lang="gu-IN"] h2, +html[lang="gu-IN"] h3, +html[lang="gu-IN"] h4, +html[lang="gu-IN"] h5, +html[lang="gu-IN"] h6 { + font-weight: 700; +} + +/* Typography for Hebrew Font */ + +html[lang="he-IL"] body, +html[lang="he-IL"] button, +html[lang="he-IL"] input, +html[lang="he-IL"] select, +html[lang="he-IL"] textarea { + font-family: "Arial Hebrew", Arial, sans-serif; +} + +html[lang="he-IL"] h1, +html[lang="he-IL"] h2, +html[lang="he-IL"] h3, +html[lang="he-IL"] h4, +html[lang="he-IL"] h5, +html[lang="he-IL"] h6 { + font-weight: 700; +} + +/* Typography for Japanese Font */ + +html[lang="ja"] body, +html[lang="ja"] button, +html[lang="ja"] input, +html[lang="ja"] select, +html[lang="ja"] textarea { + font-family: "Hiragino Kaku Gothic Pro", Meiryo, sans-serif; +} + +html[lang="ja"] h1, +html[lang="ja"] h2, +html[lang="ja"] h3, +html[lang="ja"] h4, +html[lang="ja"] h5, +html[lang="ja"] h6 { + font-weight: 700; +} + +/* Typography for Korean font */ + +html[lang="ko-KR"] body, +html[lang="ko-KR"] button, +html[lang="ko-KR"] input, +html[lang="ko-KR"] select, +html[lang="ko-KR"] textarea { + font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; +} + +html[lang="ko-KR"] h1, +html[lang="ko-KR"] h2, +html[lang="ko-KR"] h3, +html[lang="ko-KR"] h4, +html[lang="ko-KR"] h5, +html[lang="ko-KR"] h6 { + font-weight: 600; +} + +/* Typography for Thai Font */ + +html[lang="th"] h1, +html[lang="th"] h2, +html[lang="th"] h3, +html[lang="th"] h4, +html[lang="th"] h5, +html[lang="th"] h6 { + line-height: 1.65; + font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +html[lang="th"] body, +html[lang="th"] button, +html[lang="th"] input, +html[lang="th"] select, +html[lang="th"] textarea { + line-height: 1.8; + font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +/* Remove letter-spacing for all non-latin alphabets */ + +html[lang="ar"] *, +html[lang="ary"] *, +html[lang="azb"] *, +html[lang="haz"] *, +html[lang="ps"] *, +html[lang^="zh-"] *, +html[lang="bg-BG"] *, +html[lang="ru-RU"] *, +html[lang="uk"] *, +html[lang="bn-BD"] *, +html[lang="hi-IN"] *, +html[lang="mr-IN"] *, +html[lang="el"] *, +html[lang="gu-IN"] *, +html[lang="he-IL"] *, +html[lang="ja"] *, +html[lang="ko-KR"] *, +html[lang="th"] * { + letter-spacing: 0 !important; +} + +/*-------------------------------------------------------------- +6.0 Forms +--------------------------------------------------------------*/ + +label { + color: #333; + display: block; + font-weight: 800; + margin-bottom: 0.5em; +} + +fieldset { + margin-bottom: 1em; +} + +input[type="text"], +input[type="email"], +input[type="url"], +input[type="password"], +input[type="search"], +input[type="number"], +input[type="tel"], +input[type="range"], +input[type="date"], +input[type="month"], +input[type="week"], +input[type="time"], +input[type="datetime"], +input[type="datetime-local"], +input[type="color"], +textarea { + color: #666; + background: #fff; + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0)); + border: 1px solid #bbb; + -webkit-border-radius: 3px; + border-radius: 3px; + display: block; + padding: 0.7em; + width: 100%; +} + +input[type="text"]:focus, +input[type="email"]:focus, +input[type="url"]:focus, +input[type="password"]:focus, +input[type="search"]:focus, +input[type="number"]:focus, +input[type="tel"]:focus, +input[type="range"]:focus, +input[type="date"]:focus, +input[type="month"]:focus, +input[type="week"]:focus, +input[type="time"]:focus, +input[type="datetime"]:focus, +input[type="datetime-local"]:focus, +input[type="color"]:focus, +textarea:focus { + color: #222; + border-color: #333; +} + +select { + border: 1px solid #bbb; + -webkit-border-radius: 3px; + border-radius: 3px; + height: 3em; + max-width: 100%; +} + +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted #333; +} + +input[type="radio"], +input[type="checkbox"] { + margin-right: 0.5em; +} + +input[type="radio"] + label, +input[type="checkbox"] + label { + font-weight: 400; +} + +button, +input[type="button"], +input[type="submit"] { + background-color: #222; + border: 0; + -webkit-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: none; + box-shadow: none; + color: #fff; + cursor: pointer; + display: inline-block; + font-size: 14px; + font-size: 0.875rem; + font-weight: 800; + line-height: 1; + padding: 1em 2em; + text-shadow: none; + -webkit-transition: background 0.2s; + transition: background 0.2s; +} + +input + button, +input + input[type="button"], +input + input[type="submit"] { + padding: 0.75em 2em; +} + +button.secondary, +input[type="reset"], +input[type="button"].secondary, +input[type="reset"].secondary, +input[type="submit"].secondary { + background-color: #ddd; + color: #222; +} + +:not( .mejs-button ) > button:hover, +:not( .mejs-button ) > button:focus, +input[type="button"]:hover, +input[type="button"]:focus, +input[type="submit"]:hover, +input[type="submit"]:focus { + background: #767676; +} + +button.secondary:hover, +button.secondary:focus, +input[type="reset"]:hover, +input[type="reset"]:focus, +input[type="button"].secondary:hover, +input[type="button"].secondary:focus, +input[type="reset"].secondary:hover, +input[type="reset"].secondary:focus, +input[type="submit"].secondary:hover, +input[type="submit"].secondary:focus { + background: #bbb; +} + +/* Placeholder text color -- selectors need to be separate to work. */ +::-webkit-input-placeholder { + color: #333; + font-family: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif; +} + +:-moz-placeholder { + color: #333; + font-family: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif; +} + +::-moz-placeholder { + color: #333; + font-family: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif; + opacity: 1; + /* Since FF19 lowers the opacity of the placeholder by default */ +} + +:-ms-input-placeholder { + color: #333; + font-family: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif; +} + +/*-------------------------------------------------------------- +7.0 Formatting +--------------------------------------------------------------*/ + +hr { + background-color: #bbb; + border: 0; + height: 1px; + margin-bottom: 1.5em; +} + +/*-------------------------------------------------------------- +8.0 Lists +--------------------------------------------------------------*/ + +ul, +ol { + margin: 0 0 1.5em; + padding: 0; +} + +ul { + list-style: disc; +} + +ol { + list-style: decimal; +} + +li > ul, +li > ol { + margin-bottom: 0; + margin-left: 1.5em; +} + +dt { + font-weight: 700; +} + +dd { + margin: 0 1.5em 1.5em; +} + +/*-------------------------------------------------------------- +9.0 Tables +--------------------------------------------------------------*/ + +table { + border-collapse: collapse; + margin: 0 0 1.5em; + width: 100%; +} + +thead th { + border-bottom: 2px solid #bbb; + padding-bottom: 0.5em; +} + +th { + padding: 0.4em; + text-align: left; +} + +tr { + border-bottom: 1px solid #eee; +} + +td { + padding: 0.4em; +} + +th:first-child, +td:first-child { + padding-left: 0; +} + +th:last-child, +td:last-child { + padding-right: 0; +} + +/*-------------------------------------------------------------- +10.0 Links +--------------------------------------------------------------*/ + +a { + color: #222; + text-decoration: none; +} + +a:focus { + outline: thin dotted; +} + +a:hover, +a:active { + color: #000; + outline: 0; +} + +/* Hover effects */ + +.entry-content a, +.entry-summary a, +.comment-content a, +.widget a, +.site-footer .widget-area a, +.posts-navigation a, +.widget_authors a strong { + -webkit-box-shadow: inset 0 -1px 0 rgba(15, 15, 15, 1); + box-shadow: inset 0 -1px 0 rgba(15, 15, 15, 1); + -webkit-transition: color 80ms ease-in, -webkit-box-shadow 130ms ease-in-out; + transition: color 80ms ease-in, -webkit-box-shadow 130ms ease-in-out; + transition: color 80ms ease-in, box-shadow 130ms ease-in-out; + transition: color 80ms ease-in, box-shadow 130ms ease-in-out, -webkit-box-shadow 130ms ease-in-out; +} + +.entry-title a, +.entry-meta a, +.page-links a, +.page-links a .page-number, +.entry-footer a, +.entry-footer .cat-links a, +.entry-footer .tags-links a, +.edit-link a, +.post-navigation a, +.logged-in-as a, +.comment-navigation a, +.comment-metadata a, +.comment-metadata a.comment-edit-link, +.comment-reply-link, +a .nav-title, +.pagination a, +.comments-pagination a, +.site-info a, +.widget .widget-title a, +.widget ul li a, +.site-footer .widget-area ul li a, +.site-footer .widget-area ul li a { + -webkit-box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 1); + box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 1); + text-decoration: none; + -webkit-transition: color 80ms ease-in, -webkit-box-shadow 130ms ease-in-out; + transition: color 80ms ease-in, -webkit-box-shadow 130ms ease-in-out; + transition: color 80ms ease-in, box-shadow 130ms ease-in-out; + transition: color 80ms ease-in, box-shadow 130ms ease-in-out, -webkit-box-shadow 130ms ease-in-out; +} + +.entry-content a:focus, +.entry-content a:hover, +.entry-summary a:focus, +.entry-summary a:hover, +.comment-content a:focus, +.comment-content a:hover, +.widget a:focus, +.widget a:hover, +.site-footer .widget-area a:focus, +.site-footer .widget-area a:hover, +.posts-navigation a:focus, +.posts-navigation a:hover, +.comment-metadata a:focus, +.comment-metadata a:hover, +.comment-metadata a.comment-edit-link:focus, +.comment-metadata a.comment-edit-link:hover, +.comment-reply-link:focus, +.comment-reply-link:hover, +.widget_authors a:focus strong, +.widget_authors a:hover strong, +.entry-title a:focus, +.entry-title a:hover, +.entry-meta a:focus, +.entry-meta a:hover, +.page-links a:focus .page-number, +.page-links a:hover .page-number, +.entry-footer a:focus, +.entry-footer a:hover, +.entry-footer .cat-links a:focus, +.entry-footer .cat-links a:hover, +.entry-footer .tags-links a:focus, +.entry-footer .tags-links a:hover, +.post-navigation a:focus, +.post-navigation a:hover, +.pagination a:not(.prev):not(.next):focus, +.pagination a:not(.prev):not(.next):hover, +.comments-pagination a:not(.prev):not(.next):focus, +.comments-pagination a:not(.prev):not(.next):hover, +.logged-in-as a:focus, +.logged-in-as a:hover, +a:focus .nav-title, +a:hover .nav-title, +.edit-link a:focus, +.edit-link a:hover, +.site-info a:focus, +.site-info a:hover, +.widget .widget-title a:focus, +.widget .widget-title a:hover, +.widget ul li a:focus, +.widget ul li a:hover { + color: #000; + -webkit-box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 3px 0 rgba(0, 0, 0, 1); + box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 3px 0 rgba(0, 0, 0, 1); +} + +/* Fixes linked images */ +.entry-content a img, +.comment-content a img, +.widget a img { + -webkit-box-shadow: 0 0 0 8px #fff; + box-shadow: 0 0 0 8px #fff; +} + +.post-navigation a:focus .icon, +.post-navigation a:hover .icon { + color: #222; +} + +/*-------------------------------------------------------------- +11.0 Featured Image Hover +--------------------------------------------------------------*/ + +.post-thumbnail { + margin-bottom: 1em; +} + +.post-thumbnail a img { + -webkit-backface-visibility: hidden; + -webkit-transition: opacity 0.2s; + transition: opacity 0.2s; +} + +.post-thumbnail a:hover img, +.post-thumbnail a:focus img { + opacity: 0.7; +} + +/*-------------------------------------------------------------- +12.0 Navigation +--------------------------------------------------------------*/ + +.navigation-top { + background: #fff; + border-bottom: 1px solid #eee; + border-top: 1px solid #eee; + font-size: 16px; + font-size: 1rem; + position: relative; +} + +.navigation-top .wrap { + max-width: 1000px; + padding: 0; +} + +.navigation-top a { + color: #222; + font-weight: 600; + -webkit-transition: color 0.2s; + transition: color 0.2s; +} + +.navigation-top .current-menu-item > a, +.navigation-top .current_page_item > a { + color: #767676; +} + +.main-navigation { + clear: both; + display: block; +} + +.main-navigation ul { + background: #fff; + list-style: none; + margin: 0; + padding: 0 1.5em; + text-align: left; +} + +/* Hide the menu on small screens when JavaScript is available. + * It only works with JavaScript. + */ + +.js .main-navigation ul, +.main-navigation .menu-item-has-children > a > .icon, +.main-navigation .page_item_has_children > a > .icon, +.main-navigation ul a > .icon { + display: none; +} + +.main-navigation > div > ul { + border-top: 1px solid #eee; + padding: 0.75em 1.695em; +} + +.js .main-navigation.toggled-on > div > ul { + display: block; +} + +.main-navigation ul ul { + padding: 0 0 0 1.5em; +} + +.main-navigation ul ul.toggled-on { + display: block; +} + +.main-navigation ul ul a { + letter-spacing: 0; + padding: 0.4em 0; + position: relative; + text-transform: none; +} + +.main-navigation li { + border-bottom: 1px solid #eee; + position: relative; +} + +.main-navigation li li, +.main-navigation li:last-child { + border: 0; +} + +.main-navigation a { + display: block; + padding: 0.5em 0; + text-decoration: none; +} + +.main-navigation a:hover { + color: #767676; +} + +/* Menu toggle */ + +.menu-toggle { + background-color: transparent; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + color: #222; + display: none; + font-size: 14px; + font-size: 0.875rem; + font-weight: 800; + line-height: 1.5; + margin: 1px auto 2px; + padding: 1em; + text-shadow: none; +} + +/* Display the menu toggle when JavaScript is available. */ + +.js .menu-toggle { + display: block; +} + +.main-navigation.toggled-on ul.nav-menu { + display: block; +} + +.menu-toggle:hover, +.menu-toggle:focus { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} + +.menu-toggle:focus { + outline: thin solid; +} + +.menu-toggle .icon { + margin-right: 0.5em; + top: -2px; +} + +.toggled-on .menu-toggle .icon-bars, +.menu-toggle .icon-close { + display: none; +} + +.toggled-on .menu-toggle .icon-close { + display: inline-block; +} + +/* Dropdown Toggle */ + +.dropdown-toggle { + background-color: transparent; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + color: #222; + display: block; + font-size: 16px; + right: -0.5em; + line-height: 1.5; + margin: 0 auto; + padding: 0.5em; + position: absolute; + text-shadow: none; + top: 0; +} + +.dropdown-toggle:hover, +.dropdown-toggle:focus { + background: transparent; +} + +.dropdown-toggle:focus { + outline: thin dotted; +} + +.dropdown-toggle.toggled-on .icon { + -ms-transform: rotate(-180deg); /* IE 9 */ + -webkit-transform: rotate(-180deg); /* Chrome, Safari, Opera */ + transform: rotate(-180deg); +} + +/* Scroll down arrow */ + +.site-header .menu-scroll-down { + display: none; +} + +/*-------------------------------------------------------------- +13.0 Layout +--------------------------------------------------------------*/ + +html { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +*, +*:before, +*:after { + /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */ + -webkit-box-sizing: inherit; + -moz-box-sizing: inherit; + box-sizing: inherit; +} + +body { + background: #fff; + /* Fallback for when there is no custom background color defined. */ +} + +#page { + position: relative; + word-wrap: break-word; +} + +.wrap { + margin-left: auto; + margin-right: auto; + max-width: 700px; + padding-left: 2em; + padding-right: 2em; +} + +.wrap:after { + clear: both; + content: ""; + display: block; +} + +/*-------------------------------------------------------------- +13.1 Header +--------------------------------------------------------------*/ + +#masthead .wrap { + position: relative; +} + +.site-header { + background-color: #fafafa; + position: relative; +} + +/* Site branding */ + +.site-branding { + padding: 1em 0; + position: relative; + -webkit-transition: margin-bottom 0.2s; + transition: margin-bottom 0.2s; + z-index: 3; +} + +.site-branding a { + text-decoration: none; + -webkit-transition: opacity 0.2s; + transition: opacity 0.2s; +} + +.site-branding a:hover, +.site-branding a:focus { + opacity: 0.7; +} + +.site-title { + clear: none; + font-size: 24px; + font-size: 1.5rem; + font-weight: 800; + line-height: 1.25; + letter-spacing: 0.08em; + margin: 0; + padding: 0; + text-transform: uppercase; +} + +.site-title, +.site-title a { + color: #222; + opacity: 1; /* Prevent opacity from changing during selective refreshes in the customize preview */ +} + +body.has-header-image .site-title, +body.has-header-video .site-title, +body.has-header-image .site-title a, +body.has-header-video .site-title a { + color: #fff; +} + +.site-description { + color: #666; + font-size: 13px; + font-size: 0.8125rem; + margin-bottom: 0; +} + +body.has-header-image .site-description, +body.has-header-video .site-description { + color: #fff; + opacity: 0.8; +} + +.custom-logo-link { + display: inline-block; + padding-right: 1em; + vertical-align: middle; + width: auto; +} + +.custom-logo-link img { + display: inline-block; + max-height: 80px; + width: auto; +} + +body.home.title-tagline-hidden.has-header-image .custom-logo-link img, +body.home.title-tagline-hidden.has-header-video .custom-logo-link img { + max-height: 200px; + max-width: 100%; +} + +.custom-logo-link a:hover, +.custom-logo-link a:focus { + opacity: 0.9; +} + +body:not(.title-tagline-hidden) .site-branding-text { + display: inline-block; + max-width: 100%; + vertical-align: middle; +} + +.custom-header { + position: relative; +} + +.has-header-image.twentyseventeen-front-page .custom-header, +.has-header-video.twentyseventeen-front-page .custom-header, +.has-header-image.home.blog .custom-header, +.has-header-video.home.blog .custom-header { + display: table; + height: 300px; + height: 75vh; + width: 100%; +} + +.custom-header-media { + bottom: 0; + left: 0; + overflow: hidden; + position: absolute; + right: 0; + top: 0; + width: 100%; +} + +.custom-header-media:before { + /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#000000+0,000000+100&0+0,0.3+75 */ + background: -moz-linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0.3) 100%); /* FF3.6-15 */ + background: -webkit-linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0.3) 100%); /* Chrome10-25,Safari5.1-6 */ + background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0.3) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#00000000", endColorstr="#4d000000", GradientType=0); /* IE6-9 */ + bottom: 0; + content: ""; + display: block; + height: 100%; + left: 0; + position: absolute; + right: 0; + z-index: 2; +} + +.has-header-image .custom-header-media img, +.has-header-video .custom-header-media video, +.has-header-video .custom-header-media iframe { + position: fixed; + height: auto; + left: 50%; + max-width: 1000%; + min-height: 100%; + min-width: 100%; + min-width: 100vw; /* vw prevents 1px gap on left that 100% has */ + width: auto; + top: 50%; + padding-bottom: 1px; /* Prevent header from extending beyond the footer */ + -ms-transform: translateX(-50%) translateY(-50%); + -moz-transform: translateX(-50%) translateY(-50%); + -webkit-transform: translateX(-50%) translateY(-50%); + transform: translateX(-50%) translateY(-50%); +} + +.wp-custom-header .wp-custom-header-video-button { /* Specificity prevents .color-dark button overrides */ + background-color: rgba(34, 34, 34, 0.5); + border: 1px solid rgba(255, 255, 255, 0.6); + color: rgba(255, 255, 255, 0.6); + height: 45px; + overflow: hidden; + padding: 0; + position: fixed; + right: 30px; + top: 30px; + -webkit-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out; + transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out; + width: 45px; +} + +.wp-custom-header .wp-custom-header-video-button:hover, +.wp-custom-header .wp-custom-header-video-button:focus { /* Specificity prevents .color-dark button overrides */ + border-color: rgba(255, 255, 255, 0.8); + background-color: rgba(34, 34, 34, 0.8); + color: #fff; +} + +.admin-bar .wp-custom-header-video-button { + top: 62px; +} + +.has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-media img { + bottom: 0; + position: absolute; + top: auto; + -ms-transform: translateX(-50%) translateY(0); + -moz-transform: translateX(-50%) translateY(0); + -webkit-transform: translateX(-50%) translateY(0); + transform: translateX(-50%) translateY(0); +} + +/* For browsers that support 'object-fit' */ +@supports ( object-fit: cover ) { + .has-header-image .custom-header-media img, + .has-header-video .custom-header-media video, + .has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-media img { + height: 100%; + left: 0; + -o-object-fit: cover; + object-fit: cover; + top: 0; + -ms-transform: none; + -moz-transform: none; + -webkit-transform: none; + transform: none; + width: 100%; + } +} + +/* Hides div in Customizer preview when header images or videos change. */ + +body:not(.has-header-image):not(.has-header-video) .custom-header-media { + display: none; +} + +.has-header-image.twentyseventeen-front-page .site-branding, +.has-header-video.twentyseventeen-front-page .site-branding, +.has-header-image.home.blog .site-branding, +.has-header-video.home.blog .site-branding { + display: table-cell; + height: 100%; + vertical-align: bottom; +} + +/*-------------------------------------------------------------- +13.2 Front Page +--------------------------------------------------------------*/ + +.twentyseventeen-front-page .site-content { + padding: 0; +} + +.twentyseventeen-panel { + overflow: hidden; + position: relative; +} + +.panel-image { + background-position: center center; + background-repeat: no-repeat; + -webkit-background-size: cover; + background-size: cover; + position: relative; +} + +.panel-image:before { + /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#000000+0,000000+100&0+0,0.3+100 */ /* FF3.6-15 */ + background: -webkit-linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 100%); /* Chrome10-25,Safari5.1-6 */ + background: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0.3))); + background: -webkit-linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 100%); + background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#00000000", endColorstr="#4d000000", GradientType=0); /* IE6-9 */ + bottom: 0; + content: ""; + left: 0; + right: 0; + position: absolute; + top: 100px; +} + +.twentyseventeen-front-page article:not(.has-post-thumbnail):not(:first-child) { + border-top: 1px solid #ddd; +} + +.panel-content { + position: relative; +} + +.panel-content .wrap { + padding-bottom: 0.5em; + padding-top: 1.75em; +} + +/* Panel edit link */ + +.twentyseventeen-panel .edit-link { + display: block; + margin: 0.3em 0 0; +} + +.twentyseventeen-panel .entry-header .edit-link { + font-size: 14px; + font-size: 0.875rem; +} + +/* Front Page - Recent Posts */ + +.twentyseventeen-front-page .panel-content .recent-posts article { + border: 0; + color: #333; + margin-bottom: 3em; +} + +.recent-posts .entry-header { + margin-bottom: 1.2em; +} + +.page .panel-content .recent-posts .entry-title { + font-size: 20px; + font-size: 1.25rem; + font-weight: 300; + letter-spacing: 0; + text-transform: none; +} + +.twentyseventeen-panel .recent-posts .entry-header .edit-link { + color: #222; + display: inline-block; + font-size: 11px; + font-size: 0.6875rem; + margin-left: 1em; +} + +/*-------------------------------------------------------------- +13.3 Regular Content +--------------------------------------------------------------*/ + +.site-content-contain { + background-color: #fff; + position: relative; +} + +.site-content { + padding: 2.5em 0 0; +} + +/*-------------------------------------------------------------- +13.4 Posts +--------------------------------------------------------------*/ + +/* Post Landing Page */ + +.sticky { + position: relative; +} + +.post:not(.sticky) .icon-thumb-tack { + display: none; +} + +.sticky .icon-thumb-tack { + display: block; + height: 18px; + left: -1.5em; + position: absolute; + top: 1.65em; + width: 20px; +} + +.page .panel-content .entry-title, +.page-title, +body.page:not(.twentyseventeen-front-page) .entry-title { + color: #222; + font-size: 14px; + font-size: 0.875rem; + font-weight: 800; + letter-spacing: 0.14em; + text-transform: uppercase; +} + +.entry-header .entry-title { + margin-bottom: 0.25em; +} + +.entry-title a { + color: #333; + text-decoration: none; + margin-left: -2px; +} + +.entry-title:not(:first-child) { + padding-top: 0; +} + +.entry-meta { + color: #767676; + font-size: 11px; + font-size: 0.6875rem; + font-weight: 800; + letter-spacing: 0.1818em; + padding-bottom: 0.25em; + text-transform: uppercase; +} + +.entry-meta a { + color: #767676; +} + +.byline, +.updated:not(.published) { + display: none; +} + +.single .byline, +.group-blog .byline { + display: inline; +} + +.pagination, +.comments-pagination { + border-top: 1px solid #eee; + font-size: 14px; + font-size: 0.875rem; + font-weight: 800; + padding: 2em 0 3em; + text-align: center; +} + +.pagination .icon, +.comments-pagination .icon { + width: 0.666666666em; + height: 0.666666666em; +} + +.comments-pagination { + border: 0; +} + +.page-numbers { + display: none; + padding: 0.5em 0.75em; +} + +.page-numbers.current { + color: #767676; + display: inline-block; +} + +.page-numbers.current .screen-reader-text { + clip: auto; + height: auto; + overflow: auto; + position: relative !important; + width: auto; +} + +.prev.page-numbers, +.next.page-numbers { + background-color: #ddd; + -webkit-border-radius: 2px; + border-radius: 2px; + display: inline-block; + font-size: 24px; + font-size: 1.5rem; + line-height: 1; + padding: 0.25em 0.5em 0.4em; +} + +.prev.page-numbers, +.next.page-numbers { + -webkit-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out; + transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out; +} + +.prev.page-numbers:focus, +.prev.page-numbers:hover, +.next.page-numbers:focus, +.next.page-numbers:hover { + background-color: #767676; + color: #fff; +} + +.prev.page-numbers { + float: left; +} + +.next.page-numbers { + float: right; +} + +/* Aligned blockquotes */ + +.entry-content blockquote.alignleft, +.entry-content blockquote.alignright { + color: #666; + font-size: 13px; + font-size: 0.8125rem; + width: 48%; +} + +/* Blog landing, search, archives */ + +.blog .site-main > article, +.archive .site-main > article, +.search .site-main > article { + padding-bottom: 2em; +} + +body:not(.twentyseventeen-front-page) .entry-header { + padding: 1em 0; +} + +body:not(.twentyseventeen-front-page) .entry-header, +body:not(.twentyseventeen-front-page) .entry-content, +body:not(.twentyseventeen-front-page) #comments { + margin-left: auto; + margin-right: auto; +} + +body:not(.twentyseventeen-front-page) .entry-header { + padding-top: 0; +} + +.blog .entry-meta a.post-edit-link, +.archive .entry-meta a.post-edit-link, +.search .entry-meta a.post-edit-link { + color: #222; + display: inline-block; + margin-left: 1em; + white-space: nowrap; +} + +.search .page .entry-meta a.post-edit-link { + margin-left: 0; + white-space: nowrap; +} + +.taxonomy-description { + color: #666; + font-size: 13px; + font-size: 0.8125rem; +} + +/* More tag */ + +.entry-content .more-link:before { + content: ""; + display: block; + margin-top: 1.5em; +} + +/* Single Post */ + +.single-post:not(.has-sidebar) #primary, +.page.page-one-column:not(.twentyseventeen-front-page) #primary, +.archive.page-one-column:not(.has-sidebar) .page-header, +.archive.page-one-column:not(.has-sidebar) #primary { + margin-left: auto; + margin-right: auto; + max-width: 740px; +} + +.single-featured-image-header { + background-color: #fafafa; + border-bottom: 1px solid #eee; +} + +.single-featured-image-header img { + display: block; + margin: auto; +} + +.page-links { + font-size: 14px; + font-size: 0.875rem; + font-weight: 800; + padding: 2em 0 3em; +} + +.page-links .page-number { + color: #767676; + display: inline-block; + padding: 0.5em 1em; +} + +.page-links a { + display: inline-block; +} + +.page-links a .page-number { + color: #222; +} + +/* Entry footer */ + +.entry-footer { + border-bottom: 1px solid #eee; + border-top: 1px solid #eee; + margin-top: 2em; + padding: 2em 0; +} + +.entry-footer .cat-links, +.entry-footer .tags-links { + display: block; + font-size: 11px; + font-size: 0.6875rem; + font-weight: 800; + letter-spacing: 0.1818em; + padding-left: 2.5em; + position: relative; + text-transform: uppercase; +} + +.entry-footer .cat-links + .tags-links { + margin-top: 1em; +} + +.entry-footer .cat-links a, +.entry-footer .tags-links a { + color: #333; +} + +.entry-footer .cat-links .icon, +.entry-footer .tags-links .icon { + color: #767676; + left: 0; + margin-right: 0.5em; + position: absolute; + top: 2px; +} + +.entry-footer .edit-link { + display: inline-block; +} + +.entry-footer .edit-link a.post-edit-link { + background-color: #222; + -webkit-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: none; + box-shadow: none; + color: #fff; + display: inline-block; + font-size: 14px; + font-size: 0.875rem; + font-weight: 800; + margin-top: 2em; + padding: 0.7em 2em; + -webkit-transition: background-color 0.2s ease-in-out; + transition: background-color 0.2s ease-in-out; + white-space: nowrap; +} + +.entry-footer .edit-link a.post-edit-link:hover, +.entry-footer .edit-link a.post-edit-link:focus { + background-color: #767676; +} + +/* Post Formats */ + +.blog .format-status .entry-title, +.archive .format-status .entry-title, +.blog .format-aside .entry-title, +.archive .format-aside .entry-title { + display: none; +} + +.format-quote blockquote { + color: #333; + font-size: 20px; + font-size: 1.25rem; + font-weight: 300; + overflow: visible; + position: relative; +} + +.format-quote blockquote .icon { + display: block; + height: 20px; + left: -1.25em; + position: absolute; + top: 0.4em; + -webkit-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + transform: scale(-1, 1); + width: 20px; +} + +/* Post Navigation */ + +.post-navigation { + font-weight: 800; + margin: 3em 0; +} + +.post-navigation .nav-links { + padding: 1em 0; +} + +.nav-subtitle { + background: transparent; + color: #767676; + display: block; + font-size: 11px; + font-size: 0.6875rem; + letter-spacing: 0.1818em; + margin-bottom: 1em; + text-transform: uppercase; +} + +.nav-title { + color: #333; + font-size: 15px; + font-size: 0.9375rem; +} + +.post-navigation .nav-next { + margin-top: 1.5em; +} + +.nav-links .nav-previous .nav-title .nav-title-icon-wrapper { + margin-right: 0.5em; +} + +.nav-links .nav-next .nav-title .nav-title-icon-wrapper { + margin-left: 0.5em; +} + +/*-------------------------------------------------------------- +13.5 Pages +--------------------------------------------------------------*/ + +.page-header { + padding-bottom: 2em; +} + +.page .entry-header .edit-link { + font-size: 14px; + font-size: 0.875rem; +} + +.search .page .entry-header .edit-link { + font-size: 11px; + font-size: 0.6875rem; +} + +.page-links { + clear: both; + margin: 0 0 1.5em; +} + +.page:not(.home) #content { + padding-bottom: 1.5em; +} + +/* 404 page */ + +.error404 .page-content { + padding-bottom: 4em; +} + +.error404 .page-content .search-form, +.search .page-content .search-form { + margin-bottom: 3em; +} + +/*-------------------------------------------------------------- +13.6 Footer +--------------------------------------------------------------*/ + +.site-footer { + border-top: 1px solid #eee; +} + +.site-footer .wrap { + padding-bottom: 1.5em; + padding-top: 2em; +} + +/* Footer widgets */ + +.site-footer .widget-area { + padding-bottom: 2em; + padding-top: 2em; +} + +/* Social nav */ + +.social-navigation { + font-size: 16px; + font-size: 1rem; + margin-bottom: 1em; +} + +.social-navigation ul { + list-style: none; + margin-bottom: 0; + margin-left: 0; +} + +.social-navigation li { + display: inline; +} + +.social-navigation a { + background-color: #767676; + -webkit-border-radius: 40px; + border-radius: 40px; + color: #fff; + display: inline-block; + height: 40px; + margin: 0 1em 0.5em 0; + text-align: center; + width: 40px; +} + +.social-navigation a:hover, +.social-navigation a:focus { + background-color: #333; +} + +.social-navigation .icon { + height: 16px; + top: 12px; + width: 16px; + vertical-align: top; +} + +/* Site info */ + +.site-info { + font-size: 14px; + font-size: 0.875rem; + margin-bottom: 1em; +} + +.site-info a { + color: #666; +} + +.site-info .sep { + margin: 0; + display: block; + visibility: hidden; + height: 0; + width: 100%; +} + +.site-info span[role=separator] { + padding: 0 0.2em 0 0.4em; +} + +.site-info span[role=separator]::before { + content: '\002f'; +} + +/*-------------------------------------------------------------- +14.0 Comments +--------------------------------------------------------------*/ + +#comments { + clear: both; + padding: 2em 0 0.5em; +} + +.comments-title { + font-size: 20px; + font-size: 1.25rem; + margin-bottom: 1.5em; +} + +.comment-list, +.comment-list .children { + list-style: none; + margin: 0; + padding: 0; +} + +.comment-list li:before { + display: none; +} + +.comment-body { + margin-left: 65px; +} + +.comment-author { + font-size: 16px; + font-size: 1rem; + margin-bottom: 0.4em; + position: relative; + z-index: 2; +} + +.comment-author .avatar { + height: 50px; + left: -65px; + position: absolute; + width: 50px; +} + +.comment-author .says { + display: none; +} + +.comment-meta { + margin-bottom: 1.5em; +} + +.comment-metadata { + color: #767676; + font-size: 10px; + font-size: 0.625rem; + font-weight: 800; + letter-spacing: 0.1818em; + text-transform: uppercase; +} + +.comment-metadata a { + color: #767676; +} + +.comment-metadata a.comment-edit-link { + color: #222; + margin-left: 1em; +} + +.comment-body { + color: #333; + font-size: 14px; + font-size: 0.875rem; + margin-bottom: 4em; +} + +.comment-reply-link { + font-weight: 800; + position: relative; +} + +.comment-reply-link .icon { + color: #222; + left: -2em; + height: 1em; + position: absolute; + top: 0; + width: 1em; +} + +.children .comment-author .avatar { + height: 30px; + left: -45px; + width: 30px; +} + +.bypostauthor > .comment-body > .comment-meta > .comment-author .avatar { + border: 1px solid #333; + padding: 2px; +} + +.no-comments, +.comment-awaiting-moderation { + color: #767676; + font-size: 14px; + font-size: 0.875rem; + font-style: italic; +} + +.comments-pagination { + margin: 2em 0 3em; +} + +.form-submit { + text-align: right; +} + +.comment-form #wp-comment-cookies-consent { + margin: 0 10px 0 0; +} + +.comment-form .comment-form-cookies-consent label { + display: inline; +} + +/*-------------------------------------------------------------- +15.0 Widgets +--------------------------------------------------------------*/ + +#secondary { + padding: 1em 0 2em; +} + +.widget { + padding-bottom: 3em; +} + +h2.widget-title { + color: #222; + font-size: 13px; + font-size: 0.8125rem; + font-weight: 800; + letter-spacing: 0.1818em; + margin-bottom: 1.5em; + text-transform: uppercase; +} + +.widget-title a { + color: inherit; +} + +/* widget forms */ + +.widget select { + width: 100%; +} + + +/* widget lists */ + +.widget ul { + list-style: none; + margin: 0; +} + +.widget ul li, +.widget ol li { + border-bottom: 1px solid #ddd; + border-top: 1px solid #ddd; + padding: 0.5em 0; +} + +.widget:not(.widget_tag_cloud) ul li + li { + margin-top: -1px; +} + +.widget ul li ul { + margin: 0 0 -1px; + padding: 0; + position: relative; +} + +.widget ul li li { + border: 0; + padding-left: 24px; + padding-left: 1.5rem; +} + +/* Widget lists of links */ + +.widget_top-posts ul li ul, +.widget_rss_links ul li ul, +.widget-grofile ul.grofile-links li ul, +.widget_pages ul li ul, +.widget_meta ul li ul { + bottom: 0; +} + +.widget_nav_menu ul li li, +.widget_top-posts ul li, +.widget_top-posts ul li li, +.widget_rss_links ul li, +.widget_rss_links ul li li, +.widget-grofile ul.grofile-links li, +.widget-grofile ul.grofile-links li li { + padding-bottom: 0.25em; + padding-top: 0.25em; +} + +.widget_rss ul li { + padding-bottom: 1em; + padding-top: 1em; +} + +/* Widget markup */ + +.widget .post-date, +.widget .rss-date { + font-size: 0.81em; +} + +/* Text widget */ + +.widget_text { + word-wrap: break-word; +} + +.widget_text ul { + list-style: disc; + margin: 0 0 1.5em 1.5em; +} + +.widget_text ol { + list-style: decimal; +} + +.widget_text ul li, +.widget_text ol li { + border: none; +} + +.widget_text ul li:last-child, +.widget_text ol li:last-child { + padding-bottom: 0; +} + +.widget_text ul li ul { + margin: 0 0 0 1.5em; +} + +.widget_text ul li li { + padding-left: 0; + padding-right: 0; +} + +.widget_text ol li { + list-style-position: inside; +} + +.widget_text ol li + li { + margin-top: -1px; +} + +/* RSS Widget */ + +.widget_rss .widget-title .rsswidget:first-child { + float: right; +} + +.widget_rss .widget-title .rsswidget:first-child:hover { + background-color: transparent; +} + +.widget_rss .widget-title .rsswidget:first-child img { + display: block; +} + +.widget_rss ul li { + padding: 2.125em 0; +} + +.widget_rss ul li:first-child { + border-top: none; + padding-top: 0; +} + +.widget_rss li .rsswidget { + font-size: 22px; + font-size: 1.375rem; + font-weight: 300; + line-height: 1.4; +} + +.widget_rss .rss-date, +.widget_rss li cite { + color: #767676; + display: block; + font-size: 10px; + font-size: 0.625rem; + font-style: normal; + font-weight: 800; + letter-spacing: 0.18em; + line-height: 1.5; + text-transform: uppercase; +} + +.widget_rss .rss-date { + margin: 0.5em 0 1.5em; + padding: 0; +} + +.widget_rss .rssSummary { + margin-bottom: 0.5em; +} + +/* Contact Info Widget */ + +.widget_contact_info .contact-map { + margin-bottom: 0.5em; +} + +/* Gravatar */ + +.widget-grofile h4 { + font-size: 16px; + font-size: 1rem; + margin-bottom: 0; +} + +/* Recent Comments */ + +.widget_recent_comments table, +.widget_recent_comments th, +.widget_recent_comments td { + border: 0; +} + +/* Recent Posts widget */ + +.widget_recent_entries .post-date { + display: block; +} + +/* Search */ + +.search-form { + position: relative; +} + +.search-form .search-submit { + bottom: 3px; + padding: 0.5em 1em; + position: absolute; + right: 3px; + top: 3px; +} + +.search-form .search-submit .icon { + height: 24px; + top: -2px; + width: 24px; +} + +/* Tag cloud widget */ + +.tagcloud ul li { + float: left; + border-top: 0; + border-bottom: 0; + padding: 0; + margin: 4px 4px 0 0; +} + +.tagcloud, +.widget_tag_cloud, +.wp_widget_tag_cloud { + line-height: 1.5; +} + +.widget .tagcloud a, +.widget.widget_tag_cloud a, +.wp_widget_tag_cloud a { + border: 1px solid #ddd; + -webkit-box-shadow: none; + box-shadow: none; + display: block; + padding: 4px 10px 5px; + position: relative; + -webkit-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out; + transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out; + width: auto; + word-wrap: break-word; + z-index: 0; +} + +.widget .tagcloud a:hover, +.widget .tagcloud a:focus, +.widget.widget_tag_cloud a:hover, +.widget.widget_tag_cloud a:focus, +.wp_widget_tag_cloud a:hover, +.wp_widget_tag_cloud a:focus { + border-color: #bbb; + -webkit-box-shadow: none; + box-shadow: none; + text-decoration: none; +} + +/* Calendar widget */ + +.widget_calendar .wp-calendar-table { + margin-bottom: 0; +} + +.widget_calendar .wp-calendar-nav { + display: table; + width: 100%; + margin: 0 0 1.5em; + padding: 0.4em 0; +} + +.widget_calendar .wp-calendar-nav span { + display: table-cell; +} + +.widget_calendar .wp-calendar-nav-prev, +.widget_calendar .wp-calendar-nav-next { + width: 40%; +} + +.widget_calendar th, +.widget_calendar td, +.widget_calendar .wp-calendar-nav span { + text-align: center; +} + +.widget_calendar tfoot td { + border: 0; +} + +/* Gallery widget */ + +.gallery-columns-5 .gallery-caption, +.gallery-columns-6 .gallery-caption, +.gallery-columns-7 .gallery-caption, +.gallery-columns-8 .gallery-caption, +.gallery-columns-9 .gallery-caption { + display: none; +} + +/*-------------------------------------------------------------- +16.0 Media +--------------------------------------------------------------*/ + +img, +video { + height: auto; /* Make sure images are scaled correctly. */ + max-width: 100%; /* Adhere to container width. */ +} + +img.alignleft, +img.alignright { + float: none; + margin: 0; +} + +.page-content .wp-smiley, +.entry-content .wp-smiley, +.comment-content .wp-smiley { + border: none; + margin-bottom: 0; + margin-top: 0; + padding: 0; +} + +audio:focus, +video:focus { + outline: thin dotted; +} + +/* Make sure embeds and iframes fit their containers. */ + +embed, +iframe, +object { + margin-bottom: 1.5em; + max-width: 100%; +} + +/* Remove bottom on embeds that wrapped in paragraphs via wpautop. */ + +p > embed:only-child, +p > iframe:only-child, +p > object:only-child { + margin-bottom: 0; +} + +.wp-caption, +.gallery-caption { + color: #666; + font-size: 13px; + font-size: 0.8125rem; + font-style: italic; + margin-bottom: 1.5em; + max-width: 100%; +} + +.wp-caption img[class*="wp-image-"] { + display: block; + margin-left: auto; + margin-right: auto; +} + +.wp-caption .wp-caption-text { + margin: 0.8075em 0; +} + +/* Media Elements */ + +.mejs-container { + margin-bottom: 1.5em; +} + +/* Audio Player */ + +.mejs-controls a.mejs-horizontal-volume-slider, +.mejs-controls a.mejs-horizontal-volume-slider:focus, +.mejs-controls a.mejs-horizontal-volume-slider:hover { + background: transparent; + border: 0; +} + +/* Playlist Color Overrides: Light */ + +.site-content .wp-playlist-light { + border-color: #eee; + color: #222; +} + +.site-content .wp-playlist-light .wp-playlist-current-item .wp-playlist-item-album { + color: #333; +} + +.site-content .wp-playlist-light .wp-playlist-current-item .wp-playlist-item-artist { + color: #767676; +} + +.site-content .wp-playlist-light .wp-playlist-item { + border-bottom: 1px dotted #eee; + -webkit-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out; + transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out; +} + +.site-content .wp-playlist-light .wp-playlist-item:hover, +.site-content .wp-playlist-light .wp-playlist-item:focus { + border-bottom-color: rgba(0, 0, 0, 0); + background-color: #767676; + color: #fff; +} + +.site-content .wp-playlist-light a.wp-playlist-caption:hover, +.site-content .wp-playlist-light .wp-playlist-item:hover a, +.site-content .wp-playlist-light .wp-playlist-item:focus a { + color: #fff; +} + +/* Playlist Color Overrides: Dark */ + +.site-content .wp-playlist-dark { + background: #222; + border-color: #333; +} + +.site-content .wp-playlist-dark .mejs-container .mejs-controls { + background-color: #333; +} + +.site-content .wp-playlist-dark .wp-playlist-caption { + color: #fff; +} + +.site-content .wp-playlist-dark .wp-playlist-current-item .wp-playlist-item-album { + color: #eee; +} + +.site-content .wp-playlist-dark .wp-playlist-current-item .wp-playlist-item-artist { + color: #aaa; +} + +.site-content .wp-playlist-dark .wp-playlist-playing { + background-color: #333; +} + +.site-content .wp-playlist-dark .wp-playlist-item { + border-bottom: 1px dotted #555; + -webkit-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out; + transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out; +} + +.site-content .wp-playlist-dark .wp-playlist-item:hover, +.site-content .wp-playlist-dark .wp-playlist-item:focus { + border-bottom-color: rgba(0, 0, 0, 0); + background-color: #aaa; + color: #222; +} + +.site-content .wp-playlist-dark a.wp-playlist-caption:hover, +.site-content .wp-playlist-dark .wp-playlist-item:hover a, +.site-content .wp-playlist-dark .wp-playlist-item:focus a { + color: #222; +} + +/* Playlist Style Overrides */ + +.site-content .wp-playlist { + padding: 0.625em 0.625em 0.3125em; +} + +.site-content .wp-playlist-current-item .wp-playlist-item-title { + font-weight: 700; +} + +.site-content .wp-playlist-current-item .wp-playlist-item-album { + font-style: normal; +} + +.site-content .wp-playlist-current-item .wp-playlist-item-artist { + font-size: 10px; + font-size: 0.625rem; + font-weight: 800; + letter-spacing: 0.1818em; + text-transform: uppercase; +} + +.site-content .wp-playlist-item { + padding: 0 0.3125em; + cursor: pointer; +} + +.site-content .wp-playlist-item:last-of-type { + border-bottom: none; +} + +.site-content .wp-playlist-item a { + padding: 0.3125em 0; + border-bottom: none; +} + +.site-content .wp-playlist-item a, +.site-content .wp-playlist-item a:focus, +.site-content .wp-playlist-item a:hover { + -webkit-box-shadow: none; + box-shadow: none; + background: transparent; +} + +.site-content .wp-playlist-item-length { + top: 5px; +} + +/* SVG Icons base styles */ + +.icon { + display: inline-block; + fill: currentColor; + height: 1em; + position: relative; /* Align more nicely with capital letters */ + top: -0.0625em; + vertical-align: middle; + width: 1em; +} + +/*-------------------------------------------------------------- +16.1 Galleries +--------------------------------------------------------------*/ + +.gallery-item { + display: inline-block; + text-align: left; + vertical-align: top; + margin: 0 0 1.5em; + padding: 0 1em 0 0; + width: 50%; +} + +.gallery-columns-1 .gallery-item { + width: 100%; +} + +.gallery-columns-2 .gallery-item { + max-width: 50%; +} + +.gallery-item a, +.gallery-item a:hover, +.gallery-item a:focus, +.widget-area .gallery-item a, +.widget-area .gallery-item a:hover, +.widget-area .gallery-item a:focus { + -webkit-box-shadow: none; + box-shadow: none; + background: none; + display: inline-block; + max-width: 100%; +} + +.gallery-item a img { + display: block; + -webkit-transition: -webkit-filter 0.2s ease-in; + transition: -webkit-filter 0.2s ease-in; + transition: filter 0.2s ease-in; + transition: filter 0.2s ease-in, -webkit-filter 0.2s ease-in; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} + +.gallery-item a:hover img, +.gallery-item a:focus img { + -webkit-filter: opacity(60%); + filter: opacity(60%); +} + +.gallery-caption { + display: block; + text-align: left; + padding: 0 10px 0 0; + margin-bottom: 0; +} + +/*-------------------------------------------------------------- +17.0 Customizer +--------------------------------------------------------------*/ + +.highlight-front-sections.twentyseventeen-customizer.twentyseventeen-front-page .twentyseventeen-panel:after { + border: 2px dashed #0085ba; /* Matches visible edit shortcuts. */ + bottom: 1em; + content: ""; + display: block; + left: 1em; + position: absolute; + right: 1em; + top: 1em; + z-index: 1; +} + +.highlight-front-sections.twentyseventeen-customizer.twentyseventeen-front-page .twentyseventeen-panel .panel-content { + z-index: 2; /* Prevent :after from preventing interactions within the section */ +} + +/* Used for placeholder text */ +.twentyseventeen-customizer.twentyseventeen-front-page .twentyseventeen-panel .twentyseventeen-panel-title { + display: block; + font-size: 14px; + font-size: 0.875rem; + font-weight: 700; + letter-spacing: 1px; + padding: 3em; + text-transform: uppercase; + text-align: center; +} + +/* Show borders on the custom page panels only when the front page sections are being edited */ +.highlight-front-sections.twentyseventeen-customizer.twentyseventeen-front-page .twentyseventeen-panel:nth-of-type(1):after { + border: none; +} + +.twentyseventeen-front-page.twentyseventeen-customizer #primary article.panel-placeholder { + border: 0; +} + +/* Add some space around the visual edit shortcut buttons. */ +.twentyseventeen-panel > .customize-partial-edit-shortcut > button { + top: 30px; + left: 30px; +} + +/* Ensure that placeholder icons are visible. */ +.twentyseventeen-panel .customize-partial-edit-shortcut-hidden:before { + visibility: visible; +} + +/*-------------------------------------------------------------- +18.0 SVGs Fallbacks +--------------------------------------------------------------*/ + +.svg-fallback { + display: none; +} + +.no-svg .svg-fallback { + display: inline-block; +} + +.no-svg .dropdown-toggle { + padding: 0.5em 0 0; + right: 0; + text-align: center; + width: 2em; +} + +.no-svg .dropdown-toggle .svg-fallback.icon-angle-down { + font-size: 20px; + font-size: 1.25rem; + font-weight: 400; + line-height: 1; + -webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */ + -ms-transform: rotate(180deg); /* IE 9 */ + transform: rotate(180deg); +} + +.no-svg .dropdown-toggle.toggled-on .svg-fallback.icon-angle-down { + -webkit-transform: rotate(0); /* Chrome, Safari, Opera */ + -ms-transform: rotate(0); /* IE 9 */ + transform: rotate(0); +} + +.no-svg .dropdown-toggle .svg-fallback.icon-angle-down:before { + content: "\005E"; +} + +/* Social Menu fallbacks */ + +.no-svg .social-navigation a { + background: transparent; + color: #222; + height: auto; + width: auto; +} + +/* Show screen reader text in some cases */ + +.no-svg .next.page-numbers .screen-reader-text, +.no-svg .prev.page-numbers .screen-reader-text, +.no-svg .social-navigation li a .screen-reader-text, +.no-svg .search-submit .screen-reader-text { + clip: auto; + font-size: 16px; + font-size: 1rem; + font-weight: 400; + height: auto; + position: relative !important; /* overrides previous !important styles */ + width: auto; +} + +/*-------------------------------------------------------------- +19.0 Media Queries +--------------------------------------------------------------*/ + +/* Adjust positioning of edit shortcuts, override style in customize-preview.css */ +@media screen and (min-width: 20em) { + + body.customize-partial-edit-shortcuts-shown .site-header .site-title { + padding-left: 0; + } +} + +@media screen and (min-width: 30em) { + + /* Typography */ + + body, + button, + input, + select, + textarea { + font-size: 18px; + font-size: 1.125rem; + } + + h1 { + font-size: 30px; + font-size: 1.875rem; + } + + h2, + .home.blog .entry-title, + .page .panel-content .recent-posts .entry-title { + font-size: 26px; + font-size: 1.625rem; + } + + h3 { + font-size: 22px; + font-size: 1.375rem; + } + + h4 { + font-size: 18px; + font-size: 1.125rem; + } + + h5 { + font-size: 13px; + font-size: 0.8125rem; + } + + h6 { + font-size: 16px; + font-size: 1rem; + } + + .entry-content blockquote.alignleft, + .entry-content blockquote.alignright { + font-size: 14px; + font-size: 0.875rem; + } + + /* Fix image alignment */ + img.alignleft { + float: left; + margin-right: 1.5em; + } + + img.alignright { + float: right; + margin-left: 1.5em; + } + + /* Site Branding */ + + .site-branding { + padding: 3em 0; + } + + /* Front Page */ + + .panel-content .wrap { + padding-bottom: 2em; + padding-top: 3.5em; + } + + .page-one-column .panel-content .wrap { + max-width: 740px; + } + + .panel-content .entry-header { + margin-bottom: 4.5em; + } + + .panel-content .recent-posts .entry-header { + margin-bottom: 0; + } + + /* Blog Index, Archive, Search */ + + .taxonomy-description { + font-size: 14px; + font-size: 0.875rem; + } + + .page-numbers.current { + font-size: 16px; + font-size: 1rem; + } + + /* Site Footer */ + + .site-footer { + font-size: 16px; + font-size: 1rem; + } + + /* Gallery Columns */ + + .gallery-item { + max-width: 25%; + } + + .gallery-columns-1 .gallery-item { + max-width: 100%; + } + + .gallery-columns-2 .gallery-item { + max-width: 50%; + } + + .gallery-columns-3 .gallery-item { + max-width: 33.33%; + } + + .gallery-columns-4 .gallery-item { + max-width: 25%; + } +} + +@media screen and (min-width: 48em) { + + /* Typography */ + + body, + button, + input, + select, + textarea { + font-size: 16px; + font-size: 1rem; + line-height: 1.5; + } + + .entry-content blockquote.alignleft, + .entry-content blockquote.alignright { + font-size: 13px; + font-size: 0.8125rem; + } + + /* Layout */ + + .wrap { + max-width: 1000px; + padding-left: 3em; + padding-right: 3em; + } + + .has-sidebar:not(.error404) #primary { + float: left; + width: 58%; + } + + .has-sidebar #secondary { + float: right; + padding-top: 0; + width: 36%; + } + + .error404 #primary { + float: none; + } + + /* Site Branding */ + + .site-branding { + margin-bottom: 0; + } + + .has-header-image.twentyseventeen-front-page .site-branding, + .has-header-video.twentyseventeen-front-page .site-branding, + .has-header-image.home.blog .site-branding, + .has-header-video.home.blog .site-branding { + bottom: 0; + display: block; + left: 0; + height: auto; + padding-top: 0; + position: absolute; + width: 100%; + } + + .has-header-image.twentyseventeen-front-page .custom-header, + .has-header-video.twentyseventeen-front-page .custom-header, + .has-header-image.home.blog .custom-header, + .has-header-video.home.blog .custom-header { + display: block; + height: auto; + } + + .custom-header-media { + height: 165px; + position: relative; + } + + .twentyseventeen-front-page.has-header-image .custom-header-media, + .twentyseventeen-front-page.has-header-video .custom-header-media, + .home.blog.has-header-image .custom-header-media, + .home.blog.has-header-video .custom-header-media { + height: 0; + position: relative; + } + + .has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-media, + .has-header-video:not(.twentyseventeen-front-page):not(.home) .custom-header-media { + bottom: 0; + height: auto; + left: 0; + position: absolute; + right: 0; + top: 0; + } + + .custom-logo-link { + padding-right: 2em; + } + + .custom-logo-link img, + body.home.title-tagline-hidden.has-header-image .custom-logo-link img, + body.home.title-tagline-hidden.has-header-video .custom-logo-link img { + max-width: 350px; + } + + .title-tagline-hidden.home.has-header-image .custom-logo-link img, + .title-tagline-hidden.home.has-header-video .custom-logo-link img { + max-height: 200px; + } + + .site-title { + font-size: 36px; + font-size: 2.25rem; + } + + .site-description { + font-size: 16px; + font-size: 1rem; + } + + /* Navigation */ + + .navigation-top { + bottom: 0; + font-size: 14px; + font-size: 0.875rem; + left: 0; + position: absolute; + right: 0; + width: 100%; + z-index: 3; + } + + .navigation-top .wrap { + max-width: 1000px; + /* The font size is 14px here and we need 50px padding in ems */ + padding: 0.75em 3.4166666666667em; + } + + .navigation-top nav { + margin-left: -1.25em; + } + + .site-navigation-fixed.navigation-top { + bottom: auto; + position: fixed; + left: 0; + right: 0; + top: 0; + width: 100%; + z-index: 7; + } + + .admin-bar .site-navigation-fixed.navigation-top { + top: 32px; + } + + /* Main Navigation */ + + .js .menu-toggle, + .js .dropdown-toggle { + display: none; + } + + .main-navigation { + width: auto; + } + + .js .main-navigation ul, + .js .main-navigation ul ul, + .js .main-navigation > div > ul { + display: block; + } + + .main-navigation ul { + background: transparent; + padding: 0; + } + + .main-navigation > div > ul { + border: 0; + margin-bottom: 0; + padding: 0; + } + + .main-navigation li { + border: 0; + display: inline-block; + } + + .main-navigation li li { + display: block; + } + + .main-navigation a { + padding: 1em 1.25em; + } + + .main-navigation ul ul { + background: #fff; + border: 1px solid #bbb; + left: -999em; + padding: 0; + position: absolute; + top: 100%; + z-index: 99999; + } + + .main-navigation ul li.menu-item-has-children:before, + .main-navigation ul li.menu-item-has-children:after, + .main-navigation ul li.page_item_has_children:before, + .main-navigation ul li.page_item_has_children:after { + border-style: solid; + border-width: 0 6px 6px; + content: ""; + display: none; + height: 0; + position: absolute; + right: 1em; + bottom: -1px; + width: 0; + z-index: 100000; + } + + .main-navigation ul li.menu-item-has-children.focus:before, + .main-navigation ul li.menu-item-has-children:hover:before, + .main-navigation ul li.menu-item-has-children.focus:after, + .main-navigation ul li.menu-item-has-children:hover:after, + .main-navigation ul li.page_item_has_children.focus:before, + .main-navigation ul li.page_item_has_children:hover:before, + .main-navigation ul li.page_item_has_children.focus:after, + .main-navigation ul li.page_item_has_children:hover:after { + display: block; + } + + .main-navigation ul li.menu-item-has-children:before, + .main-navigation ul li.page_item_has_children:before { + border-color: transparent transparent #bbb; + bottom: 0; + } + + .main-navigation ul li.menu-item-has-children:after, + .main-navigation ul li.page_item_has_children:after { + border-color: transparent transparent #fff; + } + + .main-navigation ul ul li:hover > ul, + .main-navigation ul ul li.focus > ul { + left: 100%; + right: auto; + } + + .main-navigation ul ul a { + padding: 0.75em 1.25em; + width: 16em; + } + + .main-navigation li li { + -webkit-transition: background-color 0.2s ease-in-out; + transition: background-color 0.2s ease-in-out; + } + + .main-navigation li li:hover, + .main-navigation li li.focus { + background: #767676; + } + + .main-navigation li li a { + -webkit-transition: color 0.3s ease-in-out; + transition: color 0.3s ease-in-out; + } + + .main-navigation li li.focus > a, + .main-navigation li li:focus > a, + .main-navigation li li:hover > a, + .main-navigation li li a:hover, + .main-navigation li li a:focus, + .main-navigation li li.current_page_item a:hover, + .main-navigation li li.current-menu-item a:hover, + .main-navigation li li.current_page_item a:focus, + .main-navigation li li.current-menu-item a:focus { + color: #fff; + } + + .main-navigation ul li:hover > ul, + .main-navigation ul li.focus > ul { + left: 0.5em; + right: auto; + } + + .main-navigation .menu-item-has-children > a > .icon, + .main-navigation .page_item_has_children > a > .icon { + display: inline; + left: 5px; + position: relative; + top: -1px; + } + + .main-navigation ul ul .menu-item-has-children > a > .icon, + .main-navigation ul ul .page_item_has_children > a > .icon { + margin-top: -9px; + left: auto; + position: absolute; + right: 1em; + top: 50%; + -webkit-transform: rotate(-90deg); /* Chrome, Safari, Opera */ + -ms-transform: rotate(-90deg); /* IE 9 */ + transform: rotate(-90deg); + } + + .main-navigation ul ul ul { + left: -999em; + margin-top: -1px; + top: 0; + } + + .main-navigation ul ul li.menu-item-has-children.focus:before, + .main-navigation ul ul li.menu-item-has-children:hover:before, + .main-navigation ul ul li.menu-item-has-children.focus:after, + .main-navigation ul ul li.menu-item-has-children:hover:after, + .main-navigation ul ul li.page_item_has_children.focus:before, + .main-navigation ul ul li.page_item_has_children:hover:before, + .main-navigation ul ul li.page_item_has_children.focus:after, + .main-navigation ul ul li.page_item_has_children:hover:after { + display: none; + } + + .site-header .site-navigation-fixed .menu-scroll-down { + display: none; + } + + /* Scroll down arrow */ + + .site-header .menu-scroll-down { + display: block; + padding: 1em; + position: absolute; + right: 0; + } + + .site-header .menu-scroll-down .icon { + -webkit-transform: rotate(90deg); /* Chrome, Safari, Opera */ + -ms-transform: rotate(90deg); /* IE 9 */ + transform: rotate(90deg); + } + + .site-header .menu-scroll-down { + color: #fff; + top: 2em; + } + + .site-header .navigation-top .menu-scroll-down { + color: #767676; + top: 0.7em; + } + + .menu-scroll-down:focus { + outline: thin dotted; + } + + .menu-scroll-down .icon { + height: 18px; + width: 18px; + } + + /* Front Page */ + + .twentyseventeen-front-page.has-header-image .site-branding, + .twentyseventeen-front-page.has-header-video .site-branding, + .home.blog.has-header-image .site-branding, + .home.blog.has-header-video .site-branding { + margin-bottom: 70px; + } + + .twentyseventeen-front-page.has-header-image .custom-header-media, + .twentyseventeen-front-page.has-header-video .custom-header-media, + .home.blog.has-header-image .custom-header-media, + .home.blog.has-header-video .custom-header-media { + height: 1200px; + height: 100vh; + max-height: 100%; + overflow: hidden; + } + + .twentyseventeen-front-page.has-header-image .custom-header-media:before, + .twentyseventeen-front-page.has-header-video .custom-header-media:before, + .home.blog.has-header-image .custom-header-media:before, + .home.blog.has-header-video .custom-header-media:before { + height: 33%; + } + + .admin-bar.twentyseventeen-front-page.has-header-image .custom-header-media, + .admin-bar.twentyseventeen-front-page.has-header-video .custom-header-media, + .admin-bar.home.blog.has-header-image .custom-header-media, + .admin-bar.home.blog.has-header-video .custom-header-media { + height: calc(100vh - 32px); + } + + .panel-content .wrap { + padding-bottom: 4.5em; + padding-top: 6em; + } + + .panel-image { + height: 100vh; + max-height: 1200px; + } + + /* With panel images 100% of the screen height, we're going to fix the background image where supported to create a parallax-like effect. */ + .background-fixed .panel-image { + background-attachment: fixed; + } + + .page-two-column .panel-content .entry-header { + float: left; + width: 36%; + } + + .page-two-column .panel-content .entry-content { + float: right; + width: 58%; + } + + /* Front Page - Recent Posts */ + + .page-two-column .panel-content .recent-posts { + clear: right; + float: right; + width: 58%; + } + + .panel-content .recent-posts article { + margin-bottom: 4em; + } + + .panel-content .recent-posts .entry-header, + .page-two-column #primary .panel-content .recent-posts .entry-header, + .panel-content .recent-posts .entry-content, + .page-two-column #primary .panel-content .recent-posts .entry-content { + float: none; + width: 100%; + } + + .panel-content .recent-posts .entry-header { + margin-bottom: 1.5em; + } + + .page .panel-content .recent-posts .entry-title { + font-size: 26px; + font-size: 1.625rem; + } + + /* Posts */ + + .site-content { + padding: 5.5em 0 0; + } + + .single-post .entry-title, + .page .entry-title { + font-size: 26px; + font-size: 1.625rem; + } + + .comments-pagination, + .post-navigation { + clear: both; + } + + .post-navigation .nav-previous { + float: left; + width: 50%; + } + + .post-navigation .nav-next { + float: right; + text-align: right; + width: 50%; + } + + .nav-next, + .post-navigation .nav-next { + margin-top: 0; + } + + /* Blog, archive, search */ + + .sticky .icon-thumb-tack { + height: 23px; + left: -2.5em; + top: 1.5em; + width: 32px; + } + + body:not(.has-sidebar):not(.page-one-column) .page-header, + body.has-sidebar.error404 #primary .page-header, + body.page-two-column:not(.archive) #primary .entry-header, + body.page-two-column.archive:not(.has-sidebar) #primary .page-header { + float: left; + width: 36%; + } + + .blog:not(.has-sidebar) #primary article, + .archive:not(.page-one-column):not(.has-sidebar) #primary article, + .search:not(.has-sidebar) #primary article, + .error404:not(.has-sidebar) #primary .page-content, + .error404.has-sidebar #primary .page-content, + body.page-two-column:not(.archive) #primary .entry-content, + body.page-two-column #comments { + float: right; + width: 58%; + } + + .blog .site-main > article, + .archive .site-main > article, + .search .site-main > article { + padding-bottom: 4em; + } + + .navigation.pagination { + clear: both; + float: right; + width: 58%; + } + + .has-sidebar .navigation.pagination, + .archive.page-one-column:not(.has-sidebar) .navigation.pagination { + float: none; + width: 100%; + } + + .entry-footer { + display: table; + width: 100%; + } + + .entry-footer .cat-tags-links { + display: table-cell; + vertical-align: middle; + width: 100%; + } + + .entry-footer .edit-link { + display: table-cell; + text-align: right; + vertical-align: middle; + } + + .entry-footer .edit-link a.post-edit-link { + margin-top: 0; + margin-left: 1em; + } + + /* Entry content */ + + /* without sidebar */ + + :not(.has-sidebar) .entry-content blockquote.alignleft { + margin-left: -17.5%; + width: 48%; + } + + :not(.has-sidebar) .entry-content blockquote.alignright { + margin-right: -17.5%; + width: 48%; + } + + /* with sidebar */ + + .has-sidebar .entry-content blockquote.alignleft { + margin-left: 0; + width: 34%; + } + + .has-sidebar .entry-content blockquote.alignright { + margin-right: 0; + width: 34%; + } + + .has-sidebar #primary .entry-content blockquote.alignright.below-entry-meta { + margin-right: -72.5%; + width: 62%; + } + + /* blog and archive */ + + .blog:not(.has-sidebar) .entry-content blockquote.alignleft, + .twentyseventeen-front-page.page-two-column .entry-content blockquote.alignleft, + .archive:not(.has-sidebar) .entry-content blockquote.alignleft, + .page-two-column .entry-content blockquote.alignleft { + margin-left: -72.5%; + width: 62%; + } + + .blog:not(.has-sidebar) .entry-content blockquote.alignright, + .twentyseventeen-front-page.page-two-column .entry-content blockquote.alignright, + .archive:not(.has-sidebar) .entry-content blockquote.alignright, + .page-two-column .entry-content blockquote.alignright { + margin-right: 0; + width: 36%; + } + + /* Post formats */ + + .format-quote blockquote .icon { + left: -1.5em; + } + + /* Pages */ + + .page.page-one-column .entry-header, + .twentyseventeen-front-page.page-one-column .entry-header, + .archive.page-one-column:not(.has-sidebar) .page-header { + margin-bottom: 4em; + } + + .page:not(.home) #content { + padding-bottom: 3.25em; + } + + /* 404 page */ + + .error404 .page-content { + padding-bottom: 9em; + } + + /* Comments */ + + #comments { + padding-top: 5em; + } + + .comments-title { + margin-bottom: 2.5em; + } + + ol.children .children { + padding-left: 2em; + } + + /* Posts pagination */ + + .nav-links .nav-title { + position: relative; + } + + .nav-title-icon-wrapper { + position: absolute; + text-align: center; + width: 2em; + } + + .nav-links .nav-previous .nav-title .nav-title-icon-wrapper { + left: -2em; + } + + .nav-links .nav-next .nav-title .nav-title-icon-wrapper { + right: -2em; + } + + /* Secondary */ + + #secondary { + font-size: 14px; + font-size: 0.875rem; + line-height: 1.6; + } + + /* Widgets */ + + h2.widget-title { + font-size: 11px; + font-size: 0.6875rem; + margin-bottom: 2em; + } + + /* Footer */ + + .site-footer { + font-size: 14px; + font-size: 0.875rem; + line-height: 1.6; + margin-top: 3em; + } + + .site-footer .widget-column.footer-widget-1 { + float: left; + width: 36%; + } + + .site-footer .widget-column.footer-widget-2 { + float: right; + width: 58%; + } + + .social-navigation { + clear: left; + float: left; + margin-bottom: 0; + width: 36%; + } + + .site-info { + float: left; + padding: 0.7em 0 0; + width: 58%; + } + + .social-navigation + .site-info { + margin-left: 6%; + } + + .site-info .sep { + margin: 0 0.5em; + display: inline; + visibility: visible; + height: auto; + width: auto; + } + + /* Gallery Columns */ + + .gallery-columns-5 .gallery-item { + max-width: 20%; + } + + .gallery-columns-6 .gallery-item { + max-width: 16.66%; + } + + .gallery-columns-7 .gallery-item { + max-width: 14.28%; + } + + .gallery-columns-8 .gallery-item { + max-width: 12.5%; + } + + .gallery-columns-9 .gallery-item { + max-width: 11.11%; + } +} + +@media screen and ( min-width: 67em ) { + + /* Layout */ + + /* Navigation */ + .navigation-top .wrap { + padding: 0.75em 2em; + } + + .navigation-top nav { + margin-left: 0; + } + + /* Sticky posts */ + + .sticky .icon-thumb-tack { + font-size: 32px; + font-size: 2rem; + height: 22px; + left: -1.25em; + top: 0.75em; + width: 32px; + } + + /* Pagination */ + + .page-numbers { + display: inline-block; + } + + .page-numbers.current { + font-size: 15px; + font-size: 0.9375rem; + } + + .page-numbers.current .screen-reader-text { + clip: rect(1px, 1px, 1px, 1px); + height: 1px; + overflow: hidden; + position: absolute !important; + width: 1px; + } + + /* Comments */ + + .comment-body { + margin-left: 0; + } +} + +@media screen and ( min-width: 79em ) { + + .has-sidebar .entry-content blockquote.alignleft { + margin-left: -20%; + } + + .blog:not(.has-sidebar) .entry-content blockquote.alignright, + .archive:not(.has-sidebar) .entry-content blockquote.alignright, + .page-two-column .entry-content blockquote.alignright, + .twentyseventeen-front-page .entry-content blockquote.alignright { + margin-right: -20%; + } +} + +@media screen and ( max-width: 48.875em ) and ( min-width: 48em ) { + + .admin-bar .site-navigation-fixed.navigation-top, + .admin-bar .site-navigation-hidden.navigation-top { + top: 46px; + } +} + +/*-------------------------------------------------------------- +20.0 Print +--------------------------------------------------------------*/ + +@media print { + + /* Hide elements */ + + form, + button, + input, + select, + textarea, + .navigation-top, + .social-navigation, + #secondary, + .content-bottom-widgets, + .header-image, + .panel-image-prop, + .icon-thumb-tack, + .page-links, + .edit-link, + .post-navigation, + .pagination.navigation, + .comments-pagination, + .comment-respond, + .comment-edit-link, + .comment-reply-link, + .comment-metadata .edit-link, + .pingback .edit-link, + .site-footer aside.widget-area, + .site-info { + display: none !important; + } + + .entry-footer, + #comments, + .site-footer, + .single-featured-image-header { + border: 0; + } + + /* Font sizes */ + + body { + font-size: 12pt; + } + + h1 { + font-size: 24pt; + } + + h2 { + font-size: 22pt; + } + + h3 { + font-size: 17pt; + } + + h4 { + font-size: 12pt; + } + + h5 { + font-size: 11pt; + } + + h6 { + font-size: 12pt; + } + + .page .panel-content .entry-title, + .page-title, + body.page:not(.twentyseventeen-front-page) .entry-title { + font-size: 10pt; + } + + /* Layout */ + + .wrap { + padding-left: 5% !important; + padding-right: 5% !important; + max-width: none; + } + + /* Site Branding */ + + .site-header { + background: transparent; + padding: 0; + } + + .custom-header-media { + padding: 0; + } + + .twentyseventeen-front-page.has-header-image .site-branding, + .twentyseventeen-front-page.has-header-video .site-branding, + .home.blog.has-header-image .site-branding, + .home.blog.has-header-video .site-branding { + position: relative; + } + + .site-branding { + margin-top: 0; + margin-bottom: 1.75em !important; /* override styles added by JavaScript */ + } + + .site-title { + font-size: 25pt; + } + + .site-description { + font-size: 12pt; + opacity: 1; + } + + /* Posts */ + + .single-featured-image-header { + background: transparent; + } + + .entry-meta { + font-size: 9pt; + } + + /* Colors */ + + body, + .site { + background: none !important; /* Brute force since user agents all print differently. */ + } + + body, + a, + .site-title a, + .twentyseventeen-front-page.has-header-image .site-title, + .twentyseventeen-front-page.has-header-video .site-title, + .twentyseventeen-front-page.has-header-image .site-title a, + .twentyseventeen-front-page.has-header-video .site-title a { + color: #222 !important; /* Make sure color schemes don't affect to print */ + } + + h2, + h5, + blockquote, + .site-description, + .twentyseventeen-front-page.has-header-image .site-description, + .twentyseventeen-front-page.has-header-video .site-description, + .entry-meta, + .entry-meta a { + color: #777 !important; /* Make sure color schemes don't affect to print */ + } + + .entry-content blockquote.alignleft, + .entry-content blockquote.alignright { + font-size: 11pt; + width: 34%; + } + + .site-footer { + padding: 0; + } +} diff --git a/wp-content/themes/twentyseventeen/template-parts/footer/footer-widgets.php b/wp-content/themes/twentyseventeen/template-parts/footer/footer-widgets.php new file mode 100644 index 0000000..4d42a18 --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/footer/footer-widgets.php @@ -0,0 +1,35 @@ + + + + + + + diff --git a/wp-content/themes/twentyseventeen/template-parts/footer/site-info.php b/wp-content/themes/twentyseventeen/template-parts/footer/site-info.php new file mode 100644 index 0000000..7549376 --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/footer/site-info.php @@ -0,0 +1,24 @@ + +
            + ' ); + } + ?> + + + +
            diff --git a/wp-content/themes/twentyseventeen/template-parts/header/header-image.php b/wp-content/themes/twentyseventeen/template-parts/header/header-image.php new file mode 100644 index 0000000..9672d70 --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/header/header-image.php @@ -0,0 +1,20 @@ + +
            + +
            + +
            + + + +
            diff --git a/wp-content/themes/twentyseventeen/template-parts/header/site-branding.php b/wp-content/themes/twentyseventeen/template-parts/header/site-branding.php new file mode 100644 index 0000000..798bbe5 --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/header/site-branding.php @@ -0,0 +1,38 @@ + +
            +
            + + + +
            + +

            + +

            + + + +

            + +
            + + + 'arrow-right' ) ); ?> + + +
            +
            diff --git a/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php b/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php new file mode 100644 index 0000000..d1922fc --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php @@ -0,0 +1,33 @@ + + diff --git a/wp-content/themes/twentyseventeen/template-parts/page/content-front-page-panels.php b/wp-content/themes/twentyseventeen/template-parts/page/content-front-page-panels.php new file mode 100644 index 0000000..ca0b5f6 --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/page/content-front-page-panels.php @@ -0,0 +1,87 @@ + + +
            > + + ID ), 'twentyseventeen-featured-image' ); + + // Calculate aspect ratio: h / w * 100%. + $ratio = $thumbnail[2] / $thumbnail[1] * 100; + ?> + +
            +
            +
            + + + +
            +
            +
            + ', '' ); ?> + + + +
            + +
            + "%s"', 'twentyseventeen' ), + get_the_title() + ) + ); + ?> +
            + + + + 3, + 'post_status' => 'publish', + 'ignore_sticky_posts' => true, + 'no_found_rows' => true, + ) + ); + ?> + + have_posts() ) : ?> + +
            + + have_posts() ) : + $recent_posts->the_post(); + get_template_part( 'template-parts/post/content', 'excerpt' ); + endwhile; + wp_reset_postdata(); + ?> +
            + + + +
            +
            + +
            diff --git a/wp-content/themes/twentyseventeen/template-parts/page/content-front-page.php b/wp-content/themes/twentyseventeen/template-parts/page/content-front-page.php new file mode 100644 index 0000000..f1de0df --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/page/content-front-page.php @@ -0,0 +1,52 @@ + +
            > + + ID ), 'twentyseventeen-featured-image' ); + + // Calculate aspect ratio: h / w * 100%. + $ratio = $thumbnail[2] / $thumbnail[1] * 100; + ?> + +
            +
            +
            + + + +
            +
            +
            + ', '' ); ?> + + + +
            + +
            + "%s"', 'twentyseventeen' ), + get_the_title() + ) + ); + ?> +
            + +
            +
            + +
            diff --git a/wp-content/themes/twentyseventeen/template-parts/page/content-page.php b/wp-content/themes/twentyseventeen/template-parts/page/content-page.php new file mode 100644 index 0000000..af621e9 --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/page/content-page.php @@ -0,0 +1,32 @@ + + +
            > +
            + ', '' ); ?> + +
            +
            + '', + ) + ); + ?> +
            +
            diff --git a/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php b/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php new file mode 100644 index 0000000..1ee148a --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php @@ -0,0 +1,109 @@ + + +
            > + 'thumb-tack' ) ); + } + ?> +
            + '; + if ( is_single() ) { + twentyseventeen_posted_on(); + } else { + echo twentyseventeen_time_link(); + twentyseventeen_edit_link(); + }; + echo '
            '; + }; + + if ( is_single() ) { + the_title( '

            ', '

            ' ); + } elseif ( is_front_page() && is_home() ) { + the_title( '

            ', '

            ' ); + } else { + the_title( '

            ', '

            ' ); + } + ?> + + + + + +
            + + + +
            + + +
            + + '; + echo $audio_html; + echo '
            '; + } + }; + + }; + + if ( is_single() || empty( $audio ) ) { + + the_content( + sprintf( + /* translators: %s: Post title. */ + __( 'Continue reading "%s"', 'twentyseventeen' ), + get_the_title() + ) + ); + + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) + ); + + }; + ?> + +
            + + + + diff --git a/wp-content/themes/twentyseventeen/template-parts/post/content-excerpt.php b/wp-content/themes/twentyseventeen/template-parts/post/content-excerpt.php new file mode 100644 index 0000000..2a93cc5 --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/post/content-excerpt.php @@ -0,0 +1,48 @@ + + + diff --git a/wp-content/themes/twentyseventeen/template-parts/post/content-gallery.php b/wp-content/themes/twentyseventeen/template-parts/post/content-gallery.php new file mode 100644 index 0000000..34e2d77 --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/post/content-gallery.php @@ -0,0 +1,96 @@ + + +
            > + 'thumb-tack' ) ); + } + ?> +
            + '; + if ( is_single() ) { + twentyseventeen_posted_on(); + } else { + echo twentyseventeen_time_link(); + twentyseventeen_edit_link(); + }; + echo ''; + }; + + if ( is_single() ) { + the_title( '

            ', '

            ' ); + } elseif ( is_front_page() && is_home() ) { + the_title( '

            ', '

            ' ); + } else { + the_title( '

            ', '

            ' ); + } + ?> +
            + + +
            + + + +
            + + +
            + + '; + echo get_post_gallery(); + echo '
            '; + }; + + }; + + if ( is_single() || ! get_post_gallery() ) { + + the_content( + sprintf( + /* translators: %s: Post title. */ + __( 'Continue reading "%s"', 'twentyseventeen' ), + get_the_title() + ) + ); + + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) + ); + + }; + ?> + + + + + +
            diff --git a/wp-content/themes/twentyseventeen/template-parts/post/content-image.php b/wp-content/themes/twentyseventeen/template-parts/post/content-image.php new file mode 100644 index 0000000..07b89c4 --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/post/content-image.php @@ -0,0 +1,86 @@ + + +
            > + 'thumb-tack' ) ); + } + ?> +
            + '; + if ( is_single() ) { + twentyseventeen_posted_on(); + } else { + echo twentyseventeen_time_link(); + twentyseventeen_edit_link(); + }; + echo ''; + }; + + if ( is_single() ) { + the_title( '

            ', '

            ' ); + } elseif ( is_front_page() && is_home() ) { + the_title( '

            ', '

            ' ); + } else { + the_title( '

            ', '

            ' ); + } + ?> +
            + + +
            + + + +
            + + +
            + + "%s"', 'twentyseventeen' ), + get_the_title() + ) + ); + + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) + ); + + }; + ?> + +
            + + + +
            diff --git a/wp-content/themes/twentyseventeen/template-parts/post/content-none.php b/wp-content/themes/twentyseventeen/template-parts/post/content-none.php new file mode 100644 index 0000000..62a9ada --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/post/content-none.php @@ -0,0 +1,40 @@ + + +
            + +
            + + +

            + Get started here.', 'twentyseventeen' ), esc_url( admin_url( 'post-new.php' ) ) ); + ?> +

            + + + +

            + +
            +
            diff --git a/wp-content/themes/twentyseventeen/template-parts/post/content-video.php b/wp-content/themes/twentyseventeen/template-parts/post/content-video.php new file mode 100644 index 0000000..b073052 --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/post/content-video.php @@ -0,0 +1,107 @@ + + +
            > + 'thumb-tack' ) ); + } + ?> +
            + '; + if ( is_single() ) { + twentyseventeen_posted_on(); + } else { + echo twentyseventeen_time_link(); + twentyseventeen_edit_link(); + } + echo ''; + }; + + if ( is_single() ) { + the_title( '

            ', '

            ' ); + } elseif ( is_front_page() && is_home() ) { + the_title( '

            ', '

            ' ); + } else { + the_title( '

            ', '

            ' ); + } + ?> +
            + + + + +
            + + + +
            + + +
            + + '; + echo $video_html; + echo '
            '; + } + }; + + }; + + if ( is_single() || empty( $video ) ) { + + the_content( + sprintf( + /* translators: %s: Post title. */ + __( 'Continue reading "%s"', 'twentyseventeen' ), + get_the_title() + ) + ); + + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) + ); + }; + ?> + + + + + +
            diff --git a/wp-content/themes/twentyseventeen/template-parts/post/content.php b/wp-content/themes/twentyseventeen/template-parts/post/content.php new file mode 100644 index 0000000..366a42a --- /dev/null +++ b/wp-content/themes/twentyseventeen/template-parts/post/content.php @@ -0,0 +1,79 @@ + + +
            > + 'thumb-tack' ) ); + endif; + ?> +
            + '; + if ( is_single() ) { + twentyseventeen_posted_on(); + } else { + echo twentyseventeen_time_link(); + twentyseventeen_edit_link(); + }; + echo ''; + }; + + if ( is_single() ) { + the_title( '

            ', '

            ' ); + } elseif ( is_front_page() && is_home() ) { + the_title( '

            ', '

            ' ); + } else { + the_title( '

            ', '

            ' ); + } + ?> +
            + + +
            + + + +
            + + +
            + "%s"', 'twentyseventeen' ), + get_the_title() + ) + ); + + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) + ); + ?> +
            + + + +
            diff --git a/wp-content/themes/twentysixteen/404.php b/wp-content/themes/twentysixteen/404.php new file mode 100644 index 0000000..70592f6 --- /dev/null +++ b/wp-content/themes/twentysixteen/404.php @@ -0,0 +1,34 @@ + + +
            +
            + +
            + + +
            +

            + + +
            +
            + +
            + + + +
            + + + diff --git a/wp-content/themes/twentysixteen/archive.php b/wp-content/themes/twentysixteen/archive.php new file mode 100644 index 0000000..ebfeece --- /dev/null +++ b/wp-content/themes/twentysixteen/archive.php @@ -0,0 +1,69 @@ + + +
            +
            + + + + + + __( 'Previous page', 'twentysixteen' ), + 'next_text' => __( 'Next page', 'twentysixteen' ), + 'before_page_number' => '' . __( 'Page', 'twentysixteen' ) . ' ', + ) + ); + + // If no content, include the "No posts found" template. + else : + get_template_part( 'template-parts/content', 'none' ); + + endif; + ?> + +
            +
            + + + diff --git a/wp-content/themes/twentysixteen/comments.php b/wp-content/themes/twentysixteen/comments.php new file mode 100644 index 0000000..42a0834 --- /dev/null +++ b/wp-content/themes/twentysixteen/comments.php @@ -0,0 +1,83 @@ + + +
            + + +

            + +

            + + + +
              + 'ol', + 'short_ping' => true, + 'avatar_size' => 42, + ) + ); + ?> +
            + + + + + + +

            + + + '

            ', + 'title_reply_after' => '

            ', + ) + ); + ?> + +
            diff --git a/wp-content/themes/twentysixteen/css/blocks.css b/wp-content/themes/twentysixteen/css/blocks.css new file mode 100644 index 0000000..732a2c8 --- /dev/null +++ b/wp-content/themes/twentysixteen/css/blocks.css @@ -0,0 +1,436 @@ +/* +Theme Name: Twenty Sixteen +Description: Used to style blocks. +*/ + +/*-------------------------------------------------------------- +>>> TABLE OF CONTENTS: +---------------------------------------------------------------- +1.0 General Block Styles +2.0 Blocks - Common Blocks +3.0 Blocks - Formatting +4.0 Blocks - Layout Elements +5.0 Blocks - Widgets +6.0 Blocks - Colors +--------------------------------------------------------------*/ + +/*-------------------------------------------------------------- +1.0 General Block Styles +--------------------------------------------------------------*/ + +/* Captions */ + +[class^="wp-block-"] figcaption { + color: #686868; + font-style: italic; + line-height: 1.6153846154; + padding-top: 0.5384615385em; + text-align: left; +} + +.rtl [class^="wp-block-"] figcaption { + text-align: right; +} + +/*-------------------------------------------------------------- +2.0 Blocks - Common Blocks +--------------------------------------------------------------*/ + +/* Paragraph */ + +p.has-drop-cap:not(:focus)::first-letter { + font-size: 5em; +} + +/* Image */ + +@media screen and (min-width: 61.5625em) { + body:not(.search-results) article:not(.type-page) .wp-block-image figcaption.below-entry-meta { + clear: both; + display: block; + float: none; + margin-right: 0; + margin-left: -40%; + max-width: 140%; + } + + body.rtl:not(.search-results) article:not(.type-page) .wp-block-image figcaption.below-entry-meta { + margin-left: 0; + margin-right: -40%; + } +} + +/* Gallery */ + +.wp-block-gallery { + margin-bottom: 1.75em; +} + +/* Quote */ + +.wp-block-quote:not(.is-large):not(.is-style-large).alignleft, +.wp-block-quote:not(.is-large):not(.is-style-large).alignright { + border-left: none; + padding-left: 0; +} + +.rtl .wp-block-quote:not(.is-large):not(.is-style-large).alignleft, +.rtl .wp-block-quote:not(.is-large):not(.is-style-large).alignright { + border-right: none; + padding-right: 0; +} + +.wp-block-quote cite { + color: #1a1a1a; + display: block; + font-size: 16px; + font-size: 1rem; + line-height: 1.75; +} + +.wp-block-quote cite:before { + content: "\2014\00a0"; +} + +/* Audio */ + +.wp-block-audio audio { + display: block; + width: 100%; +} + +/* Cover */ + +.wp-block-cover-image.aligncenter, +.wp-block-cover.aligncenter { + display: flex; +} + +/* File */ + +.wp-block-file .wp-block-file__button { + background: #1a1a1a; + border: 0; + border-radius: 2px; + color: #fff; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-weight: 700; + letter-spacing: 0.046875em; + line-height: 1; + padding: 0.84375em 0.875em 0.78125em; + text-transform: uppercase; +} + +.wp-block-file .wp-block-file__button:hover, +.wp-block-file .wp-block-file__button:focus { + background: #007acc; +} + +.wp-block-file .wp-block-file__button:focus { + outline: thin dotted; + outline-offset: -4px; +} + +.rtl .wp-block-file * + .wp-block-file__button { + margin-left: 0.75em; + margin-right: 0; +} + +/*-------------------------------------------------------------- +3.0 Blocks - Formatting Blocks +--------------------------------------------------------------*/ + +/* Code */ + +.wp-block-code { + border: 0; + font-family: Inconsolata, monospace; + font-size: 16px; + font-size: 1rem; + line-height: 1.75; + padding: 0; +} + +/* Pullquote */ + +.wp-block-pullquote { + border-width: 4px; +} + +.wp-block-pullquote blockquote { + color: #686868; + border-left: 4px solid #1a1a1a; + margin: 0; + padding: 0 0 0 24px; +} + +.rtl .wp-block-pullquote blockquote { + border-left: none; + border-right: 4px solid #1a1a1a; + padding: 0 24px 0 0; +} + +.wp-block-pullquote p { + font-size: 19px; + font-size: 1.1875rem; +} + +.wp-block-pullquote cite { + color: #1a1a1a; + display: block; + font-size: 16px; + font-size: 1rem; + font-style: none; + line-height: 1.75; + text-transform: none; +} + +.wp-block-pullquote cite:before { + content: "\2014\00a0"; +} + +/* Table */ + +.wp-block-table, +.wp-block-table th, +.wp-block-table td { + border: 1px solid #d1d1d1; +} + +.wp-block-table { + border-collapse: separate; + border-spacing: 0; + border-width: 1px 0 0 1px; + margin: 0 0 1.75em; + table-layout: fixed; + width: 100%; +} + +.wp-block-table th, +.wp-block-table td { + font-weight: normal; + padding: 0.4375em; + text-align: left; +} + +.wp-block-table th { + border-width: 0 1px 1px 0; + font-weight: 700; +} + +.wp-block-table td { + border-width: 0 1px 1px 0; +} + +.rtl .wp-block-table th, +.rtl .wp-block-table td { + text-align: right; +} + +/*-------------------------------------------------------------- +4.0 Blocks - Layout Elements +--------------------------------------------------------------*/ + +/* Buttons */ + +.wp-block-button .wp-block-button__link { + box-shadow: none; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-weight: 700; + letter-spacing: 0.046875em; + line-height: 1; + padding: 0.84375em 1.3125em 0.78125em; + text-transform: uppercase; +} + +.entry-content .wp-block-button__link { + background: #1a1a1a; + color: #fff; +} + +.entry-content .is-style-outline .wp-block-button__link:not(.has-background) { + background: transparent; +} + +.entry-content .is-style-outline .wp-block-button__link:not(.has-text-color) { + color: #1a1a1a; +} + +.entry-content .wp-block-button__link:hover, +.entry-content .wp-block-button__link:focus, +.entry-content .is-style-outline .wp-block-button__link:not(.has-background):hover, +.entry-content .is-style-outline .wp-block-button__link:not(.has-background):focus, +.entry-content .is-style-outline .wp-block-button__link:not(.has-text-color):hover, +.entry-content .is-style-outline .wp-block-button__link:not(.has-text-color):focus { + background: #007acc; + color: #fff; +} + +.wp-block-button .wp-block-button__link:focus { + outline: thin dotted; + outline-offset: -4px; +} + +/* Seperator */ + +hr.wp-block-separator { + border: 0; +} + +.wp-block-separator { + margin-left: auto; + margin-right: auto; + max-width: 100px; +} + +.wp-block-separator.is-style-wide { + max-width: 100%; +} + +/* Media & Text */ + +.wp-block-media-text { + margin-bottom: 1.75em; +} + +.wp-block-media-text *:last-child { + margin-bottom: 0; +} + +/*-------------------------------------------------------------- +5.0 Blocks - Widget Blocks +--------------------------------------------------------------*/ + +/* Archives, Categories & Latest Posts */ + +.wp-block-archives.aligncenter, +.wp-block-categories.aligncenter, +.wp-block-latest-posts.aligncenter { + list-style-position: inside; + text-align: center; +} + +/* Latest Comments */ + +.wp-block-latest-comments__comment-meta a { + box-shadow: none; + font-weight: 700; +} + +.wp-block-latest-comments__comment-date { + color: #686868; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.6153846154; +} + +.wp-block-latest-comments .wp-block-latest-comments__comment { + border-top: 1px solid #d1d1d1; + margin-bottom: 0; + padding: 1.75em 0; +} + +.wp-block-latest-comments__comment-excerpt p:last-child { + margin-bottom: 0; +} + +/*-------------------------------------------------------------- +6.0 Blocks - Colors +--------------------------------------------------------------*/ + +.entry-content .has-dark-gray-color { + color: #1a1a1a; +} + +.entry-content .has-dark-gray-background-color { + background-color: #1a1a1a; +} + +.entry-content .has-medium-gray-color { + color: #686868; +} + +.entry-content .has-medium-gray-background-color { + background-color: #686868; +} + +.entry-content .has-light-gray-color { + color: #e5e5e5; +} + +.entry-content .has-light-gray-background-color { + background-color: #e5e5e5; +} + +.entry-content .has-white-color { + color: #fff; +} + +.entry-content .has-white-background-color { + background-color: #fff; +} + +.entry-content .has-blue-gray-color { + color: #4d545c; +} + +.entry-content .has-blue-gray-background-color { + background-color: #4d545c; +} + +.entry-content .has-bright-blue-color { + color: #007acc; +} + +.entry-content .has-bright-blue-background-color { + background-color: #007acc; +} + +.entry-content .has-light-blue-color { + color: #9adffd; +} + +.entry-content .has-light-blue-background-color { + background-color: #9adffd; +} + +.entry-content .has-dark-brown-color { + color: #402b30; +} + +.entry-content .has-dark-brown-background-color { + background-color: #402b30; +} + +.entry-content .has-medium-brown-color { + color: #774e24; +} + +.entry-content .has-medium-brown-background-color { + background-color: #774e24; +} + +.entry-content .has-dark-red-color { + color: #640c1f; +} + +.entry-content .has-dark-red-background-color { + background-color: #640c1f; +} + +.entry-content .has-bright-red-color { + color: #ff675f; +} + +.entry-content .has-bright-red-background-color { + background-color: #ff675f; +} + +.entry-content .has-yellow-color { + color: #ffef8e; +} + +.entry-content .has-yellow-background-color { + background-color: #ffef8e; +} diff --git a/wp-content/themes/twentysixteen/css/editor-blocks.css b/wp-content/themes/twentysixteen/css/editor-blocks.css new file mode 100644 index 0000000..cc7411a --- /dev/null +++ b/wp-content/themes/twentysixteen/css/editor-blocks.css @@ -0,0 +1,616 @@ +/* +Theme Name: Twenty Sixteen +Description: Used to style blocks in the editor. +*/ + +/*-------------------------------------------------------------- +>>> TABLE OF CONTENTS: +---------------------------------------------------------------- +1.0 General Typography +2.0 General Block Styles +3.0 Blocks - Common Blocks +4.0 Blocks - Formatting +5.0 Blocks - Layout Elements +6.0 Blocks - Widgets +--------------------------------------------------------------*/ + +/*-------------------------------------------------------------- +1.0 General Typography +--------------------------------------------------------------*/ + +.edit-post-visual-editor .editor-block-list__block, +.editor-default-block-appender textarea.editor-default-block-appender__content { + font-family: Merriweather, Georgia, serif; + font-size: 16px; + font-size: 1rem; + line-height: 1.75; +} + +.edit-post-visual-editor .editor-block-list__block { + color: #1a1a1a; +} + +.editor-post-title__block .editor-post-title__input { + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 28px; + font-size: 1.75rem; + font-weight: 700; + line-height: 1.25; + margin-bottom: 1em; +} + +.edit-post-visual-editor h1 { + font-size: 28px; + font-size: 1.75rem; + line-height: 1.25; + margin-top: 2em; + margin-bottom: 1em; +} + +.edit-post-visual-editor h2 { + font-size: 23px; + font-size: 1.4375rem; + line-height: 1.2173913043; + margin-top: 2.4347826087em; + margin-bottom: 1.2173913043em; +} + +.edit-post-visual-editor h3 { + font-size: 19px; + font-size: 1.1875rem; + line-height: 1.1052631579; + margin-top: 2.9473684211em; + margin-bottom: 1.4736842105em; +} + +.edit-post-visual-editor h4, +.edit-post-visual-editor h5, +.edit-post-visual-editor h6 { + font-size: 16px; + font-size: 1rem; + line-height: 1.3125; + margin-top: 3.5em; + margin-bottom: 1.75em; +} + +.edit-post-visual-editor h4 { + letter-spacing: 0.140625em; + text-transform: uppercase; +} + +.edit-post-visual-editor h6 { + font-style: italic; +} + +.edit-post-visual-editor h1, +.edit-post-visual-editor h2, +.edit-post-visual-editor h3, +.edit-post-visual-editor h4, +.edit-post-visual-editor h5, +.edit-post-visual-editor h6 { + font-weight: 900; +} + +@media screen and (min-width: 61.5625em) { + .edit-post-visual-editor h1 { + font-size: 33px; + font-size: 2.0625rem; + line-height: 1.2727272727; + margin-top: 1.696969697em; + margin-bottom: 0.8484848485em; + } + + .edit-post-visual-editor h2 { + font-size: 28px; + font-size: 1.75rem; + line-height: 1.25; + margin-top: 2em; + margin-bottom: 1em; + } + + .edit-post-visual-editor h3 { + font-size: 23px; + font-size: 1.4375rem; + line-height: 1.2173913043; + margin-top: 2.4347826087em; + margin-bottom: 1.2173913043em; + } + + .edit-post-visual-editor h4 { + letter-spacing: 0.131578947em; + } + + .edit-post-visual-editor h4, + .edit-post-visual-editor h5, + .edit-post-visual-editor h6 { + font-size: 19px; + font-size: 1.1875rem; + line-height: 1.1052631579; + margin-top: 2.9473684211em; + margin-bottom: 1.473684211em; + } +} + +.edit-post-visual-editor h1:first-child, +.edit-post-visual-editor h2:first-child, +.edit-post-visual-editor h3:first-child, +.edit-post-visual-editor h4:first-child, +.edit-post-visual-editor h5:first-child, +.edit-post-visual-editor h6:first-child { + margin-top: 0; +} + +.edit-post-visual-editor p { + margin: 0 0 1.75em; +} + +.edit-post-visual-editor blockquote p { + margin-bottom: 1.4736842105em; +} + +@media screen and (min-width: 44.375em) { + .editor-post-title__block .editor-post-title__input { + font-size: 33px; + font-size: 2.0625rem; + line-height: 1.2727272727; + margin-bottom: 0.8484848485em; + } +} + +@media screen and (min-width: 61.5625em) { + .editor-post-title__block .editor-post-title__input { + font-size: 40px; + font-size: 2.5rem; + line-height: 1.225; + margin-bottom: 1.05em; + } +} + +/*-------------------------------------------------------------- +2.0 General Block Styles +--------------------------------------------------------------*/ + +/* Main column width */ + +.editor-styles-wrapper { + max-width: 100% !important; /* Override where editor-style.css is affecting this */ +} + +.wp-block { + max-width: 630px; /* 600px + 30px to account for padding. */ +} + +/* Link styles */ + +.edit-post-visual-editor a, +.editor-block-list__block a, +.wp-block-freeform.block-library-rich-text__tinymce a { + color: #007acc; +} + +/* List styles */ + +.edit-post-visual-editor ul:not(.wp-block-gallery), +.editor-block-list__block ul:not(.wp-block-gallery), +.block-library-list ul, +.edit-post-visual-editor ol, +.editor-block-list__block ol, +.block-library-list ol { + margin: 0 0 1.75em 1.25em; + padding: 0; +} + +.edit-post-visual-editor ul:not(.wp-block-gallery), +.editor-block-list__block ul:not(.wp-block-gallery), +.block-library-list ul { + list-style: disc; +} + +.edit-post-visual-editor ol, +.editor-block-list__block ol, +.block-library-list ol { + list-style: decimal; + margin-left: 1.5em; +} + +.edit-post-visual-editor ul:not(.wp-block-gallery) li, +.editor-block-list__block ul:not(.wp-block-gallery) li, +.edit-post-visual-editor ol li, +.editor-block-list__block ol li, +.block-library-list li { + margin-bottom: 0; +} + +.edit-post-visual-editor ul:not(.wp-block-gallery) li > ul, +.editor-block-list__block ul:not(.wp-block-gallery) li > ul, +.block-library-list li > ul, +.edit-post-visual-editor li > ol, +.editor-block-list__block li > ol, +.block-library-list li > ol { + margin-bottom: 0; +} + +.rtl .edit-post-visual-editor ul:not(.wp-block-gallery), +.rtl .editor-block-list__block ul:not(.wp-block-gallery), +.rtl .block-library-list ul, +.rtl .edit-post-visual-editor ol, +.rtl .editor-block-list__block ol, +.rtl .block-library-list ol { + margin-left: 0; + margin-right: 1.25em; + padding: 0; +} + +.rtl .edit-post-visual-editor ol, +.rtl .editor-block-list__block ol, +.rtl .block-library-list ol { + margin-left: 1.5em; + margin-right: 1.5em; +} + +/* Quotes */ + +.rtl .editor-block-list__block blockquote { + border-left: 0; + padding-left: 0; +} + +/* Captions */ + +[class^="wp-block-"] figcaption { + color: #686868; + font-style: italic; + line-height: 1.6153846154; + padding-top: 0.5384615385em; + text-align: left; +} + +.rtl [class^="wp-block-"] figcaption { + text-align: right; +} + +/*-------------------------------------------------------------- +3.0 Blocks - Common Blocks +--------------------------------------------------------------*/ + +/* Paragraph */ + +.wp-block-paragraph.has-drop-cap:not(:focus)::first-letter { + font-size: 5em; + line-height: 0.68; + margin: 0.05em 0.1em 0 0; + text-transform: uppercase; + font-style: normal; +} + +.rtl .wp-block-paragraph.has-drop-cap:not(:focus)::first-letter { + margin: 0.05em 0 0 0.1em; +} + +/* Quote */ + +.wp-block-quote { + border: 0 solid #1a1a1a; + border-left-width: 4px; + color: #686868; + font-style: italic; + line-height: 1.4736842105; + margin: 0 0 1.4736842105em; + overflow: hidden; + padding: 0 0 0 1.263157895em; +} + +.wp-block-quote:not(.is-large):not(.is-style-large).alignleft, +.wp-block-quote:not(.is-large):not(.is-style-large).alignright { + border-left: 0; + padding-left: 0; +} + +.editor-block-list__block .wp-block-quote p { + font-size: 19px; + font-size: 1.1875rem; + margin-bottom: 1.4736842105em; +} + +.wp-block-quote__citation { + color: #1a1a1a; + display: block; + font-size: 16px; + font-size: 1rem; + line-height: 1.75; +} + +.wp-block-quote__citation:before { + content: "\2014\00a0"; +} + +.wp-block-quote em, +.wp-block-quote i, +.wp-block-quote__citation:before { + font-style: normal; +} + +.wp-block-quote strong, +.wp-block-quote b { + font-weight: 400; +} + +.wp-block-quote > :last-child { + margin-bottom: 0; +} + +.wp-block-quote.alignleft { + margin: 0.3157894737em 1.4736842105em 1.473684211em 0; +} + +.wp-block-quote.alignright { + margin: 0.3157894737em 0 1.473684211em 1.4736842105em; +} + +.wp-block-quote.aligncenter { + margin-bottom: 1.473684211em; +} + +.rtl .wp-block-quote:not(.is-large):not(.is-style-large).alignleft, +.rtl .wp-block-quote:not(.is-large):not(.is-style-large).alignright { + border-right: 0; + padding-right: 0; +} + +@media screen and (min-width: 44.375em) { + .wp-block-quote.alignleft, + .wp-block-quote.alignright { + border-width: 4px 0 0 0; + padding: 0.9473684211em 0 0; + width: -webkit-calc(50% - 0.736842105em); + width: calc(50% - 0.736842105em); + } + + .wp-block-quote:not(.alignleft):not(.alignright) { + margin-left: -1.473684211em; + } + + .rtl .wp-block-quote:not(.alignleft):not(.alignright) { + margin-left: 0; + margin-right: -1.473684211em; + } +} + +@media screen and (min-width: 80em) { + .editor-block-list__block .wp-block-quote.alignleft { + margin-left: -40%; + width: -webkit-calc(60% - 1.4736842105em); + width: calc(60% - 1.4736842105em); + } +} + +/* File */ + +.wp-block-file__textlink { + box-shadow: 0 1px 0 0 currentColor; + color: #007acc; +} + +.wp-block-file .wp-block-file__button { + background: #1a1a1a; + border: 0; + border-radius: 2px; + color: #fff; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-weight: 700; + letter-spacing: 0.046875em; + line-height: 1; + padding: 0.84375em 0.875em 0.78125em; + text-transform: uppercase; +} + +/*-------------------------------------------------------------- +4.0 Blocks - Formatting +--------------------------------------------------------------*/ + +/* Code */ + +.wp-block-code { + border: 0; + padding: 0.125em 0.25em; +} + +/* Classic */ + +.wp-block-freeform.block-library-rich-text__tinymce blockquote { + border: 0 solid #1a1a1a; + border-left-width: 4px; + color: #686868; + font-style: italic; + line-height: 1.4736842105; + margin: 0 0 1.4736842105em; + overflow: hidden; + padding: 0 0 0 1.263157895em; +} + +.editor-block-list__block .wp-block-freeform.block-library-rich-text__tinymce blockquote:not(.alignleft):not(.alignright) { + margin-left: 0; +} + +.wp-block-freeform.block-library-rich-text__tinymce blockquote p { + font-size: 19px; + font-size: 1.1875rem; +} + +.wp-block-freeform.block-library-rich-text__tinymce blockquote cite { + color: #1a1a1a; + display: block; + font-size: 16px; + font-size: 1rem; + font-style: normal; + line-height: 1.75; +} + +.wp-block-freeform.block-library-rich-text__tinymce blockquote cite:before { + content: "\2014\00a0"; +} + +.wp-block-freeform.block-library-rich-text__tinymce blockquote.alignleft { + margin: 0.3157894737em 1.4736842105em 1.473684211em 0; +} + +.wp-block-freeform.block-library-rich-text__tinymce blockquote.alignright { + margin: 0.3157894737em 0 1.473684211em 1.4736842105em; +} + +.wp-block-freeform.block-library-rich-text__tinymce blockquote.aligncenter { + margin-bottom: 1.473684211em; +} + +@media screen and (min-width: 44.375em) { + .wp-block-freeform.block-library-rich-text__tinymce blockquote.alignleft, + .wp-block-freeform.block-library-rich-text__tinymce blockquote.alignright { + border-width: 4px 0 0 0; + padding: 0.9473684211em 0 0; + width: -webkit-calc(50% - 0.736842105em); + width: calc(50% - 0.736842105em); + } +} + +.rtl .wp-block-freeform.block-library-rich-text__tinymce blockquote { + border-left-width: 0; + border-right-width: 4px; + overflow: hidden; + padding-left: 0; + padding-right: 1.263157895em; +} + +.rtl .wp-block-freeform.block-library-rich-text__tinymce .alignleft { + float: left; +} + +.rtl .wp-block-freeform.block-library-rich-text__tinymce .alignright { + float: right; +} + +.rtl .wp-block-freeform.block-library-rich-text__tinymce blockquote.alignleft { + margin: 0.3157894737em 0 1.473684211em 1.4736842105em; +} + +.rtl .wp-block-freeform.block-library-rich-text__tinymce blockquote.alignright { + margin: 0.3157894737em 1.4736842105em 1.473684211em 0; +} + +/* Pullquote */ + +.editor-block-list__block .wp-block-pullquote blockquote { + border: 0; + margin: 0; + padding: 0; +} + +.wp-block-pullquote blockquote > .editor-rich-text p { + font-size: 19px; + font-size: 1.1875rem; +} + +.wp-block-pullquote .wp-block-pullquote__citation { + color: #1a1a1a; + display: block; + font-size: 16px; + font-size: 1rem; + font-style: italic; + line-height: 1.75; + text-transform: none; +} + +.wp-block-pullquote .wp-block-pullquote__citation:before { + content: "\2014\00a0"; +} + +/* Table */ + +.editor-block-list__block table.wp-block-table th, +.editor-block-list__block table.wp-block-table td { + padding: 0; +} + +.rtl .wp-block-table th, +.rtl .wp-block-table td { + text-align: right; +} + +/*-------------------------------------------------------------- +5.0 Blocks - Layout Elements +--------------------------------------------------------------*/ + +/* Buttons */ + +.wp-block-button .wp-block-button__link { + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-weight: 700; + letter-spacing: 0.046875em; + line-height: 1; + padding: 0.84375em 1.3125em 0.78125em; + text-transform: uppercase; +} + +.wp-block-button__link { + background: #1a1a1a; + color: #fff; +} + +.is-style-outline .wp-block-button__link { + color: #1a1a1a; +} + +/* Media & Text */ + +.wp-block-media-text *:last-child { + margin-bottom: 0; +} + +/*-------------------------------------------------------------- +6.0 Blocks - Widgets +--------------------------------------------------------------*/ + +/* Archives, Categories & Latest Posts */ + +[data-align="center"] .wp-block-archives ul, +[data-align="center"] .wp-block-categories ul, +[data-align="center"] .wp-block-latest-posts ul { + list-style-position: inside; +} + +/* Latest Comments */ + +.editor-block-list__block .wp-block-latest-comments__comment-meta a { + box-shadow: none; + font-weight: 700; + text-decoration: none; +} + +.wp-block-latest-comments__comment-date { + color: #686868; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.6153846154; +} + +.wp-block-latest-comments .wp-block-latest-comments__comment { + border-top: 1px solid #d1d1d1; + margin-bottom: 0; + padding: 1.75em 0; +} + +.wp-block-latest-comments__comment-excerpt p:last-child { + margin-bottom: 0; +} + +/* Latest Posts */ + +.edit-post-visual-editor .wp-block-latest-posts.is-grid { + list-style: none; + margin-left: 0; + margin-right: 0; +} + +.edit-post-visual-editor .wp-block-latest-posts.is-grid li { + margin-bottom: 16px; +} diff --git a/wp-content/themes/twentysixteen/css/editor-style.css b/wp-content/themes/twentysixteen/css/editor-style.css new file mode 100644 index 0000000..a4cab64 --- /dev/null +++ b/wp-content/themes/twentysixteen/css/editor-style.css @@ -0,0 +1,547 @@ +/* +Theme Name: Twenty Sixteen +Description: Used to style the TinyMCE editor. +*/ + + +/** + * Table of Contents: + * + * 1.0 - Body + * 2.0 - Typography + * 3.0 - Elements + * 4.0 - Alignment + * 5.0 - Caption + * 6.0 - Galleries + * 7.0 - Audio / Video + * 8.0 - RTL + */ + + +/** + * 1.0 - Body + */ + +body { + color: #1a1a1a; + font-family: Merriweather, Georgia, serif; + font-size: 16px; + font-weight: 400; + line-height: 1.75; + margin: 20px 40px; + max-width: 600px; + vertical-align: baseline; +} + +body.post-type-page { + max-width: 840px; +} + + +/** + * 2.0 - Typography + */ + +h1, +h2, +h3, +h4, +h5, +h6 { + clear: both; + font-weight: 900; + margin: 56px 0 28px; +} + +h1 { + font-size: 33px; + line-height: 1.2727272727; +} + +h2 { + font-size: 28px; + line-height: 1.25; +} + +h3 { + font-size: 23px; + line-height: 1.2173913043; +} + +h4, +h5, +h6 { + font-size: 19px; + line-height: 1.1052631579; +} + +h4 { + letter-spacing: 0.13333em; + text-transform: uppercase; +} + +h6 { + font-style: italic; +} + +h1:first-child, +h2:first-child, +h3:first-child, +h4:first-child, +h5:first-child, +h6:first-child { + margin-top: 0; +} + +p { + margin: 0 0 28px; +} + +b, +strong { + font-weight: 700; +} + +dfn, +cite, +em, +i { + font-style: italic; +} + +blockquote { + border-left: 4px solid #1a1a1a; + color: #686868; + font-size: 19px; + font-style: italic; + line-height: 1.4736842105; + margin-bottom: 28px; + overflow: hidden; + padding: 0 0 0 24px; +} + +blockquote:not(.alignleft):not(.alignright) { + margin-left: -28px; +} + +blockquote blockquote:not(.alignleft):not(.alignright) { + margin-left: 0; +} + +blockquote:before, +blockquote:after { + content: ""; + display: table; +} + +blockquote:after { + clear: both; +} + +blockquote > :last-child { + margin-bottom: 0; +} + +blockquote cite, +blockquote small { + color: #1a1a1a; + font-size: 16px; + line-height: 1.75; +} + +blockquote em, +blockquote i, +blockquote cite { + font-style: normal; +} + +blockquote strong, +blockquote b { + font-weight: 400; +} + +blockquote.alignleft, +blockquote.alignright { + border: 0 solid #1a1a1a; + border-top-width: 4px; + padding: 18px 0 0; + width: -webkit-calc(50% - 14px); + width: calc(50% - 14px); +} + +address { + font-style: italic; + margin: 0 0 28px; +} + +code, +kbd, +tt, +var, +samp, +pre { + font-family: Inconsolata, monospace; +} + +pre { + border: 1px solid #d1d1d1; + font-size: 16px; + line-height: 1.3125; + margin: 0 0 28px; + max-width: 100%; + overflow: auto; + padding: 14px; + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} + +code { + background-color: #d1d1d1; + padding: 2px 4px; +} + +abbr[title] { + border-bottom: 1px dotted #d1d1d1; + cursor: help; +} + +mark, +ins { + background: #007acc; + color: #fff; + padding: 2px 4px; + text-decoration: none; +} + +sup, +sub { + font-size: 75%; + height: 0; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -6px; +} + +sub { + bottom: -3px; +} + +small { + font-size: 80%; +} + +big { + font-size: 125%; +} + + +/** + * 3.0 - Elements + */ + +hr { + background-color: #d1d1d1; + border: 0; + height: 1px; + margin-bottom: 28px; +} + +ul, +ol { + margin: 0 0 28px 0; + padding: 0; +} + +ul { + list-style: disc; +} + +ol { + list-style: decimal; +} + +li > ul, +li > ol { + margin-bottom: 0; +} + +li > ul, +blockquote > ul { + margin-left: 20px; +} + +li > ol, +blockquote > ol { + margin-left: 24px; +} + +dl { + margin: 0 0 28px; +} + +dt { + font-weight: bold; +} + +dd { + margin: 0 0 28px; +} + +table, +th, +td, +.mce-item-table, +.mce-item-table th, +.mce-item-table td { + border: 1px solid #d1d1d1; +} + +table a { + color: #007acc; +} + +table, +.mce-item-table { + border-collapse: separate; + border-spacing: 0; + border-width: 1px 0 0 1px; + margin: 0 0 28px; + width: 100%; +} + +table th, +.mce-item-table th, +table caption { + border-width: 0 1px 1px 0; + font-size: 16px; + font-weight: 700; + padding: 7px; + text-align: left; + vertical-align: baseline; +} + +table td, +.mce-item-table td { + border-width: 0 1px 1px 0; + font-size: 16px; + padding: 7px; + vertical-align: baseline; +} + +img { + border: 0; + height: auto; + max-width: 100%; + vertical-align: middle; +} + +a img { + display: block; +} + +figure { + margin: 0; +} + +del { + opacity: 0.8; +} + +a { + box-shadow: 0 1px 0 0 currentColor; + color: #007acc; + text-decoration: none; +} + +fieldset { + border: 1px solid #d1d1d1; + margin: 0 0 28px; + padding: 14px; +} + + +/** + * 4.0 - Alignment + */ + +.alignleft { + float: left; + margin: 6px 28px 28px 0; +} + +.alignright { + float: right; + margin: 6px 0 28px 28px; +} + +.aligncenter { + clear: both; + display: block; + margin: 0 auto 28px; +} + + +/** + * 5.0 - Caption + */ + +.wp-caption { + background: transparent; + border: none; + margin-bottom: 28px; + max-width: 100%; + padding: 0; + text-align: inherit; +} + +.wp-caption-text, +.wp-caption-dd { + color: #686868; + font-size: 13px; + font-style: italic; + line-height: 1.6153846154; + padding-top: 7px; +} + + +/** + * 6.0 - Galleries + */ + +.mce-content-body .wpview-wrap { + margin-bottom: 28px; +} + +.gallery { + margin: 0 -1.1666667%; + padding: 0; +} + +.gallery .gallery-item { + display: inline-block; + max-width: 33.33%; + padding: 0 1.1400652% 2.2801304%; + text-align: center; + vertical-align: top; + width: 100%; +} + +.gallery-columns-1 .gallery-item { + max-width: 100%; +} + +.gallery-columns-2 .gallery-item { + max-width: 50%; +} + +.gallery-columns-4 .gallery-item { + max-width: 25%; +} + +.gallery-columns-5 .gallery-item { + max-width: 20%; +} + +.gallery-columns-6 .gallery-item { + max-width: 16.66%; +} + +.gallery-columns-7 .gallery-item { + max-width: 14.28%; +} + +.gallery-columns-8 .gallery-item { + max-width: 12.5%; +} + +.gallery-columns-9 .gallery-item { + max-width: 11.11%; +} + +.gallery .gallery-caption { + font-size: 13px; + margin: 0; +} + +.gallery-columns-6 .gallery-caption, +.gallery-columns-7 .gallery-caption, +.gallery-columns-8 .gallery-caption, +.gallery-columns-9 .gallery-caption { + display: none; +} + + +/** + * 7.0 - Audio / Video + */ + +.wp-audio-shortcode a, +.wp-playlist a { + box-shadow: none; +} + +.mce-content-body .wp-audio-playlist { + margin: 0; + padding-bottom: 0; +} + +.mce-content-body .wp-playlist-tracks { + margin-top: 0; +} + +.mce-content-body .wp-playlist-item { + padding: 10px 0; +} + +.mce-content-body .wp-playlist-item-length { + top: 10px; +} + + +/** + * 8.0 - RTL + */ + +.rtl blockquote { + border: 0 solid #1a1a1a; + border-right-width: 4px; +} + +.rtl blockquote.alignleft, +.rtl blockquote.alignright { + border: 0 solid #1a1a1a; + border-top-width: 4px; +} + +.rtl blockquote:not(.alignleft):not(.alignright) { + margin-right: -28px; + padding: 0 24px 0 0; +} + +.rtl blockquote blockquote:not(.alignleft):not(.alignright) { + margin-right: 0; + margin-left: auto; +} + +.rtl li > ul, +.rtl blockquote > ul { + margin-right: 20px; + margin-left: auto; +} + +.rtl li > ol, +.rtl blockquote > ol { + margin-right: 24px; + margin-left: auto; +} + +.rtl table th, +.rtl .mce-item-table th, +.rtl table caption { + text-align: right; +} diff --git a/wp-content/themes/twentysixteen/css/ie.css b/wp-content/themes/twentysixteen/css/ie.css new file mode 100644 index 0000000..ddf1210 --- /dev/null +++ b/wp-content/themes/twentysixteen/css/ie.css @@ -0,0 +1,48 @@ +/* +Theme Name: Twenty Sixteen +Description: Global Styles for older IE versions (previous to IE10). +*/ + +.site-header-main:before, +.site-header-main:after, +.site-footer:before, +.site-footer:after { + content: ""; + display: table; +} + +.site-header-main:after, +.site-footer:after { + clear: both; +} + +@media screen and (min-width: 56.875em) { + .site-branding, + .site-info { + float: left; + } + + .site-header-menu, + .site-footer .social-navigation { + float: right; + } + + .site-footer .social-navigation { + margin-left: 7px; + } + + .rtl .site-branding, + .rtl .site-info { + float: right; + } + + .rtl .site-header-menu, + .rtl .site-footer .social-navigation { + float: left; + } + + .rtl .site-footer .social-navigation { + margin-right: 7px; + margin-left: 0; + } +} diff --git a/wp-content/themes/twentysixteen/css/ie7.css b/wp-content/themes/twentysixteen/css/ie7.css new file mode 100644 index 0000000..97089a7 --- /dev/null +++ b/wp-content/themes/twentysixteen/css/ie7.css @@ -0,0 +1,176 @@ +/* +Theme Name: Twenty Sixteen +Description: IE7 specific style. +*/ + +.site-inner { + max-width: 656px; +} + +.post-navigation, +.pagination, +.image-navigation, +.entry-header, +.entry-summary, +.entry-content, +.entry-footer, +.page-header, +.page-content, +.post-thumbnail, +.content-bottom-widgets, +.comments-area { + margin-right: 28px; + margin-left: 28px; + max-width: 100%; +} + +.site-header, +.sidebar, +.site-footer, +.widecolumn { + padding-right: 28px; + padding-left: 28px; +} + +.search-submit { + height: auto; + margin-top: 28px; + padding: 15px 0 8px; + position: relative; + width: auto; +} + +.search-submit .screen-reader-text { + height: auto; + position: relative !important; + width: auto; +} + +.image-navigation .nav-previous, +.image-navigation .nav-next, +.comment-navigation .nav-previous, +.comment-navigation .nav-next { + *display: inline; + zoom: 1; +} + +.image-navigation .nav-previous + .nav-next, +.comment-navigation .nav-previous + .nav-next { + margin-left: 14px; +} + +.pagination .nav-links { + padding: 0; +} + +.pagination .page-numbers { + line-height: 1; + margin: -4px 14px 0; + padding: 18px 0; +} + +.pagination .prev, +.pagination .next { + display: inline-block; + font-size: 16px; + font-weight: 700; + height: auto; + left: 0; + line-height: 1; + margin: 0; + padding: 18px 14px; + position: relative; + right: 0; + text-transform: none; + width: auto; +} + +.dropdown-toggle { + display: none; +} + +.main-navigation ul ul { + display: block; +} + +.social-navigation { + margin-top: 1.75em; +} + +.social-navigation a { + height: auto; + padding: 3px 7px; + width: auto; +} + +.social-navigation .screen-reader-text { + height: auto; + position: relative !important; + width: auto; +} + +.site-header-main { + overflow : hidden; + zoom : 1; +} + +.entry-footer > span { + margin-right: 14px; +} + +.site-info .site-title { + font-size: 13px; + margin-right: 14px; +} + +.gallery-item { + max-width: 30%; +} + +.gallery-columns-1 .gallery-item { + max-width: 100%; +} + +.gallery-columns-2 .gallery-item { + max-width: 46%; +} + +.gallery-columns-4 .gallery-item { + max-width: 22%; +} + +.gallery-columns-5 .gallery-item { + max-width: 17%; +} + +.gallery-columns-6 .gallery-item { + max-width: 13.5%; +} + +.gallery-columns-7 .gallery-item { + max-width: 11%; +} + +.gallery-columns-8 .gallery-item { + max-width: 9.5%; +} + +.gallery-columns-9 .gallery-item { + max-width: 8%; +} + +.rtl .image-navigation .nav-previous + .nav-next, +.rtl .comment-navigation .nav-previous + .nav-next { + margin-right: 14px; + margin-left: 0; +} + +.rtl .entry-footer > span { + margin-right: 14px; + margin-left: 0; +} + +.rtl .site-info .site-title { + margin-right: 0; + margin-left: 14px; +} diff --git a/wp-content/themes/twentysixteen/css/ie8.css b/wp-content/themes/twentysixteen/css/ie8.css new file mode 100644 index 0000000..261df7d --- /dev/null +++ b/wp-content/themes/twentysixteen/css/ie8.css @@ -0,0 +1,222 @@ +/* +Theme Name: Twenty Sixteen +Description: IE8 specific style. +*/ + +code { + background-color: transparent; + padding: 0; +} + +.entry-content a, +.entry-summary a, +.taxonomy-description a, +.logged-in-as a, +.comment-content a, +.pingback .comment-body > a, +.textwidget a, +.entry-footer a:hover, +.site-info a:hover { + text-decoration: underline; +} + +.entry-content a:hover, +.entry-content a:focus, +.entry-summary a:hover, +.entry-summary a:focus, +.taxonomy-description a:hover, +.taxonomy-description a:focus, +.logged-in-as a:hover, +.logged-in-as a:focus, +.comment-content a:hover, +.comment-content a:focus, +.pingback .comment-body > a:hover, +.pingback .comment-body > a:focus, +.textwidget a:hover, +.textwidget a:focus, +.entry-content .wp-audio-shortcode a, +.entry-content .wp-playlist a, +.page-links a { + text-decoration: none; +} + +.site { + margin: 21px; +} + +.site-inner { + max-width: 710px; +} + +.site-header { + padding-top: 3.9375em; + padding-bottom: 3.9375em; +} + +.site-branding { + float: left; + margin-top: 1.3125em; + margin-bottom: 1.3125em; +} + +.site-title { + font-size: 28px; + line-height: 1.25; +} + +.site-description { + display: block; +} + +.menu-toggle { + float: right; + font-size: 16px; + margin: 1.3125em 0; + padding: 0.8125em 0.875em 0.6875em; +} + +.site-header-menu { + clear: both; + margin: 0; + padding: 1.3125em 0; +} + +.site-header .main-navigation + .social-navigation { + margin-top: 2.625em; +} + +.header-image { + margin: 1.3125em 0; +} + +.site-main { + margin-bottom: 5.25em; +} + +.post-navigation { + margin-bottom: 5.25em; +} + +.post-navigation .post-title { + font-size: 28px; + line-height: 1.25; +} + +.pagination { + margin: 0 7.6923% 4.421052632em; +} + +.pagination .nav-links:before, +.pagination .nav-links:after { + display: none; +} + +/* restore screen-reader-text */ +.pagination .current .screen-reader-text { + position: absolute !important; +} + +.pagination .page-numbers { + display: inline-block; + font-weight: 400; +} + +.image-navigation .nav-previous, +.image-navigation .nav-next, +.comment-navigation .nav-previous, +.comment-navigation .nav-next { + display: inline-block; +} + +.image-navigation .nav-previous + .nav-next:before, +.comment-navigation .nav-previous + .nav-next:before { + content: "\002f"; + display: inline-block; + filter: alpha(opacity=70); + padding: 0 0.538461538em; +} + +.site-main > article { + margin-bottom: 5.25em; +} + +.entry-title { + font-size: 33px; + line-height: 1.2727272727; + margin-bottom: 0.8484848485em; +} + +.entry-content blockquote.alignleft, +.entry-content blockquote.alignright { + border-width: 4px 0 0 0; + padding: 0.9473684211em 0 0; + width: 50%; +} + +.entry-footer > span:after { + content: "\002f"; + display: inline-block; + filter: alpha(opacity=70); + padding: 0 0.538461538em; +} + +.updated { + display: none; +} + +.updated.published { + display: inline; +} + +.comment-author { + margin-bottom: 0; +} + +.comment-author .avatar { + height: 42px; + position: relative; + top: 0.25em; + width: 42px; +} + +.comment-list .children > li { + padding-left: 1.75em; +} + +.comment-list + .comment-respond, +.comment-navigation + .comment-respond { + padding-top: 3.5em; +} + +.comment-reply-link { + margin-top: 0; +} + +.comments-area, +.widget, +.content-bottom-widgets .widget-area { + margin-bottom: 5.25em; +} + +.sidebar, +.widecolumn { + margin-bottom: 5.25em; +} + +.site-footer .main-navigation, +.site-footer .social-navigation { + display: none; +} + +.rtl .site-branding { + float: right; +} + +.rtl .menu-toggle { + float: left; +} + +.rtl .comment-list .children > li { + padding-right: 1.75em; + padding-left: 0; +} diff --git a/wp-content/themes/twentysixteen/footer.php b/wp-content/themes/twentysixteen/footer.php new file mode 100644 index 0000000..f389fcf --- /dev/null +++ b/wp-content/themes/twentysixteen/footer.php @@ -0,0 +1,73 @@ + + + + +
            + + + + + + + + +
            + + + ' ); + } + ?> + + + +
            +
            + + + + + + diff --git a/wp-content/themes/twentysixteen/functions.php b/wp-content/themes/twentysixteen/functions.php new file mode 100644 index 0000000..561f00e --- /dev/null +++ b/wp-content/themes/twentysixteen/functions.php @@ -0,0 +1,587 @@ + tag in the document head, and expect WordPress to + * provide it for us. + */ + add_theme_support( 'title-tag' ); + + /* + * Enable support for custom logo. + * + * @since Twenty Sixteen 1.2 + */ + add_theme_support( + 'custom-logo', + array( + 'height' => 240, + 'width' => 240, + 'flex-height' => true, + ) + ); + + /* + * Enable support for Post Thumbnails on posts and pages. + * + * @link https://developer.wordpress.org/reference/functions/add_theme_support/#post-thumbnails + */ + add_theme_support( 'post-thumbnails' ); + set_post_thumbnail_size( 1200, 9999 ); + + // This theme uses wp_nav_menu() in two locations. + register_nav_menus( + array( + 'primary' => __( 'Primary Menu', 'twentysixteen' ), + 'social' => __( 'Social Links Menu', 'twentysixteen' ), + ) + ); + + /* + * Switch default core markup for search form, comment form, and comments + * to output valid HTML5. + */ + add_theme_support( + 'html5', + array( + 'search-form', + 'comment-form', + 'comment-list', + 'gallery', + 'caption', + 'script', + 'style', + ) + ); + + /* + * Enable support for Post Formats. + * + * See: https://wordpress.org/support/article/post-formats/ + */ + add_theme_support( + 'post-formats', + array( + 'aside', + 'image', + 'video', + 'quote', + 'link', + 'gallery', + 'status', + 'audio', + 'chat', + ) + ); + + /* + * This theme styles the visual editor to resemble the theme style, + * specifically font, colors, icons, and column width. + */ + add_editor_style( array( 'css/editor-style.css', twentysixteen_fonts_url() ) ); + + // Load regular editor styles into the new block-based editor. + add_theme_support( 'editor-styles' ); + + // Load default block styles. + add_theme_support( 'wp-block-styles' ); + + // Add support for responsive embeds. + add_theme_support( 'responsive-embeds' ); + + // Add support for custom color scheme. + add_theme_support( + 'editor-color-palette', + array( + array( + 'name' => __( 'Dark Gray', 'twentysixteen' ), + 'slug' => 'dark-gray', + 'color' => '#1a1a1a', + ), + array( + 'name' => __( 'Medium Gray', 'twentysixteen' ), + 'slug' => 'medium-gray', + 'color' => '#686868', + ), + array( + 'name' => __( 'Light Gray', 'twentysixteen' ), + 'slug' => 'light-gray', + 'color' => '#e5e5e5', + ), + array( + 'name' => __( 'White', 'twentysixteen' ), + 'slug' => 'white', + 'color' => '#fff', + ), + array( + 'name' => __( 'Blue Gray', 'twentysixteen' ), + 'slug' => 'blue-gray', + 'color' => '#4d545c', + ), + array( + 'name' => __( 'Bright Blue', 'twentysixteen' ), + 'slug' => 'bright-blue', + 'color' => '#007acc', + ), + array( + 'name' => __( 'Light Blue', 'twentysixteen' ), + 'slug' => 'light-blue', + 'color' => '#9adffd', + ), + array( + 'name' => __( 'Dark Brown', 'twentysixteen' ), + 'slug' => 'dark-brown', + 'color' => '#402b30', + ), + array( + 'name' => __( 'Medium Brown', 'twentysixteen' ), + 'slug' => 'medium-brown', + 'color' => '#774e24', + ), + array( + 'name' => __( 'Dark Red', 'twentysixteen' ), + 'slug' => 'dark-red', + 'color' => '#640c1f', + ), + array( + 'name' => __( 'Bright Red', 'twentysixteen' ), + 'slug' => 'bright-red', + 'color' => '#ff675f', + ), + array( + 'name' => __( 'Yellow', 'twentysixteen' ), + 'slug' => 'yellow', + 'color' => '#ffef8e', + ), + ) + ); + + // Indicate widget sidebars can use selective refresh in the Customizer. + add_theme_support( 'customize-selective-refresh-widgets' ); + } +endif; // twentysixteen_setup() +add_action( 'after_setup_theme', 'twentysixteen_setup' ); + +/** + * Sets the content width in pixels, based on the theme's design and stylesheet. + * + * Priority 0 to make it available to lower priority callbacks. + * + * @global int $content_width + * + * @since Twenty Sixteen 1.0 + */ +function twentysixteen_content_width() { + $GLOBALS['content_width'] = apply_filters( 'twentysixteen_content_width', 840 ); +} +add_action( 'after_setup_theme', 'twentysixteen_content_width', 0 ); + +/** + * Add preconnect for Google Fonts. + * + * @since Twenty Sixteen 1.6 + * + * @param array $urls URLs to print for resource hints. + * @param string $relation_type The relation type the URLs are printed. + * @return array $urls URLs to print for resource hints. + */ +function twentysixteen_resource_hints( $urls, $relation_type ) { + if ( wp_style_is( 'twentysixteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { + $urls[] = array( + 'href' => 'https://fonts.gstatic.com', + 'crossorigin', + ); + } + + return $urls; +} +add_filter( 'wp_resource_hints', 'twentysixteen_resource_hints', 10, 2 ); + +/** + * Registers a widget area. + * + * @link https://developer.wordpress.org/reference/functions/register_sidebar/ + * + * @since Twenty Sixteen 1.0 + */ +function twentysixteen_widgets_init() { + register_sidebar( + array( + 'name' => __( 'Sidebar', 'twentysixteen' ), + 'id' => 'sidebar-1', + 'description' => __( 'Add widgets here to appear in your sidebar.', 'twentysixteen' ), + 'before_widget' => '
            ', + 'after_widget' => '
            ', + 'before_title' => '

            ', + 'after_title' => '

            ', + ) + ); + + register_sidebar( + array( + 'name' => __( 'Content Bottom 1', 'twentysixteen' ), + 'id' => 'sidebar-2', + 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ), + 'before_widget' => '
            ', + 'after_widget' => '
            ', + 'before_title' => '

            ', + 'after_title' => '

            ', + ) + ); + + register_sidebar( + array( + 'name' => __( 'Content Bottom 2', 'twentysixteen' ), + 'id' => 'sidebar-3', + 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ), + 'before_widget' => '
            ', + 'after_widget' => '
            ', + 'before_title' => '

            ', + 'after_title' => '

            ', + ) + ); +} +add_action( 'widgets_init', 'twentysixteen_widgets_init' ); + +if ( ! function_exists( 'twentysixteen_fonts_url' ) ) : + /** + * Register Google fonts for Twenty Sixteen. + * + * Create your own twentysixteen_fonts_url() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return string Google fonts URL for the theme. + */ + function twentysixteen_fonts_url() { + $fonts_url = ''; + $fonts = array(); + $subsets = 'latin,latin-ext'; + + /* + * translators: If there are characters in your language that are not supported + * by Merriweather, translate this to 'off'. Do not translate into your own language. + */ + if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) { + $fonts[] = 'Merriweather:400,700,900,400italic,700italic,900italic'; + } + + /* + * translators: If there are characters in your language that are not supported + * by Montserrat, translate this to 'off'. Do not translate into your own language. + */ + if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) { + $fonts[] = 'Montserrat:400,700'; + } + + /* + * translators: If there are characters in your language that are not supported + * by Inconsolata, translate this to 'off'. Do not translate into your own language. + */ + if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentysixteen' ) ) { + $fonts[] = 'Inconsolata:400'; + } + + if ( $fonts ) { + $fonts_url = add_query_arg( + array( + 'family' => urlencode( implode( '|', $fonts ) ), + 'subset' => urlencode( $subsets ), + 'display' => urlencode( 'fallback' ), + ), + 'https://fonts.googleapis.com/css' + ); + } + + return $fonts_url; + } +endif; + +/** + * Handles JavaScript detection. + * + * Adds a `js` class to the root `` element when JavaScript is detected. + * + * @since Twenty Sixteen 1.0 + */ +function twentysixteen_javascript_detection() { + echo "\n"; +} +add_action( 'wp_head', 'twentysixteen_javascript_detection', 0 ); + +/** + * Enqueues scripts and styles. + * + * @since Twenty Sixteen 1.0 + */ +function twentysixteen_scripts() { + // Add custom fonts, used in the main stylesheet. + wp_enqueue_style( 'twentysixteen-fonts', twentysixteen_fonts_url(), array(), null ); + + // Add Genericons, used in the main stylesheet. + wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.4.1' ); + + // Theme stylesheet. + wp_enqueue_style( 'twentysixteen-style', get_stylesheet_uri(), array(), '20190507' ); + + // Theme block stylesheet. + wp_enqueue_style( 'twentysixteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentysixteen-style' ), '20190102' ); + + // Load the Internet Explorer specific stylesheet. + wp_enqueue_style( 'twentysixteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentysixteen-style' ), '20170530' ); + wp_style_add_data( 'twentysixteen-ie', 'conditional', 'lt IE 10' ); + + // Load the Internet Explorer 8 specific stylesheet. + wp_enqueue_style( 'twentysixteen-ie8', get_template_directory_uri() . '/css/ie8.css', array( 'twentysixteen-style' ), '20170530' ); + wp_style_add_data( 'twentysixteen-ie8', 'conditional', 'lt IE 9' ); + + // Load the Internet Explorer 7 specific stylesheet. + wp_enqueue_style( 'twentysixteen-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'twentysixteen-style' ), '20170530' ); + wp_style_add_data( 'twentysixteen-ie7', 'conditional', 'lt IE 8' ); + + // Load the html5 shiv. + wp_enqueue_script( 'twentysixteen-html5', get_template_directory_uri() . '/js/html5.js', array(), '3.7.3' ); + wp_script_add_data( 'twentysixteen-html5', 'conditional', 'lt IE 9' ); + + wp_enqueue_script( 'twentysixteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20170530', true ); + + if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { + wp_enqueue_script( 'comment-reply' ); + } + + if ( is_singular() && wp_attachment_is_image() ) { + wp_enqueue_script( 'twentysixteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20170530' ); + } + + wp_enqueue_script( 'twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20181217', true ); + + wp_localize_script( + 'twentysixteen-script', + 'screenReaderText', + array( + 'expand' => __( 'expand child menu', 'twentysixteen' ), + 'collapse' => __( 'collapse child menu', 'twentysixteen' ), + ) + ); +} +add_action( 'wp_enqueue_scripts', 'twentysixteen_scripts' ); + +/** + * Enqueue styles for the block-based editor. + * + * @since Twenty Sixteen 1.6 + */ +function twentysixteen_block_editor_styles() { + // Block styles. + wp_enqueue_style( 'twentysixteen-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css', array(), '20190102' ); + // Add custom fonts. + wp_enqueue_style( 'twentysixteen-fonts', twentysixteen_fonts_url(), array(), null ); +} +add_action( 'enqueue_block_editor_assets', 'twentysixteen_block_editor_styles' ); + +/** + * Adds custom classes to the array of body classes. + * + * @since Twenty Sixteen 1.0 + * + * @param array $classes Classes for the body element. + * @return array (Maybe) filtered body classes. + */ +function twentysixteen_body_classes( $classes ) { + // Adds a class of custom-background-image to sites with a custom background image. + if ( get_background_image() ) { + $classes[] = 'custom-background-image'; + } + + // Adds a class of group-blog to sites with more than 1 published author. + if ( is_multi_author() ) { + $classes[] = 'group-blog'; + } + + // Adds a class of no-sidebar to sites without active sidebar. + if ( ! is_active_sidebar( 'sidebar-1' ) ) { + $classes[] = 'no-sidebar'; + } + + // Adds a class of hfeed to non-singular pages. + if ( ! is_singular() ) { + $classes[] = 'hfeed'; + } + + return $classes; +} +add_filter( 'body_class', 'twentysixteen_body_classes' ); + +/** + * Converts a HEX value to RGB. + * + * @since Twenty Sixteen 1.0 + * + * @param string $color The original color, in 3- or 6-digit hexadecimal form. + * @return array Array containing RGB (red, green, and blue) values for the given + * HEX code, empty array otherwise. + */ +function twentysixteen_hex2rgb( $color ) { + $color = trim( $color, '#' ); + + if ( strlen( $color ) === 3 ) { + $r = hexdec( substr( $color, 0, 1 ) . substr( $color, 0, 1 ) ); + $g = hexdec( substr( $color, 1, 1 ) . substr( $color, 1, 1 ) ); + $b = hexdec( substr( $color, 2, 1 ) . substr( $color, 2, 1 ) ); + } elseif ( strlen( $color ) === 6 ) { + $r = hexdec( substr( $color, 0, 2 ) ); + $g = hexdec( substr( $color, 2, 2 ) ); + $b = hexdec( substr( $color, 4, 2 ) ); + } else { + return array(); + } + + return array( + 'red' => $r, + 'green' => $g, + 'blue' => $b, + ); +} + +/** + * Custom template tags for this theme. + */ +require get_template_directory() . '/inc/template-tags.php'; + +/** + * Customizer additions. + */ +require get_template_directory() . '/inc/customizer.php'; + +/** + * Add custom image sizes attribute to enhance responsive image functionality + * for content images + * + * @since Twenty Sixteen 1.0 + * + * @param string $sizes A source size value for use in a 'sizes' attribute. + * @param array $size Image size. Accepts an array of width and height + * values in pixels (in that order). + * @return string A source size value for use in a content image 'sizes' attribute. + */ +function twentysixteen_content_image_sizes_attr( $sizes, $size ) { + $width = $size[0]; + + if ( 840 <= $width ) { + $sizes = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px'; + } + + if ( 'page' === get_post_type() ) { + if ( 840 > $width ) { + $sizes = '(max-width: ' . $width . 'px) 85vw, ' . $width . 'px'; + } + } else { + if ( 840 > $width && 600 <= $width ) { + $sizes = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px'; + } elseif ( 600 > $width ) { + $sizes = '(max-width: ' . $width . 'px) 85vw, ' . $width . 'px'; + } + } + + return $sizes; +} +add_filter( 'wp_calculate_image_sizes', 'twentysixteen_content_image_sizes_attr', 10, 2 ); + +/** + * Add custom image sizes attribute to enhance responsive image functionality + * for post thumbnails + * + * @since Twenty Sixteen 1.0 + * + * @param array $attr Attributes for the image markup. + * @param int $attachment Image attachment ID. + * @param array $size Registered image size or flat array of height and width dimensions. + * @return array The filtered attributes for the image markup. + */ +function twentysixteen_post_thumbnail_sizes_attr( $attr, $attachment, $size ) { + if ( 'post-thumbnail' === $size ) { + if ( is_active_sidebar( 'sidebar-1' ) ) { + $attr['sizes'] = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 60vw, (max-width: 1362px) 62vw, 840px'; + } else { + $attr['sizes'] = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 88vw, 1200px'; + } + } + return $attr; +} +add_filter( 'wp_get_attachment_image_attributes', 'twentysixteen_post_thumbnail_sizes_attr', 10, 3 ); + +/** + * Modifies tag cloud widget arguments to display all tags in the same font size + * and use list format for better accessibility. + * + * @since Twenty Sixteen 1.1 + * + * @param array $args Arguments for tag cloud widget. + * @return array The filtered arguments for tag cloud widget. + */ +function twentysixteen_widget_tag_cloud_args( $args ) { + $args['largest'] = 1; + $args['smallest'] = 1; + $args['unit'] = 'em'; + $args['format'] = 'list'; + + return $args; +} +add_filter( 'widget_tag_cloud_args', 'twentysixteen_widget_tag_cloud_args' ); diff --git a/wp-content/themes/twentysixteen/genericons/COPYING.txt b/wp-content/themes/twentysixteen/genericons/COPYING.txt new file mode 100644 index 0000000..aece214 --- /dev/null +++ b/wp-content/themes/twentysixteen/genericons/COPYING.txt @@ -0,0 +1,9 @@ +Genericons 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 2 of the License, or (at your option) any later version. + +The fonts are distributed 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +As a special exception, if you create a document which uses this font, and embed this font or unaltered portions of this font into the document, this font does not by itself cause the resulting document to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the document might be covered by the GNU General Public License. If you modify this font, you may extend this exception to your version of the font, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. + +This license does not convey any intellectual property rights to third party trademarks that may be included in the icon font; such marks remain subject to all rights and guidelines of use of their owner. \ No newline at end of file diff --git a/wp-content/themes/twentysixteen/genericons/Genericons.eot b/wp-content/themes/twentysixteen/genericons/Genericons.eot new file mode 100644 index 0000000..7322565 Binary files /dev/null and b/wp-content/themes/twentysixteen/genericons/Genericons.eot differ diff --git a/wp-content/themes/twentysixteen/genericons/Genericons.svg b/wp-content/themes/twentysixteen/genericons/Genericons.svg new file mode 100644 index 0000000..4740685 --- /dev/null +++ b/wp-content/themes/twentysixteen/genericons/Genericons.svg @@ -0,0 +1,537 @@ + + + + + +Created by FontForge 20150618 at Fri Sep 18 10:24:13 2015 + By Joen Asmussen +Copyright (c) 2015, Joen Asmussen + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wp-content/themes/twentysixteen/genericons/Genericons.ttf b/wp-content/themes/twentysixteen/genericons/Genericons.ttf new file mode 100644 index 0000000..0174438 Binary files /dev/null and b/wp-content/themes/twentysixteen/genericons/Genericons.ttf differ diff --git a/wp-content/themes/twentysixteen/genericons/Genericons.woff b/wp-content/themes/twentysixteen/genericons/Genericons.woff new file mode 100644 index 0000000..0e7212a Binary files /dev/null and b/wp-content/themes/twentysixteen/genericons/Genericons.woff differ diff --git a/wp-content/themes/twentysixteen/genericons/LICENSE.txt b/wp-content/themes/twentysixteen/genericons/LICENSE.txt new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/wp-content/themes/twentysixteen/genericons/LICENSE.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) 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 +this service 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 make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. 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. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +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 +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE 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. + + 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 +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 2 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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision 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, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This 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. diff --git a/wp-content/themes/twentysixteen/genericons/README.md b/wp-content/themes/twentysixteen/genericons/README.md new file mode 100644 index 0000000..4aa8cc0 --- /dev/null +++ b/wp-content/themes/twentysixteen/genericons/README.md @@ -0,0 +1,218 @@ +# Genericons + +Genericons are vector icons embedded in a webfont designed to be clean and simple keeping with a generic aesthetic. + +Use genericons for instant HiDPI, to change icon colors on the fly, or even with CSS effects such as drop-shadows or gradients! + + +## Usage + +To use it, place the `genericons` folder in your stylesheet directory and enqueue the genericons.css file. Now you can create an icon like this: + +``` +.my-icon:before { + content: '\f101'; + font: normal 16px/1 'Genericons'; + display: inline-block; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +``` + +This will output a comment icon before every element with the class "my-icon". The `content: '\f101';` part of this CSS is easily copied from the helper tool at http://genericons.com/, or `example.html` in the `font` directory. + +You can also use the bundled example.css if you'd rather insert the icons using HTML tags. + + +## Building your own Genericons + +In the `source` directory, you'll find all Genericons source icons in SVG format. This will allow you to bake your own flavor of Genericons using a tool such as FontCustom (http://fontcustom.com) or Fontello (http://fontello.com). Perhaps you need more logos than are available in the base Genericons package? Just add those logos and bake your own expanded set. Maybe you need just a few of the icons Genericons provides, but would like to trim the fat? Remove the ones you won't need! + + +### FontCustom instructions + +FontCustom is a powerful commandline tool which which bakes icon fonts from the SVG source files. It's the tool Genericons is built on, and it provides highly accurate and perfectly crisp icons, *provided all SVGs have the same pixel height*. + +It's not that hard to use, and once it's installed you'll never think of icon-fonts the same way again. Seriously, you should try it. Icon fonts for everyone! + +1. Install FontCustom. Follow the instructions on the website: http://fontcustom.com/ +2. In the `source` directory from the Genericons download, open the file called `fontcustom.yml` in a text editor. Customize the `font_name` and `css_selector`. +3. Open a terminal. Browse to the `source` directory. Type `fontcustom compile`. + +You'll now receive a brand new subdirectory called `fontcustom-webfont`. Inside here you'll find your very own flavor of Genericons, with only the icons you want, including a handy example page that'll help you copy/paste the necessary glyphs or CSS values. + +*Please note*: In the source directory, there's a hidden file called `.fontcustom-manifest.json`. This file is auto-generated by the FontCustom tool, and holds codepoints (unicode addresses) for every glyph, so its address doesn't change when you add or remove icons. If you feel the need to "start fresh" with the unicode addresses, you should delete this file. + + +### Fontello instructions + +Fontello is very easy to use. Just drop the SVG files of the icons you want onto their website and download the font. The downside is that Fontello seems to ignore the 16px pixelgrid, so you'll end up with fuzzy icons. Buyer beware. + + +## Notes + +**Photoshop mockups** + +The `Genericons.ttf` file can be placed in your system fonts folder and used Photoshop or other graphics apps if you like. + +If you're using Genericons in your Photoshop mockups, please remember to delete the old version of the font from Font Book, and grab the new one from the zip file. This also affects using it in your webdesigns: if you have an old version of the font installed locally, that's the font that'll be used in your website as well, so if you're missing icons, check for old versions of the font on your system. + +**Pixel grid** + +Genericons has been designed for a 16x16px grid. That means it'll look sharp at font-size: 16px exactly. It'll also be crisp at multiples thereof, such as 32px or 64px. It'll look reasonably crisp at in-between font sizes such as 24px or 48px, but not quite as crisp as 16 or 32. Please don't set the font-size to 17px, though, that'll just look terrible blurry. + +**Antialiasing** + +If you keep intact the `-webkit-font-smoothing: antialiased;` and `-moz-osx-font-smoothing: grayscale;` CSS properties. That'll make the icons look their best possible, in Firefox and WebKit based browsers. + +**optimizeLegibility** + +Note: On Android browsers with version 4.2, 4.3, and probably later, Genericons will simply not show up if you're using the CSS property "text-rendering" set to "optimizeLegibility. + +**Updates** + +We don't often update icons, but do very carefully when we get good feedback suggesting improvements. Please be mindful if you upgrade, and check that the updated icons behave as you intended. + +**Base64 encoding** + +By default, Genericons ships with a stylesheet that includes a base64 encoded version of the font. This is to sidestep issues with cross-origin requests for fonts, that happen when a stylesheet loads a font that's stored on a different domain or subdomain. This is very common when using caching plugins. + +Base64 encoding comes with a 25% filesize overhead compared to just loading the WOFF file directly. If you know that you won't be loading fonts across domains, or have the ability to edit your server config files to allow it, you can get slightly faster performance by loading Genericons without the base64 encoding. Simply edit `genericons.css` and edit the `@font-face` declaration to match this: + +``` +@font-face { + font-family: 'Genericons'; + src: url('Genericons.woff') format('woff'), + url('Genericons.ttf') format('truetype'), + url('Genericons.svg#genericonsregular') format('svg'); + font-weight: normal; + font-style: normal; +} +``` + + + +## Changelog + +**3.4.1** + +* IE8 support restored. + +**3.4** + +* Updated: Update Google Plus icon to new geometric version. This also *retires* the "alt" version, so *please be mindful if you choose to update, make sure you use the `f206` glyph, not the `f218` glyph, as it no longer exists! +* New: Added helper rotation classes to the base CSS, thanks to geminorum. Apply `genericon-rotate-90` to rotate 90 degrees, -180, -270. Or `genericon-flip-horizontal` or -vertical. + +*Again, it is important if you choose to update to this version, make sure you're not using `genericon-googleplus-alt` or unicode character `f218`, as that has been retired! Use `genericon-googleplus` and glyph `f206` instead!* + +**3.3.1** + +Security Hardening: Remove Genericons example.html file. Please visit genericons.com instead. + +**3.3** + +The Open Source release. + +You can now build your own flavors of Genericons with all the SVGs provided. + + +**3.2** + +A number of new icons and a couple of quick updates. + +* New: Activity +* New: HTML anchor +* New: Bug +* New: Download +* New: Handset +* New: Microphone +* New: Minus +* New: Plus +* New: Move +* New: Rating stars, empty, half, full +* New: Shuffle +* New: video camera +* New: Spotify +* New: Twitch +* Update: Fixed geometry in Edit icon +* Update: Updated Foursquare icon +* IE8 bugfix, slipstreamed into this. + +Twitch and Spotify mark the last social icons that will be added to Genericons. +Future social icons will have to happen in a separate font. + +**3.1** + +Genericons is now generated using a commandline tool called FontCustom. This makes it far easier to add new icons to the font, but the switch means the download zip now has a different layout, fonts have different filenames, there's now no .otf font included (but the .ttf should suffice), and the font now has slightly different metrics. I've taken great care to ensure this new version should work as a drop-in replacement, but please be mindful and test carefully if you choose to upgrade. + +* Per feedback, the baked-in 16px width and height has been removed from the helper CSS. It wasn't really necessary (the glyph itself has these dimensions naturally), and it caused some headaches. +* Base64 encoding is now included by default in the helper CSS. This makes it drop-in easy to get Genericons working in Firefox even when using a CDN. +* Title attribute on website tool. +* New: Website. +* New: Ellipsis. +* New: Foursquare. +* New: X-post. +* New: Sitemap. +* New: Hierarchy. +* New: Paintbrush. +* Updated: Show and Hide icons were updated for clarity. + +**3.0.3** + +Bunch of updates mostly. + +* Two new icons, Dropbox and Fullscreen. +* Updates to all icons containing an exclamation mark. +* Updates to Image and Quote. +* Nicer "Share" icon. +* Bigger default Linkedin icon. + +**3.0.2** + +A slew of new stuff and updates. + +* Social icons: Skype, Digg, Reddit, Stumbleupon, Pocket. +* New generic icons: heart, lock and print. +* New editing icons: code, bold, italic, image +* New interaction icons: subscribe, unsubscribe, subscribed, reply all, reply, flag. +* The hyperlink icon has been updated to be clearer, chunkier. +* The "home" icon has been updated for style, size and clarity. +* The email icon has been updated for style and clarity, and to fit with the new subscribe icons. +* The document icon has been updated for style. +* The "pin" icon has been updated for style and clarity. +* The Twitter icon has been scaled down to fit with the other social icons. + +**3.0.1** + +Mostly maintenance. + +* Fixed an issue with the example page that showed an old "top" icon instead of the actual NEW "refresh" icon. +* Added inverse Google+ and Path. +* Replaced tabs with spaces in the helper CSS. +* Changed the Genericons.com copy/paste tool to serve span's instead of div's for casual icon insertion. It's being converted to "inline-block" anyway. + +**3.0** + +Mainly maintenance and a few new icons. + +* Fast forward, rewind, PollDaddy, Notice, Info, Help, Portfolio +* Updated the feed icon. It's a bit smaller now for consistency, the previous one was rather big. +* So, the previous version numbering, 2.09, wasn't very PHP version compare friendly. So from now on it'll be 3.0, 3.1 etc. Props Ipstenu. +* Genericons.com now has a mini release blog. +* The CSS has prettier formatting, props Konstantin Obenland. + +**2.09** + +Updated Facebook icon to new version. Updated Instagram logo to use new one-color version. Updated Google+ icon to use same radius as Instagram and Facebook. Added a bunch of new icons, cog, unapprove, cart, media player buttons, tablet, send to tablet. + +**2.06** + +Included Base64 encoded version. This is necessary for Genericons to work with CDNs in Firefox. Firefox blocks fonts linked from a different domain. A CDN (typically s.example.com) usually puts the font on a subdomain, and is hence blocked in Firefox. + +**2.05** + +Added a bunch of new icons, including upload to cloud, download to cloud, many more. + +**2.0** + +Initial public release diff --git a/wp-content/themes/twentysixteen/genericons/genericons.css b/wp-content/themes/twentysixteen/genericons/genericons.css new file mode 100644 index 0000000..a91abdd --- /dev/null +++ b/wp-content/themes/twentysixteen/genericons/genericons.css @@ -0,0 +1,263 @@ +/** + + Genericons + +*/ + + +/* IE8 and below use EOT and allow cross-site embedding. + IE9 uses WOFF which is base64 encoded to allow cross-site embedding. + So unfortunately, IE9 will throw a console error, but it'll still work. + When the font is base64 encoded, cross-site embedding works in Firefox */ +@font-face { + font-family: "Genericons"; + src: url("./Genericons.eot"); + src: url("./Genericons.eot?") format("embedded-opentype"); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: "Genericons"; + src: url("data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAADakAA0AAAAAVqwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAA2iAAAABoAAAAcdeu6KE9TLzIAAAGgAAAARQAAAGBkLHXFY21hcAAAAogAAACWAAABsqlys6FjdnQgAAADIAAAAAQAAAAEAEQFEWdhc3AAADaAAAAACAAAAAj//wADZ2x5ZgAABFQAAC7AAABIkKrsSc5oZWFkAAABMAAAAC8AAAA2C2BCV2hoZWEAAAFgAAAAHQAAACQQuAgGaG10eAAAAegAAACfAAABOFjwU3Jsb2NhAAADJAAAATAAAAEwy4vdrm1heHAAAAGAAAAAIAAAACAA6QEZbmFtZQAAMxQAAAE5AAACN1KGf59wb3N0AAA0UAAAAjAAAAXo9iKXv3jaY2BkYGAAYqUtWvLx/DZfGbg5GEDgkmLVWhj9/ycDAwcbWJyDgQlEAQABJgkgAHjaY2BkYOBgAIIdHAz/fwLZbAyMDKiAFQBE7gLWAAAAAAEAAACXAOgAEAAAAAAAAgAAAAEAAQAAAEAALgAAAAB42mNgYf/MOIGBlYGB1Zh1JgMDoxyEZr7OkMYkxMDAxMDKzAADjAIMCBCQ5prC0MCg8FWcA8TdwQFVg6REgYERAPvTCMQAAAB42i1PsRXCUAg8SAprl7FN4QZqb2WZGRjAIVLrHj4be4ews7OJHAd54cMBd+Af7JHmt3RPYAOHAYFweFhmYE4jlj+uVb8nshCzd/qVeNUCLysG8lgwrojfSW/pcTK6o7rWX82En6HJwIEv+wbi28IwpndxRu/JaJGStHRDq5EB+OKCNumZLlSVl2TnOFVtl9nR5t7woR0QzVT+D7cKLeIAeNpjYGBgZoBgGQZGBhBYA+QxgvksDBOAtAIQsoDoj5yfOD9JflL7zPGF84vkF80vll88v0R+yfxS9lX8/3+wCoZPDJ8EPil8ZvjC8EXgi8IXgy8OXwK+JHwp+Mrw////x/wsfHx8HHxMvJo8Rjw6PGo8CjxSPCI8fDwc3PVQ2/ECRjYGuDJGJiDBhK4A4pXhDABtHClYAAAARAURAAAALAAsACwALABaAIQAzADyAQABHAFGAZQBzgIIArIDTAOkA+AEEgTCBRYFYgW+BjAGwgbkByQHSAeCB+AI2Ao4CowLGgvQDBwM6g08DX4Nug4kDkYOYg6ADsoO7A8yD4gP8hAwEGYQpBDuEUgRshHUEfYSQBJeEnoSlhLEEtwTIBNYE6oT6hQaFC4UShSQFJ4UtBTyFSAVjBW4FegV+hYUFiwWQBZWFmQWchaIFuYXFhdUF4gXyhgEGCwYThh8GNYZEhlCGVgZZhl8GZIZoBnQGhIaShp8GtIa6Br+GzAbVBt+G8Ib/Bw6HGgciBy8HOwdHh1WHXAdmB3eHvYfIB8uHzofSB9WH6of4CA4IMghACFCIcQh4CIGIjoiSCJ8IpYiyCLmIxAjWiPwJCQkSHja1Xx5YFTVvf/53nUm++zJJJnMkpkJJJkss5GFMIQ9w04IS0BZRSJLMIIo1l4XFETQFkVFBKwVrbuWpRaXPOtalZaCPKu1D2yf28NX21qfQubk9z3nzoSAS//+Mbn3nnvuuWc/n+/n+z3fCxHIaEKEJfJMIhKVhJ4GUtP8jCqRz+ufVuQ/NT8jChgkT4ssWmbRz6gK9DU/Ayw+bPKY/B6TZ7TgpuVwN71Unnnm0dHS24QQRSACUYis8XyzST6xEAch4LF5ZJsnKkc9NsDDj2ETXgUikT4iaClNJEBSGoZIP74qa+l//YRfKB5EAEyj4g/ztWBZbslcIEjucqHATOpjkYBXsYo18DNYeOQI3UMvonuOHIHXj+/YcXyHSs7FLGQp+o7sYA8IFq+BpmqKhtk6SDEZinWVWfMsHlLfIkRCgjdPsLpAtMlRUu8CmzVP8HlDEInJmkC+wcbihT54cN/6cePW79Mv/f1E+MUT2zvCM68cOWt7Rwc2pk8TNQ3IWW0gEbuI3yxI7KW9HdtnjbxyZrhj+xPbWX0EYhjcf9h3Jg9gldjBfhLm1af1ERF7BTAEmoxngQDeU35mB/YPsDiFtU0gxChgX2tn8S6FP3zG38O+zMWEVkU1yaYQRCMxt13WblvTT9bcdgpaTsnahlcqUp9owt0Vr2zYc+oUHwN8S2FjwMYV62PNA5+pPhaFc0EP4JhuPr2la4eQCVCsNRvnLac3A9nRNShIBFZPXpciEmHjareZsEbRWNTEBhVvHDasmyniwP7HJ+4AhlsgbmOP7PUsWVA8DFmHuzoSa3avSXR09XZ0HaZfHa7raOARKjm8kWoLdwfuamwHbcqaNVOo1t54V2D3QtA2nsQL1TYePrwRtMTaWUWYhvI0gGlYz5FeldWtgPiwvfW8bpVgAk/cwxqtR/hwhHxeVq9YWNG6duzo0miCHtBgy55TlN/jbYIHFGwyi6IJ6NVO7RG0c7c7ugBDRITMuMlYqovNAFYeuNg4BWPRSBCDBRhsEaKRQJCl5mOvSfmxpqbY3GQSCmYvXjy7s6bVP2WcjI/P4iEUxG7ddWt0brKrC5/P+Yz2fTans2bNjWMvPTwOi8B2Vhtw5pEr+cpyCWabVVAkVQngpGDFtChYcIsQCIYgT1ADQUUNifmQB7g4HIrN6pIdiponhCAYkoJDMd7ucEkOlxK32q02qxIMlAewtuYWQVwLdsg6+fyNbcufpfRunw+CruicxZMm1JYsV4zGfIuUV9+8OH7VzTdfFV80IpSVVZBvMErLS2rHT140JxrJtYfGjRjrFIyl3liplFNkNDlFY6nTmwuKwx0fu6gZfL67aOrZ5W03Pn/SQNiZfrXlIfr62RfrVXeh9JvpoxY4FUt5/eRFm2bsvTy/YvzFdSDK5jq/F8DrrzMpglAxtSFekt2zZ/rmRZPr/WYl1JmVJxdEq6VcX3GhoGY7zaAUuoZ5pNwhrqF5WabyKXVZhW4l/MJZaHhoC28cdiIDKkJ4nxqIiZQittSTBJlKiL8+LogKUe3+mDleLrvAjLhidsRIPBDMAda9LsERkxwCsETlccHiVXx2S4sUD1SBWyIIewRxjzDgk8iBw54n/0w3db0rjt/1ViE9TY/nNXaeue+KFT+Cxz4uSNCP6Bp5+biD/9dsLw0qj8DEq51nG1+if695Cb68Zevjbs19yW+VvZO2LB9yLT1Er4JdsAEsP/85/ZxupEvw+PznPweLNhWq4MY2evS13r0roL03FCq+m/5W2Jx4iP5u/dsQm1SrddTDuw0Xd7lKw+05HqUYSuGfM+nhE/bxIXBCrGAf3Sc0ultay6/9qXZB5lggL5R1FyAeVyEef0Aa8EZR7Qi4kuRz++3helzyOL0wgJfhOL8YXsXtkgNnaIsQrrc7YvE8UGOqllwpVM/Vnvo9pdvoEdpfVTXzgZ+MuPJ5n99dV/vjhyfPTs6uvwVu+TCrcfGm5OQt4R+tsLY3rFJquycX25Yff/vwfT0jH5QDY+vEbavV3KI3b5QrxfqfXbS445E3s4dUtm1a3Dg8XpRILPfm6vUlKD9UjQQH0MGHKG3xDEcZEXbEAz4UIKUIiyg0zwMI+hHk5dCPKlv3yZOWX/TT2VWUpqrYAxUR4SxB6HwNpN6c5jj8Iyt28drRp2lfqmFHl4xPOLZjufLHWK6b4YPIBAMrI9IiYU+Ugejl5YrSbpiQT1+lvX/+s6N6/EXXtsW7nE51/pKKiNMofU2P9h0SJ0ANCJEFs8bHShVRpB+Z/NVeUTASRJ9M2yyIzB6yhKzi2GA3s0HxeXFFF5hjgDMXFKjHuZsNdgtYYvEWMRphQGBA6AjXOwLlPq+kqPXh+tgIiNkVVVHBIiKOxBz2c3F+HGpVjJmjEbENVsDEL7aN7Nn38idXH6T7v9i27Qv6pzNv0x+PFQO3XC8JX/+j+y/gmypIBXkW1VFoBYdslvMkVZjcCMZV9NN7b6H9R8YXF/lX+Lw2S561qhb8T13bbs23WjdOCVzm82GkrVLwycO/OvSeqmHu+w9e/cnL+3pGbvsCJvLSU3mn6YYlUul9fTUhWREeSo30SHv7dkOOklNXNzZcGJoT9Qp+gzu7JL/Qlt3QAUu6Ox9YJQsilHlFWei7SzDBbFXwuiErE6lWVN68M9XQBT3vH2FzXSC3wj9Rlm4ldWQ4G0W73q8hITOh1ZARh5FBLM5+Me7xh20+my/qi4ajYeE9IZAbGLPkmh3T1723++JF9797+do3WncKVqO9oMjucpWblz66ZMmjS0d2j48VSXS/uE9nVJIWDE/fcc2SMYGLd7+3bu37uy+ePPEeyFVzDdmqURIXP/rbRxeXx8Y0Fb3Nk2M9RZ13Kc8jJzFjXTkjCTJxx4YX4R/FPkZF2FQHFYWyxxz02FoUfCbYhPn0ILQ9KExbumxGvL0KqjrkAnpoWkfluKG52fSQJMGEbJvbUxNuLZ++eVkDEPG/bl40oW1h9aS62kmhszsF8/Ir/WF3cSz1n+L187eaSnzFxZbs+GWPr2ZcKT0/Gct0k+ZBKzC91Bg/saCYDoEPiYTVjhG8moIa9dgLbCrWOs672mbSVyVbeCiGHfSbG0ZPg6mto6ZPGyk1PbSpftowbwH9GgAMhixvg3fMyMwy1ZfkGSIW9X0sbpzS2DxpclPjlL4N8NqTB4sqg4XdHtpz4CAcrrQ5h5Re3E5nY2c+isJhGsqFqazGLkkf9kBQwJURDMQtbALEWKWsrD/ZGsFVEULemYdJkQSpeewvyOeJLNWt++MT2xZEqmdctePgksVPeicUeOffqZb+TMqzb71kxuxAc57j6iVrn1005obXfzT/0ZtXTQjOMKuqaBVUn33munj5xBV3/fIvBhJftGnvgfkbPnxx18rm+Qn6wbAN22MPXy08ZfQsj9x6+LLp4e3/0bD49l9B3cFLn76uLTSt+6a7p965yOYszJmSVWgy+u54rnvS7nu3rp9Vr+N4RvYtzvCJAiFPwGYGY3ELn8/AGiXqjbI77AgbEI8Fgmk0x6nD2CRS7TinOWxuYboywE5yBMiFXCIt5+/YliwZX7J12lW/u31a0+W73u5Zd3T3tVOGdC0zl8iCSZDlvNHjtN41Sx/oGjZ1x0XRdn9Odp1r3KjY3GiBwbjG4pAP0NO7BjMH+hn9iuU/dP1icEaTlx0G8c7Ox+9YnYhfdM3td7bdcmyoIc9iSGRZbaYpVy185uZpzctvm7n96zujndGaXVcObZ01+upk5TSLhfpnLNo8BRyw7sgAQRDIXmGBukDei4srn/PeAuS2BeXpq2yF2V9+SR/+MnVFOiDvZecv03d41eUlUW9Xc4gXbyQR+bkP0TuIkwWpYhx/FrPDjCITQxhlVjaAtSAHlaGfpu5bsco7bZ71qvaN1z0152hdxNo8YdiabkPBpsSYG1VioA/SFB1Oh0AZ3HYtlLWvuKLnboOV/p7+agr9+1NPzbu7FB5nbcjoT/mIDd9af0ZBIag27OnjZ+CanoKsl/J7Ac99nL0SgHeJplTgWvbqWgUqEw47kw9xEwoHnDaMeEZNvihvVFwaBb+gs0wF1c0TN93cM3/+ig0XXzSqNfJqVzIZqjapGm2iH9PIrqoqZ/ls+lHMbi8ra2i8boOwNuVLJObO2cKm52D8cJBqjsEX1J+4lQK7O1aANeKr0c05B9bNHkb2b8J5WQlepRSs9iaojw2GELGMvnSKqVBIzf/XvPk0/ez0ZjP932RUJtFkMqqlT+ejCCWn9Lf6TolkbCMqSKg7NY1JsVekA5l3knxp9QOooPSTbeSnZAe5h9xH7icPkoeZNodNsNUq7M+q1KHOoNQpqpWdFBsDFOxOJR9A8QahtgYCwdpANKB3byAYCfIVGIhiZAS7IFobi8bqIqzPo/VxftV/I6A2DrF6B9Ta62rtYbtj4GdjRy37szqsdXYwyXEjOPyyLQ4mv+qPB1UjBGV/VFVx1Pk/Af+E9BkvqVZThSnVCiLgdBZZrADn/RNgIDGKVuEFTC68AAIM5JHOCDArcH2cujJ19mNwpV59EO6kH34sjPv000+hUpA/ph8KjQ9K/5AlWi2oAkjsHVaowIpM54D5A63OzoFjLPt0TUX+HC+AL+GLEhyTZAFkEPCWHew1ngE7H8vOptXpFop6jqwMlgzfgCn07Rd3wmz68M4X9/5pVeoFiLx47+Rdu3ZhaPbOF+//06rz56oF5dwL5GM2V5GJFaCO5uaqVQsSYVTXBJQPDrsUV9I8AjEVgXUEMEzFFKiHWTgDUxiRRmStjdQhVQuUsyj+aoyBcAgUPUI4B8whIRjggocnY1Qcc2MP2T0TSiIqi0GO1w6XiLfsjfStAPXlOINQiAVZlojhEpYZDJjjMYyPK5KCcG+2SxI5yJgfI2T0Dkb8OAc8tpueWLlyidW075r14N4wIbn6rTtmlSdC2KNGEUb+/OVlD4Brodt/KX3/dnHo0I4tV6xrn7vgyWuT2V3tl9AvV14xvCXLsHPlqv9qanEkQxs3RTsstnBBVbS0am4gEDEYzEUFlfXFzki1udghK5VlFTWh8bmohxlt9jGBwFirTTYbi70V9spOj9cvCh0bW8Mza3Js5qmXrBtWPjJsKjaaHRsebp91+0y64TRsuqRp1o43eibdsNAZG9/TTQ899BD9dFxb7qzZUP2MyXwv/fSNdde9DyGdd+rNZLQzzUDvMqxdfRn945139E8Yn9dgm739re6xm9bWY1uzBEiuaLp1Q7j62jtTWaNuGtYz1FfiTV775ALhshdbJlmbWpZfds3637g80+d3fpgMV1uDwxcsnFlcWaZm5zkc44YMbfc4PBZByHGai9v8/haTXYFhlQKUTSh1eQSo9Pnag1aP0yIZi8rcc2pHXhYy5Yy5aHU00l5tsOfVDC+Pb2ieclU0P2flA303f/3WTTeuPXrvZVb3yq3T7qJPrN/QXer8rz27YOU99/7BJQk5t7xL/7x7H/3D+9f//8R1mT73Y3W4ej25BG9cuAjy5BAqSKY8A858HnIJsTiKJ5eI+ngspPiC3kAeJgOXWAZqSMLF0iK6RIe8Wy2aMGb26CZnXlnlitVXdl86K2E2I+waTFa3P1IaWdU+xmzxjB41rACGKdbEiNmTpo+oyxLKW6Z3zpsx0mKRCsKR5NgZ48aXFBeJJmeR0XhKdTQOKc0eP2rMww899bO7N8xzqkPEnKH1M+ffsO3QojmbZ8Qtcm6uqtD/EVS7w+3yuUqzzUKRKycXCr2VeeXV4jOpjwQ5W5It1aMuGzPx+s62Km++ASFJyS+sCCerqxdMm9hYlZP9htG9fNWD9786b/LlTW4hr6QoKz2GiEFXIAYNIddh79hVbgwNMqiRUCwy5iaivseUAtlmBWapCgz+YRqmD9rTgn3gORITJpusg2SINS3zB57bMnQgpo4Mw6QbDiy5auWUiZe//yukq6ZRdZ3r75y69cq2sYteeHB7z4wqekmT1ze8qX368g6Xu9xtKYjEOxdVDvWUOIpqIj5vkXPYsBkzu7ctXzGsIR7tnL1xXsswr6el9dLJ1aFCp8NWUlYV8/pikVlXHrxnVbfYuuzyJQdumNSYN3zFrmff62mfefnGqXeu76xL5lTN6Nn+4AuL5tPftl86e3hzRbDY6bAYjeZ8zCPkLXe7W0I2e3l5dai+FqmIMzhkQtuCS0a3BgMlVrPJ46ofMbTKbvN4orWFRagDJSdNrBkRCnH+jKyIKMzuGGESHXFX1wbwrFQiS+EcJSRUgomjOO94Zp1Gwe6ptyuaPVhkZ0cymmCsgSZGXjFu7lCtt27VwgSoiACeOWMLDAbYG01KpLiu3OAJ6mdM3ZWsqK0QtIvu/3qzbKr2lLTvnD5zrz+Q1Cn927BVDas93KIVJLVkBBmPesxmrGUMq6UPWwSJAY4VYC3TWqK9nKkzCrvzxzidV+0oE1iQWwesdgmsjhgzlyjEqzCzbsRi1e0/gBKO866MXoTpLCimHHILYgXrCtQSgn7R7mD3LpBezx/qyu949nBHvmto/rDbfkL/1hoKjRwZCrXC6HmtrfNaBU9lw5DqshmpLY+C75FH6AePPkY/eOQR8KU+rKiZWVo1pFGuxoEYUb1vWCjvilfoF/QE/eKVtQWllUXrZtTNKDn03/Nks9kGDYXT69qWL2+rmVIn0jOT/vxkycz62LyYaMh3VeZ3dORXuvKHgRJqxeJbW/VzKDS8rHZIQ3B4alnXgctWHOzqOnjiYJdwb03JxOHlDUJ7qCVUnUg9Fe8srq9b+uzGKVM2/mop6n/hkb4Z66oDC43whj07Rx4/pG75HcurJ4Wa6bU5CypCsXlsfSK/Znq6RnwkjuPBjDBM7RX5loUwHDw23VzOu81hU2VPRscKRh1x/aE0ze63e2sA5t03f4w2LwZqzega+bUtW16X7kMaoc7bPX/+7nmw/D6Mlo7Os/ttIS8tm3vPnGjnj0YfPeKpqfHAx5uef3HTZdU/Ptq5a+6cnZ1/qA0dZ/FEryPbP8B5nU/KM3ybb+Lo+jrbxkF+yPZyHBB3IamOOxRkxpn9GyTW7wWSXX76Hn3P35UMwHLZ1DC6wSSr3Kx+VN/iOcrs6Kl9LAF9H/z8hR1Sqc9XKhHdrvUCcqnWgT0WByFG0WTMiduMEHUIt8Ga1Od0O6wULBTDggVWpv4u5NPtqc9hDb0dLt+d+iL1xW61lb5FD0F56lnw0V/RtyAC4+kH9CFxL/0TTIDI2W/o28t66EvQ0rOMt10ghCpzsO0uMoa3XRUFNU9iKoQKeaBrOEwcMr6F65vtb8TNyLCYcqGzMKaZcMuiBxVo+dXZjdbIHFlWrEU1rjMGWaVX5g11Z1vL8suaK4RTXtlpSa2ylcr/dFpLyz6wFouCS5RcFvr3Yp+vGEZk2wtUsmgRpbTFarVV2MyCgTYU5IqyWlkh2xxVVSV09S/tZW5zn0GRcZ4U5jnzDLtyrT5vcbDYk2PhOMX2R9h+0GDtb9BmCPnezY/0bgfHOgFnLd9TYnsdqPw5PDaPGBZ6xd5+wjRETJ7i8jylIRPW+klmLmHJCmPHOdwqZYTMRqCESyFFKBHf7GKApmAwRdg+U5Ldk8weC5+HZcSftmtm2DQza+q7f4hNeCdZTKhsmcQ6cIH8XHf3c/Qs/ZCefX716ufhjrXv3NvZee87a3fRr3buhKw/wdBO+rRKVj+vJ2LJkefji8+fXd2588RnJ3Z27qRf0dcxuUToXPqfnTAV3tPnB9aJ8L1IE957GY7arSLrVQ/rTKmL72ZqTGs+tUfS+B4m/ezUnn7siD2nCBncrmxSTKp0W53JEw3b8LAw45c+rbj+mh4vNlQ+VlhYRqFzBg9NwM5ORvu4xiniOdXrRKYcSODZqWhn2RLStLOYjCVIsbNwIOCkhD2HXkx5fl1cZChpxLrUoqasioxHxS16iZ4mqK0PowJRAnU/VFUJy1JC4RJ1xRO8DMK0KYebmya/s8bSb0AwqFij4pxQETyNVRLcDtTnDn9X5QnJGajr4H3rYpwblaQJZdwohqdhm5g+MmFPOowc1Wb6oZ7OvHtuO5vVmF+/pwGU6GnYM37Q9DVzFsh3NQWi+qY5Xx8zYaZ6tXo1tseNCAcOQB2tRYA4qAFvPt+jUyFurx+BsAt/Fsrmpk6VNzUGvTnWYcLX+4WyA/6uwIFCs7lwf+rkgQCG/cIwnspfU5pnDIWnS88dSJ3c7/cfKGptLTwglGHwoL9rYG1ynC8gJdh3KqCUZjv15W7JjOyOIM9HBEMJhdhHNGq6+9n0+oFhkLVzdd/q9Ue+PLKenQAb/LfVmSe4dHY9eze8mX64fv2AfTpdFm/pBcWRdFGoXtgtUY9NNsHfvlVmauxAngZBE1dT07fKpd+cq5VhsG2cr7cSUsFtVza2FeOJMjj6gXqIOIw4UGzpCv+mOkomIb6S+jf14vKNQKWBKO+QXKxTKaJbNdv/Z9AWNEIMqyIagXe8EZi2FUNVI8aNjgLnXYifMpyl8hL6JfKeL5dSBc4shRwYCjl+WEu3Tnrl3Zcn0lvh8kmvrFjxypQUYWauU/SlhRxbZXyTypf09CyDM3BmWU9PXyVcAT2TZ0yfTG+lW/EKL+3RXzglRDk6n1dn5ofh46uOgDcIjDWyuiOtjDNLeByCFgcE46whqEtk8N7PmSM2KK7zTYkUeWC/ckoAWMBbcucvdm2/qH3FK0lY+8fQdWfJdRpt5M268//eSG3h1YC3u257eAVvWsuaEaf2rEDIgf2eoj2nhJN0L2vTlO3e6ZPhinfhQ54DvMoauDf1Fm/4V13LeRNfWrNgJQdjEBho6b4S2P/M7IX1MwIKo15IaLSX9mqQ4CdIyBfcayxNen+R29HPz8NA+nrFhNbX29eriQl+EhPqBfcaS8PmqJaWKxbEsyjzcLFVGqJ+ziLsKutBhlWIVHJ4wPgZPveTiQ44mo49ySgg0DCB4OxPA76mg4+eQuGJEYoOIOjiX2+KqyACXjMH5w1QirxhBzGy9WrBP5CLQSW0/BD1U/8hWi5M3L9f+jE9mPoUJtL9ggPaQHCkPmXYovMFDbs2i692BN4gMxqj1Ne0PqKJuGAUBpiUGahTvdBLE+f4MeMLRu6TZAT8M3kYi0jhT8TfGQxzF5pedmJVJRLvv16lF98zkDzGdIwCW90OHIoaQfXjfMQ+6u3TaELUUo8vEGak9moLEgs0mIThBQqW3qdBL7acPetbwJ/lskdp/oS5syE2Ztx8VOQ5jPYgDCVS/E1WFegdjDc5uLY5g+a+Gp6IUO4z1aMYcwLeZEGgCnxmphyhmAWi7zm09ZMjdPfvj8I2mAYlr67qJ/Me/Jx+TA880b23G//kjLvE72HREZGsepX+lT5JLz/6BCSh6PMH5/VpPB2X7f3fADEo6ovYG07uo+JCecJ1UlyiLcgsBpZmMXgs6luVeZErZnxzunVZs8PhE76u7L68u5L+H193f4zQj8LC3LHa/LgvMbNrmPTO2AkTxp45ylcVRNmeAQ5MZp/BhtgQ1nkNQwXUXeJc3+RIhqCG6Oth0GB3sMYH1ZAgcBqleJnHFv1tkv7mpVkPbm0E1AoC0S2TmIMOHqi+JmH4S9d/MofFg2/G4i95YyWcSo8dD7U3AWoT/tjwU0IZ28h47PiSOSwCyutLaS3vPd3fivsxVWa8mPLAyzg9Liu7m7sz+bwDTkt8rXGazJ2XOIJrLLRmytRuXDcauzLXpZR2NcP2qxk2MD8lQZuypntqmmy9TJvZnUA2snUBP1HY3Mgjhbp/HIKnyrA+GjGjClHAii+wi+VccsyZSpfT5VPn7IR9Nz733I2Ys0qYNFl7DB/AXVOPrd0FWSnnc2B4jjlTMTxbwPBMPsmWEJIJH8QdMucl9KR2Uj65IEVgr9aLY4Vz1EAGuBQpwsFi48WuBvI10Q82k3GZ4pHionAQZ7CQIZhHEFd1HrMLO0w4iKwJzALi8JjKcIJxDwMTTn34y18E7ZOa0f4/PnTz6UcXrZc3DVs69i8pzfLO+KlLnljF4pRSvP8k1L1xzNP0b1X0jH3zqyDeugvsdPKlrz48Dt+3vDP215euPbKtFBR8SFNMJxGxrZLGW8OWpcb87tL1ZPjDOoG1j89EfzrFWVRP+vC9PsKd3RjSzBASBtZnKtczy9gq5/wgfQGHlN7vM6fXizCM/gu2a9QCa6UH04HuvlE4Mdgw/H33mjW718j30zLEJyLsSZ3Sry0L2VOcPvTwGpbkPG6icj7L8IW7kg1emTL3HUNVCa+QPLceEYnTsSJ3IBu8GAnLisuUdN4ZphzXmTJJ4475gqs/7f2pM2Vd/Mhc8Hi4EEK1Ecmzz8TSCPu48Bj8B2nnRuZHmRFDNKGrA/ycwMqx5zgI/A3QX6T6ZZ9OjCVOm5lE0nM9yzVK5oTKCB0j4kRlumgJ12d1cRiJNUHajsVtTNw+OWizT1UPb2xdVxV67vI9pwolwvWyHWWejYfD1Us3nNrT0srXpqaCKqf9Ye1Wxr+DbGEEA5ERbCdNRFquHEwmP207mqQN9CS8Bm1tnyaPt83e20/2yruSx/ARjKcN4GaPjuNdW2rHXiAMkIHJLpnRKPVc/4t6RWS9Qtym+Af5f+UnuKwRsPCoByQCn1PLLJjFXFTpL+THqYVaOmCWBrO4HRIX2B8UTX8H1zySWyS1EplFf8G8UGHWLGqRH++gv8B3O+BzrssnFFYPxuiYgASEiFRvCllNr8xksYDUJsHTMSxJsHRYFyMm41YCIYE/jQlsDKZ6B3wJRKwe88bEGSxyd9o+Pg8BVyhWTX+Gc5st0syzNE+QNe6STIwiq7zGSBmbAWeJoDsecx5fwG5kTfm2/ucjQZzZNShz4lwTJBl9jx3xsM03+D48SB/8vnthgEylMqE+7cLAgAN0xgP6e0K8awRuB+G2DFbnb+1iZ5CF4ZisG2T4WbeNMEMJs5718TiJObNo6dUu4qM0jvD8GX4FLsg/zASuzRcdVI4YZYownCtKYxlpmQI5K2NWwEyZqOExxfhcwQeYituv2xAydnCGM8U6FjN5Lqev4LEKCiOAIRBEfIc3iF/6cJBv+vQn/eQnn96kcODglnD9mnrzbvqvX5bSf0Ju6S8hm9FEoq97Ja3FMXxOAwBDq8Eg4IIBFJCwesz1FnDe8NZi43SHX0U5vLGqfVypDgoCVk3HLmBmGyZH8OJ2bzzsqHSlMeIc9pQPYI9ej+8rPe1JSDJ10If1/JI5HOnQ+R1lCtxfn/EqI7fgmdjWlkfl8hqBGDECFy3zLmf6JzNHpN6bKwToXIGNEMV1xy1yKMD38Qfn2bDymZgo5c4cePJFue86MKjFNP2MZbNhuUpNsdXI8gaUm/q6TY+5iY84kxBNyGrTs5nVLRCJc41F4apFIjN1+4hYX1/fd4TZo9hU0vT5fBZLi/80zjRNAdFyj7pAXUCq+M6K6ldUixpkRDFoCQTlINMf48G4HIuLcQeictwh2h1+h2rHseaT216vLmikv6tptm95Y4Sz5Y0ttqZa+rvGTwyGTxqhrrbJtuWNkdaRb9xqb6qFOhZNN3H4FU7fam+uOZdSzyA3O4E5NNfoST/RM771dcy4jGM3ucDGYEV9/rwvH4Ab+VWI+fnOaRyUC7+BkOo3n96yaYNweHwf4aHUmPHf+iAidWTL6c3jU2M2bGJX4fCGb/GH4nNypTyjVyCgstXPlrusc4eUfmEsCGGYsEkj4ezRY/XF/SaTwWx1n5srOo8y6SyRxWZEvUx0qGbceoBz8ZTsyxH965GBbxIyOK+7D4n48AwrnmTwftD+QyYtkiELm576dyB6iSkuIAa+nyCDvp/A0tLfT4jAHbwN34u5ZBDm6kbwNNalQRc7x4AAeEZfsXj+OgO6vKoixyOWv4LaFcNcjqnG84rxpH+DihPS4CoMFAm82rj0M0XzL1Gw/0UtUzy+hO1mrR+oxoXzznLhvJMym3TI1zy2MDK3C+edsExH+720V9v7rQlXz4vpSzJooWk5dl55ju/+wodx1m995ZMazFsvKOjskfP0yPPKCH93GfrONa4qB9+uZkDLfqUQjnIPqO8pH170t7ffsf/n825aUlHkLCyKjC52vmUyj5n+fXUSGhqndSdGXrR/XEFBia+k2Du0umpkg7fUaquOpH3hdZ1Xn9Xsp+K8YYYKjrknqRuHzQ0nL0jLEhpZ2hSOvESYwZ6lZcyHupk9I2MHYUzHTOz4RhgVg7AFj6DPb0HNLlzMggqjGimWeQe00/85UamlPuvgtkitYwTeybwu3I7JE6bDvO7/xPrkKtvYTgbTQFsEexnEW8CF0horv35CU/DGZ1+YcP/9E1741caK5gk4ZZeO+c1r97YMHXP33WOGttz7+ktj2Jwgl8BJdafixhWsfw3F7F8iqBbRwQzaQeGyE/Qo1Jw4Kh09cfToCag52/U1kK/lhm3IoRu2QQO8to2+Rl/bBq/RshaJtDCdjOunaTtQEdv9MQpRFLSoxX3LgTjKtTREubBJNxIpiCqsnX0oqges7lEm33UTrcxhhFnz8IRU9lwKbtMfMPp+ux6lP1wP2w+Xn/p3JWvkO8os+4EyLSj+g+oPldoHL8+lOw50/lDJOH1e7mSJGIqm56iMcgzLNRkF5rRgCqIIY/Y0k8CtngyARYJyaEfbc0v6OR7LCWYdpb18CrMPyujxHW0Tqabfp/0ldFzP4z7Vg3OVL8iLfMf752wPIuuTjCzycgdl0Weq5w4WHD0kPsnHrk4mV48dt6Il3ODzNYRbVozjMcB7SsaVxzRSdogDoUEYx/lRNrPSQBrEeYnMv9kT5Fv1wC0jDLgljS2shmHdKdLtDxcxNS/FxaPE51EfSW6Nr1lTPvfiem0wd+K2hguHlDkEurFzZE+Uf1qncEW4j583nwb76c1slxR5h3TeGGq6J6rG6SbTNwQiz8I2FBAn99f1cJRUVBt3QfF5mCmOQWglFOlBH8qkZV+uXr1w6sqFf/0NnQbk+iVz6uouXbt96YK3FG3smHuW3ZinFt20+r6nhV8NH9daWkpb6PFJU28jaTs6kTP7wz4xrHriYYsv7pFna19oFTRRwS6oXnKFikvOtM1b49wim2EQ6+eMYwmYgswRk7MLOJCWxzhxe/s5Vko6Xel7U0j0phaAm00QI/ezZv3KeIOR5HB/ZxuOIMp+i8ljYR8asNk2BEC3DKt+I6BKr+nKDWjf8DHTzS2gm5i1bzROhPFeThNjiqVnDC9shEHjLErjagYztmnny0kz+Y/zZZgjqKgjuLtlMF4j5EONMEJ1jIAyCNRAvhQcAY54cIQQCKoO/MsXWSK8RVkXR3jmCeP5QhnGYaAM8iGuloEazzcEK/HGEccMJYdaIyvMXdNRI48QkDiPEPBtScWkIuboyMdZd6GIzBPFLNnkEsjLkGhT8n1FhcMiFUEAWXbkWnL9geJRzsJch5xX6nCGC8XcGkOhrSJ/Yo9k9Ug2Q/OkZqUgJ2R3j3FdtuidJwO1bl+NSynJrk2Wx3ODxV6Lx2MszbYmY0PlvOxQgbMsz+fMcjsNhaFgnVLamD8kWIUKowEMcpYMTtc1726SsrJHubPUPIMh35rbHBTyLaPrvEaDx1BTWyY4Suoryk2CRxr6LcH9L0mxIMPum/zHp7LCRQaLTSyNueOq2ZdndfogS/VnNcdkVbD7so0VTtHuNNqz1ycFk5wlGLN8pc0em9VkMIH/ZsgxGBTVLDrkItvQfHOJN+AwmbPiVos9x1SgWixyvsliLXQ2O2srKt2uSqfRPKW2oNWUZcpxlIcWz/gJ7X+mPOeWEa3DSgqiLXK2Uc01Fxepdq9FrjMWZEuWxpGjyzplh8mpcBm6V3SrC6SMDfJbPH6Az/t+fcMNv75BFAdfpJM38Ougv7SfJLO79DJUxzlvIF9rYq84YK/BGwNbKyRqArEXUb8vwd6REnwvC+ORa/BYA+lLcDtOIr3PJXD+wqL1PAfbACpILRmmf6+sey4hJ/Po3y2nv5YxIWOLDYd0VHl6wUtpYodI08i/Ru4njWOZLtwYuPqmrh083KfvRQrJtMPI2LXeB5jc6NIkn3fdGIZ8oY5WB7WP29H1gHftWIyw87QHMoRZGdAtzv/2PS1LMps7me+4gejSpI8wBV5EAU55jMhAgmlOeFCSCQHnYXqY41ucY4BGcvX9EKOIOjEEWyS+Y+rzBiEaDCj5oDBfLodubiyDcyYaAp9igf/0+8EP3MtP/G0M2xGjBxPOTv9Ef5c/X9Dy/RjKdya0p6KBQNSvatSBtDPX3xWAclG2jZu+8QyNTkx2xaBNSzjzMbH+VheGOp2J1L/wJX+UkMHfEo4mE0k7mUeW8D2jtE9gC8SZU6DHNBDDfGzZ8A6KiHLlf2C0mdUHrxlQH/D8ueCqDgx1Mpoe9rGN/Sjx0kG2m5MOMiealD4N+tJq2vmX+fq484nwAJKqD9L3Y9Z5wZeMPpCeJ3j7wJ5TkJk2OJPoB6f2pMXKmeQgZTiZmTsC9skpNaH08v00ou/Lh42CiGzXwbZHM2tWfsS3plXMFmh3v84k6fH/Hsc9A/Cnb0TJPdEWoe+kwGcPqoOzerYxkxi7F36W3sETYBWuqZ/imvLwvRYH9w6Iu8BhYh7XgzrZFrb5TC2Q6WaZ3rGMPkCX0AeW3TH2lR5NS/edpvW8Qn+kd9OROY/+9s1H5rRdYoF/aQ+c64UHNJptWSqm0o0W0nOCkMk4H3SLVyX75tdcCqytwyESZFt85UFlIMIcDwR9ujUsEg+YeC3xoUtwtwjML47dFah2m98bCOreoI48QeWbBG/neucuCkQC18+lX+28h/5rzg14s3iOJ+9t9rS39D68XfrY5yB9/thSDO4qSWk7U8Pn/mNT5+M/aarY8mu+qTCybRnt38rzS5x49MpbNl/52HH9bivAsgmtmGTqgiMg6HHXY1aY5fX6He0/0tmh/WLzwpXhzsTcWyZnbF3aoL1swZNGC1nTTXps3TOeInHGwMaQMgSAAQ7AuI09bPJWAclCLcHqUO3EIb9+371H6eX0SfrXV1cJpOv5S6D+sBgOU7LqVSiBabDt6Ocnnn+a/m06r8OrOBca+f8FUcr9zjhX5CTaGg8rAjOvBoRg2AXumDR1z5o1UyJzws/2Wr98up88/aW11/EOFB8XtTVTBDJlTXhOhJKpBYfoF0PoF1AwBAoObT50KO3TLGJLB++pySS9p3buO2pHxoLDDZ+mwWE13SeDzpxAZc6MOn1XPKTfy+gJvL+zM9+Z6T/mLsDwltnSGbHWQ6y/+TduhNfNyHbRQPTIoh//PCIKMe654JHIOroVqtahHh25Eqro1nXHhMdT77yTOpE68U7qHeFx+WN6zx/onvffh4V/EFENodekboRb6DrhGrgx8917poyMP4SnGFCFH5TJsWOo7g96Mb0ZN7h++YPfFnklL8zjWKaK386MVrD6wbK07x7X1ezI8CuZ/cmIs4vtZnOc9nBvczbv1EAQYZk9hfq43cFs1gof036udnWxweCBueOHzLphj77r20f0O8q4MQcyLpaBpP/TkKZrF3Xq8ZSH4cLv9arJBLLoO7029Z3hgId9i8x2j+3hWJhv3NnjulJSnv5M2Wp31PNHkqPebhl4xp+EM0/s4njohol/27r1b3Q/vZ3uZyGxy+LKN+bn/Z3+NXb1xNEmk6nI6cz95SU//uKiXK2kPLiJPvPIuFunjA6HyhSn0vPLn0OgK8epuWrCd9Dr3+l7JBEO5Lvlx359GGZfXaRqg7OGiby4s8vykRcX5qlbTWaTIbvYbHPlOpsacj6qcTVYJ8/GEk3NJZGs3GDbqFxwRvxh57xZYduYQDg3MCWZc15fidybtIjNdh//TwL4ZrzoyzARWxxn7y6hZFffxcpwWk3v/+yvlChLzpyFiz+Fx+THaDUcYwccP/s8HcUIiPR6apQ45+yOY8c4DqVtSen95cHaJhPPusJznmcmV3XYyuQx/Pz/AAfdhq542o2QsWrDMBCGfyVOSjOUDn4AdSlJiY1sMCTZ0hQHQqcM6RyMahsSKVj2EChd+wgd+wZ9s7xDz4pKl0IrkO7T3a+73wZwhU8wnNcNHhwzDPDiuIMLvDvu4hYnxx4G7M5xD9fsyXGf8q+kZN4l3e7tq5YZfDw77tDcN8ddPOLDsQef+Y574Cxx3Kd8gQU0DjiiQokcBWpwDJFhRDGGQIQEY+IV6SQU0RwGezR0GpvBQh+OVZkXNR9mIx6LKBnzlZaKz82+MUaSZGmV0k7JqJOit1hKJasy04p4TcWcmu6wJRHWMm92W4LUimsbK1JIayskYxwz2r81PlciTBBgSvv7M5BqVae6yiWPQ8Fn/McAXaJJMA1a8/9wu7FFQ2Vtf4mwE0IbW2fYyMqUWnEholAIwf/u+QXtVlqxAAAAeNpt0meTFVUUheH7DhkJEgQJgpIFhdvn7NM9gxKGCZKzKGZyUHJGySAgSq7i5wrFfYdPdFXX+tRP9V61Wl2tt8//rdbh1vueV29eWl2tYXQxjOGMYCSjGM0YxvIB4xjPBCbyIZOYzBSm8hHTmM7HzGAms5jNJ8xhLp/yGfOYzwIWsojFLOFzlrKML/iS5aygTUUiExRqGrrpYSVf8TWrWM0a1tLLOvroZ4BBvmE9G9jIJjazha1sYzs72MkudvMte/iO79nLD/zIT/zML/zKb+xjPwc4yCEOc4SjHOM4v/MHJzjJKU5zhrOc4zwXuMglLnOFq/zJX1zjOje4yS1uc4e73ONv7vOAh/zDI/7lPx7zhKc84zkveDnqwsljg1W7bVZmMrMZZjFrszG7zZ63mfSSXtJLekkv6SW9pJf00pBX6VV6lV6lV+lVepVepVfpVXpJL+klvaSX9JJe6njZu7J3Ze/K3pW9K3tXbg9915id/wid0Amd0Amd0Amd0Il3TueesJ+wn7CfsJ+wn7CfsJ+wn7CfsJ+wn7CfsJ+wn7CfsJ+wn0h6SS/pZb2sl/WyXtbLelkv62W9rBd6oRd6oRd6oRd6oRd6oVf0il7RK3pFr+gVvaJX9IperVfr1Xq1Xq1X69V6tV6tV+s1eo1eo9foNXqNXtPxijsr7qy4s+LOijsr7qy0h75rzG6zx+w115l9Zr85YA520l0Wd1ncZXGXxV0Wd1ncZama1x+EcTsAAAAB//8AAnjaY2BgYGQAgosrjpwF0ZcUq9bCaABTzgdAAAA=") format("woff"), + url("./Genericons.ttf") format("truetype"), + url("./Genericons.svg#Genericons") format("svg"); + font-weight: normal; + font-style: normal; +} + +@media screen and (-webkit-min-device-pixel-ratio:0) { + @font-face { + font-family: "Genericons"; + src: url("./Genericons.svg#Genericons") format("svg"); + } +} + + +/** + * All Genericons + */ + +.genericon { + font-size: 16px; + vertical-align: top; + text-align: center; + -moz-transition: color .1s ease-in 0; + -webkit-transition: color .1s ease-in 0; + display: inline-block; + font-family: "Genericons"; + font-style: normal; + font-weight: normal; + font-variant: normal; + line-height: 1; + text-decoration: inherit; + text-transform: none; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + speak: none; +} + + +/** + * Helper classes + */ + +.genericon-rotate-90 { + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -ms-transform: rotate(90deg); + -o-transform: rotate(90deg); + transform: rotate(90deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); +} + +.genericon-rotate-180 { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -o-transform: rotate(180deg); + transform: rotate(180deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); +} + +.genericon-rotate-270 { + -webkit-transform: rotate(270deg); + -moz-transform: rotate(270deg); + -ms-transform: rotate(270deg); + -o-transform: rotate(270deg); + transform: rotate(270deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); +} + +.genericon-flip-horizontal { + -webkit-transform: scale(-1, 1); + -moz-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + -o-transform: scale(-1, 1); + transform: scale(-1, 1); +} + +.genericon-flip-vertical { + -webkit-transform: scale(1, -1); + -moz-transform: scale(1, -1); + -ms-transform: scale(1, -1); + -o-transform: scale(1, -1); + transform: scale(1, -1); +} + + +/** + * Individual icons + */ + +.genericon-404:before { content: "\f423"; } +.genericon-activity:before { content: "\f508"; } +.genericon-anchor:before { content: "\f509"; } +.genericon-aside:before { content: "\f101"; } +.genericon-attachment:before { content: "\f416"; } +.genericon-audio:before { content: "\f109"; } +.genericon-bold:before { content: "\f471"; } +.genericon-book:before { content: "\f444"; } +.genericon-bug:before { content: "\f50a"; } +.genericon-cart:before { content: "\f447"; } +.genericon-category:before { content: "\f301"; } +.genericon-chat:before { content: "\f108"; } +.genericon-checkmark:before { content: "\f418"; } +.genericon-close:before { content: "\f405"; } +.genericon-close-alt:before { content: "\f406"; } +.genericon-cloud:before { content: "\f426"; } +.genericon-cloud-download:before { content: "\f440"; } +.genericon-cloud-upload:before { content: "\f441"; } +.genericon-code:before { content: "\f462"; } +.genericon-codepen:before { content: "\f216"; } +.genericon-cog:before { content: "\f445"; } +.genericon-collapse:before { content: "\f432"; } +.genericon-comment:before { content: "\f300"; } +.genericon-day:before { content: "\f305"; } +.genericon-digg:before { content: "\f221"; } +.genericon-document:before { content: "\f443"; } +.genericon-dot:before { content: "\f428"; } +.genericon-downarrow:before { content: "\f502"; } +.genericon-download:before { content: "\f50b"; } +.genericon-draggable:before { content: "\f436"; } +.genericon-dribbble:before { content: "\f201"; } +.genericon-dropbox:before { content: "\f225"; } +.genericon-dropdown:before { content: "\f433"; } +.genericon-dropdown-left:before { content: "\f434"; } +.genericon-edit:before { content: "\f411"; } +.genericon-ellipsis:before { content: "\f476"; } +.genericon-expand:before { content: "\f431"; } +.genericon-external:before { content: "\f442"; } +.genericon-facebook:before { content: "\f203"; } +.genericon-facebook-alt:before { content: "\f204"; } +.genericon-fastforward:before { content: "\f458"; } +.genericon-feed:before { content: "\f413"; } +.genericon-flag:before { content: "\f468"; } +.genericon-flickr:before { content: "\f211"; } +.genericon-foursquare:before { content: "\f226"; } +.genericon-fullscreen:before { content: "\f474"; } +.genericon-gallery:before { content: "\f103"; } +.genericon-github:before { content: "\f200"; } +.genericon-googleplus:before { content: "\f206"; } +.genericon-googleplus-alt:before { content: "\f218"; } +.genericon-handset:before { content: "\f50c"; } +.genericon-heart:before { content: "\f461"; } +.genericon-help:before { content: "\f457"; } +.genericon-hide:before { content: "\f404"; } +.genericon-hierarchy:before { content: "\f505"; } +.genericon-home:before { content: "\f409"; } +.genericon-image:before { content: "\f102"; } +.genericon-info:before { content: "\f455"; } +.genericon-instagram:before { content: "\f215"; } +.genericon-italic:before { content: "\f472"; } +.genericon-key:before { content: "\f427"; } +.genericon-leftarrow:before { content: "\f503"; } +.genericon-link:before { content: "\f107"; } +.genericon-linkedin:before { content: "\f207"; } +.genericon-linkedin-alt:before { content: "\f208"; } +.genericon-location:before { content: "\f417"; } +.genericon-lock:before { content: "\f470"; } +.genericon-mail:before { content: "\f410"; } +.genericon-maximize:before { content: "\f422"; } +.genericon-menu:before { content: "\f419"; } +.genericon-microphone:before { content: "\f50d"; } +.genericon-minimize:before { content: "\f421"; } +.genericon-minus:before { content: "\f50e"; } +.genericon-month:before { content: "\f307"; } +.genericon-move:before { content: "\f50f"; } +.genericon-next:before { content: "\f429"; } +.genericon-notice:before { content: "\f456"; } +.genericon-paintbrush:before { content: "\f506"; } +.genericon-path:before { content: "\f219"; } +.genericon-pause:before { content: "\f448"; } +.genericon-phone:before { content: "\f437"; } +.genericon-picture:before { content: "\f473"; } +.genericon-pinned:before { content: "\f308"; } +.genericon-pinterest:before { content: "\f209"; } +.genericon-pinterest-alt:before { content: "\f210"; } +.genericon-play:before { content: "\f452"; } +.genericon-plugin:before { content: "\f439"; } +.genericon-plus:before { content: "\f510"; } +.genericon-pocket:before { content: "\f224"; } +.genericon-polldaddy:before { content: "\f217"; } +.genericon-portfolio:before { content: "\f460"; } +.genericon-previous:before { content: "\f430"; } +.genericon-print:before { content: "\f469"; } +.genericon-quote:before { content: "\f106"; } +.genericon-rating-empty:before { content: "\f511"; } +.genericon-rating-full:before { content: "\f512"; } +.genericon-rating-half:before { content: "\f513"; } +.genericon-reddit:before { content: "\f222"; } +.genericon-refresh:before { content: "\f420"; } +.genericon-reply:before { content: "\f412"; } +.genericon-reply-alt:before { content: "\f466"; } +.genericon-reply-single:before { content: "\f467"; } +.genericon-rewind:before { content: "\f459"; } +.genericon-rightarrow:before { content: "\f501"; } +.genericon-search:before { content: "\f400"; } +.genericon-send-to-phone:before { content: "\f438"; } +.genericon-send-to-tablet:before { content: "\f454"; } +.genericon-share:before { content: "\f415"; } +.genericon-show:before { content: "\f403"; } +.genericon-shuffle:before { content: "\f514"; } +.genericon-sitemap:before { content: "\f507"; } +.genericon-skip-ahead:before { content: "\f451"; } +.genericon-skip-back:before { content: "\f450"; } +.genericon-skype:before { content: "\f220"; } +.genericon-spam:before { content: "\f424"; } +.genericon-spotify:before { content: "\f515"; } +.genericon-standard:before { content: "\f100"; } +.genericon-star:before { content: "\f408"; } +.genericon-status:before { content: "\f105"; } +.genericon-stop:before { content: "\f449"; } +.genericon-stumbleupon:before { content: "\f223"; } +.genericon-subscribe:before { content: "\f463"; } +.genericon-subscribed:before { content: "\f465"; } +.genericon-summary:before { content: "\f425"; } +.genericon-tablet:before { content: "\f453"; } +.genericon-tag:before { content: "\f302"; } +.genericon-time:before { content: "\f303"; } +.genericon-top:before { content: "\f435"; } +.genericon-trash:before { content: "\f407"; } +.genericon-tumblr:before { content: "\f214"; } +.genericon-twitch:before { content: "\f516"; } +.genericon-twitter:before { content: "\f202"; } +.genericon-unapprove:before { content: "\f446"; } +.genericon-unsubscribe:before { content: "\f464"; } +.genericon-unzoom:before { content: "\f401"; } +.genericon-uparrow:before { content: "\f500"; } +.genericon-user:before { content: "\f304"; } +.genericon-video:before { content: "\f104"; } +.genericon-videocamera:before { content: "\f517"; } +.genericon-vimeo:before { content: "\f212"; } +.genericon-warning:before { content: "\f414"; } +.genericon-website:before { content: "\f475"; } +.genericon-week:before { content: "\f306"; } +.genericon-wordpress:before { content: "\f205"; } +.genericon-xpost:before { content: "\f504"; } +.genericon-youtube:before { content: "\f213"; } +.genericon-zoom:before { content: "\f402"; } + + + + diff --git a/wp-content/themes/twentysixteen/header.php b/wp-content/themes/twentysixteen/header.php new file mode 100644 index 0000000..d28debf --- /dev/null +++ b/wp-content/themes/twentysixteen/header.php @@ -0,0 +1,106 @@ + + class="no-js"> + + + + + + + + + + +> + +
            +
            + + + + +
            diff --git a/wp-content/themes/twentysixteen/image.php b/wp-content/themes/twentysixteen/image.php new file mode 100644 index 0000000..492f40b --- /dev/null +++ b/wp-content/themes/twentysixteen/image.php @@ -0,0 +1,118 @@ + + +
            +
            + + + +
            > + + + +
            + ', '' ); ?> +
            + +
            + +
            + + + + +
            + + '', + 'link_before' => '', + 'link_after' => '', + 'pagelink' => '' . __( 'Page', 'twentysixteen' ) . ' %', + 'separator' => ', ', + ) + ); + ?> +
            + +
            + + %1$s %3$s × %4$s', + esc_html_x( 'Full size', 'Used before full size attachment link.', 'twentysixteen' ), + esc_url( wp_get_attachment_url() ), + absint( $metadata['width'] ), + absint( $metadata['height'] ) + ); + } + ?> + "%s"', 'twentysixteen' ), + get_the_title() + ), + '', + '' + ); + ?> +
            +
            + + _x( 'Published in%title', 'Parent post link', 'twentysixteen' ), + ) + ); + // End the loop. + endwhile; + ?> + +
            +
            + + + diff --git a/wp-content/themes/twentysixteen/inc/back-compat.php b/wp-content/themes/twentysixteen/inc/back-compat.php new file mode 100644 index 0000000..84b51c4 --- /dev/null +++ b/wp-content/themes/twentysixteen/inc/back-compat.php @@ -0,0 +1,78 @@ +

            %s

            ', $message ); +} + +/** + * Prevents the Customizer from being loaded on WordPress versions prior to 4.4. + * + * @since Twenty Sixteen 1.0 + * + * @global string $wp_version WordPress version. + */ +function twentysixteen_customize() { + wp_die( + /* translators: %s: The current WordPress version. */ + sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ), + '', + array( + 'back_link' => true, + ) + ); +} +add_action( 'load-customize.php', 'twentysixteen_customize' ); + +/** + * Prevents the Theme Preview from being loaded on WordPress versions prior to 4.4. + * + * @since Twenty Sixteen 1.0 + * + * @global string $wp_version WordPress version. + */ +function twentysixteen_preview() { + if ( isset( $_GET['preview'] ) ) { + /* translators: %s: The current WordPress version. */ + wp_die( sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ) ); + } +} +add_action( 'template_redirect', 'twentysixteen_preview' ); diff --git a/wp-content/themes/twentysixteen/inc/customizer.php b/wp-content/themes/twentysixteen/inc/customizer.php new file mode 100644 index 0000000..677a5f8 --- /dev/null +++ b/wp-content/themes/twentysixteen/inc/customizer.php @@ -0,0 +1,1259 @@ + $default_background_color, + ) + ) + ); + + /** + * Filter the arguments used when adding 'custom-header' support in Twenty Sixteen. + * + * @since Twenty Sixteen 1.0 + * + * @param array $args { + * An array of custom-header support arguments. + * + * @type string $default-text-color Default color of the header text. + * @type int $width Width in pixels of the custom header image. Default 1200. + * @type int $height Height in pixels of the custom header image. Default 280. + * @type bool $flex-height Whether to allow flexible-height header images. Default true. + * @type callable $wp-head-callback Callback function used to style the header image and text + * displayed on the blog. + * } + */ + add_theme_support( + 'custom-header', + apply_filters( + 'twentysixteen_custom_header_args', + array( + 'default-text-color' => $default_text_color, + 'width' => 1200, + 'height' => 280, + 'flex-height' => true, + 'wp-head-callback' => 'twentysixteen_header_style', + ) + ) + ); +} +add_action( 'after_setup_theme', 'twentysixteen_custom_header_and_background' ); + +if ( ! function_exists( 'twentysixteen_header_style' ) ) : + /** + * Styles the header text displayed on the site. + * + * Create your own twentysixteen_header_style() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @see twentysixteen_custom_header_and_background(). + */ + function twentysixteen_header_style() { + // If the header text option is untouched, let's bail. + if ( display_header_text() ) { + return; + } + + // If the header text has been hidden. + ?> + + get_setting( 'blogname' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + + if ( isset( $wp_customize->selective_refresh ) ) { + $wp_customize->selective_refresh->add_partial( + 'blogname', + array( + 'selector' => '.site-title a', + 'container_inclusive' => false, + 'render_callback' => 'twentysixteen_customize_partial_blogname', + ) + ); + $wp_customize->selective_refresh->add_partial( + 'blogdescription', + array( + 'selector' => '.site-description', + 'container_inclusive' => false, + 'render_callback' => 'twentysixteen_customize_partial_blogdescription', + ) + ); + } + + // Add color scheme setting and control. + $wp_customize->add_setting( + 'color_scheme', + array( + 'default' => 'default', + 'sanitize_callback' => 'twentysixteen_sanitize_color_scheme', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'color_scheme', + array( + 'label' => __( 'Base Color Scheme', 'twentysixteen' ), + 'section' => 'colors', + 'type' => 'select', + 'choices' => twentysixteen_get_color_scheme_choices(), + 'priority' => 1, + ) + ); + + // Add page background color setting and control. + $wp_customize->add_setting( + 'page_background_color', + array( + 'default' => $color_scheme[1], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'page_background_color', + array( + 'label' => __( 'Page Background Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); + + // Remove the core header textcolor control, as it shares the main text color. + $wp_customize->remove_control( 'header_textcolor' ); + + // Add link color setting and control. + $wp_customize->add_setting( + 'link_color', + array( + 'default' => $color_scheme[2], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'link_color', + array( + 'label' => __( 'Link Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); + + // Add main text color setting and control. + $wp_customize->add_setting( + 'main_text_color', + array( + 'default' => $color_scheme[3], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'main_text_color', + array( + 'label' => __( 'Main Text Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); + + // Add secondary text color setting and control. + $wp_customize->add_setting( + 'secondary_text_color', + array( + 'default' => $color_scheme[4], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'secondary_text_color', + array( + 'label' => __( 'Secondary Text Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); +} +add_action( 'customize_register', 'twentysixteen_customize_register', 11 ); + +/** + * Render the site title for the selective refresh partial. + * + * @since Twenty Sixteen 1.2 + * @see twentysixteen_customize_register() + * + * @return void + */ +function twentysixteen_customize_partial_blogname() { + bloginfo( 'name' ); +} + +/** + * Render the site tagline for the selective refresh partial. + * + * @since Twenty Sixteen 1.2 + * @see twentysixteen_customize_register() + * + * @return void + */ +function twentysixteen_customize_partial_blogdescription() { + bloginfo( 'description' ); +} + +/** + * Registers color schemes for Twenty Sixteen. + * + * Can be filtered with {@see 'twentysixteen_color_schemes'}. + * + * The order of colors in a colors array: + * 1. Main Background Color. + * 2. Page Background Color. + * 3. Link Color. + * 4. Main Text Color. + * 5. Secondary Text Color. + * + * @since Twenty Sixteen 1.0 + * + * @return array An associative array of color scheme options. + */ +function twentysixteen_get_color_schemes() { + /** + * Filter the color schemes registered for use with Twenty Sixteen. + * + * The default schemes include 'default', 'dark', 'gray', 'red', and 'yellow'. + * + * @since Twenty Sixteen 1.0 + * + * @param array $schemes { + * Associative array of color schemes data. + * + * @type array $slug { + * Associative array of information for setting up the color scheme. + * + * @type string $label Color scheme label. + * @type array $colors HEX codes for default colors prepended with a hash symbol ('#'). + * Colors are defined in the following order: Main background, page + * background, link, main text, secondary text. + * } + * } + */ + return apply_filters( + 'twentysixteen_color_schemes', + array( + 'default' => array( + 'label' => __( 'Default', 'twentysixteen' ), + 'colors' => array( + '#1a1a1a', + '#ffffff', + '#007acc', + '#1a1a1a', + '#686868', + ), + ), + 'dark' => array( + 'label' => __( 'Dark', 'twentysixteen' ), + 'colors' => array( + '#262626', + '#1a1a1a', + '#9adffd', + '#e5e5e5', + '#c1c1c1', + ), + ), + 'gray' => array( + 'label' => __( 'Gray', 'twentysixteen' ), + 'colors' => array( + '#616a73', + '#4d545c', + '#c7c7c7', + '#f2f2f2', + '#f2f2f2', + ), + ), + 'red' => array( + 'label' => __( 'Red', 'twentysixteen' ), + 'colors' => array( + '#ffffff', + '#ff675f', + '#640c1f', + '#402b30', + '#402b30', + ), + ), + 'yellow' => array( + 'label' => __( 'Yellow', 'twentysixteen' ), + 'colors' => array( + '#3b3721', + '#ffef8e', + '#774e24', + '#3b3721', + '#5b4d3e', + ), + ), + ) + ); +} + +if ( ! function_exists( 'twentysixteen_get_color_scheme' ) ) : + /** + * Retrieves the current Twenty Sixteen color scheme. + * + * Create your own twentysixteen_get_color_scheme() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return array An associative array of either the current or default color scheme HEX values. + */ + function twentysixteen_get_color_scheme() { + $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); + $color_schemes = twentysixteen_get_color_schemes(); + + if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { + return $color_schemes[ $color_scheme_option ]['colors']; + } + + return $color_schemes['default']['colors']; + } +endif; // twentysixteen_get_color_scheme() + +if ( ! function_exists( 'twentysixteen_get_color_scheme_choices' ) ) : + /** + * Retrieves an array of color scheme choices registered for Twenty Sixteen. + * + * Create your own twentysixteen_get_color_scheme_choices() function to override + * in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return array Array of color schemes. + */ + function twentysixteen_get_color_scheme_choices() { + $color_schemes = twentysixteen_get_color_schemes(); + $color_scheme_control_options = array(); + + foreach ( $color_schemes as $color_scheme => $value ) { + $color_scheme_control_options[ $color_scheme ] = $value['label']; + } + + return $color_scheme_control_options; + } +endif; // twentysixteen_get_color_scheme_choices() + + +if ( ! function_exists( 'twentysixteen_sanitize_color_scheme' ) ) : + /** + * Handles sanitization for Twenty Sixteen color schemes. + * + * Create your own twentysixteen_sanitize_color_scheme() function to override + * in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @param string $value Color scheme name value. + * @return string Color scheme name. + */ + function twentysixteen_sanitize_color_scheme( $value ) { + $color_schemes = twentysixteen_get_color_scheme_choices(); + + if ( ! array_key_exists( $value, $color_schemes ) ) { + return 'default'; + } + + return $value; + } +endif; // twentysixteen_sanitize_color_scheme() + +/** + * Enqueues front-end CSS for color scheme. + * + * @since Twenty Sixteen 1.0 + * + * @see wp_add_inline_style() + */ +function twentysixteen_color_scheme_css() { + $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); + + // Don't do anything if the default color scheme is selected. + if ( 'default' === $color_scheme_option ) { + return; + } + + $color_scheme = twentysixteen_get_color_scheme(); + + // Convert main text hex color to rgba. + $color_textcolor_rgb = twentysixteen_hex2rgb( $color_scheme[3] ); + + // If the rgba values are empty return early. + if ( empty( $color_textcolor_rgb ) ) { + return; + } + + // If we get this far, we have a custom color scheme. + $colors = array( + 'background_color' => $color_scheme[0], + 'page_background_color' => $color_scheme[1], + 'link_color' => $color_scheme[2], + 'main_text_color' => $color_scheme[3], + 'secondary_text_color' => $color_scheme[4], + 'border_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.2)', $color_textcolor_rgb ), + + ); + + $color_scheme_css = twentysixteen_get_color_scheme_css( $colors ); + + wp_add_inline_style( 'twentysixteen-style', $color_scheme_css ); +} +add_action( 'wp_enqueue_scripts', 'twentysixteen_color_scheme_css' ); + +/** + * Binds the JS listener to make Customizer color_scheme control. + * + * Passes color scheme data as colorScheme global. + * + * @since Twenty Sixteen 1.0 + */ +function twentysixteen_customize_control_js() { + wp_enqueue_script( 'color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), '20170530', true ); + wp_localize_script( 'color-scheme-control', 'colorScheme', twentysixteen_get_color_schemes() ); +} +add_action( 'customize_controls_enqueue_scripts', 'twentysixteen_customize_control_js' ); + +/** + * Binds JS handlers to make the Customizer preview reload changes asynchronously. + * + * @since Twenty Sixteen 1.0 + */ +function twentysixteen_customize_preview_js() { + wp_enqueue_script( 'twentysixteen-customize-preview', get_template_directory_uri() . '/js/customize-preview.js', array( 'customize-preview' ), '20170530', true ); +} +add_action( 'customize_preview_init', 'twentysixteen_customize_preview_js' ); + +/** + * Returns CSS for the color schemes. + * + * @since Twenty Sixteen 1.0 + * + * @param array $colors Color scheme colors. + * @return string Color scheme CSS. + */ +function twentysixteen_get_color_scheme_css( $colors ) { + $colors = wp_parse_args( + $colors, + array( + 'background_color' => '', + 'page_background_color' => '', + 'link_color' => '', + 'main_text_color' => '', + 'secondary_text_color' => '', + 'border_color' => '', + ) + ); + + return << .page-links-title, + .comment-author, + .comment-reply-title small a:hover, + .comment-reply-title small a:focus { + color: {$colors['main_text_color']}; + } + + blockquote, + .menu-toggle.toggled-on, + .menu-toggle.toggled-on:hover, + .menu-toggle.toggled-on:focus, + .post-navigation, + .post-navigation div + div, + .pagination, + .widget, + .page-header, + .page-links a, + .comments-title, + .comment-reply-title { + border-color: {$colors['main_text_color']}; + } + + button, + button[disabled]:hover, + button[disabled]:focus, + input[type="button"], + input[type="button"][disabled]:hover, + input[type="button"][disabled]:focus, + input[type="reset"], + input[type="reset"][disabled]:hover, + input[type="reset"][disabled]:focus, + input[type="submit"], + input[type="submit"][disabled]:hover, + input[type="submit"][disabled]:focus, + .menu-toggle.toggled-on, + .menu-toggle.toggled-on:hover, + .menu-toggle.toggled-on:focus, + .pagination:before, + .pagination:after, + .pagination .prev, + .pagination .next, + .page-links a { + background-color: {$colors['main_text_color']}; + } + + /* Secondary Text Color */ + + /** + * IE8 and earlier will drop any block with CSS3 selectors. + * Do not combine these styles with the next block. + */ + body:not(.search-results) .entry-summary { + color: {$colors['secondary_text_color']}; + } + + blockquote, + .post-password-form label, + a:hover, + a:focus, + a:active, + .post-navigation .meta-nav, + .image-navigation, + .comment-navigation, + .widget_recent_entries .post-date, + .widget_rss .rss-date, + .widget_rss cite, + .site-description, + .author-bio, + .entry-footer, + .entry-footer a, + .sticky-post, + .taxonomy-description, + .entry-caption, + .comment-metadata, + .pingback .edit-link, + .comment-metadata a, + .pingback .comment-edit-link, + .comment-form label, + .comment-notes, + .comment-awaiting-moderation, + .logged-in-as, + .form-allowed-tags, + .site-info, + .site-info a, + .wp-caption .wp-caption-text, + .gallery-caption, + .widecolumn label, + .widecolumn .mu_register label { + color: {$colors['secondary_text_color']}; + } + + .widget_calendar tbody a:hover, + .widget_calendar tbody a:focus { + background-color: {$colors['secondary_text_color']}; + } + + /* Border Color */ + fieldset, + pre, + abbr, + acronym, + table, + th, + td, + input[type="date"], + input[type="time"], + input[type="datetime-local"], + input[type="week"], + input[type="month"], + input[type="text"], + input[type="email"], + input[type="url"], + input[type="password"], + input[type="search"], + input[type="tel"], + input[type="number"], + textarea, + .main-navigation li, + .main-navigation .primary-menu, + .menu-toggle, + .dropdown-toggle:after, + .social-navigation a, + .image-navigation, + .comment-navigation, + .tagcloud a, + .entry-content, + .entry-summary, + .page-links a, + .page-links > span, + .comment-list article, + .comment-list .pingback, + .comment-list .trackback, + .comment-reply-link, + .no-comments, + .widecolumn .mu_register .mu_alert { + border-color: {$colors['main_text_color']}; /* Fallback for IE7 and IE8 */ + border-color: {$colors['border_color']}; + } + + hr, + code { + background-color: {$colors['main_text_color']}; /* Fallback for IE7 and IE8 */ + background-color: {$colors['border_color']}; + } + + @media screen and (min-width: 56.875em) { + .main-navigation li:hover > a, + .main-navigation li.focus > a { + color: {$colors['link_color']}; + } + + .main-navigation ul ul, + .main-navigation ul ul li { + border-color: {$colors['border_color']}; + } + + .main-navigation ul ul:before { + border-top-color: {$colors['border_color']}; + border-bottom-color: {$colors['border_color']}; + } + + .main-navigation ul ul li { + background-color: {$colors['page_background_color']}; + } + + .main-navigation ul ul:after { + border-top-color: {$colors['page_background_color']}; + border-bottom-color: {$colors['page_background_color']}; + } + } + +CSS; +} + + +/** + * Outputs an Underscore template for generating CSS for the color scheme. + * + * The template generates the css dynamically for instant display in the + * Customizer preview. + * + * @since Twenty Sixteen 1.0 + */ +function twentysixteen_color_scheme_css_template() { + $colors = array( + 'background_color' => '{{ data.background_color }}', + 'page_background_color' => '{{ data.page_background_color }}', + 'link_color' => '{{ data.link_color }}', + 'main_text_color' => '{{ data.main_text_color }}', + 'secondary_text_color' => '{{ data.secondary_text_color }}', + 'border_color' => '{{ data.border_color }}', + ); + ?> + + a, + .main-navigation li.focus > a { + color: %1$s; + } + } + '; + + wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $link_color ) ); +} +add_action( 'wp_enqueue_scripts', 'twentysixteen_link_color_css', 11 ); + +/** + * Enqueues front-end CSS for the main text color. + * + * @since Twenty Sixteen 1.0 + * + * @see wp_add_inline_style() + */ +function twentysixteen_main_text_color_css() { + $color_scheme = twentysixteen_get_color_scheme(); + $default_color = $color_scheme[3]; + $main_text_color = get_theme_mod( 'main_text_color', $default_color ); + + // Don't do anything if the current color is the default. + if ( $main_text_color === $default_color ) { + return; + } + + // Convert main text hex color to rgba. + $main_text_color_rgb = twentysixteen_hex2rgb( $main_text_color ); + + // If the rgba values are empty return early. + if ( empty( $main_text_color_rgb ) ) { + return; + } + + // If we get this far, we have a custom color scheme. + $border_color = vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.2)', $main_text_color_rgb ); + + $css = ' + /* Custom Main Text Color */ + body, + blockquote cite, + blockquote small, + .main-navigation a, + .menu-toggle, + .dropdown-toggle, + .social-navigation a, + .post-navigation a, + .pagination a:hover, + .pagination a:focus, + .widget-title a, + .site-branding .site-title a, + .entry-title a, + .page-links > .page-links-title, + .comment-author, + .comment-reply-title small a:hover, + .comment-reply-title small a:focus { + color: %1$s + } + + blockquote, + .menu-toggle.toggled-on, + .menu-toggle.toggled-on:hover, + .menu-toggle.toggled-on:focus, + .post-navigation, + .post-navigation div + div, + .pagination, + .widget, + .page-header, + .page-links a, + .comments-title, + .comment-reply-title { + border-color: %1$s; + } + + button, + button[disabled]:hover, + button[disabled]:focus, + input[type="button"], + input[type="button"][disabled]:hover, + input[type="button"][disabled]:focus, + input[type="reset"], + input[type="reset"][disabled]:hover, + input[type="reset"][disabled]:focus, + input[type="submit"], + input[type="submit"][disabled]:hover, + input[type="submit"][disabled]:focus, + .menu-toggle.toggled-on, + .menu-toggle.toggled-on:hover, + .menu-toggle.toggled-on:focus, + .pagination:before, + .pagination:after, + .pagination .prev, + .pagination .next, + .page-links a { + background-color: %1$s; + } + + /* Border Color */ + fieldset, + pre, + abbr, + acronym, + table, + th, + td, + input[type="date"], + input[type="time"], + input[type="datetime-local"], + input[type="week"], + input[type="month"], + input[type="text"], + input[type="email"], + input[type="url"], + input[type="password"], + input[type="search"], + input[type="tel"], + input[type="number"], + textarea, + .main-navigation li, + .main-navigation .primary-menu, + .menu-toggle, + .dropdown-toggle:after, + .social-navigation a, + .image-navigation, + .comment-navigation, + .tagcloud a, + .entry-content, + .entry-summary, + .page-links a, + .page-links > span, + .comment-list article, + .comment-list .pingback, + .comment-list .trackback, + .comment-reply-link, + .no-comments, + .widecolumn .mu_register .mu_alert { + border-color: %1$s; /* Fallback for IE7 and IE8 */ + border-color: %2$s; + } + + hr, + code { + background-color: %1$s; /* Fallback for IE7 and IE8 */ + background-color: %2$s; + } + + @media screen and (min-width: 56.875em) { + .main-navigation ul ul, + .main-navigation ul ul li { + border-color: %2$s; + } + + .main-navigation ul ul:before { + border-top-color: %2$s; + border-bottom-color: %2$s; + } + } + '; + + wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $main_text_color, $border_color ) ); +} +add_action( 'wp_enqueue_scripts', 'twentysixteen_main_text_color_css', 11 ); + +/** + * Enqueues front-end CSS for the secondary text color. + * + * @since Twenty Sixteen 1.0 + * + * @see wp_add_inline_style() + */ +function twentysixteen_secondary_text_color_css() { + $color_scheme = twentysixteen_get_color_scheme(); + $default_color = $color_scheme[4]; + $secondary_text_color = get_theme_mod( 'secondary_text_color', $default_color ); + + // Don't do anything if the current color is the default. + if ( $secondary_text_color === $default_color ) { + return; + } + + $css = ' + /* Custom Secondary Text Color */ + + /** + * IE8 and earlier will drop any block with CSS3 selectors. + * Do not combine these styles with the next block. + */ + body:not(.search-results) .entry-summary { + color: %1$s; + } + + blockquote, + .post-password-form label, + a:hover, + a:focus, + a:active, + .post-navigation .meta-nav, + .image-navigation, + .comment-navigation, + .widget_recent_entries .post-date, + .widget_rss .rss-date, + .widget_rss cite, + .site-description, + .author-bio, + .entry-footer, + .entry-footer a, + .sticky-post, + .taxonomy-description, + .entry-caption, + .comment-metadata, + .pingback .edit-link, + .comment-metadata a, + .pingback .comment-edit-link, + .comment-form label, + .comment-notes, + .comment-awaiting-moderation, + .logged-in-as, + .form-allowed-tags, + .site-info, + .site-info a, + .wp-caption .wp-caption-text, + .gallery-caption, + .widecolumn label, + .widecolumn .mu_register label { + color: %1$s; + } + + .widget_calendar tbody a:hover, + .widget_calendar tbody a:focus { + background-color: %1$s; + } + '; + + wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $secondary_text_color ) ); +} +add_action( 'wp_enqueue_scripts', 'twentysixteen_secondary_text_color_css', 11 ); diff --git a/wp-content/themes/twentysixteen/inc/template-tags.php b/wp-content/themes/twentysixteen/inc/template-tags.php new file mode 100644 index 0000000..da15431 --- /dev/null +++ b/wp-content/themes/twentysixteen/inc/template-tags.php @@ -0,0 +1,286 @@ +%1$s%2$s %4$s', + get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ), + _x( 'Author', 'Used before post author name.', 'twentysixteen' ), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + get_the_author() + ); + } + + if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { + twentysixteen_entry_date(); + } + + $format = get_post_format(); + if ( current_theme_supports( 'post-formats', $format ) ) { + printf( + '%1$s%3$s', + sprintf( '%s ', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ), + esc_url( get_post_format_link( $format ) ), + get_post_format_string( $format ) + ); + } + + if ( 'post' === get_post_type() ) { + twentysixteen_entry_taxonomies(); + } + + if ( ! is_singular() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { + echo ''; + /* translators: %s: Post title. */ + comments_popup_link( sprintf( __( 'Leave a comment on %s', 'twentysixteen' ), get_the_title() ) ); + echo ''; + } + } +endif; + +if ( ! function_exists( 'twentysixteen_entry_date' ) ) : + /** + * Prints HTML with date information for current post. + * + * Create your own twentysixteen_entry_date() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_entry_date() { + $time_string = ''; + + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $time_string = ''; + } + + $time_string = sprintf( + $time_string, + esc_attr( get_the_date( 'c' ) ), + get_the_date(), + esc_attr( get_the_modified_date( 'c' ) ), + get_the_modified_date() + ); + + printf( + '%1$s %3$s', + _x( 'Posted on', 'Used before publish date.', 'twentysixteen' ), + esc_url( get_permalink() ), + $time_string + ); + } +endif; + +if ( ! function_exists( 'twentysixteen_entry_taxonomies' ) ) : + /** + * Prints HTML with category and tags for current post. + * + * Create your own twentysixteen_entry_taxonomies() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_entry_taxonomies() { + $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); + if ( $categories_list && twentysixteen_categorized_blog() ) { + printf( + '%1$s %2$s', + _x( 'Categories', 'Used before category names.', 'twentysixteen' ), + $categories_list + ); + } + + $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); + if ( $tags_list && ! is_wp_error( $tags_list ) ) { + printf( + '%1$s %2$s', + _x( 'Tags', 'Used before tag names.', 'twentysixteen' ), + $tags_list + ); + } + } +endif; + +if ( ! function_exists( 'twentysixteen_post_thumbnail' ) ) : + /** + * Displays an optional post thumbnail. + * + * Wraps the post thumbnail in an anchor element on index views, or a div + * element when on single views. + * + * Create your own twentysixteen_post_thumbnail() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_post_thumbnail() { + if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { + return; + } + + if ( is_singular() ) : + ?> + +
            + +
            + + + + + + +
            + +
            + %2$s', + esc_url( get_permalink( get_the_ID() ) ), + /* translators: %s: Post title. */ + sprintf( __( 'Continue reading "%s"', 'twentysixteen' ), get_the_title( get_the_ID() ) ) + ); + return ' … ' . $link; + } + add_filter( 'excerpt_more', 'twentysixteen_excerpt_more' ); +endif; + +if ( ! function_exists( 'twentysixteen_categorized_blog' ) ) : + /** + * Determines whether blog/site has more than one category. + * + * Create your own twentysixteen_categorized_blog() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return bool True if there is more than one category, false otherwise. + */ + function twentysixteen_categorized_blog() { + $all_the_cool_cats = get_transient( 'twentysixteen_categories' ); + if ( false === $all_the_cool_cats ) { + // Create an array of all the categories that are attached to posts. + $all_the_cool_cats = get_categories( + array( + 'fields' => 'ids', + // We only need to know if there is more than one category. + 'number' => 2, + ) + ); + + // Count the number of categories that are attached to the posts. + $all_the_cool_cats = count( $all_the_cool_cats ); + + set_transient( 'twentysixteen_categories', $all_the_cool_cats ); + } + + if ( $all_the_cool_cats > 1 || is_preview() ) { + // This blog has more than 1 category so twentysixteen_categorized_blog() should return true. + return true; + } else { + // This blog has only 1 category so twentysixteen_categorized_blog() should return false. + return false; + } + } +endif; + +/** + * Flushes out the transients used in twentysixteen_categorized_blog(). + * + * @since Twenty Sixteen 1.0 + */ +function twentysixteen_category_transient_flusher() { + if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { + return; + } + // Like, beat it. Dig? + delete_transient( 'twentysixteen_categories' ); +} +add_action( 'edit_category', 'twentysixteen_category_transient_flusher' ); +add_action( 'save_post', 'twentysixteen_category_transient_flusher' ); + +if ( ! function_exists( 'twentysixteen_the_custom_logo' ) ) : + /** + * Displays the optional custom logo. + * + * Does nothing if the custom logo is not available. + * + * @since Twenty Sixteen 1.2 + */ + function twentysixteen_the_custom_logo() { + if ( function_exists( 'the_custom_logo' ) ) { + the_custom_logo(); + } + } +endif; + +if ( ! function_exists( 'wp_body_open' ) ) : + /** + * Fire the wp_body_open action. + * + * Added for backward compatibility to support pre-5.2.0 WordPress versions. + * + * @since Twenty Sixteen 2.0 + */ + function wp_body_open() { + /** + * Triggered after the opening tag. + * + * @since Twenty Sixteen 2.0 + */ + do_action( 'wp_body_open' ); + } +endif; diff --git a/wp-content/themes/twentysixteen/index.php b/wp-content/themes/twentysixteen/index.php new file mode 100644 index 0000000..f0f7b94 --- /dev/null +++ b/wp-content/themes/twentysixteen/index.php @@ -0,0 +1,66 @@ + + +
            +
            + + + + +
            +

            +
            + + + __( 'Previous page', 'twentysixteen' ), + 'next_text' => __( 'Next page', 'twentysixteen' ), + 'before_page_number' => '' . __( 'Page', 'twentysixteen' ) . ' ', + ) + ); + + // If no content, include the "No posts found" template. + else : + get_template_part( 'template-parts/content', 'none' ); + + endif; + ?> + +
            +
            + + + diff --git a/wp-content/themes/twentysixteen/js/color-scheme-control.js b/wp-content/themes/twentysixteen/js/color-scheme-control.js new file mode 100644 index 0000000..e65b5bd --- /dev/null +++ b/wp-content/themes/twentysixteen/js/color-scheme-control.js @@ -0,0 +1,96 @@ +/* global colorScheme, Color */ +/** + * Add a listener to the Color Scheme control to update other color controls to new values/defaults. + * Also trigger an update of the Color Scheme CSS when a color is changed. + */ + +( function( api ) { + var cssTemplate = wp.template( 'twentysixteen-color-scheme' ), + colorSchemeKeys = [ + 'background_color', + 'page_background_color', + 'link_color', + 'main_text_color', + 'secondary_text_color' + ], + colorSettings = [ + 'background_color', + 'page_background_color', + 'link_color', + 'main_text_color', + 'secondary_text_color' + ]; + + api.controlConstructor.select = api.Control.extend( { + ready: function() { + if ( 'color_scheme' === this.id ) { + this.setting.bind( 'change', function( value ) { + var colors = colorScheme[value].colors; + + // Update Background Color. + var color = colors[0]; + api( 'background_color' ).set( color ); + api.control( 'background_color' ).container.find( '.color-picker-hex' ) + .data( 'data-default-color', color ) + .wpColorPicker( 'defaultColor', color ); + + // Update Page Background Color. + color = colors[1]; + api( 'page_background_color' ).set( color ); + api.control( 'page_background_color' ).container.find( '.color-picker-hex' ) + .data( 'data-default-color', color ) + .wpColorPicker( 'defaultColor', color ); + + // Update Link Color. + color = colors[2]; + api( 'link_color' ).set( color ); + api.control( 'link_color' ).container.find( '.color-picker-hex' ) + .data( 'data-default-color', color ) + .wpColorPicker( 'defaultColor', color ); + + // Update Main Text Color. + color = colors[3]; + api( 'main_text_color' ).set( color ); + api.control( 'main_text_color' ).container.find( '.color-picker-hex' ) + .data( 'data-default-color', color ) + .wpColorPicker( 'defaultColor', color ); + + // Update Secondary Text Color. + color = colors[4]; + api( 'secondary_text_color' ).set( color ); + api.control( 'secondary_text_color' ).container.find( '.color-picker-hex' ) + .data( 'data-default-color', color ) + .wpColorPicker( 'defaultColor', color ); + } ); + } + } + } ); + + // Generate the CSS for the current Color Scheme. + function updateCSS() { + var scheme = api( 'color_scheme' )(), + css, + colors = _.object( colorSchemeKeys, colorScheme[ scheme ].colors ); + + // Merge in color scheme overrides. + _.each( colorSettings, function( setting ) { + colors[ setting ] = api( setting )(); + } ); + + // Add additional color. + // jscs:disable + colors.border_color = Color( colors.main_text_color ).toCSS( 'rgba', 0.2 ); + // jscs:enable + + css = cssTemplate( colors ); + + api.previewer.send( 'update-color-scheme-css', css ); + } + + // Update the CSS whenever a color setting is changed. + _.each( colorSettings, function( setting ) { + api( setting, function( setting ) { + setting.bind( updateCSS ); + } ); + } ); +} )( wp.customize ); diff --git a/wp-content/themes/twentysixteen/js/customize-preview.js b/wp-content/themes/twentysixteen/js/customize-preview.js new file mode 100644 index 0000000..fc99333 --- /dev/null +++ b/wp-content/themes/twentysixteen/js/customize-preview.js @@ -0,0 +1,41 @@ +/** + * Live-update changed settings in real time in the Customizer preview. + */ + +( function( $ ) { + var style = $( '#twentysixteen-color-scheme-css' ), + api = wp.customize; + + if ( ! style.length ) { + style = $( 'head' ).append( ''; + return parent.insertBefore(p.lastChild, parent.firstChild); + } + + /** + * Returns the value of `html5.elements` as an array. + * @private + * @returns {Array} An array of shived element node names. + */ + function getElements() { + var elements = html5.elements; + return typeof elements == 'string' ? elements.split(' ') : elements; + } + + /** + * Extends the built-in list of html5 elements + * @memberOf html5 + * @param {String|Array} newElements whitespace separated list or array of new element names to shiv + * @param {Document} ownerDocument The context document. + */ + function addElements(newElements, ownerDocument) { + var elements = html5.elements; + if(typeof elements != 'string'){ + elements = elements.join(' '); + } + if(typeof newElements != 'string'){ + newElements = newElements.join(' '); + } + html5.elements = elements +' '+ newElements; + shivDocument(ownerDocument); + } + + /** + * Returns the data associated to the given document + * @private + * @param {Document} ownerDocument The document. + * @returns {Object} An object of data. + */ + function getExpandoData(ownerDocument) { + var data = expandoData[ownerDocument[expando]]; + if (!data) { + data = {}; + expanID++; + ownerDocument[expando] = expanID; + expandoData[expanID] = data; + } + return data; + } + + /** + * returns a shived element for the given nodeName and document + * @memberOf html5 + * @param {String} nodeName name of the element + * @param {Document|DocumentFragment} ownerDocument The context document. + * @returns {Object} The shived element. + */ + function createElement(nodeName, ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createElement(nodeName); + } + if (!data) { + data = getExpandoData(ownerDocument); + } + var node; + + if (data.cache[nodeName]) { + node = data.cache[nodeName].cloneNode(); + } else if (saveClones.test(nodeName)) { + node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); + } else { + node = data.createElem(nodeName); + } + + // Avoid adding some elements to fragments in IE < 9 because + // * Attributes like `name` or `type` cannot be set/changed once an element + // is inserted into a document/fragment + // * Link elements with `src` attributes that are inaccessible, as with + // a 403 response, will cause the tab/window to crash + // * Script elements appended to fragments will execute when their `src` + // or `text` property is set + return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; + } + + /** + * returns a shived DocumentFragment for the given document + * @memberOf html5 + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived DocumentFragment. + */ + function createDocumentFragment(ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createDocumentFragment(); + } + data = data || getExpandoData(ownerDocument); + var clone = data.frag.cloneNode(), + i = 0, + elems = getElements(), + l = elems.length; + for(;i -1, + isOpera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, + isIE = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; + + if ( ( isWebkit || isOpera || isIE ) && document.getElementById && window.addEventListener ) { + window.addEventListener( 'hashchange', function() { + var id = location.hash.substring( 1 ), + element; + + if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { + return; + } + + element = document.getElementById( id ); + + if ( element ) { + if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { + element.tabIndex = -1; + } + + element.focus(); + + // Repositions the window on jump-to-anchor to account for admin bar and border height. + window.scrollBy( 0, -53 ); + } + }, false ); + } +} )(); diff --git a/wp-content/themes/twentysixteen/page.php b/wp-content/themes/twentysixteen/page.php new file mode 100644 index 0000000..582c3a1 --- /dev/null +++ b/wp-content/themes/twentysixteen/page.php @@ -0,0 +1,42 @@ + + +
            +
            + + +
            + + + +
            + + + diff --git a/wp-content/themes/twentysixteen/readme.txt b/wp-content/themes/twentysixteen/readme.txt new file mode 100644 index 0000000..0de9136 --- /dev/null +++ b/wp-content/themes/twentysixteen/readme.txt @@ -0,0 +1,120 @@ +=== Twenty Sixteen === +Contributors: wordpressdotorg +Tested up to: 5.0 +Version: 2.1 +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html +Tags: one-column, two-columns, right-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready, blog + +== Description == +Twenty Sixteen is a modernized take on an ever-popular WordPress layout — the horizontal masthead with an optional right sidebar that works perfectly for blogs and websites. It has custom color options with beautiful default color schemes, a harmonious fluid grid using a mobile-first approach, and impeccable polish in every detail. Twenty Sixteen will make your WordPress look beautiful everywhere. + +* Mobile-first, Responsive Layout +* Custom Colors +* Custom Header +* Social Links +* Post Formats +* The GPL v2.0 or later license. :) Use it to make something cool. + +For more information about Twenty Sixteen please go to https://wordpress.org/support/article/twenty-sixteen/. + +== Installation == + +1. In your admin panel, go to Appearance -> Themes and click the 'Add New' button. +2. Type in Twenty Sixteen in the search form and press the 'Enter' key on your keyboard. +3. Click on the 'Activate' button to use your new theme right away. +4. Go to https://wordpress.org/support/article/twenty-sixteen/ for a guide on how to customize this theme. +5. Navigate to Appearance > Customize in your admin panel and customize to taste. + +== Copyright == + +Twenty Sixteen WordPress Theme, Copyright 2014-2020 WordPress.org +Twenty Sixteen is distributed under the terms of the GNU GPL + +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 2 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. + +Twenty Sixteen Theme bundles the following third-party resources: + +HTML5 Shiv v3.7.0, Copyright 2014 Alexander Farkas +Licenses: MIT/GPL2 +Source: https://github.com/aFarkas/html5shiv + +Genericons icon font, Copyright 2013-2017 Automattic.com +License: GNU GPL, Version 2 (or later) +Source: http://www.genericons.com + +Image used in screenshot.png: A photo by Austin Schmid (https://unsplash.com/schmidy/), licensed under Creative Commons Zero(http://creativecommons.org/publicdomain/zero/1.0/) + +== Changelog == + += 2.1 = +* Released: March 31, 2020 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_2.1 + += 2.0 = +* Released: May 7, 2019 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_2.0 + += 1.9 = +* Released: February 21, 2019 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.9 + += 1.8 = +* Released: January 9, 2019 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.8 + += 1.7 = +* Released: December 19, 2018 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.7 + += 1.6 = +* Released: December 6, 2018 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.6 + += 1.5 = +* Released: May 17, 2018 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.5 + += 1.4 = +* Released: November 14, 2017 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.4 + += 1.3 = +* Released: August 16, 2016 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.3 + += 1.2 = +* Released: April 12, 2016 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.2 + += 1.1 = +* Released: January 6, 2016 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.1 + += 1.0 = +* Released: December 8, 2015 + +Initial release + +== Notes == + +Only the default and dark color schemes are accessibility ready. diff --git a/wp-content/themes/twentysixteen/rtl.css b/wp-content/themes/twentysixteen/rtl.css new file mode 100644 index 0000000..84d1a8b --- /dev/null +++ b/wp-content/themes/twentysixteen/rtl.css @@ -0,0 +1,756 @@ +/* +Theme Name: Twenty Sixteen +Description: Adds support for languages written in a Right To Left (RTL) direction. +It's easy, just a matter of overwriting all the horizontal positioning attributes +of your CSS stylesheet in a separate stylesheet file named rtl.css. + +See: https://codex.wordpress.org/Right_to_Left_Language_Support +*/ + +/** + * Table of Contents: + * + * 1.0 - Normalize + * 2.0 - Typography + * 3.0 - Elements + * 4.0 - Forms + * 5.0 - Navigations + * 6.0 - Accessibility + * 7.0 - Widgets + * 8.0 - Content + * 8.1 - Header + * 8.2 - Posts and pages + * 8.3 - Comments + * 8.4 - Footer + * 9.0 - Multisites + * 10.0 - Media Queries + * 10.1 - >= 710px + * 10.2 - >= 910px + * 10.3 - >= 985px + * 10.4 - >= 1200px + */ + + +/** + * 1.0 - Normalize + */ + +body { + direction: rtl; + unicode-bidi: embed; +} + +input[type="checkbox"], +input[type="radio"] { + margin-right: auto; + margin-left: 0.4375em; +} + + +/** + * 2.0 - Typography + */ + +body, +button, +button[disabled]:hover, +button[disabled]:focus, +input[type="button"], +input[type="button"][disabled]:hover, +input[type="button"][disabled]:focus, +input[type="reset"], +input[type="reset"][disabled]:hover, +input[type="reset"][disabled]:focus, +input[type="submit"], +input[type="submit"][disabled]:hover, +input[type="submit"][disabled]:focus, +input, +select, +textarea, +.post-password-form label, +.main-navigation, +.post-navigation, +.post-navigation .post-title, +.pagination, +.image-navigation, +.comment-navigation, +.site .skip-link, +.logged-in .site .skip-link, +.widget .widget-title, +.widget_recent_entries .post-date, +.widget_rss .rss-date, +.widget_rss cite, +.tagcloud a, +.site-title, +.entry-title, +.entry-footer, +.sticky-post, +.page-title, +.page-links, +.comments-title, +.comment-reply-title, +.comment-metadata, +.pingback .edit-link, +.comment-reply-link, +.comment-form label, +.no-comments, +.required, +.site-footer .site-title, +.site-footer .site-title:after, +.widecolumn label, +.widecolumn .mu_register label, +.site-footer span[role=separator] { + font-family: Arial, Tahoma, sans-serif; +} + +::-webkit-input-placeholder { + font-family: Arial, Tahoma, sans-serif; +} + +:-moz-placeholder { + font-family: Arial, Tahoma, sans-serif; +} + +::-moz-placeholder { + font-family: Arial, Tahoma, sans-serif; +} + +:-ms-input-placeholder { + font-family: Arial, Tahoma, sans-serif; +} + +blockquote { + border-right-width: 4px; + border-left-width: 0; + padding-right: 1.263157895em; + padding-left: 0; +} + +.entry-content h1, +.entry-content h2, +.entry-content h3, +.entry-content h4, +.entry-content h5, +.entry-content h6, +.entry-summary h1, +.entry-summary h2, +.entry-summary h3, +.entry-summary h4, +.entry-summary h5, +.entry-summary h6, +.comment-content h1, +.comment-content h2, +.comment-content h3, +.comment-content h4, +.comment-content h5, +.comment-content h6, +.textwidget h1, +.textwidget h2, +.textwidget h3, +.textwidget h4, +.textwidget h5, +.textwidget h6, +.entry-content .author-title, +.widget_calendar caption, +.widecolumn h2 { + font-weight: 700; +} + + +/** + * 3.0 - Elements + */ + +ul, +ol { + margin: 0 1.25em 1.75em 0; +} + +ol { + margin-right: 1.5em; + margin-left: 0; +} + +caption, +th, +td { + text-align: right; +} + + +/** + * 4.0 - Forms + */ + +input[type="search"].search-field { + border-radius: 0 2px 2px 0; +} + +.search-submit:before { + left: 1px; +} + +.search-submit { + border-radius: 2px 0 0 2px; + left: 0; + right: auto; +} + + +/** + * 5.0 - Navigation + */ + +.main-navigation ul ul { + margin-right: 0.875em; + margin-left: auto; +} + +.main-navigation .menu-item-has-children > a { + margin-right: auto; + margin-left: 56px; +} + +.dropdown-toggle { + left: 0; + right: auto; +} + +.dropdown-toggle:after { + border-right-width: 1px; + border-left-width: 0; + left: auto; + right: 1px; +} + +.social-navigation li { + float: right; + margin: 0 0 0.4375em 0.4375em; +} + +.pagination:before { + left: 0; + right: auto; +} + +.pagination:after { + left: 54px; + right: auto; +} + +.pagination .nav-links { + padding-right: 0; + padding-left: 106px; +} + +.pagination .nav-links:before { + content: "\f430"; + left: -1px; + right: auto; +} + +.pagination .nav-links:after { + content: "\f429"; + left: 55px; + right: auto; +} + +.pagination .page-numbers { + margin: 0 -0.7368421053em 0 0.7368421053em; +} + +.pagination .prev, +.pagination .next { + margin: 0; +} + +.pagination .prev { + left: 54px; + right: auto; +} + +.pagination .prev:before { + content: "\f429"; + left: auto; + right: -1px; +} + +.pagination .next { + left: 0; + right: auto; +} + +.pagination .next:before { + content: "\f430"; + left: -1px; + right: auto; +} + +.comment-navigation { + margin-right: 0; + margin-left: 0; +} + + +/** + * 6.0 - Accessibility + */ + +.site .skip-link { + left: auto; + right: -9999em; +} + +.site .skip-link:focus { + left: auto; + right: 6px; +} + + +/** + * 7.0 - Widgets + */ + +.tagcloud a { + margin-right: 0; + margin-left: 0.1875em; +} + +.tagcloud ul { + margin-right: 0; +} + + +/** + * 8.0 - Content + */ + + +/** + * 8.1 - Header + */ + +.site-branding { + margin-right: 0; + margin-left: auto; +} + + +/** + * 8.2 - Posts and pages + */ + +.author-avatar .avatar { + float: right; + margin-right: 0; + margin-left: 1.75em; +} + +.entry-footer .avatar { + margin-right: 0; + margin-left: 0.5384615385em; +} + +.page-links a, +.page-links > span { + margin-right: auto; + margin-left: 0.3076923077em; +} + +.page-links > .page-links-title { + padding-right: 0; + padding-left: 0.6153846154em; +} + +body:not(.search-results) .entry-summary .alignright { + margin: 0.2631578947em 0 1.4736842105em 1.4736842105em; +} + +body:not(.search-results) .entry-summary .alignleft { + margin: 0.2631578947em 1.4736842105em 1.4736842105em 0; +} + + +/** + * 8.3 - Comments + */ + +.comment-list .children > li { + padding-right: 0.875em; + padding-left: 0; +} + +.comment-author .avatar { + float: right; + margin-right: auto; + margin-left: 0.875em; +} + +.bypostauthor > article .fn:after { + left: auto; + right: 3px; +} + +.comment-content ul, +.comment-content ol { + margin: 0 1.25em 1.5em 0; +} + +.comment-reply-title small a { + float: left; +} + +.comment-form #wp-comment-cookies-consent { + margin: 0 0 0 10px; +} + +.comment-form .comment-form-cookies-consent label { + font-family: Arial, Tahoma, sans-serif; +} + +/** + * 9.0 - Multisites + */ + +.widecolumn .mu_register label { + margin-right: 0; + margin-left: 0.7692307692em; +} + + +/** + * 10.0 - Media Queries + */ + + +/** + * 10.1 - >= 710px + */ + +@media screen and (min-width: 44.375em) { + .pagination { + margin: 0 7.6923% 4.421052632em 23.0769%; + } + + .entry-header, + .post-thumbnail, + .entry-content, + .entry-summary, + .entry-footer, + .comments-area, + .image-navigation, + .post-navigation, + .page-header, + .page-content, + .content-bottom-widgets { + margin-right: 7.6923%; + margin-left: 23.0769%; + } + + .entry-content blockquote:not(.alignright):not(.alignleft), + .entry-summary blockquote, + .comment-content blockquote { + margin-right: -1.473684211em; + margin-left: auto; + } + + .entry-content blockquote blockquote:not(.alignright):not(.alignleft), + .entry-summary blockquote blockquote, + .comment-content blockquote blockquote { + margin-right: 0; + margin-left: auto; + } + + .entry-content ul, + .entry-summary ul, + .comment-content ul, + .entry-content ol, + .entry-summary ol, + .comment-content ol { + margin-right: 0; + margin-left: auto; + } + + .entry-content li > ul, + .entry-summary li > ul, + .comment-content li > ul, + .entry-content blockquote > ul, + .entry-summary blockquote > ul, + .comment-content blockquote > ul { + margin-right: 1.25em; + margin-left: auto; + } + + .entry-content li > ol, + .entry-summary li > ol, + .comment-content li > ol, + .entry-content blockquote > ol, + .entry-summary blockquote > ol, + .comment-content blockquote > ol { + margin-right: 1.5em; + margin-left: auto; + } + + .comment-list .children > li { + padding-right: 1.75em; + padding-left: 0; + } + + .sidebar, + .widecolumn { + padding-right: 7.6923%; + padding-left: 23.0769%; + } + + body:not(.search-results) .entry-summary li > ul, + body:not(.search-results) .entry-summary blockquote > ul { + margin-right: 1.157894737em; + margin-left: auto; + } + + body:not(.search-results) .entry-summary li > ol, + body:not(.search-results) .entry-summary blockquote > ol { + margin-right: 1.473684211em; + margin-left: auto; + } +} + + +/** + * 10.2 - >= 910px + */ + +@media screen and (min-width: 56.875em) { + .main-navigation .primary-menu > li { + float: right; + } + + .main-navigation ul ul { + left: auto; + margin: 0; + right: -999em; + } + + .main-navigation ul ul:before { + left: 9px; + right: auto; + } + + .main-navigation ul ul:after { + left: 11px; + right: auto; + } + + .main-navigation li:hover > ul, + .main-navigation li.focus > ul { + left: 0; + right: auto; + } + + .main-navigation ul ul li:hover > ul, + .main-navigation ul ul li.focus > ul { + left: 100%; + right: auto; + } + + .main-navigation .menu-item-has-children > a { + margin: 0; + padding-right: 0.875em; + padding-left: 2.25em; + } + + .main-navigation .menu-item-has-children > a:after { + left: 0.625em; + right: auto; + } + + .main-navigation ul ul .menu-item-has-children > a { + padding-right: 0.875em; + padding-left: 2.0625em; + } + + .main-navigation ul ul .menu-item-has-children > a:after { + left: 0.5625em; + right: auto; + top: 0.8125em; + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + transform: rotate(-90deg); + } + + .content-area { + float: right; + margin-right: auto; + margin-left: -100%; + } + + .entry-header, + .post-thumbnail, + .entry-content, + .entry-summary, + .entry-footer, + .comments-area, + .image-navigation, + .post-navigation, + .pagination, + .page-header, + .page-content, + .content-bottom-widgets { + margin-right: 0; + margin-left: 0; + } + + .sidebar { + float: right; + margin-right: 75%; + margin-left: auto; + padding: 0; + } + + .widget blockquote { + padding-right: 1.0625em; + padding-left: 0; + } + + .widget .alignright { + margin: 0.2307692308em 0 1.6153846154em 1.6153846154em; + } + + .widget .alignleft { + margin: 0.2307692308em 1.6153846154em 1.6153846154em 0; + } + + .tagcloud a { + margin: 0 0 0.5384615385em 0.2307692308em; + } + + .content-bottom-widgets .widget-area:nth-child(1):nth-last-child(2), + .content-bottom-widgets .widget-area:nth-child(2):nth-last-child(1) { + float: right; + margin-right: auto; + margin-left: 7.1428571%; + } + + .content-bottom-widgets .widget-area:nth-child(2):nth-last-child(1):last-of-type { + margin-right: auto; + margin-left: 0; + } + + .site-info { + margin: 0.538461538em 0 0.538461538em auto; + } + + .no-sidebar .entry-header, + .no-sidebar .entry-content, + .no-sidebar .entry-summary, + .no-sidebar .entry-footer, + .no-sidebar .comments-area, + .no-sidebar .image-navigation, + .no-sidebar .post-navigation, + .no-sidebar .pagination, + .no-sidebar .page-header, + .no-sidebar .page-content, + .no-sidebar .content-bottom-widgets { + margin-right: 15%; + margin-left: 15%; + } + + .no-sidebar .post-thumbnail { + margin-right: 0; + margin-left: 0; + } + + .widecolumn { + padding-right: 15%; + padding-left: 15%; + } +} + + +/** + * 10.3 - >= 985px + */ + +@media screen and (min-width: 61.5625em) { + body:not(.search-results) article:not(.type-page) .entry-content { + float: left; + } + + body:not(.search-results) article:not(.type-page) .entry-content > blockquote.alignleft.below-entry-meta { + margin-right: 1.473684211em; + margin-left: 0; + width: -webkit-calc(50% - 0.736842105em); + width: calc(50% - 0.736842105em); + } + + body:not(.search-results) article:not(.type-page) .entry-content > blockquote.alignright.below-entry-meta { + margin-right: -40%; + margin-left: 1.473684211em; + width: -webkit-calc(60% - 1.4736842105em); + width: calc(60% - 1.4736842105em); + } + + body:not(.search-results) article:not(.type-page) img.below-entry-meta, + body:not(.search-results) article:not(.type-page) figure.below-entry-meta { + margin-right: -40%; + margin-left: 0; + } + + body:not(.search-results) article:not(.type-page) .entry-footer { + float: right; + } + + body.no-sidebar:not(.search-results) article:not(.type-page) .entry-content { + float: right; + margin-right: 34.99999999%; + margin-left: -100%; + } + + body.no-sidebar:not(.search-results) article:not(.type-page) .entry-footer { + margin-right: 15%; + margin-left: -100%; + } +} + + +/** + * 10.4 - >= 1200px + */ + +@media screen and (min-width: 75em) { + body:not(.search-results) .entry-summary li > ul, + body:not(.search-results) .entry-summary blockquote > ul { + margin-right: 0.956521739em; + margin-left: auto; + } + + body:not(.search-results) .entry-summary li > ol, + body:not(.search-results) .entry-summary blockquote > ol { + margin-right: 1.52173913em; + margin-left: auto; + } + + body:not(.search-results) .entry-summary blockquote { + padding-right: 1.347826087em; + padding-left: 0; + } + + body:not(.search-results) .entry-summary blockquote:not(.alignright):not(.alignleft) { + margin-right: -1.52173913em; + margin-left: auto; + } + + body:not(.search-results) .entry-summary blockquote blockquote:not(.alignright):not(.alignleft) { + margin-right: 0; + margin-left: auto; + } + + body:not(.search-results) .entry-summary .alignright { + margin: 0.2608695652em 0 1.5217391304em 1.5217391304em; + } + + body:not(.search-results) .entry-summary .alignleft { + margin: 0.2608695652em 1.5217391304em 1.5217391304em 0; + } +} diff --git a/wp-content/themes/twentysixteen/screenshot.png b/wp-content/themes/twentysixteen/screenshot.png new file mode 100644 index 0000000..e4f2b25 Binary files /dev/null and b/wp-content/themes/twentysixteen/screenshot.png differ diff --git a/wp-content/themes/twentysixteen/search.php b/wp-content/themes/twentysixteen/search.php new file mode 100644 index 0000000..d82d9ff --- /dev/null +++ b/wp-content/themes/twentysixteen/search.php @@ -0,0 +1,61 @@ + + +
            +
            + + + + + + __( 'Previous page', 'twentysixteen' ), + 'next_text' => __( 'Next page', 'twentysixteen' ), + 'before_page_number' => '' . __( 'Page', 'twentysixteen' ) . ' ', + ) + ); + + // If no content, include the "No posts found" template. + else : + get_template_part( 'template-parts/content', 'none' ); + + endif; + ?> + +
            +
            + + + diff --git a/wp-content/themes/twentysixteen/searchform.php b/wp-content/themes/twentysixteen/searchform.php new file mode 100644 index 0000000..2fb75d4 --- /dev/null +++ b/wp-content/themes/twentysixteen/searchform.php @@ -0,0 +1,17 @@ + + + diff --git a/wp-content/themes/twentysixteen/sidebar-content-bottom.php b/wp-content/themes/twentysixteen/sidebar-content-bottom.php new file mode 100644 index 0000000..c232164 --- /dev/null +++ b/wp-content/themes/twentysixteen/sidebar-content-bottom.php @@ -0,0 +1,28 @@ + + diff --git a/wp-content/themes/twentysixteen/sidebar.php b/wp-content/themes/twentysixteen/sidebar.php new file mode 100644 index 0000000..31cb16d --- /dev/null +++ b/wp-content/themes/twentysixteen/sidebar.php @@ -0,0 +1,15 @@ + + + + + diff --git a/wp-content/themes/twentysixteen/single.php b/wp-content/themes/twentysixteen/single.php new file mode 100644 index 0000000..ade82e1 --- /dev/null +++ b/wp-content/themes/twentysixteen/single.php @@ -0,0 +1,59 @@ + + +
            +
            + _x( 'Published in%title', 'Parent post link', 'twentysixteen' ), + ) + ); + } elseif ( is_singular( 'post' ) ) { + // Previous/next post navigation. + the_post_navigation( + array( + 'next_text' => ' ' . + '' . __( 'Next post:', 'twentysixteen' ) . ' ' . + '%title', + 'prev_text' => ' ' . + '' . __( 'Previous post:', 'twentysixteen' ) . ' ' . + '%title', + ) + ); + } + + // End the loop. + endwhile; + ?> + +
            + + + +
            + + + diff --git a/wp-content/themes/twentysixteen/style.css b/wp-content/themes/twentysixteen/style.css new file mode 100644 index 0000000..33bcace --- /dev/null +++ b/wp-content/themes/twentysixteen/style.css @@ -0,0 +1,4026 @@ +/* +Theme Name: Twenty Sixteen +Theme URI: https://wordpress.org/themes/twentysixteen/ +Author: the WordPress team +Author URI: https://wordpress.org/ +Description: Twenty Sixteen is a modernized take on an ever-popular WordPress layout — the horizontal masthead with an optional right sidebar that works perfectly for blogs and websites. It has custom color options with beautiful default color schemes, a harmonious fluid grid using a mobile-first approach, and impeccable polish in every detail. Twenty Sixteen will make your WordPress look beautiful everywhere. +Version: 2.1 +Requires at least: 4.4 +Requires PHP: 5.2.4 +License: GNU General Public License v2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html +Tags: one-column, two-columns, right-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready, blog +Text Domain: twentysixteen + +This theme, like WordPress, is licensed under the GPL. +Use it to make something cool, have fun, and share what you've learned with others. +*/ + + +/** + * Table of Contents + * + * 1.0 - Normalize + * 2.0 - Genericons + * 3.0 - Typography + * 4.0 - Elements + * 5.0 - Forms + * 6.0 - Navigation + * 6.1 - Links + * 6.2 - Menus + * 7.0 - Accessibility + * 8.0 - Alignments + * 9.0 - Clearings + * 10.0 - Widgets + * 11.0 - Content + * 11.1 - Header + * 11.2 - Posts and pages + * 11.3 - Post Formats + * 11.4 - Comments + * 11.5 - Sidebar + * 11.6 - Footer + * 12.0 - Media + * 12.1 - Captions + * 12.2 - Galleries + * 13.0 - Multisite + * 14.0 - Media Queries + * 14.1 - >= 710px + * 14.2 - >= 783px + * 14.3 - >= 910px + * 14.4 - >= 985px + * 14.5 - >= 1200px + * 15.0 - Print + */ + + +/** + * 1.0 - Normalize + * + * Normalizing styles have been helped along thanks to the fine work of + * Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normalize.css/ + */ + +html { + font-family: sans-serif; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} + +body { + margin: 0; +} + +article, +aside, +details, +figcaption, +figure, +footer, +header, +main, +menu, +nav, +section, +summary { + display: block; +} + +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} + +audio:not([controls]) { + display: none; + height: 0; +} + +[hidden], +template { + display: none; +} + +a { + background-color: transparent; +} + +abbr[title] { + border-bottom: 1px dotted; +} + +b, +strong { + font-weight: 700; +} + +small { + font-size: 80%; +} + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +img { + border: 0; +} + +svg:not(:root) { + overflow: hidden; +} + +figure { + margin: 0; +} + +hr { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +code, +kbd, +pre, +samp { + font-size: 1em; +} + +button, +input, +optgroup, +select, +textarea { + color: inherit; + font: inherit; + margin: 0; +} + +select { + text-transform: none; +} + +button { + overflow: visible; +} + +button, +input, +select, +textarea { + max-width: 100%; +} + +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} + +button[disabled], +html input[disabled] { + cursor: default; + opacity: .5; +} + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +input[type="checkbox"], +input[type="radio"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + margin-right: 0.4375em; + padding: 0; +} + +input[type="date"]::-webkit-inner-spin-button, +input[type="date"]::-webkit-outer-spin-button, +input[type="time"]::-webkit-inner-spin-button, +input[type="time"]::-webkit-outer-spin-button, +input[type="datetime-local"]::-webkit-inner-spin-button, +input[type="datetime-local"]::-webkit-outer-spin-button, +input[type="week"]::-webkit-inner-spin-button, +input[type="week"]::-webkit-outer-spin-button, +input[type="month"]::-webkit-inner-spin-button, +input[type="month"]::-webkit-outer-spin-button, +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +input[type="search"] { + -webkit-appearance: textfield; +} + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +fieldset { + border: 1px solid #d1d1d1; + margin: 0 0 1.75em; + min-width: inherit; + padding: 0.875em; +} + +fieldset > :last-child { + margin-bottom: 0; +} + +legend { + border: 0; + padding: 0; +} + +textarea { + overflow: auto; + vertical-align: top; +} + +optgroup { + font-weight: bold; +} + + +/** + * 2.0 - Genericons + */ + +.menu-item-has-children a:after, +.social-navigation a:before, +.dropdown-toggle:after, +.bypostauthor > article .fn:after, +.comment-reply-title small a:before, +.pagination .prev:before, +.pagination .next:before, +.pagination .nav-links:before, +.pagination .nav-links:after, +.search-submit:before { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + display: inline-block; + font-family: "Genericons"; + font-size: 16px; + font-style: normal; + font-variant: normal; + font-weight: normal; + line-height: 1; + speak: none; + text-align: center; + text-decoration: inherit; + text-transform: none; + vertical-align: top; +} + + +/** + * 3.0 - Typography + */ + +body, +button, +input, +select, +textarea { + color: #1a1a1a; + font-family: Merriweather, Georgia, serif; + font-size: 16px; + font-size: 1rem; + line-height: 1.75; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + clear: both; + font-weight: 700; + margin: 0; + text-rendering: optimizeLegibility; +} + +p { + margin: 0 0 1.75em; +} + +dfn, +cite, +em, +i { + font-style: italic; +} + +blockquote { + border: 0 solid #1a1a1a; + border-left-width: 4px; + color: #686868; + font-size: 19px; + font-size: 1.1875rem; + font-style: italic; + line-height: 1.4736842105; + margin: 0 0 1.4736842105em; + overflow: hidden; + padding: 0 0 0 1.263157895em; +} + +blockquote, +q { + quotes: none; +} + +blockquote:before, +blockquote:after, +q:before, +q:after { + content: ""; +} + +blockquote p { + margin-bottom: 1.4736842105em; +} + +blockquote cite, +blockquote small { + color: #1a1a1a; + display: block; + font-size: 16px; + font-size: 1rem; + line-height: 1.75; +} + +blockquote cite:before, +blockquote small:before { + content: "\2014\00a0"; +} + +blockquote em, +blockquote i, +blockquote cite { + font-style: normal; +} + +blockquote strong, +blockquote b { + font-weight: 400; +} + +blockquote > :last-child { + margin-bottom: 0; +} + +address { + font-style: italic; + margin: 0 0 1.75em; +} + +code, +kbd, +tt, +var, +samp, +pre { + font-family: Inconsolata, monospace; +} + +pre { + border: 1px solid #d1d1d1; + font-size: 16px; + font-size: 1rem; + line-height: 1.3125; + margin: 0 0 1.75em; + max-width: 100%; + overflow: auto; + padding: 1.75em; + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} + +code { + background-color: #d1d1d1; + padding: 0.125em 0.25em; +} + +abbr, +acronym { + border-bottom: 1px dotted #d1d1d1; + cursor: help; +} + +mark, +ins { + background: #007acc; + color: #fff; + padding: 0.125em 0.25em; + text-decoration: none; +} + +big { + font-size: 125%; +} + + +/** + * 4.0 - Elements + */ + +html { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +*, +*:before, +*:after { + /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */ + -webkit-box-sizing: inherit; + -moz-box-sizing: inherit; + box-sizing: inherit; +} + +body { + background: #1a1a1a; + /* Fallback for when there is no custom background color defined. */ +} + +hr { + background-color: #d1d1d1; + border: 0; + height: 1px; + margin: 0 0 1.75em; +} + +ul, +ol { + margin: 0 0 1.75em 1.25em; + padding: 0; +} + +ul { + list-style: disc; +} + +ol { + list-style: decimal; + margin-left: 1.5em; +} + +li > ul, +li > ol { + margin-bottom: 0; +} + +dl { + margin: 0 0 1.75em; +} + +dt { + font-weight: 700; +} + +dd { + margin: 0 0 1.75em; +} + +img { + height: auto; + /* Make sure images are scaled correctly. */ + max-width: 100%; + /* Adhere to container width. */ + vertical-align: middle; +} + +del { + opacity: 0.8; +} + +table, +th, +td { + border: 1px solid #d1d1d1; +} + +table { + border-collapse: separate; + border-spacing: 0; + border-width: 1px 0 0 1px; + margin: 0 0 1.75em; + table-layout: fixed; + /* Prevents HTML tables from becoming too wide */ + width: 100%; +} + +caption, +th, +td { + font-weight: normal; + text-align: left; +} + +th { + border-width: 0 1px 1px 0; + font-weight: 700; +} + +td { + border-width: 0 1px 1px 0; +} + +th, +td { + padding: 0.4375em; +} + +/* Placeholder text color -- selectors need to be separate to work. */ +::-webkit-input-placeholder { + color: #686868; + font-family: Montserrat, "Helvetica Neue", sans-serif; +} + +:-moz-placeholder { + color: #686868; + font-family: Montserrat, "Helvetica Neue", sans-serif; +} + +::-moz-placeholder { + color: #686868; + font-family: Montserrat, "Helvetica Neue", sans-serif; + opacity: 1; + /* Since FF19 lowers the opacity of the placeholder by default */ +} + +:-ms-input-placeholder { + color: #686868; + font-family: Montserrat, "Helvetica Neue", sans-serif; +} + + +/** + * 5.0 - Forms + */ + +input { + line-height: normal; +} + +button, +button[disabled]:hover, +button[disabled]:focus, +input[type="button"], +input[type="button"][disabled]:hover, +input[type="button"][disabled]:focus, +input[type="reset"], +input[type="reset"][disabled]:hover, +input[type="reset"][disabled]:focus, +input[type="submit"], +input[type="submit"][disabled]:hover, +input[type="submit"][disabled]:focus { + background: #1a1a1a; + border: 0; + border-radius: 2px; + color: #fff; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-weight: 700; + letter-spacing: 0.046875em; + line-height: 1; + padding: 0.84375em 0.875em 0.78125em; + text-transform: uppercase; +} + +button:hover, +button:focus, +input[type="button"]:hover, +input[type="button"]:focus, +input[type="reset"]:hover, +input[type="reset"]:focus, +input[type="submit"]:hover, +input[type="submit"]:focus { + background: #007acc; +} + +button:focus, +input[type="button"]:focus, +input[type="reset"]:focus, +input[type="submit"]:focus { + outline: thin dotted; + outline-offset: -4px; +} + +input[type="date"], +input[type="time"], +input[type="datetime-local"], +input[type="week"], +input[type="month"], +input[type="text"], +input[type="email"], +input[type="url"], +input[type="password"], +input[type="search"], +input[type="tel"], +input[type="number"], +textarea { + background: #f7f7f7; + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0)); + border: 1px solid #d1d1d1; + border-radius: 2px; + color: #686868; + padding: 0.625em 0.4375em; + width: 100%; +} + +input[type="date"]:focus, +input[type="time"]:focus, +input[type="datetime-local"]:focus, +input[type="week"]:focus, +input[type="month"]:focus, +input[type="text"]:focus, +input[type="email"]:focus, +input[type="url"]:focus, +input[type="password"]:focus, +input[type="search"]:focus, +input[type="tel"]:focus, +input[type="number"]:focus, +textarea:focus { + background-color: #fff; + border-color: #007acc; + color: #1a1a1a; + outline: 0; +} + +.post-password-form { + margin-bottom: 1.75em; +} + +.post-password-form label { + color: #686868; + display: block; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 13px; + font-size: 0.8125rem; + letter-spacing: 0.076923077em; + line-height: 1.6153846154; + margin-bottom: 1.75em; + text-transform: uppercase; +} + +.post-password-form input[type="password"] { + margin-top: 0.4375em; +} + +.post-password-form > :last-child { + margin-bottom: 0; +} + +.search-form { + position: relative; +} + +input[type="search"].search-field { + border-radius: 2px 0 0 2px; + width: -webkit-calc(100% - 42px); + width: calc(100% - 42px); +} + +.search-submit:before { + content: "\f400"; + font-size: 24px; + left: 2px; + line-height: 42px; + position: relative; + width: 40px; +} + +.search-submit { + border-radius: 0 2px 2px 0; + bottom: 0; + overflow: hidden; + padding: 0; + position: absolute; + right: 0; + top: 0; + width: 42px; +} + + +/** + * 6.0 - Navigation + */ + +/** + * 6.1 - Links + */ + +a { + color: #007acc; + text-decoration: none; +} + +a:hover, +a:focus, +a:active { + color: #686868; +} + +a:focus { + outline: thin dotted; +} + +a:hover, +a:active { + outline: 0; +} + +.entry-content a, +.entry-summary a, +.taxonomy-description a, +.logged-in-as a, +.comment-content a, +.pingback .comment-body > a, +.textwidget a, +.entry-footer a:hover, +.site-info a:hover { + box-shadow: 0 1px 0 0 currentColor; +} + +.entry-content a:hover, +.entry-content a:focus, +.entry-summary a:hover, +.entry-summary a:focus, +.taxonomy-description a:hover, +.taxonomy-description a:focus, +.logged-in-as a:hover, +.logged-in-as a:focus, +.comment-content a:hover, +.comment-content a:focus, +.pingback .comment-body > a:hover, +.pingback .comment-body > a:focus, +.textwidget a:hover, +.textwidget a:focus { + box-shadow: none; +} + + +/** + * 6.2 - Menus + */ + +.site-header-menu { + display: none; + -webkit-flex: 0 1 100%; + -ms-flex: 0 1 100%; + flex: 0 1 100%; + margin: 0.875em 0; +} + +.site-header-menu.toggled-on, +.no-js .site-header-menu { + display: block; +} + +.main-navigation { + font-family: Montserrat, "Helvetica Neue", sans-serif; +} + +.site-footer .main-navigation { + margin-bottom: 1.75em; +} + +.main-navigation ul { + list-style: none; + margin: 0; +} + +.main-navigation li { + border-top: 1px solid #d1d1d1; + position: relative; +} + +.main-navigation a { + color: #1a1a1a; + display: block; + line-height: 1.3125; + outline-offset: -1px; + padding: 0.84375em 0; +} + +.main-navigation a:hover, +.main-navigation a:focus { + color: #007acc; +} + +.main-navigation .current-menu-item > a, +.main-navigation .current-menu-ancestor > a { + font-weight: 700; +} + +.main-navigation ul ul { + display: none; + margin-left: 0.875em; +} + +.no-js .main-navigation ul ul { + display: block; +} + +.main-navigation ul .toggled-on { + display: block; +} + +.main-navigation .primary-menu { + border-bottom: 1px solid #d1d1d1; +} + +.main-navigation .menu-item-has-children > a { + margin-right: 56px; +} + +.dropdown-toggle { + background-color: transparent; + border: 0; + border-radius: 0; + color: #1a1a1a; + content: ""; + height: 48px; + padding: 0; + position: absolute; + right: 0; + text-transform: none; + top: 0; + width: 48px; +} + +.dropdown-toggle:after { + border: 0 solid #d1d1d1; + border-left-width: 1px; + content: "\f431"; + font-size: 24px; + left: 1px; + position: relative; + width: 48px; +} + +.dropdown-toggle:hover, +.dropdown-toggle:focus { + background-color: transparent; + color: #007acc; +} + +.dropdown-toggle:focus { + outline: thin dotted; + outline-offset: -1px; +} + +.dropdown-toggle:focus:after { + border-color: transparent; +} + +.dropdown-toggle.toggled-on:after { + content: "\f432"; +} + +.site-header .main-navigation + .social-navigation { + margin-top: 1.75em; +} + +.site-footer .social-navigation { + margin-bottom: 1.75em; +} + +.social-navigation ul { + list-style: none; + margin: 0 0 -0.4375em; +} + +.social-navigation li { + float: left; + margin: 0 0.4375em 0.4375em 0; +} + +.social-navigation a { + border: 1px solid #d1d1d1; + border-radius: 50%; + color: #1a1a1a; + display: block; + height: 35px; + position: relative; + width: 35px; +} + +.social-navigation a:before { + content: "\f415"; + height: 33px; + line-height: 33px; + text-align: center; + width: 33px; +} + +.social-navigation a:hover:before, +.social-navigation a:focus:before { + color: #007acc; +} + +.social-navigation a[href*="codepen.io"]:before { + content: "\f216"; +} + +.social-navigation a[href*="digg.com"]:before { + content: "\f221"; +} + +.social-navigation a[href*="dribbble.com"]:before { + content: "\f201"; +} + +.social-navigation a[href*="dropbox.com"]:before { + content: "\f225"; +} + +.social-navigation a[href*="facebook.com"]:before { + content: "\f203"; +} + +.social-navigation a[href*="flickr.com"]:before { + content: "\f211"; +} + +.social-navigation a[href*="foursquare.com"]:before { + content: "\f226"; +} + +.social-navigation a[href*="plus.google.com"]:before { + content: "\f206"; +} + +.social-navigation a[href*="github.com"]:before { + content: "\f200"; +} + +.social-navigation a[href*="instagram.com"]:before { + content: "\f215"; +} + +.social-navigation a[href*="linkedin.com"]:before { + content: "\f208"; +} + +.social-navigation a[href*="path.com"]:before { + content: "\f219"; +} + +.social-navigation a[href*="pinterest.com"]:before { + content: "\f210"; +} + +.social-navigation a[href*="getpocket.com"]:before { + content: "\f224"; +} + +.social-navigation a[href*="polldaddy.com"]:before { + content: "\f217"; +} + +.social-navigation a[href*="reddit.com"]:before { + content: "\f222"; +} + +.social-navigation a[href*="skype.com"]:before { + content: "\f220"; +} + +.social-navigation a[href*="stumbleupon.com"]:before { + content: "\f223"; +} + +.social-navigation a[href*="tumblr.com"]:before { + content: "\f214"; +} + +.social-navigation a[href*="twitter.com"]:before { + content: "\f202"; +} + +.social-navigation a[href*="vimeo.com"]:before { + content: "\f212"; +} + +.social-navigation a[href*="wordpress.com"]:before, +.social-navigation a[href*="wordpress.org"]:before { + content: "\f205"; +} + +.social-navigation a[href*="youtube.com"]:before { + content: "\f213"; +} + +.social-navigation a[href^="mailto:"]:before { + content: "\f410"; +} + +.social-navigation a[href*="spotify.com"]:before { + content: "\f515"; +} + +.social-navigation a[href*="twitch.tv"]:before { + content: "\f516"; +} + +.social-navigation a[href$="/feed/"]:before { + content: "\f413"; +} + +.post-navigation { + border-top: 4px solid #1a1a1a; + border-bottom: 4px solid #1a1a1a; + clear: both; + font-family: Montserrat, "Helvetica Neue", sans-serif; + margin: 0 7.6923% 3.5em; +} + +.post-navigation a { + color: #1a1a1a; + display: block; + padding: 1.75em 0; +} + +.post-navigation span { + display: block; +} + +.post-navigation .meta-nav { + color: #686868; + font-size: 13px; + font-size: 0.8125rem; + letter-spacing: 0.076923077em; + line-height: 1.6153846154; + margin-bottom: 0.5384615385em; + text-transform: uppercase; +} + +.post-navigation .post-title { + display: inline; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 23px; + font-size: 1.4375rem; + font-weight: 700; + line-height: 1.2173913043; + text-rendering: optimizeLegibility; +} + +.post-navigation a:hover .post-title, +.post-navigation a:focus .post-title { + color: #007acc; +} + +.post-navigation div + div { + border-top: 4px solid #1a1a1a; +} + +.pagination { + border-top: 4px solid #1a1a1a; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 19px; + font-size: 1.1875rem; + margin: 0 7.6923% 2.947368421em; + min-height: 56px; + position: relative; +} + +.pagination:before, +.pagination:after { + background-color: #1a1a1a; + content: ""; + height: 52px; + position: absolute; + top:0; + width: 52px; + z-index: 0; +} + +.pagination:before { + right: 0; +} + +.pagination:after { + right: 54px; +} + +.pagination a:hover, +.pagination a:focus { + color: #1a1a1a; +} + +.pagination .nav-links { + padding-right: 106px; + position: relative; +} + +.pagination .nav-links:before, +.pagination .nav-links:after { + color: #fff; + font-size: 32px; + line-height: 51px; + opacity: 0.3; + position: absolute; + width: 52px; + z-index: 1; +} + +.pagination .nav-links:before { + content: "\f429"; + right: -1px; +} + +.pagination .nav-links:after { + content: "\f430"; + right: 55px; +} + +/* reset screen-reader-text */ +.pagination .current .screen-reader-text { + position: static !important; +} + +.pagination .page-numbers { + display: none; + letter-spacing: 0.013157895em; + line-height: 1; + margin: 0 0.7368421053em 0 -0.7368421053em; + padding: 0.8157894737em 0.7368421053em 0.3947368421em; + text-transform: uppercase; +} + +.pagination .current { + display: inline-block; + font-weight: 700; +} + +.pagination .prev, +.pagination .next { + background-color: #1a1a1a; + color: #fff; + display: inline-block; + height: 52px; + margin: 0; + overflow: hidden; + padding: 0; + position: absolute; + top: 0; + width: 52px; + z-index: 2; +} + +.pagination .prev:before, +.pagination .next:before { + font-size: 32px; + height: 53px; + line-height: 52px; + position: relative; + width: 53px; +} + +.pagination .prev:hover, +.pagination .prev:focus, +.pagination .next:hover, +.pagination .next:focus { + background-color: #007acc; + color: #fff; +} + +.pagination .prev:focus, +.pagination .next:focus { + outline: 0; +} + +.pagination .prev { + right: 54px; +} + +.pagination .prev:before { + content: "\f430"; + left: -1px; + top: -1px; +} + +.pagination .next { + right: 0; +} + +.pagination .next:before { + content: "\f429"; + right: -1px; + top: -1px; +} + +.image-navigation, +.comment-navigation { + border-top: 1px solid #d1d1d1; + border-bottom: 1px solid #d1d1d1; + color: #686868; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.6153846154; + margin: 0 7.6923% 2.1538461538em; + padding: 1.0769230769em 0; +} + +.comment-navigation { + margin-right: 0; + margin-left: 0; +} + +.comments-title + .comment-navigation { + border-bottom: 0; + margin-bottom: 0; +} + +.image-navigation .nav-previous:not(:empty), +.image-navigation .nav-next:not(:empty), +.comment-navigation .nav-previous:not(:empty), +.comment-navigation .nav-next:not(:empty) { + display: inline-block; +} + +.image-navigation .nav-previous:not(:empty) + .nav-next:not(:empty):before, +.comment-navigation .nav-previous:not(:empty) + .nav-next:not(:empty):before { + content: "\002f"; + display: inline-block; + opacity: 0.7; + padding: 0 0.538461538em; +} + + +/** + * 7.0 - Accessibility + */ + +/* Text meant only for screen readers */ +.says, +.screen-reader-text { + clip: rect(1px, 1px, 1px, 1px); + height: 1px; + overflow: hidden; + position: absolute !important; + width: 1px; + /* many screen reader and browser combinations announce broken words as they would appear visually */ + word-wrap: normal !important; +} + +/* must have higher specificity than alternative color schemes inline styles */ +.site .skip-link { + background-color: #f1f1f1; + box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2); + color: #21759b; + display: block; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 14px; + font-weight: 700; + left: -9999em; + outline: none; + padding: 15px 23px 14px; + text-decoration: none; + text-transform: none; + top: -9999em; +} + +.logged-in .site .skip-link { + box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.2); + font-family: "Open Sans", sans-serif; +} + +.site .skip-link:focus { + clip: auto; + height: auto; + left: 6px; + top: 7px; + width: auto; + z-index: 100000; +} + + +/** + * 8.0 - Alignments + */ + +.alignleft { + float: left; + margin: 0.375em 1.75em 1.75em 0; +} + +.alignright { + float: right; + margin: 0.375em 0 1.75em 1.75em; +} + +.aligncenter { + clear: both; + display: block; + margin: 0 auto 1.75em; +} + +blockquote.alignleft { + margin: 0.3157894737em 1.4736842105em 1.473684211em 0; +} + +blockquote.alignright { + margin: 0.3157894737em 0 1.473684211em 1.4736842105em; +} + +blockquote.aligncenter { + margin-bottom: 1.473684211em; +} + + +/** + * 9.0 - Clearings + */ + +.clear:before, +.clear:after, +blockquote:before, +blockquote:after, +.entry-content:before, +.entry-content:after, +.entry-summary:before, +.entry-summary:after, +.comment-content:before, +.comment-content:after, +.site-content:before, +.site-content:after, +.site-main > article:before, +.site-main > article:after, +.primary-menu:before, +.primary-menu:after, +.social-links-menu:before, +.social-links-menu:after, +.textwidget:before, +.textwidget:after, +.content-bottom-widgets:before, +.content-bottom-widgets:after { + content: ""; + display: table; +} + +.clear:after, +blockquote:after, +.entry-content:after, +.entry-summary:after, +.comment-content:after, +.site-content:after, +.site-main > article:after, +.primary-menu:after, +.social-links-menu:after, +.textwidget:after, +.content-bottom-widgets:after { + clear: both; +} + + +/** + * 10.0 - Widgets + */ + +.widget { + border-top: 4px solid #1a1a1a; + margin-bottom: 3.5em; + padding-top: 1.75em; +} + +.widget-area > :last-child, +.widget > :last-child { + margin-bottom: 0; +} + +.widget .widget-title { + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 16px; + font-size: 1rem; + letter-spacing: 0.046875em; + line-height: 1.3125; + margin: 0 0 1.75em; + text-transform: uppercase; +} + +.widget .widget-title:empty { + margin-bottom: 0; +} + +.widget-title a { + color: #1a1a1a; +} + +/* Calendar widget */ +.widget.widget_calendar table { + margin: 0; +} + +.widget_calendar .wp-calendar-nav { + display: table; + width: 100%; +} + +.widget_calendar .wp-calendar-nav span { + display: table-cell; +} + +.widget_calendar .wp-calendar-nav-prev, +.widget_calendar .wp-calendar-nav-next { + width: 40%; +} + +.widget_calendar td, +.widget_calendar th, +.widget_calendar .wp-calendar-nav span { + line-height: 2.5625; + padding: 0; + text-align: center; +} + +.widget_calendar caption { + font-weight: 900; + margin-bottom: 1.75em; +} + +.widget_calendar tbody a { + background-color: #007acc; + color: #fff; + display: block; + font-weight: 700; +} + +.widget_calendar tbody a:hover, +.widget_calendar tbody a:focus { + background-color: #686868; + color: #fff; +} + +/* Recent Posts widget */ +.widget_recent_entries .post-date { + color: #686868; + display: block; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.615384615; + margin-bottom: 0.538461538em; +} + +.widget_recent_entries li:last-child .post-date { + margin-bottom: 0; +} + +/* RSS widget */ +.widget_rss .rsswidget img { + margin-top: -0.375em; +} + +.widget_rss .rss-date, +.widget_rss cite { + color: #686868; + display: block; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 13px; + font-size: 0.8125rem; + font-style: normal; + line-height: 1.615384615; + margin-bottom: 0.538461538em; +} + +.widget_rss .rssSummary:last-child { + margin-bottom: 2.1538461538em; +} + +.widget_rss li:last-child :last-child { + margin-bottom: 0; +} + +/* Tag Cloud widget */ +.tagcloud a { + border: 1px solid #d1d1d1; + border-radius: 2px; + display: inline-block; + font-family: Montserrat, "Helvetica Neue", sans-serif; + line-height: 1; + margin: 0 0.1875em 0.4375em 0; + padding: 0.5625em 0.4375em 0.5em; +} + +.tagcloud ul { + list-style-type: none; + margin-left: 0; +} + +.tagcloud ul li { + display: inline-block; +} + +.tagcloud a:hover, +.tagcloud a:focus { + border-color: #007acc; + color: #007acc; + outline: 0; +} + + +/** + * 11.0 - Content + */ + +.site { + background-color: #fff; +} + +.site-inner { + margin: 0 auto; + max-width: 1320px; + position: relative; +} + +.site-content { + word-wrap: break-word; +} + +/* Do not show the outline on the skip link target. */ +#content[tabindex="-1"]:focus { + outline: 0; +} + +.site-main { + margin-bottom: 3.5em; +} + +.site-main > :last-child { + margin-bottom: 0; +} + + +/** + * 11.1 - Header + */ + +.site-header { + padding: 2.625em 7.6923%; +} + +.site-header-main { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} + +.site-branding { + margin: 0.875em auto 0.875em 0; + /* Avoid overflowing wide custom logo in small screens in Firefox and IEs */ + max-width: 100%; + min-width: 0; + overflow: hidden; +} + +.custom-logo-link { + display: block; +} + +.custom-logo { + max-width: 180px; +} + +.site-title { + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 23px; + font-size: 1.4375rem; + font-weight: 700; + line-height: 1.2173913043; + margin: 0; +} + +.site-branding .site-title a { + color: #1a1a1a; +} + +.site-branding .site-title a:hover, +.site-branding .site-title a:focus { + color: #007acc; +} + +.wp-custom-logo .site-title { + margin-top: 0.608695652em; +} + +.site-description { + color: #686868; + display: none; + font-size: 13px; + font-size: 0.8125rem; + font-weight: 400; + line-height: 1.0769230769; + margin: 0.538461538em 0 0; +} + +.menu-toggle { + background-color: transparent; + border: 1px solid #d1d1d1; + color: #1a1a1a; + font-size: 13px; + font-size: 0.8125rem; + margin: 1.076923077em 0; + padding: 0.769230769em; +} + +.no-js .menu-toggle { + display: none; +} + +.menu-toggle:hover, +.menu-toggle:focus { + background-color: transparent; + border-color: #007acc; + color: #007acc; +} + +.menu-toggle.toggled-on, +.menu-toggle.toggled-on:hover, +.menu-toggle.toggled-on:focus { + background-color: #1a1a1a; + border-color: #1a1a1a; + color: #fff; +} + +.menu-toggle:focus { + outline: 0; +} + +.menu-toggle.toggled-on:focus { + outline: thin dotted; +} + +.header-image { + clear: both; + margin: 0.875em 0; +} + +.header-image a { + display: block; +} + +.header-image a:hover img, +.header-image a:focus img { + opacity: 0.85; +} + +/** + * 11.2 - Posts and pages + */ + +.site-main > article { + margin-bottom: 3.5em; + position: relative; +} + +.entry-header, +.entry-summary, +.entry-content, +.entry-footer, +.page-content { + margin-right: 7.6923%; + margin-left: 7.6923%; +} + +.entry-title { + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 28px; + font-size: 1.75rem; + font-weight: 700; + line-height: 1.25; + margin-bottom: 1em; +} + +.entry-title a { + color: #1a1a1a; +} + +.entry-title a:hover, +.entry-title a:focus { + color: #007acc; +} + +.post-thumbnail { + display: block; + margin: 0 7.6923% 1.75em; +} + +.post-thumbnail img { + display: block; +} + +.no-sidebar .post-thumbnail img { + margin: 0 auto; +} + +a.post-thumbnail:hover, +a.post-thumbnail:focus { + opacity: 0.85; +} + +.entry-content, +.entry-summary { + border-color: #d1d1d1; +} + +.entry-content h1, +.entry-summary h1, +.comment-content h1, +.textwidget h1 { + font-size: 28px; + font-size: 1.75rem; + line-height: 1.25; + margin-top: 2em; + margin-bottom: 1em; +} + +.entry-content h2, +.entry-summary h2, +.comment-content h2, +.textwidget h2 { + font-size: 23px; + font-size: 1.4375rem; + line-height: 1.2173913043; + margin-top: 2.4347826087em; + margin-bottom: 1.2173913043em; +} + +.entry-content h3, +.entry-summary h3, +.comment-content h3, +.textwidget h3 { + font-size: 19px; + font-size: 1.1875rem; + line-height: 1.1052631579; + margin-top: 2.9473684211em; + margin-bottom: 1.4736842105em; +} + +.entry-content h4, +.entry-content h5, +.entry-content h6, +.entry-summary h4, +.entry-summary h5, +.entry-summary h6, +.comment-content h4, +.comment-content h5, +.comment-content h6, +.textwidget h4, +.textwidget h5, +.textwidget h6 { + font-size: 16px; + font-size: 1rem; + line-height: 1.3125; + margin-top: 3.5em; + margin-bottom: 1.75em; +} + +.entry-content h4, +.entry-summary h4, +.comment-content h4, +.textwidget h4 { + letter-spacing: 0.140625em; + text-transform: uppercase; +} + +.entry-content h6, +.entry-summary h6, +.comment-content h6, +.textwidget h6 { + font-style: italic; +} + +.entry-content h1, +.entry-content h2, +.entry-content h3, +.entry-content h4, +.entry-content h5, +.entry-content h6, +.entry-summary h1, +.entry-summary h2, +.entry-summary h3, +.entry-summary h4, +.entry-summary h5, +.entry-summary h6, +.comment-content h1, +.comment-content h2, +.comment-content h3, +.comment-content h4, +.comment-content h5, +.comment-content h6, +.textwidget h1, +.textwidget h2, +.textwidget h3, +.textwidget h4, +.textwidget h5, +.textwidget h6 { + font-weight: 900; +} + +.entry-content h1:first-child, +.entry-content h2:first-child, +.entry-content h3:first-child, +.entry-content h4:first-child, +.entry-content h5:first-child, +.entry-content h6:first-child, +.entry-summary h1:first-child, +.entry-summary h2:first-child, +.entry-summary h3:first-child, +.entry-summary h4:first-child, +.entry-summary h5:first-child, +.entry-summary h6:first-child, +.comment-content h1:first-child, +.comment-content h2:first-child, +.comment-content h3:first-child, +.comment-content h4:first-child, +.comment-content h5:first-child, +.comment-content h6:first-child, +.textwidget h1:first-child, +.textwidget h2:first-child, +.textwidget h3:first-child, +.textwidget h4:first-child, +.textwidget h5:first-child, +.textwidget h6:first-child { + margin-top: 0; +} + +.post-navigation .post-title, +.entry-title, +.comments-title { + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + hyphens: auto; +} + +body:not(.search-results) .entry-summary { + color: #686868; + font-size: 19px; + font-size: 1.1875rem; + line-height: 1.4736842105; + margin-bottom: 1.4736842105em; +} + +body:not(.search-results) .entry-header + .entry-summary { + margin-top: -0.736842105em; +} + +body:not(.search-results) .entry-summary p, +body:not(.search-results) .entry-summary address, +body:not(.search-results) .entry-summary hr, +body:not(.search-results) .entry-summary ul, +body:not(.search-results) .entry-summary ol, +body:not(.search-results) .entry-summary dl, +body:not(.search-results) .entry-summary dd, +body:not(.search-results) .entry-summary table { + margin-bottom: 1.4736842105em; +} + +body:not(.search-results) .entry-summary li > ul, +body:not(.search-results) .entry-summary li > ol { + margin-bottom: 0; +} + +body:not(.search-results) .entry-summary th, +body:not(.search-results) .entry-summary td { + padding: 0.3684210526em; +} + +body:not(.search-results) .entry-summary fieldset { + margin-bottom: 1.4736842105em; + padding: 0.3684210526em; +} + +body:not(.search-results) .entry-summary blockquote { + border-color: currentColor; +} + +body:not(.search-results) .entry-summary blockquote > :last-child { + margin-bottom: 0; +} + +body:not(.search-results) .entry-summary .alignleft { + margin: 0.2631578947em 1.4736842105em 1.4736842105em 0; +} + +body:not(.search-results) .entry-summary .alignright { + margin: 0.2631578947em 0 1.4736842105em 1.4736842105em; +} + +body:not(.search-results) .entry-summary .aligncenter { + margin-bottom: 1.4736842105em; +} + +.entry-content > :last-child, +.entry-summary > :last-child, +body:not(.search-results) .entry-summary > :last-child, +.page-content > :last-child, +.comment-content > :last-child, +.textwidget > :last-child { + margin-bottom: 0; +} + +.more-link { + white-space: nowrap; +} + +.author-info { + border-color: inherit; + border-style: solid; + border-width: 1px 0 1px 0; + clear: both; + padding-top: 1.75em; + padding-bottom: 1.75em; +} + +.author-avatar .avatar { + float: left; + height: 42px; + margin: 0 1.75em 1.75em 0; + width: 42px; +} + +.author-description > :last-child { + margin-bottom: 0; +} + +.entry-content .author-title { + clear: none; + font-size: 16px; + font-size: 1rem; + font-weight: 900; + line-height: 1.75; + margin: 0; +} + +.author-bio { + color: #686868; + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.6153846154; + margin-bottom: 1.6153846154em; + overflow: hidden; +} + +.author-link { + white-space: nowrap; +} + +.entry-footer { + color: #686868; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.6153846154; + margin-top: 2.1538461538em; +} + +.entry-footer:empty { + margin: 0; +} + +.entry-footer a { + color: #686868; +} + +.entry-footer a:hover, +.entry-footer a:focus { + color: #007acc; +} + +.entry-footer > span:not(:last-child):after { + content: "\002f"; + display: inline-block; + opacity: 0.7; + padding: 0 0.538461538em; +} + +.entry-footer .avatar { + height: 21px; + margin: -0.1538461538em 0.5384615385em 0 0; + width: 21px; +} + +.sticky-post { + color: #686868; + display: block; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 13px; + font-size: 0.8125rem; + letter-spacing: 0.076923077em; + line-height: 1.6153846154; + margin-bottom: 0.5384615385em; + text-transform: uppercase; +} + +/** + * IE8 and earlier will drop any block with CSS3 selectors. + * Do not combine these styles with the next block. + */ +.updated:not(.published) { + display: none; +} + +.sticky .posted-on, +.byline { + display: none; +} + +.single .byline, +.group-blog .byline { + display: inline; +} + +.page-header { + border-top: 4px solid #1a1a1a; + margin: 0 7.6923% 3.5em; + padding-top: 1.75em; +} + +body.error404 .page-header, +body.search-no-results .page-header { + border-top: 0; + padding-top: 0; +} + +.page-title { + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 23px; + font-size: 1.4375rem; + line-height: 1.2173913043; +} + +.taxonomy-description { + color: #686868; + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.6153846154; +} + +.taxonomy-description p { + margin: 0.5384615385em 0 1.6153846154em; +} + +.taxonomy-description > :last-child { + margin-bottom: 0; +} + +.page-links { + clear: both; + font-family: Montserrat, "Helvetica Neue", sans-serif; + margin: 0 0 1.75em; +} + +.page-links a, +.page-links > span { + border: 1px solid #d1d1d1; + border-radius: 2px; + display: inline-block; + font-size: 13px; + font-size: 0.8125rem; + height: 1.8461538462em; + line-height: 1.6923076923em; + margin-right: 0.3076923077em; + text-align: center; + width: 1.8461538462em; +} + +.page-links a { + background-color: #1a1a1a; + border-color: #1a1a1a; + color: #fff; +} + +.page-links a:hover, +.page-links a:focus { + background-color: #007acc; + border-color: transparent; + color: #fff; +} + +.page-links > .page-links-title { + border: 0; + color: #1a1a1a; + height: auto; + margin: 0; + padding-right: 0.6153846154em; + width: auto; +} + +.entry-attachment { + margin-bottom: 1.75em; +} + +.entry-caption { + color: #686868; + font-size: 13px; + font-size: 0.8125rem; + font-style: italic; + line-height: 1.6153846154; + padding-top: 1.0769230769em; +} + +.entry-caption > :last-child { + margin-bottom: 0; +} + +.content-bottom-widgets { + margin: 0 7.6923%; +} + +.content-bottom-widgets .widget-area { + margin-bottom: 3.5em; +} + + +/** + * 11.3 - Post Formats + */ + +.format-aside .entry-title, +.format-image .entry-title, +.format-video .entry-title, +.format-quote .entry-title, +.format-gallery .entry-title, +.format-status .entry-title, +.format-link .entry-title, +.format-audio .entry-title, +.format-chat .entry-title { + font-size: 19px; + font-size: 1.1875rem; + line-height: 1.473684211; + margin-bottom: 1.473684211em; +} + +.blog .format-status .entry-title, +.archive .format-status .entry-title { + display: none; +} + + +/** + * 11.4 - Comments + */ + +.comments-area { + margin: 0 7.6923% 3.5em; +} + +.comment-list + .comment-respond, +.comment-navigation + .comment-respond { + padding-top: 1.75em; +} + +.comments-title, +.comment-reply-title { + border-top: 4px solid #1a1a1a; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 23px; + font-size: 1.4375rem; + font-weight: 700; + line-height: 1.3125; + padding-top: 1.217391304em; +} + +.comments-title { + margin-bottom: 1.217391304em; +} + +.comment-list { + list-style: none; + margin: 0; +} + +.comment-list article, +.comment-list .pingback, +.comment-list .trackback { + border-top: 1px solid #d1d1d1; + padding: 1.75em 0; +} + +.comment-list .children { + list-style: none; + margin: 0; +} + +.comment-list .children > li { + padding-left: 0.875em; +} + +.comment-author { + color: #1a1a1a; + margin-bottom: 0.4375em; +} + +.comment-author .avatar { + float: left; + height: 28px; + margin-right: 0.875em; + position: relative; + width: 28px; +} + +.bypostauthor > article .fn:after { + content: "\f304"; + left: 3px; + position: relative; + top: 5px; +} + +.comment-metadata, +.pingback .edit-link { + color: #686868; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.6153846154; +} + +.comment-metadata { + margin-bottom: 2.1538461538em; +} + +.comment-metadata a, +.pingback .comment-edit-link { + color: #686868; +} + +.comment-metadata a:hover, +.comment-metadata a:focus, +.pingback .comment-edit-link:hover, +.pingback .comment-edit-link:focus { + color: #007acc; +} + +.comment-metadata .edit-link, +.pingback .edit-link { + display: inline-block; +} + +.comment-metadata .edit-link:before, +.pingback .edit-link:before { + content: "\002f"; + display: inline-block; + opacity: 0.7; + padding: 0 0.538461538em; +} + +.comment-content ul, +.comment-content ol { + margin: 0 0 1.5em 1.25em; +} + +.comment-content li > ul, +.comment-content li > ol { + margin-bottom: 0; +} + +.comment-reply-link { + border: 1px solid #d1d1d1; + border-radius: 2px; + color: #007acc; + display: inline-block; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 13px; + font-size: 0.8125rem; + line-height: 1; + margin-top: 2.1538461538em; + padding: 0.5384615385em 0.5384615385em 0.4615384615em; +} + +.comment-reply-link:hover, +.comment-reply-link:focus { + border-color: currentColor; + color: #007acc; + outline: 0; +} + +.comment-form { + padding-top: 1.75em; +} + +.comment-form label { + color: #686868; + display: block; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 13px; + font-size: 0.8125rem; + letter-spacing: 0.076923077em; + line-height: 1.6153846154; + margin-bottom: 0.5384615385em; + text-transform: uppercase; +} + +.comment-list .comment-form { + padding-bottom: 1.75em; +} + +.comment-notes, +.comment-awaiting-moderation, +.logged-in-as, +.form-allowed-tags { + color: #686868; + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.6153846154; + margin-bottom: 2.1538461538em; +} + +.no-comments { + border-top: 1px solid #d1d1d1; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-weight: 700; + margin: 0; + padding-top: 1.75em; +} + +.comment-navigation + .no-comments { + border-top: 0; + padding-top: 0; +} + +.form-allowed-tags code { + font-family: Inconsolata, monospace; +} + +.form-submit { + margin-bottom: 0; +} + +.required { + color: #007acc; + font-family: Merriweather, Georgia, serif; +} + +.comment-reply-title small { + font-size: 100%; +} + +.comment-reply-title small a { + border: 0; + float: right; + height: 32px; + overflow: hidden; + width: 26px; +} + +.comment-reply-title small a:hover, +.comment-reply-title small a:focus { + color: #1a1a1a; +} + +.comment-reply-title small a:before { + content: "\f405"; + font-size: 32px; + position: relative; + top: -5px; +} + +.comment-form #wp-comment-cookies-consent { + margin: 0 10px 0 0; +} + +.comment-form .comment-form-cookies-consent label { + display: inline; + font-family: Merriweather, Georgia, serif; + letter-spacing: 0; + text-transform: none; +} + +/** + * 11.5 - Sidebar + */ + +.sidebar { + margin-bottom: 3.5em; + padding: 0 7.6923%; +} + + +/** + * 11.6 - Footer + */ + +.site-footer { + padding: 0 7.6923% 1.75em; +} + +.site-info { + color: #686868; + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.6153846154; +} + +.site-info a { + color: #686868; +} + +.site-info a:hover, +.site-info a:focus { + color: #007acc; +} + +.site-footer .site-title { + font-family: inherit; + font-size: inherit; + font-weight: 400; +} + +.site-footer .site-title:after { + content: "\002f"; + display: inline-block; + font-family: Montserrat, sans-serif; + opacity: 0.7; + padding: 0 0.307692308em 0 0.538461538em; +} + +.site-footer span[role=separator] { + font-family: Montserrat, sans-serif; + opacity: 0.7; + padding: 0 0.307692308em 0 0.538461538em; +} + +.site-footer span[role=separator]::before { + content: '\002f'; +} + + +/** + * 12.0 - Media + */ + +.site .avatar { + border-radius: 50%; +} + +.entry-content .wp-smiley, +.entry-summary .wp-smiley, +.comment-content .wp-smiley, +.textwidget .wp-smiley { + border: none; + margin-top: 0; + margin-bottom: 0; + padding: 0; +} + +.entry-content a img, +.entry-summary a img, +.comment-content a img, +.textwidget a img { + display: block; +} + +/* Make sure embeds and iframes fit their containers. */ +embed, +iframe, +object, +video { + margin-bottom: 1.75em; + max-width: 100%; + vertical-align: middle; +} + +p > embed, +p > iframe, +p > object, +p > video { + margin-bottom: 0; +} + +.entry-content .wp-audio-shortcode a, +.entry-content .wp-playlist a { + box-shadow: none; +} + +.wp-audio-shortcode, +.wp-video, +.wp-playlist.wp-audio-playlist { + margin-top: 0; + margin-bottom: 1.75em; +} + +.wp-playlist.wp-audio-playlist { + padding-bottom: 0; +} + +.wp-playlist .wp-playlist-tracks { + margin-top: 0; +} + +.wp-playlist-item .wp-playlist-caption { + border-bottom: 0; + padding: 0.7142857143em 0; +} + +.wp-playlist-item .wp-playlist-item-length { + top: 0.7142857143em; +} + + +/** + * 12.1 - Captions + */ + +.wp-caption { + margin-bottom: 1.75em; + max-width: 100%; +} + +.wp-caption img[class*="wp-image-"] { + display: block; + margin: 0; +} + +.wp-caption .wp-caption-text { + color: #686868; + font-size: 13px; + font-size: 0.8125rem; + font-style: italic; + line-height: 1.6153846154; + padding-top: 0.5384615385em; +} + + +/** + * 12.2 - Galleries + */ + +.gallery { + margin: 0 -1.1666667% 1.75em; +} + +.gallery-item { + display: inline-block; + max-width: 33.33%; + padding: 0 1.1400652% 2.2801304%; + text-align: center; + vertical-align: top; + width: 100%; +} + +.gallery-columns-1 .gallery-item { + max-width: 100%; +} + +.gallery-columns-2 .gallery-item { + max-width: 50%; +} + +.gallery-columns-4 .gallery-item { + max-width: 25%; +} + +.gallery-columns-5 .gallery-item { + max-width: 20%; +} + +.gallery-columns-6 .gallery-item { + max-width: 16.66%; +} + +.gallery-columns-7 .gallery-item { + max-width: 14.28%; +} + +.gallery-columns-8 .gallery-item { + max-width: 12.5%; +} + +.gallery-columns-9 .gallery-item { + max-width: 11.11%; +} + +.gallery-icon img { + margin: 0 auto; +} + +.gallery-caption { + color: #686868; + display: block; + font-size: 13px; + font-size: 0.8125rem; + font-style: italic; + line-height: 1.6153846154; + padding-top: 0.5384615385em; +} + +.gallery-columns-6 .gallery-caption, +.gallery-columns-7 .gallery-caption, +.gallery-columns-8 .gallery-caption, +.gallery-columns-9 .gallery-caption { + display: none; +} + + +/** + * 13.0 - Multisites + */ + +.widecolumn { + margin-bottom: 3.5em; + padding: 0 7.6923%; +} + +.widecolumn .mu_register { + width: auto; +} + +.widecolumn .mu_register .mu_alert { + background: transparent; + border-color: #d1d1d1; + color: inherit; + margin-bottom: 3.5em; + padding: 1.75em; +} + +.widecolumn form, +.widecolumn .mu_register form { + margin-top: 0; +} + +.widecolumn h2 { + font-size: 23px; + font-size: 1.4375rem; + font-weight: 900; + line-height: 1.2173913043; + margin-bottom: 1.2173913043em; +} + +.widecolumn p { + margin: 1.75em 0; +} + +.widecolumn p + h2 { + margin-top: 2.4347826087em; +} + +.widecolumn label, +.widecolumn .mu_register label { + color: #686868; + font-family: Montserrat, "Helvetica Neue", sans-serif; + font-size: 13px; + font-size: 0.8125rem; + font-weight: 400; + letter-spacing: 0.076923077em; + line-height: 1.6153846154; + text-transform: uppercase; +} + +.widecolumn .mu_register label { + margin: 2.1538461538em 0.7692307692em 0.5384615385em 0; +} + +.widecolumn .mu_register label strong { + font-weight: 400; +} + +.widecolumn #key, +.widecolumn .mu_register #blog_title, +.widecolumn .mu_register #user_email, +.widecolumn .mu_register #blogname, +.widecolumn .mu_register #user_name { + font-size: 16px; + font-size: 1rem; + width: 100%; +} + +.widecolumn .mu_register #blogname { + margin: 0; +} + +.widecolumn .mu_register #blog_title, +.widecolumn .mu_register #user_email, +.widecolumn .mu_register #user_name { + margin: 0 0 0.375em; +} + +.widecolumn #submit, +.widecolumn .mu_register input[type="submit"] { + font-size: 16px; + font-size: 1rem; + margin: 0; + width: auto; +} + +.widecolumn .mu_register .prefix_address, +.widecolumn .mu_register .suffix_address { + font-size: inherit; +} + +.widecolumn .mu_register > :last-child, +.widecolumn form > :last-child { + margin-bottom: 0; +} + + +/** + * 14.0 - Media Queries + */ + +/** + * Does the same thing as , + * but in the future W3C standard way. -ms- prefix is required for IE10+ to + * render responsive styling in Windows 8 "snapped" views; IE10+ does not honor + * the meta tag. See https://core.trac.wordpress.org/ticket/25888. + */ +@-ms-viewport { + width: device-width; +} + +@viewport { + width: device-width; +} + + +/** + * 14.1 - >= 710px + */ + +@media screen and (min-width: 44.375em) { + body:not(.custom-background-image):before, + body:not(.custom-background-image):after { + background: inherit; + content: ""; + display: block; + height: 21px; + left: 0; + position: fixed; + width: 100%; + z-index: 99; + } + + body:not(.custom-background-image):before { + top: 0; + } + + body:not(.custom-background-image).admin-bar:before { + top: 46px; + } + + body:not(.custom-background-image):after { + bottom: 0; + } + + .site { + margin: 21px; + } + + .site-main { + margin-bottom: 5.25em; + } + + .site-header { + padding: 3.9375em 7.6923%; + } + + .site-branding { + margin-top: 1.3125em; + margin-bottom: 1.3125em; + } + + .custom-logo { + max-width: 210px; + } + + .site-title { + font-size: 28px; + font-size: 1.75rem; + line-height: 1.25; + } + + .wp-custom-logo .site-title { + margin-top: 0.5em; + } + + .site-description { + display: block; + } + + .menu-toggle { + font-size: 16px; + font-size: 1.0rem; + margin: 1.3125em 0; + padding: 0.8125em 0.875em 0.6875em; + } + + .site-header-menu { + margin: 1.3125em 0; + } + + .site-header .main-navigation + .social-navigation { + margin-top: 2.625em; + } + + .header-image { + margin: 1.3125em 0; + } + + .pagination { + margin: 0 23.0769% 4.421052632em 7.6923% + } + + .post-navigation { + margin-bottom: 5.25em; + } + + .post-navigation .post-title { + font-size: 28px; + font-size: 1.75rem; + line-height: 1.25; + } + + /* restore screen-reader-text */ + .pagination .current .screen-reader-text { + position: absolute !important; + } + + .pagination .page-numbers { + display: inline-block; + } + + .site-main > article { + margin-bottom: 5.25em; + } + + .entry-header, + .post-thumbnail, + .entry-content, + .entry-summary, + .entry-footer, + .comments-area, + .image-navigation, + .post-navigation, + .page-header, + .page-content, + .content-bottom-widgets { + margin-right: 23.0769%; + } + + .entry-title { + font-size: 33px; + font-size: 2.0625rem; + line-height: 1.2727272727; + margin-bottom: 0.8484848485em; + } + + .entry-content blockquote.alignleft, + .entry-content blockquote.alignright { + border-width: 4px 0 0 0; + padding: 0.9473684211em 0 0; + width: -webkit-calc(50% - 0.736842105em); + width: calc(50% - 0.736842105em); + } + + .entry-content blockquote:not(.alignleft):not(.alignright), + .entry-summary blockquote, + .comment-content blockquote { + margin-left: -1.473684211em; + } + + .entry-content blockquote blockquote:not(.alignleft):not(.alignright), + .entry-summary blockquote blockquote, + .comment-content blockquote blockquote { + margin-left: 0; + } + + .entry-content ul, + .entry-summary ul, + .comment-content ul, + .entry-content ol, + .entry-summary ol, + .comment-content ol { + margin-left: 0; + } + + .entry-content li > ul, + .entry-summary li > ul, + .comment-content li > ul, + .entry-content blockquote > ul, + .entry-summary blockquote > ul, + .comment-content blockquote > ul { + margin-left: 1.25em; + } + + .entry-content li > ol, + .entry-summary li > ol, + .comment-content li > ol, + .entry-content blockquote > ol, + .entry-summary blockquote > ol, + .comment-content blockquote > ol { + margin-left: 1.5em; + } + + .comment-author { + margin-bottom: 0; + } + + .comment-author .avatar { + height: 42px; + position: relative; + top: 0.25em; + width: 42px; + } + + .comment-list .children > li { + padding-left: 1.75em; + } + + .comment-list + .comment-respond, + .comment-navigation + .comment-respond { + padding-top: 3.5em; + } + + .comments-area, + .widget, + .content-bottom-widgets .widget-area { + margin-bottom: 5.25em; + } + + .sidebar, + .widecolumn { + margin-bottom: 5.25em; + padding-right: 23.0769%; + } + + body:not(.search-results) .entry-summary li > ul, + body:not(.search-results) .entry-summary blockquote > ul { + margin-left: 1.157894737em; + } + + body:not(.search-results) .entry-summary li > ol, + body:not(.search-results) .entry-summary blockquote > ol { + margin-left: 1.473684211em; + } +} + + +/** + * 14.2 - >= 783px + */ + +@media screen and (min-width: 48.9375em) { + body:not(.custom-background-image).admin-bar:before { + top: 32px; + } +} + + +/** + * 14.3 - >= 910px + */ + +@media screen and (min-width: 56.875em) { + .site-header { + padding-right: 4.5455%; + padding-left: 4.5455%; + } + + .site-header-main { + -webkit-align-items: flex-start; + -ms-flex-align: start; + align-items: flex-start; + } + + .wp-custom-logo .site-header-main { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + } + + .site-header-menu { + display: block; + -webkit-flex: 0 1 auto; + -ms-flex: 0 1 auto; + flex: 0 1 auto; + } + + .main-navigation { + margin: 0 -0.875em; + } + + .main-navigation .primary-menu, + .main-navigation .primary-menu > li { + border: 0; + } + + .main-navigation .primary-menu > li { + float: left; + } + + .main-navigation a { + outline-offset: -8px; + padding: 0.65625em 0.875em; + white-space: nowrap; + } + + .main-navigation li:hover > a, + .main-navigation li.focus > a { + color: #007acc; + } + + .main-navigation ul ul { + border-bottom: 1px solid #d1d1d1; + display: block; + left: -999em; + margin: 0; + position: absolute; + z-index: 99999; + } + + .main-navigation ul ul ul { + top: -1px; + } + + .main-navigation ul ul ul:before, + .main-navigation ul ul ul:after { + border: 0; + } + + .main-navigation ul ul li { + background-color: #fff; + border: 1px solid #d1d1d1; + border-bottom-width: 0; + } + + .main-navigation ul ul a { + white-space: normal; + width: 12.6875em; + } + + .main-navigation ul ul:before, + .main-navigation ul ul:after { + border-style: solid; + content: ""; + position: absolute; + } + + .main-navigation ul ul:before { + border-color: #d1d1d1 transparent; + border-width: 0 10px 10px; + right: 9px; + top: -9px; + } + + .main-navigation ul ul:after { + border-color: #fff transparent; + border-width: 0 8px 8px; + right: 11px; + top: -7px; + } + + .main-navigation li:hover > ul, + .main-navigation li.focus > ul { + left: auto; + right: 0; + } + + .main-navigation ul ul li:hover > ul, + .main-navigation ul ul li.focus > ul { + left: auto; + right: 100%; + } + + .main-navigation .menu-item-has-children > a { + margin: 0; + padding-right: 2.25em; + } + + .main-navigation .menu-item-has-children > a:after { + content: "\f431"; + position: absolute; + right: 0.625em; + top: 0.8125em; + } + + .main-navigation ul ul .menu-item-has-children > a { + padding-right: 2.0625em; + } + + .main-navigation ul ul .menu-item-has-children > a:after { + right: 0.5625em; + top: 0.875em; + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); + } + + .dropdown-toggle, + .main-navigation ul .dropdown-toggle.toggled-on, + .menu-toggle, + .site-header .social-navigation, + .site-footer .main-navigation { + display: none; + } + + .site-content { + padding: 0 4.5455%; + } + + .content-area { + float: left; + margin-right: -100%; + width: 70%; + } + + .entry-header, + .post-thumbnail, + .entry-content, + .entry-summary, + .entry-footer, + .comments-area, + .image-navigation, + .post-navigation, + .pagination, + .page-header, + .page-content, + .content-bottom-widgets { + margin-right: 0; + margin-left: 0; + } + + .sidebar { + float: left; + margin-left: 75%; + padding: 0; + width: 25%; + } + + .widget { + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.6153846154; + margin-bottom: 3.230769231em; + padding-top: 1.615384615em; + } + + .widget .widget-title { + margin-bottom: 1.3125em; + } + + .widget p, + .widget address, + .widget hr, + .widget ul, + .widget ol, + .widget dl, + .widget dd, + .widget table { + margin-bottom: 1.6153846154em; + } + + .widget li > ul, + .widget li > ol { + margin-bottom: 0; + } + + .widget blockquote { + font-size: 16px; + font-size: 1rem; + line-height: 1.3125; + margin-bottom: 1.3125em; + padding-left: 1.0625em; + } + + .widget blockquote cite, + .widget blockquote small { + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.6153846154; + } + + .widget th, + .widget td { + padding: 0.5384615385em; + } + + .widget pre { + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.6153846154; + margin-bottom: 1.6153846154em; + padding: 0.5384615385em; + } + + .widget fieldset { + margin-bottom: 1.6153846154em; + padding: 0.5384615385em; + } + + .widget button, + .widget input, + .widget select, + .widget textarea { + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.6153846154; + } + + .widget button, + .widget input[type="button"], + .widget input[type="reset"], + .widget input[type="submit"] { + line-height: 1; + padding: 0.846153846em; + } + + .widget input[type="date"], + .widget input[type="time"], + .widget input[type="datetime-local"], + .widget input[type="week"], + .widget input[type="month"], + .widget input[type="text"], + .widget input[type="email"], + .widget input[type="url"], + .widget input[type="password"], + .widget input[type="search"], + .widget input[type="tel"], + .widget input[type="number"], + .widget textarea { + padding: 0.4615384615em 0.5384615385em; + } + + .widget h1 { + font-size: 23px; + font-size: 1.4375rem; + line-height: 1.2173913043; + margin-bottom: 0.9130434783em; + } + + .widget h2 { + font-size: 19px; + font-size: 1.1875rem; + line-height: 1.1052631579; + margin-bottom: 1.1052631579em; + } + + .widget h3 { + font-size: 16px; + font-size: 1rem; + line-height: 1.3125; + margin-bottom: 1.3125em; + } + + .widget h4, + .widget h5, + .widget h6 { + font-size: 13px; + font-size: 0.8125rem; + line-height: 1.6153846154; + margin-bottom: 0.9130434783em; + } + + .widget .alignleft { + margin: 0.2307692308em 1.6153846154em 1.6153846154em 0; + } + + .widget .alignright { + margin: 0.2307692308em 0 1.6153846154em 1.6153846154em; + } + + .widget .aligncenter { + margin-bottom: 1.6153846154em; + } + + .widget_calendar td, + .widget_calendar th, + .widget_calendar .wp-calendar-nav span { + line-height: 2.6923076923; + padding: 0; + } + + .widget_rss .rssSummary:last-child { + margin-bottom: 1.615384615em; + } + + .widget input[type="search"].search-field { + width: -webkit-calc(100% - 35px); + width: calc(100% - 35px); + } + + .widget .search-submit:before { + font-size: 16px; + left: 1px; + line-height: 35px; + width: 34px; + } + + .widget button.search-submit { + padding: 0; + width: 35px; + } + + .tagcloud a { + margin: 0 0.2307692308em 0.5384615385em 0; + padding: 0.5384615385em 0.4615384615em 0.4615384615em; + } + + .textwidget h1 { + margin-top: 1.8260869565em; + } + + .textwidget h2 { + margin-top: 2.2105263158em; + } + + .textwidget h3 { + margin-top: 2.625em; + } + + .textwidget h4 { + letter-spacing: 0.153846154em; + } + + .textwidget h4, + .textwidget h5, + .textwidget h6 { + margin-top: 3.2307692308em; + } + + .content-bottom-widgets .widget-area:nth-child(1):nth-last-child(2), + .content-bottom-widgets .widget-area:nth-child(2):nth-last-child(1) { + float: left; + margin-right: 7.1428571%; + width: 46.42857145%; + } + + .content-bottom-widgets .widget-area:nth-child(2):nth-last-child(1):last-of-type { + margin-right: 0; + } + + .site-footer { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + padding: 0 4.5455% 3.5em; + } + + .site-footer .social-navigation { + margin: 0; + -webkit-order: 2; + -ms-flex-order: 2; + order: 2; + } + + .site-info { + margin: 0.538461538em auto 0.538461538em 0; + -webkit-order: 1; + -ms-flex-order: 1; + order: 1; + } + + .no-sidebar .content-area { + float: none; + margin: 0; + width: 100%; + } + + .no-sidebar .entry-header, + .no-sidebar .entry-content, + .no-sidebar .entry-summary, + .no-sidebar .entry-footer, + .no-sidebar .comments-area, + .no-sidebar .image-navigation, + .no-sidebar .post-navigation, + .no-sidebar .pagination, + .no-sidebar .page-header, + .no-sidebar .page-content, + .no-sidebar .content-bottom-widgets { + margin-right: 15%; + margin-left: 15%; + } + + .widecolumn { + padding-right: 15%; + padding-left: 15%; + } +} + + +/** + * 14.4 - >= 985px + */ + +@media screen and (min-width: 61.5625em) { + .site-main { + margin-bottom: 7.0em; + } + + .site-header { + padding: 5.25em 4.5455%; + } + + .site-branding, + .site-header-menu, + .header-image { + margin-top: 1.75em; + margin-bottom: 1.75em; + } + + .custom-logo { + max-width: 240px; + } + + .image-navigation { + margin-bottom: 3.230769231em; + } + + .post-navigation { + margin-bottom: 7.0em; + } + + .pagination { + margin-bottom: 5.894736842em; + } + + .widget { + margin-bottom: 4.307692308em; + } + + .site-main > article { + margin-bottom: 7.0em; + } + + .entry-title { + font-size: 40px; + font-size: 2.5rem; + line-height: 1.225; + margin-bottom: 1.05em; + } + + .format-aside .entry-title, + .format-image .entry-title, + .format-video .entry-title, + .format-quote .entry-title, + .format-gallery .entry-title, + .format-status .entry-title, + .format-link .entry-title, + .format-audio .entry-title, + .format-chat .entry-title { + font-size: 23px; + font-size: 1.4375em; + line-height: 1.304347826; + margin-bottom: 1.826086957em; + } + + .post-thumbnail { + margin-bottom: 2.625em; + } + + .entry-content h1, + .entry-summary h1, + .comment-content h1 { + font-size: 33px; + font-size: 2.0625rem; + line-height: 1.2727272727; + margin-top: 1.696969697em; + margin-bottom: 0.8484848485em; + } + + .entry-content h2, + .entry-summary h2, + .comment-content h2 { + font-size: 28px; + font-size: 1.75rem; + line-height: 1.25; + margin-top: 2em; + margin-bottom: 1em; + } + + .entry-content h3, + .entry-summary h3, + .comment-content h3 { + font-size: 23px; + font-size: 1.4375rem; + line-height: 1.2173913043; + margin-top: 2.4347826087em; + margin-bottom: 1.2173913043em; + } + + .entry-content h4, + .entry-summary h4, + .entry-intro h4, + .comment-content h4 { + letter-spacing: 0.131578947em; + } + + .entry-content h4, + .entry-content h5, + .entry-content h6, + .entry-summary h4, + .entry-summary h5, + .entry-summary h6, + .comment-content h4, + .comment-content h5, + .comment-content h6 { + font-size: 19px; + font-size: 1.1875rem; + line-height: 1.1052631579; + margin-top: 2.9473684211em; + margin-bottom: 1.473684211em; + } + + .author-info { + border-bottom-width: 0; + padding-bottom: 0; + } + + .comment-list + .comment-respond, + .comment-navigation + .comment-respond { + padding-top: 5.25em; + } + + .comments-area, + .sidebar, + .content-bottom-widgets .widget-area, + .widecolumn { + margin-bottom: 7.0em; + } + + body:not(.search-results) .entry-summary { + margin-bottom: 2.210526316em; + } + + body:not(.search-results) .entry-header + .entry-summary { + margin-top: -1.105263158em; + } + + body:not(.search-results) article:not(.type-page) .entry-content { + float: right; + width: 71.42857144%; + } + + body:not(.search-results) article:not(.type-page) .entry-content > blockquote.alignleft.below-entry-meta { + margin-left: -40%; + width: -webkit-calc(60% - 1.4736842105em); + width: calc(60% - 1.4736842105em); + } + + body:not(.search-results) article:not(.type-page) img.below-entry-meta, + body:not(.search-results) article:not(.type-page) figure.below-entry-meta { + clear: both; + display: block; + float: none; + margin-right: 0; + margin-left: -40%; + max-width: 140%; + } + + body:not(.search-results) article:not(.type-page) figure.below-entry-meta img.below-entry-meta, + body:not(.search-results) article:not(.type-page) table figure.below-entry-meta, + body:not(.search-results) article:not(.type-page) table img.below-entry-meta { + margin: 0; + max-width: 100%; + } + + body:not(.search-results) article:not(.type-page) .entry-footer { + float: left; + margin-top: 0.1538461538em; + width: 21.42857143%; + } + + body:not(.search-results) article:not(.type-page) .entry-footer > span:not(:last-child):after { + display: none; + } + + .single .byline, + .full-size-link, + body:not(.search-results).group-blog .byline, + body:not(.search-results) .entry-format, + body:not(.search-results) .cat-links, + body:not(.search-results) .tags-links, + body:not(.search-results) article:not(.sticky) .posted-on, + body:not(.search-results) article:not(.type-page) .comments-link, + body:not(.search-results) article:not(.type-page) .entry-footer .edit-link { + display: block; + margin-bottom: 0.5384615385em; + } + + body:not(.search-results) article:not(.type-page) .entry-footer > span:last-child { + margin-bottom: 0; + } + + body:not(.search-results) article:not(.type-page) .entry-footer .avatar { + display: block; + height: auto; + margin: 0 0 0.5384615385em; + width: 49px; + } + + body.no-sidebar:not(.search-results) article:not(.type-page) .entry-content { + float: left; + margin-right: -100%; + margin-left: 34.99999999%; + width: 50.00000001%; + } + + body.no-sidebar:not(.search-results) article:not(.type-page) .entry-footer { + margin-right: -100%; + margin-left: 15%; + width: 15%; + } +} + + +/** + * 14.5 - >= 1200px + */ + +@media screen and (min-width: 75em) { + body:not(.search-results) .entry-summary { + font-size: 23px; + font-size: 1.4375rem; + line-height: 1.5217391304; + margin-bottom: 1.826086957em; + } + + body:not(.search-results) .entry-header + .entry-summary { + margin-top: -0.913043478em; + } + + body:not(.search-results) .entry-summary p, + body:not(.search-results) .entry-summary address, + body:not(.search-results) .entry-summary hr, + body:not(.search-results) .entry-summary ul, + body:not(.search-results) .entry-summary ol, + body:not(.search-results) .entry-summary dl, + body:not(.search-results) .entry-summary dd, + body:not(.search-results) .entry-summary table { + margin-bottom: 1.5217391304em; + } + + body:not(.search-results) .entry-summary li > ul, + body:not(.search-results) .entry-summary blockquote > ul { + margin-left: 0.956521739em; + } + + body:not(.search-results) .entry-summary li > ol, + body:not(.search-results) .entry-summary blockquote > ol { + margin-left: 1.52173913em; + } + + body:not(.search-results) .entry-summary blockquote { + font-size: 23px; + font-size: 1.4375rem; + line-height: 1.5217391304; + margin: 0 0 1.5217391304em; + padding-left: 1.347826087em; + } + + body:not(.search-results) .entry-summary blockquote:not(.alignleft):not(.alignright) { + margin-left: -1.52173913em; + } + + body:not(.search-results) .entry-summary blockquote blockquote:not(.alignleft):not(.alignright) { + margin-left: 0; + } + + body:not(.search-results) .entry-summary blockquote cite, + body:not(.search-results) .entry-summary blockquote small { + font-size: 19px; + font-size: 1.1875rem; + line-height: 1.8421052632; + } + + body:not(.search-results) .entry-summary th, + body:not(.search-results) .entry-summary td { + padding: 0.3043478261em; + } + + body:not(.search-results) .entry-summary pre { + font-size: 16px; + font-size: 1rem; + line-height: 1.75; + margin-bottom: 1.75em; + padding: 1.75em; + } + + body:not(.search-results) .entry-summary fieldset { + margin-bottom: 1.5217391304em; + padding: 0.3043478261em; + } + + body:not(.search-results) .entry-summary h1 { + margin-top: 2.121212121em; + margin-bottom: 1.060606061em; + } + + body:not(.search-results) .entry-summary h2 { + margin-top: 2.5em; + margin-bottom: 1.25em; + } + + body:not(.search-results) .entry-summary h3 { + margin-top: 3.043478261em; + margin-bottom: 1.52173913em; + } + + body:not(.search-results) .entry-summary h4, + body:not(.search-results) .entry-summary h5, + body:not(.search-results) .entry-summary h6 { + margin-top: 3.684210526em; + margin-bottom: 1.842105263em; + } + + body:not(.search-results) .entry-summary h1:first-child, + body:not(.search-results) .entry-summary h2:first-child, + body:not(.search-results) .entry-summary h3:first-child, + body:not(.search-results) .entry-summary h4:first-child, + body:not(.search-results) .entry-summary h5:first-child, + body:not(.search-results) .entry-summary h6:first-child { + margin-top: 0; + } + + body:not(.search-results) .entry-summary .alignleft { + margin: 0.2608695652em 1.5217391304em 1.5217391304em 0; + } + + body:not(.search-results) .entry-summary .alignright { + margin: 0.2608695652em 0 1.5217391304em 1.5217391304em; + } + + body:not(.search-results) .entry-summary .aligncenter { + margin-bottom: 1.5217391304em; + } +} + + +/** + * 15.0 - Print + */ + +@media print { + form, + button, + input, + select, + textarea, + .navigation, + .main-navigation, + .social-navigation, + .sidebar, + .content-bottom-widgets, + .header-image, + .page-links, + .edit-link, + .comment-respond, + .comment-edit-link, + .comment-reply-link, + .comment-metadata .edit-link, + .pingback .edit-link { + display: none; + } + + body, + blockquote cite, + blockquote small, + pre, + .entry-content h4, + .entry-content h5, + .entry-content h6, + .entry-summary h4, + .entry-summary h5, + .entry-summary h6, + .comment-content h4, + .comment-content h5, + .comment-content h6, + .entry-content .author-title { + font-size: 12pt; + } + + blockquote { + font-size: 14.25pt; + } + + .site-title, + .page-title, + .comments-title, + .entry-content h2, + .entry-summary h2, + .comment-content h2, + .widecolumn h2 { + font-size: 17.25pt; + } + + .site-description { + display: block; + } + + .entry-title { + font-size: 24.75pt; + line-height: 1.2727272727; + margin-bottom: 1.696969697em; + } + + .format-aside .entry-title, + .format-image .entry-title, + .format-video .entry-title, + .format-quote .entry-title, + .format-gallery .entry-title, + .format-status .entry-title, + .format-link .entry-title, + .format-audio .entry-title, + .format-chat .entry-title { + font-size: 17.25pt; + line-height: 1.304347826; + margin-bottom: 1.826086957em; + } + + .entry-content h1, + .entry-summary h1, + .comment-content h1 { + font-size: 21pt; + } + + .entry-content h3, + .entry-summary h3, + .comment-content h3, + body:not(.search-results) .entry-summary { + font-size: 14.25pt; + } + + .site-description, + .author-bio, + .entry-footer, + .sticky-post, + .taxonomy-description, + .entry-caption, + .comment-metadata, + .comment-notes, + .comment-awaiting-moderation, + .site-info, + .wp-caption .wp-caption-text, + .gallery-caption { + font-size: 9.75pt; + } + + body, + .site { + background: none !important; /* Brute force since user agents all print differently. */ + } + + body, + blockquote cite, + blockquote small, + .site-branding .site-title a, + .entry-title a, + .comment-author { + color: #1a1a1a !important; /* Make sure color schemes don't affect to print */ + } + + blockquote, + .page-header, + .comments-title { + border-color: #1a1a1a !important; /* Make sure color schemes don't affect to print */ + } + + blockquote, + .site-description, + body:not(.search-results) .entry-summary, + body:not(.search-results) .entry-summary blockquote, + .author-bio, + .entry-footer, + .entry-footer a, + .sticky-post, + .taxonomy-description, + .entry-caption, + .comment-author, + .comment-metadata a, + .comment-notes, + .comment-awaiting-moderation, + .site-info, + .site-info a, + .wp-caption .wp-caption-text, + .gallery-caption { + color: #686868 !important; /* Make sure color schemes don't affect to print */ + } + + code, + hr { + background-color: #d1d1d1 !important; /* Make sure color schemes don't affect to print */ + } + + pre, + abbr, + acronym, + table, + th, + td, + .author-info, + .comment-list article, + .comment-list .pingback, + .comment-list .trackback, + .no-comments { + border-color: #d1d1d1 !important; /* Make sure color schemes don't affect to print */ + } + + a { + color: #007acc !important; /* Make sure color schemes don't affect to print */ + } + + .entry-content a, + .entry-summary a, + .taxonomy-description a, + .comment-content a, + .pingback .comment-body > a { + box-shadow: none; + border-bottom: 1px solid #007acc !important; /* Make sure color schemes don't affect to print */ + } + + .site { + margin: 5%; + } + + .site-inner { + max-width: none; + } + + .site-header { + padding: 0 0 1.75em; + } + + .site-branding { + margin-top: 0; + margin-bottom: 1.75em; + } + + .site-main { + margin-bottom: 3.5em; + } + + .entry-header, + .entry-footer, + .page-header, + .page-content, + .entry-content, + .entry-summary, + .post-thumbnail, + .comments-area { + margin-right: 0; + margin-left: 0; + } + + .post-thumbnail, + .site-main > article { + margin-bottom: 3.5em; + } + + .entry-content blockquote.alignleft, + .entry-content blockquote.alignright { + border-width: 4px 0 0 0; + padding: 0.9473684211em 0 0; + width: -webkit-calc(50% - 0.736842105em); + width: calc(50% - 0.736842105em); + } + + body:not(.search-results) .entry-header + .entry-summary { + margin-top: -1.473684211em; + } + + .site-footer, + .widecolumn { + padding: 0; + } +} diff --git a/wp-content/themes/twentysixteen/template-parts/biography.php b/wp-content/themes/twentysixteen/template-parts/biography.php new file mode 100644 index 0000000..5430f2b --- /dev/null +++ b/wp-content/themes/twentysixteen/template-parts/biography.php @@ -0,0 +1,40 @@ + + +
            +
            + +
            + +
            +

            + +

            + + +

            +
            +
            diff --git a/wp-content/themes/twentysixteen/template-parts/content-none.php b/wp-content/themes/twentysixteen/template-parts/content-none.php new file mode 100644 index 0000000..28077f4 --- /dev/null +++ b/wp-content/themes/twentysixteen/template-parts/content-none.php @@ -0,0 +1,38 @@ + + +
            + + +
            + + +

            + Get started here.', 'twentysixteen' ), esc_url( admin_url( 'post-new.php' ) ) ); + ?> +

            + + + +

            + + + + +

            + + + +
            +
            diff --git a/wp-content/themes/twentysixteen/template-parts/content-page.php b/wp-content/themes/twentysixteen/template-parts/content-page.php new file mode 100644 index 0000000..a4c4a2c --- /dev/null +++ b/wp-content/themes/twentysixteen/template-parts/content-page.php @@ -0,0 +1,47 @@ + + +
            > +
            + ', '' ); ?> +
            + + + +
            + '', + 'link_before' => '', + 'link_after' => '', + 'pagelink' => '' . __( 'Page', 'twentysixteen' ) . ' %', + 'separator' => ', ', + ) + ); + ?> +
            + + "%s"', 'twentysixteen' ), + get_the_title() + ), + '
            ', + '
            ' + ); + ?> + +
            diff --git a/wp-content/themes/twentysixteen/template-parts/content-search.php b/wp-content/themes/twentysixteen/template-parts/content-search.php new file mode 100644 index 0000000..79307ae --- /dev/null +++ b/wp-content/themes/twentysixteen/template-parts/content-search.php @@ -0,0 +1,53 @@ + + +
            > +
            + ', esc_url( get_permalink() ) ), '' ); ?> +
            + + + + + + + +
            + + "%s"', 'twentysixteen' ), + get_the_title() + ), + '', + '' + ); + ?> +
            + + + + "%s"', 'twentysixteen' ), + get_the_title() + ), + '
            ', + '
            ' + ); + ?> + + +
            + diff --git a/wp-content/themes/twentysixteen/template-parts/content-single.php b/wp-content/themes/twentysixteen/template-parts/content-single.php new file mode 100644 index 0000000..5b54398 --- /dev/null +++ b/wp-content/themes/twentysixteen/template-parts/content-single.php @@ -0,0 +1,55 @@ + + +
            > +
            + ', '' ); ?> +
            + + + + + +
            + '', + 'link_before' => '', + 'link_after' => '', + 'pagelink' => '' . __( 'Page', 'twentysixteen' ) . ' %', + 'separator' => ', ', + ) + ); + + if ( '' !== get_the_author_meta( 'description' ) ) { + get_template_part( 'template-parts/biography' ); + } + ?> +
            + +
            + + "%s"', 'twentysixteen' ), + get_the_title() + ), + '', + '' + ); + ?> +
            +
            diff --git a/wp-content/themes/twentysixteen/template-parts/content.php b/wp-content/themes/twentysixteen/template-parts/content.php new file mode 100644 index 0000000..fda751f --- /dev/null +++ b/wp-content/themes/twentysixteen/template-parts/content.php @@ -0,0 +1,61 @@ + + +
            > +
            + + + + + ', esc_url( get_permalink() ) ), '' ); ?> +
            + + + + + +
            + "%s"', 'twentysixteen' ), + get_the_title() + ) + ); + + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + 'pagelink' => '' . __( 'Page', 'twentysixteen' ) . ' %', + 'separator' => ', ', + ) + ); + ?> +
            + +
            + + "%s"', 'twentysixteen' ), + get_the_title() + ), + '', + '' + ); + ?> +
            +